REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.00 KB
Close
/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/application/determine_hosting_panel.py
Text
Base64
""" Determines hosting panel. This module has minimal dependencies and only imports required panel class. """ import logging from importlib import import_module from pathlib import Path CPANEL_FILE = "/usr/local/cpanel/cpanel" DA_FILE = "/usr/local/directadmin/directadmin" PLESK_FILE = "/usr/sbin/plesk" GP_FILE = "/etc/sysconfig/imunify360/integration.conf" logger = logging.getLogger(__name__) def get_hosting_panel(root_module: str): # pragma no cover # note: keep the panel test order in sync with the deploy script, # to avoid detecting conflicting panels in agent vs. the deploy script if is_generic_panel_installed(): # Checking this panel first is convenient for development, since # it allows you to turn any panel in the Generic Panel simply by # creating `/etc/sysconfig/imunify360/integration.conf`. module = import_module(f"{root_module}.subsys.panels.generic.panel") return module.GenericPanel() elif is_plesk_installed(): module = import_module(f"{root_module}.subsys.panels.plesk.panel") return module.Plesk() elif is_cpanel_installed(): module = import_module(f"{root_module}.subsys.panels.cpanel.panel") return module.cPanel() elif is_directadmin_installed(): module = import_module( f"{root_module}.subsys.panels.directadmin.panel" ) return module.DirectAdmin() elif root_module == "defence360agent": module = import_module(f"{root_module}.subsys.panels.no_cp.panel") return module.NoCP() module = import_module(f"{root_module}.subsys.panels.no_cp.panel") return module.NoControlPanel() def is_cpanel_installed(): return _is_panel_installed(CPANEL_FILE) def is_directadmin_installed(): return _is_panel_installed(DA_FILE) def is_generic_panel_installed(): return _is_panel_installed(GP_FILE) def is_plesk_installed(): return _is_panel_installed(PLESK_FILE) def _is_panel_installed(panel_file): return Path(panel_file).is_file()
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-06-08 20:23:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
determine_hosting_panel.py
2.00 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
settings.py
1.74 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tags.py
3.07 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
734 B
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).