Commit Graph

8 Commits

Author SHA1 Message Date
usmannasir
54262e6a52 Fix OWASP toggle interaction and prevent recursive change events
Fixes issues where toggle became unresponsive and triggered recursive calls:

1. Add flags (updatingOWASPStatus, updatingComodoStatus) to prevent change
   event handlers from triggering when status check updates toggle state
2. Guard change event handlers to return early when flags are set
3. IMPORTANT: Still increment counters when returning early to maintain
   correct counter state for subsequent user clicks
4. Set flags before updating toggle via prop('checked'), reset after 100ms
5. Use timeout delays (500ms) before status checks after install/uninstall
   to allow operations to complete and prevent race conditions

This ensures:
- Toggle responds correctly to user clicks on first click
- Status updates don't trigger unwanted installations
- Counter state is maintained even when skipping automatic updates
- No recursive loops when updating toggle state
2025-11-26 18:45:44 +05:00
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
Master3395
c06533b986 Fix ALL documentation links.
Fix ALL documentation links.
2025-09-08 11:50:35 +02: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
1b045eb26b enable dark mode 2025-08-05 01:47:22 +05:00
usmannasir
ac0980acc4 enable dark mode 2025-08-05 01:02:25 +05:00
usmannasir
69429999b2 enable dark mode 2025-08-05 00:40:56 +05:00
usmannasir
6dd7114f6d Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00