Files
CyberPanel/plogical
usmannasir ae020ece7b Fix OWASP CRS UI toggle state issues and improve installation reliability
This commit resolves issues where the OWASP CRS toggle in ModSecurity settings
would appear to flip back to OFF even when installation succeeded, and improves
detection of manually installed OWASP CRS rules.

Issues Fixed:
1. Toggle not updating immediately after installation/uninstallation
2. Manual OWASP installations to rules.conf not detected by toggle
3. Silent installation failures without detailed error logging

Changes:

firewall/static/firewall/firewall.js:
- Update toggle state immediately after successful installation (getOWASPAndComodoStatus(true))
- Update toggle state after failed installation to show correct OFF state
- Provides instant visual feedback instead of requiring page refresh

firewall/firewallManager.py (getOWASPAndComodoStatus):
- Expand detection logic to check both httpd_config.conf AND rules.conf
- Detect manual OWASP installations (Include/modsecurity_rules_file with owasp/crs-setup)
- Case-insensitive pattern matching for better compatibility

plogical/modSec.py (setupOWASPRules):
- Add specific error logging for each installation step failure
- Log detailed messages: directory creation, download, extraction, configuration
- Helps diagnose: network issues, missing tools (wget/unzip), permission problems

Impact:
- Toggle correctly reflects OWASP CRS state after enable/disable operations
- Manual installations following external tutorials now detected correctly
- Installation failures are logged with specific error messages for debugging
- Improves UX by eliminating perception that "toggle keeps flipping back"

Fixes: OWASP CRS toggle UI bug
Related: Community thread https://community.cyberpanel.net/t/4-mod-security-rules-packages/133/8
Related: Ticket #GTPDPO7EV
2025-11-24 01:53:36 +05:00
..
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-09-01 13:11:42 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-10-19 23:51:55 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-09-10 20:01:52 +02:00
2025-08-29 22:30:06 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00
2025-08-01 14:56:30 +05:00