cyberpanel/plogical
usmannasir 2a20d1ef12 Add ModSecurity compatibility detection for user installations
Handle the scenario where users install ModSecurity after CyberPanel is already
installed with custom OpenLiteSpeed binaries.

Problem:
- When users click "Install ModSecurity" in CyberPanel UI, the system used
  package manager (yum/apt) to install stock ModSecurity
- Stock ModSecurity is NOT ABI-compatible with custom OLS binaries
- This causes immediate server crashes (segfaults) when installed

Solution:
- Detect if custom OLS binary is already installed before installing ModSecurity
- If custom OLS detected, download compatible ModSecurity from cyberpanel.net
- If stock OLS detected, use package manager as usual

Implementation:
- isCustomOLSBinaryInstalled(): Detects custom OLS by scanning binary for markers
- detectBinarySuffix(): Determines Ubuntu vs RHEL binaries needed
- installCompatibleModSecurity(): Downloads, verifies, and installs compatible ModSecurity
- Modified installModSec(): Main entry point - routes to compatible installer if needed

User flow:
1. User with custom OLS clicks "Install ModSecurity" in UI
2. System detects custom OLS binary is installed
3. System writes "Detected custom OpenLiteSpeed binary" to install log
4. System downloads OS-specific compatible ModSecurity from cyberpanel.net
5. System verifies SHA256 checksum
6. System backs up any existing ModSecurity
7. System installs compatible version with OLS restart
8. User sees "ModSecurity Installed (ABI-compatible version).[200]"

Safety features:
- Checksum verification before installation
- Automatic backup of existing ModSecurity
- Graceful OLS restart with timeout handling
- Detailed logging to /home/cyberpanel/modSecInstallLog

This prevents server crashes when users install ModSecurity after custom OLS
binaries are already deployed.
2025-11-08 15:28:34 +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 Add ModSecurity compatibility detection for user installations 2025-11-08 15:28:34 +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