diff --git a/CyberCP/wsgi.py b/CyberCP/wsgi.py index c9cc8c835..03015f999 100644 --- a/CyberCP/wsgi.py +++ b/CyberCP/wsgi.py @@ -8,7 +8,13 @@ https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os +import sys +# Ensure CyberPanel app path takes precedence over system 'firewall' package +PROJECT_ROOT = '/usr/local/CyberCP' +while PROJECT_ROOT in sys.path: + sys.path.remove(PROJECT_ROOT) +sys.path.insert(0, PROJECT_ROOT) from django.core.wsgi import get_wsgi_application diff --git a/baseTemplate/context_processors.py b/baseTemplate/context_processors.py index 696f9d840..b3122a0fe 100644 --- a/baseTemplate/context_processors.py +++ b/baseTemplate/context_processors.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +import os +import time + from .views import VERSION, BUILD def version_context(request): @@ -49,4 +52,15 @@ def notification_preferences_context(request): return { 'backup_notification_dismissed': False, 'ai_scanner_notification_dismissed': False + } + +def firewall_static_context(request): + """Expose a cache-busting token for firewall static assets.""" + firewall_js_path = '/usr/local/CyberCP/static/firewall/firewall.js' + try: + version = int(os.path.getmtime(firewall_js_path)) + except OSError: + version = int(time.time()) + return { + 'FIREWALL_STATIC_VERSION': version } \ No newline at end of file diff --git a/baseTemplate/templates/baseTemplate/homePage.html b/baseTemplate/templates/baseTemplate/homePage.html index 2a1aef84f..2373f10ae 100644 --- a/baseTemplate/templates/baseTemplate/homePage.html +++ b/baseTemplate/templates/baseTemplate/homePage.html @@ -876,6 +876,29 @@ + +
| {% trans "ID" %} | @@ -1019,7 +1203,8 @@
|---|
| {% trans "IP Address" %} | @@ -1115,7 +1323,7 @@|
|---|---|
| {$ bannedIP.ip $} @@ -1141,7 +1349,15 @@ | + |
{% trans "All IP addresses are currently allowed. Add banned IPs to block suspicious or malicious traffic." %}
{% trans "No banned IPs match your search. Try a different IP, reason or status (Active/Expired)." %}
+