cyberpanel/plogical
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
..
.my.cnf.4370 Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
.mysql.4370 Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
Backupsv2.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
ClusterManager.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
CyberCPLogFileWriter.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
CyberPanelUpgrade.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
DockerSites.py Fix n8n proxy configuration for OpenLiteSpeed compatibility 2025-11-08 00:32:16 +05:00
IncScheduler.py Improve One-Click Backup verification with multi-method approach 2025-10-14 18:49:41 +05:00
SwitchOldAliasToNew.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
__init__.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
acl.py bug fix: https://github.com/usmannasir/cyberpanel/issues/773 2025-08-11 00:33:25 +05:00
acl.py.backup_dns_fix bug fix: https://github.com/usmannasir/cyberpanel/issues/773 2025-08-11 00:33:25 +05:00
adminPass.py v2.4.4 release 2025-09-01 13:11:42 +05:00
alias.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
apiAccess.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
applicationInstaller.py Fix backup restore permission error and improve SFTP fallback 2025-10-15 04:30:43 +05:00
backupSchedule.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
backupScheduleLocal.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
backupUtilities.py Fix backup file moving to handle compressed database backups 2025-10-15 00:56:45 +05:00
backup_config.json Enhance database backup with compression support and backward compatibility 2025-10-14 19:54:11 +05:00
bandwidthReset.py Fix monthly bandwidth for websites 2025-09-12 10:41:11 +02:00
cPanelImporter.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
childDomain.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
cronUtil.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
csf.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
customACME.py bug fix: ssl timeout issues 2025-10-19 23:51:55 +05:00
dnsUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
domain.xml Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
emergency_2fa_disable.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
filesPermsUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
filesPermsUtilities.py.bak Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
findBWUsage.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
firewallUtilities.py Add sieve by default. 2025-09-10 20:01:52 +02:00
ftpUtilities.py ubuntu 24 ftp fix 2025-08-29 22:30:06 +05:00
getSystemInformation.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
hashPassword.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
httpProc.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
installUtilities.py bug fix: https://github.com/usmannasir/cyberpanel/issues/1479#issuecomment-3185937407 2025-08-14 20:54:38 +05:00
letsEncrypt.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
mailUtilities.py Add sieve by default. 2025-09-10 20:01:52 +02:00
modSec.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
mysqlUtilities.py Remove strict exit code checking in database restore functions 2025-10-15 00:53:31 +05:00
phpUtilities.py bug fix: php manager turning off uploads 2025-09-03 13:27:00 +05:00
phpmyadminsignin.php Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
pluginManagerGlobal.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
processUtilities.py Enhance database backup with compression support and backward compatibility 2025-10-14 19:54:11 +05:00
randomPassword.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
rebuildQuotas.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
remoteBackup.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
remoteTransferUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
renew.py bug fix: https://github.com/usmannasir/cyberpanel/issues/1468 2025-08-06 14:56:58 +05:00
restoreMeta.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
serverLogs.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
sslUtilities.py Fix acme.sh not creating domain configurations in /root/.acme.sh/ 2025-10-22 12:53:05 +05:00
sslv2.py bug fix: https://github.com/usmannasir/cyberpanel/issues/1471 2025-08-08 00:56:41 +05:00
test.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
test1.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
test_backup_compatibility.py Enhance database backup with compression support and backward compatibility 2025-10-14 19:54:11 +05:00
tuning.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
upgrade.py Add ModSecurity compatibility handling for custom OLS binaries 2025-11-08 15:23:59 +05:00
upgrade.py.bak Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
upgradeCritical.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
vhost.py bug fix: staging site issue 2025-09-22 13:31:20 +05:00
vhostConfs.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
virtualHostUtilities.py bug fix: staging site issue 2025-09-22 13:31:20 +05:00