Commit Graph

36 Commits

Author SHA1 Message Date
usmannasir
2e8d9d5e8e conflict fix 2025-11-09 19:34:57 +05:00
usmannasir
6b999e5c8b Fix RHEL 9 binary filenames to match server structure
RHEL 9 binaries use '-rhel' suffix instead of '-rhel9':
- openlitespeed-phpconfig-x86_64-rhel (not rhel9)
- cyberpanel_ols_x86_64_rhel.so (not rhel9.so)

Updated URLs in install and upgrade modules to use correct filenames.
2025-11-09 17:14:47 +05:00
usmannasir
7c6ce4cd72 Fix OS detection to prioritize Ubuntu/Debian check
Ubuntu systems were incorrectly being detected as rhel9. Added explicit
Ubuntu/Debian check at the beginning of detectBinarySuffix() before
checking for RHEL-based distributions.

This ensures Ubuntu and Debian systems are properly identified and use
the correct binaries from the ubuntu/ directory instead of rhel9/.
2025-11-09 17:12:23 +05:00
usmannasir
20254f467c Add support for RHEL 8 and RHEL 9 custom binaries
Update OS detection and binary distribution to support separate binaries
for AlmaLinux/RHEL 8 and 9. The new structure uses:
- rhel8/ directory for AlmaLinux/RHEL 8.x binaries
- rhel9/ directory for AlmaLinux/RHEL 9.x binaries
- ubuntu/ directory for Ubuntu/Debian binaries

Changes:
- Enhanced detectBinarySuffix() to distinguish between RHEL 8 and 9
- Updated binary URLs to use new directory structure
- Updated ModSecurity checksums for all OS variants
- Applied changes to install, upgrade, and ModSecurity modules

This ensures proper ABI compatibility by providing OS-specific builds
with correct glibc and library dependencies for each platform.
2025-11-09 12:10:43 +05:00
usmannasir
44bc736ee7 Add ModSecurity compatibility handling for custom OLS binaries
Implement automatic detection and update of ModSecurity when upgrading to custom OpenLiteSpeed binaries.

Problem:
- Stock ModSecurity modules are NOT ABI-compatible with custom OLS binaries
- Using stock ModSecurity with custom OLS causes server crashes (segfaults)
- Custom OLS has different memory layout and function signatures
- ModSecurity must be rebuilt against custom OLS headers

Solution:
- Detect if custom OLS binary is installed (check for PHPConfig markers)
- Detect if ModSecurity is currently installed
- Automatically download and install ABI-compatible ModSecurity
- Verify checksums before installation
- Backup existing ModSecurity before replacing

Implementation:
- isCustomOLSBinaryInstalled(): Detects custom OLS by scanning binary for markers
- installCompatibleModSecurity(): Downloads OS-specific compatible ModSecurity
- handleModSecurityCompatibility(): Orchestrates the compatibility check and update
- Integrated into upgrade process after custom binary installation

Binary URLs:
- RHEL/AlmaLinux: https://cyberpanel.net/mod_security-compatible-rhel.so
- Ubuntu/Debian: https://cyberpanel.net/mod_security-compatible-ubuntu.so

Checksums:
- RHEL SHA256: db580afc431fda40d46bdae2249ac74690d9175ff6d8b1843f2837d86f8d602f
- Ubuntu SHA256: 115971fcd44b74bc7c7b097b9cec33ddcfb0fb07bb9b562ec9f4f0691c388a6b

Safety features:
- Checksum verification before installation
- Automatic backup of existing ModSecurity
- Graceful OLS restart with timeout handling
- Non-fatal errors allow upgrade to continue

This prevents server crashes for existing CyberPanel users who have ModSecurity
installed when they upgrade to custom OpenLiteSpeed binaries.
2025-11-08 15:23:59 +05:00
usmannasir
f7fc75b258 Add binary verification and rollback mechanism for OLS custom binaries
Implement safety checks to verify custom OpenLiteSpeed binaries work before committing to them:

Verification checks:
- Check library dependencies with ldd to detect missing libraries
- Test binary execution with -v flag to ensure it can run
- Detect issues like wrong binary type (ubuntu vs rhel) for the OS

