mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 16:46:06 +02:00
Fix static file serving: Allow /static/ paths in secMiddleware and add static file URL pattern
This commit is contained in:
@@ -39,7 +39,7 @@ class secMiddleware:
|
||||
webhook_pattern = re.compile(r'^/websites/[^/]+/(webhook|gitNotify)/?$')
|
||||
|
||||
if pathActual == "/backup/localInitiate" or pathActual == '/' or pathActual == '/verifyLogin' or pathActual == '/logout' or pathActual.startswith('/api')\
|
||||
or webhook_pattern.match(pathActual) or pathActual.startswith('/cloudAPI'):
|
||||
or webhook_pattern.match(pathActual) or pathActual.startswith('/cloudAPI') or pathActual.startswith('/static/'):
|
||||
pass
|
||||
else:
|
||||
# Session check logging removed
|
||||
|
||||
@@ -15,11 +15,15 @@ Including another URLconf
|
||||
"""
|
||||
from django.urls import path, re_path, include
|
||||
from django.contrib import admin
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.views.static import serve
|
||||
from firewall import views as firewall_views
|
||||
|
||||
urlpatterns = [
|
||||
# Serve static files first (before catch-all routes)
|
||||
re_path(r'^static/(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT}),
|
||||
path('base/', include('baseTemplate.urls')),
|
||||
path('', include('loginSystem.urls')),
|
||||
path('imunifyav/', firewall_views.imunifyAV, name='imunifyav_root'),
|
||||
path('ImunifyAV/', firewall_views.imunifyAV, name='imunifyav_root_legacy'),
|
||||
path('packages/', include('packages.urls')),
|
||||
@@ -40,7 +44,8 @@ urlpatterns = [
|
||||
path('filemanager/', include('filemanager.urls')),
|
||||
path('emailPremium/', include('emailPremium.urls')),
|
||||
path('manageservices/', include('manageServices.urls')),
|
||||
path('plugins/testPlugin/', include('testPlugin.urls')), path('plugins/discordWebhooks/',include('discordWebhooks.urls')),
|
||||
path('plugins/testPlugin/', include('testPlugin.urls')),
|
||||
# path('plugins/discordWebhooks/',include('discordWebhooks.urls')), # Module not available in v2.5.5-dev
|
||||
path('plugins/', include('pluginHolder.urls')),
|
||||
path('emailMarketing/', include('emailMarketing.urls')),
|
||||
path('cloudAPI/', include('cloudAPI.urls')),
|
||||
@@ -50,4 +55,5 @@ path('plugins/', include('pluginHolder.urls')),
|
||||
path('IncrementalBackups/', include('IncBackups.urls')),
|
||||
path('aiscanner/', include('aiScanner.urls')),
|
||||
# path('Terminal/', include('WebTerminal.urls')),
|
||||
path('', include('loginSystem.urls')),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user