Implement ImunifyAV asset management and routing

- Added a static method to ensure ImunifyAV assets are created and permissions set correctly in CageFS.py.
- Updated the URL routing in urls.py to include paths for ImunifyAV, supporting both legacy and new routes.
- Modified the ImunifyAV HTML template to use Django's URL template tag for better maintainability.
- Enhanced the cyberpanel_fixes.sh script to ensure ImunifyAV UI assets are installed during fixes.
- Improved database user resolution and password handling in mysqlUtilities.py for better security and reliability.

This update enhances the integration and management of ImunifyAV within the CyberPanel environment.
This commit is contained in:
Master3395
2025-11-15 23:25:13 +01:00
parent 34f10cebe3
commit 0aca2a5aaf
8 changed files with 352 additions and 13 deletions

View File

@@ -8,6 +8,7 @@ sys.path.append('/usr/local/CyberCP')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
django.setup()
from django.http import HttpResponse
from django.db.models import Q
import json
from plogical.acl import ACLManager
import plogical.CyberCPLogFileWriter as logging
@@ -227,19 +228,26 @@ class DatabaseManager:
return ACLManager.loadErrorJson('changePasswordStatus', 0)
userName = data['dbUserName']
dbPassword = data['dbPassword']
dbPassword = str(data['dbPassword']) if data['dbPassword'] is not None else ''
db = Databases.objects.filter(dbUser=userName)
db_queryset = Databases.objects.filter(Q(dbUser=userName) | Q(dbName=userName))
if not db_queryset.exists():
data_ret = {'status': 0, 'changePasswordStatus': 0,
'error_message': "Database or database user could not be found."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
database_obj = db_queryset.first()
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(db[0].website.domain, admin, currentACL) == 1:
if ACLManager.checkOwnership(database_obj.website.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadErrorJson()
try:
meta = DBMeta.objects.get(database=db[0], key=DatabaseManager.REMOTE_ACCESS)
meta = DBMeta.objects.get(database=database_obj, key=DatabaseManager.REMOTE_ACCESS)
host = json.loads(meta.value)['remoteIP']
except:
host = None