Rollback mechanism:
- Automatically restore original binary from backup if verification fails
- Remove incompatible custom module
- Continue installation with standard OLS if custom binary fails

This prevents installation failures and system downtime when:
- Wrong binary type is downloaded due to OS detection issues
- Library dependencies are missing
- Binary cannot execute on the target system

Changes:
- Added verifyCustomBinary() method to check dependencies and execution
- Added rollbackCustomBinary() method to restore from backup
- Updated installCustomOLSBinaries() to verify and rollback on failure
- Applied to both install/installCyberPanel.py and plogical/upgrade.py

Benefits:
- Zero downtime: System falls back to working binary automatically
- Better error reporting: Shows which libraries are missing
- Safer upgrades: Users won't be left with broken installations
2025-11-07 13:50:47 +05:00
usmannasir
39b74cb9b7 Fix OLS binary compatibility by detecting OS distribution
Add OS detection logic to download correct OpenLiteSpeed binaries based on system type:
- Ubuntu/Debian systems: Download binaries with libcrypt.so.1 (GLIBC 2.35)
- RHEL/AlmaLinux/Rocky 8+/9+: Download binaries with libcrypt.so.2 (GLIBC 2.34)

This fixes the "libcrypt.so.2: cannot open shared object file" error that occurred
when Ubuntu systems tried to use RHEL-compiled binaries.

Changes:
- Added detectBinarySuffix() method to both installCyberPanel.py and upgrade.py
- Updated binary URLs to use https://cyberpanel.net with OS-specific suffix
- Module URL: cyberpanel_ols_x86_64_{ubuntu|rhel}.so
- Binary URL: openlitespeed-phpconfig-x86_64-{ubuntu|rhel}

Binary compatibility matrix:
- Ubuntu 20.04/22.04/24.04, Debian 10+, CentOS 7 → ubuntu binaries
- AlmaLinux 8+/9+, Rocky 8+/9+, RHEL 8+/9+, OpenEuler → rhel binaries
2025-11-07 12:52:15 +05:00
usmannasir
ea0ee3f771 Add custom OLS binary installation to upgrade process
- Port custom binary installation methods from install to upgrade.py
- Automatically install/upgrade custom OLS binaries during CyberPanel upgrades
- Add architecture detection, download, installation, and module configuration
- Create automatic backups before upgrading binaries
- Enable .htaccess PHP config support for existing OpenLiteSpeed installations
- Make upgrade.py fully independent from installCyberPanel.py
2025-11-06 20:40:07 +05:00
usmannasir
99b0476358 Merge branch 'v2.4.4' into stable 2025-10-27 19:54:08 +05:00
usmannasir
0100d3ea5b add aiscanner file patcher 2025-10-26 01:56:36 +05:00
Master3395
1a82700f51 Update PHP version references and improve AlmaLinux 9 compatibility
- Changed PHP symlink from version 8.0 to 8.3 in various scripts to ensure compatibility with the latest PHP version.
- Updated documentation links in the FAQ to point to the new community support page.
- Added checks and fixes for MariaDB installation issues specific to AlmaLinux 9.
- Enhanced the installation script to support additional PHP versions and improve overall installation reliability.
2025-09-15 01:25:52 +02:00
Master3395
0c8ee38c2b Add Almalinux 10 and php 84+85
Add Almalinux 10 and php 84+85
2025-09-07 22:57:53 +02:00
usmannasir
c1f742425c bug fix: imuinfy restore after upgrade 2025-09-03 12:59:55 +05:00
usmannasir
07d86ac549 bug fix: imuinfy restore after upgrade 2025-09-03 02:04:36 +05:00
usmannasir
af2ff95739 bug fix: imuinfy restore after upgrade 2025-09-03 01:41:32 +05:00
usmannasir
195dac046f bug fix: imuinfy restore after upgrade 2025-09-03 01:32:06 +05:00
usmannasir
f13a1b8c20 bug fix: imuinfy restore after upgrade 2025-09-03 01:19:09 +05:00
usmannasir
6d7a86fb58 bug fix: imuinfy restore after upgrade 2025-09-03 01:11:11 +05:00
usmannasir
7fbb5f9123 bug fix: imuinfy restore after upgrade 2025-09-03 01:03:37 +05:00
usmannasir
4aff5fbd3a bug fix: imuinfy restore after upgrade 2025-09-02 23:34:16 +05:00
usmannasir
9a38b98ca9 v2.4.4 release 2025-09-01 13:11:42 +05:00
usmannasir
d799449849 ubuntu 24 support inside cyberpanel 2025-08-29 22:24:13 +05:00
usmannasir
cd9792c941 feat: Add comprehensive recovery mechanism for damaged CyberPanel installations during upgrade
- Implement directory integrity checks to detect missing CyberPanel components
- Add automatic recovery by cloning fresh repository when essential directories are lost
- Create database credential recovery with automatic password reset capability
- Update all service configurations (FTP, PowerDNS, Postfix, Dovecot) when password is reset
- Add service restart functionality to apply new configurations
- Preserve existing configuration files during recovery process
- Handle both Ubuntu (root password) and CentOS (separate password) database configurations

This ensures upgrades can complete successfully even when /usr/local/CyberCP is completely lost.
2025-08-23 16:02:19 +05:00
usmannasir
94bd6f7b5d bug fix: upgrade missing acl file 2025-08-13 23:35:40 +05:00
usmannasir
a4791035d0 Remove CSF support as it's being discontinued on August 31, 2025
- Remove CSF menu item from sidebar navigation
- Disable CSF-related URL endpoints in firewall module
- Update upgrade process to automatically remove CSF and restore firewalld
- Archive CSF template and configuration files
- Clean up CSF references in settings and upgrade scripts

CSF (ConfigServer Security & Firewall) is shutting down on August 31, 2025.
This commit removes CSF integration and ensures firewalld is restored as the
default firewall solution during upgrades.

Fixes #1473
2025-08-11 15:49:31 +05:00
usmannasir
753f4f0606 Fix: Preserve new INSTALLED_APPS during upgrade by not overwriting settings.py
The issue was that restoreCriticalFiles was restoring the OLD settings.py from backup
which didn't have new apps like 'aiScanner' in INSTALLED_APPS.

Solution:
- Modified restoreCriticalFiles to skip settings.py restoration
- Keep the NEW settings.py from the fresh clone (which has aiScanner in INSTALLED_APPS)
- Only update the DATABASES section with saved credentials from backup
- This preserves all new app registrations while maintaining database connectivity

This properly fixes the RuntimeError about aiScanner.status_models.ScanStatusUpdate
not being in INSTALLED_APPS after upgrades.
2025-08-08 22:54:44 +05:00
usmannasir
63371be011 Fix settings.py preservation during upgrade to maintain INSTALLED_APPS
During the upgrade process, settings.py was being overwritten with only the DATABASES
section preserved, causing loss of INSTALLED_APPS and other configurations. This resulted
in the 'aiScanner' app not being recognized after upgrade.

Fixed by:
- Improving the regex pattern to more accurately match only the DATABASES dictionary
- Adding re.DOTALL flag to handle multi-line DATABASES configuration
- Ensuring all other settings including INSTALLED_APPS are preserved during upgrade

This resolves the RuntimeError about aiScanner.status_models.ScanStatusUpdate not having
an explicit app_label.
2025-08-08 22:44:42 +05:00
usmannasir
00885d24a8 bug fix: https://github.com/usmannasir/cyberpanel/issues/1470 2025-08-08 04:03:18 +05:00
usmannasir
0704e97ff8 bug fixes to wp installation 2025-08-07 06:58:48 +05:00
usmannasir
a7126d6150 potential bug fix in upgrade 2025-08-03 22:37:39 +05:00
usmannasir
aeef20d89c potential bug fix in upgrade 2025-08-03 15:06:16 +05:00
usmannasir
c22c3c5f76 potential bug fix in upgrade 2025-08-03 14:55:00 +05:00
usmannasir
65fa9fc5c2 potential bug fix in upgrade 2025-08-03 14:29:24 +05:00
usmannasir
695425a8d6 bug fix: https://github.com/usmannasir/cyberpanel/issues/1466 2025-08-02 10:03:09 +05:00
usmannasir
9b509e4a6f release v2.4.3 2025-08-01 15:05:33 +05:00
usmannasir
6dd7114f6d Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00