ACIL FM
Dark
Refresh
Current DIR:
/opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos
/
opt
cloudlinux
venv
lib
python3.11
site-packages
clwpos
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
bin
-
chmod
Open
Rename
Delete
cli_versions
-
chmod
Open
Rename
Delete
feature_suites
-
chmod
Open
Rename
Delete
hooks
-
chmod
Open
Rename
Delete
migrations
-
chmod
Open
Rename
Delete
object_cache
-
chmod
Open
Rename
Delete
optimization_features
-
chmod
Open
Rename
Delete
php
-
chmod
Open
Rename
Delete
user
-
chmod
Open
Rename
Delete
__pycache__
-
chmod
Open
Rename
Delete
billing.py
6.24 MB
chmod
View
DL
Edit
Rename
Delete
cl_wpos_exceptions.py
3.59 MB
chmod
View
DL
Edit
Rename
Delete
constants.py
5.56 MB
chmod
View
DL
Edit
Rename
Delete
create_user_uid_dirs.py
754 B
chmod
View
DL
Edit
Rename
Delete
cron.py
2.14 MB
chmod
View
DL
Edit
Rename
Delete
daemon.py
37.12 MB
chmod
View
DL
Edit
Rename
Delete
daemon_base.py
2.84 MB
chmod
View
DL
Edit
Rename
Delete
daemon_config.py
621 B
chmod
View
DL
Edit
Rename
Delete
daemon_redis_lib.py
11.93 MB
chmod
View
DL
Edit
Rename
Delete
daemon_subscription_handler.py
6.44 MB
chmod
View
DL
Edit
Rename
Delete
data_collector_utils.py
9.42 MB
chmod
View
DL
Edit
Rename
Delete
logsetup.py
4.04 MB
chmod
View
DL
Edit
Rename
Delete
papi.py
9.87 MB
chmod
View
DL
Edit
Rename
Delete
parse.py
2.1 MB
chmod
View
DL
Edit
Rename
Delete
redis_configuration_pid_file_cleaner.py
1.01 MB
chmod
View
DL
Edit
Rename
Delete
report_generator.py
21.18 MB
chmod
View
DL
Edit
Rename
Delete
scoped_cache.py
1.34 MB
chmod
View
DL
Edit
Rename
Delete
socket_utils.py
4.03 MB
chmod
View
DL
Edit
Rename
Delete
stats.py
12.02 MB
chmod
View
DL
Edit
Rename
Delete
utils.py
58.25 MB
chmod
View
DL
Edit
Rename
Delete
whmcs_utils.py
9.36 MB
chmod
View
DL
Edit
Rename
Delete
wpos_admin.py
67.14 MB
chmod
View
DL
Edit
Rename
Delete
wpos_hooks.py
4.85 MB
chmod
View
DL
Edit
Rename
Delete
wpos_req_scanner.py
4.38 MB
chmod
View
DL
Edit
Rename
Delete
wp_config.py
725 B
chmod
View
DL
Edit
Rename
Delete
wp_utils.py
16.33 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
928 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/wpos_hooks.py
#!/opt/cloudlinux/venv/bin/python3 -bb # -*- coding: utf-8 -*- # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENCE.TXT import subprocess import sys from distutils.sysconfig import get_python_lib from pathlib import Path from clwpos.constants import ( ALT_PHP_REDIS_ENABLE_UTILITY, INSTALL_CACHING_HOOKS_UTILITY, ) from clwpos.optimization_features import OBJECT_CACHE_FEATURE from clwpos.feature_suites import ( any_suite_allowed_on_server, is_module_allowed_for_user ) from clwpos.utils import is_wpos_supported UNIVERSAL_HOOK_PATH_DNF = '/etc/dnf/universal-hooks/multi_pkgs/transaction' UNIVERSAL_HOOK_PATH_YUM = '/etc/yum/universal-hooks/multi_pkgs/posttrans' UNIVERSAL_HOOK_PATH_APT = '/etc/apt/universal-hooks/multi_pkgs/Post-Invoke' HOOKS_LISTENERS_DIR = '/usr/share/cloudlinux/hooks/listeners' MODIFY_USER_HOOK = 'wpos_modify_user_hook.py' USER_DIRS_HOOK = 'wpos_user_dirs_hook.py' # Hooks that depend on AccelerateWP activation state DYNAMIC_WPOS_HOOKS = (MODIFY_USER_HOOK,) # Default hooks that should be always installed DEFAULT_WPOS_HOOKS = (USER_DIRS_HOOK,) def get_universal_hook_alt_php_path() -> Path: """ Get path to yum universal hooks directory with alt-php*-pecl-ext hooks. """ dir_name = 'alt-php__WILDCARD__-pecl-ext' if Path('/etc/apt/').exists(): return Path(UNIVERSAL_HOOK_PATH_APT, dir_name) elif Path('/etc/dnf/').exists(): return Path(UNIVERSAL_HOOK_PATH_DNF, dir_name) return Path(UNIVERSAL_HOOK_PATH_YUM, dir_name) def install_yum_universal_hook_alt_php() -> None: """ Install yum universal hook for configuring PHP redis after alt-php*-pecl-ext package is installed/updated. """ hook_dir_path = get_universal_hook_alt_php_path() hook_dir_path.mkdir(parents=True, exist_ok=True) hook_name = Path(ALT_PHP_REDIS_ENABLE_UTILITY).name hook_full_path = Path(hook_dir_path, hook_name) if not hook_full_path.exists(): hook_full_path.symlink_to(ALT_PHP_REDIS_ENABLE_UTILITY) def uninstall_yum_universal_hook_alt_php() -> None: """ Remove yum universal hook for configuring PHP redis ext. """ hook_dir_path = get_universal_hook_alt_php_path() hook_name = Path(ALT_PHP_REDIS_ENABLE_UTILITY).name hook_full_path = Path(hook_dir_path, hook_name) # check is_symlink because we want to delete link even if it's broken if hook_full_path.is_symlink(): hook_full_path.unlink() def install_single_hook(hook) -> None: """ Install single hook """ lve_utils_hooks_dir = Path(get_python_lib(), 'clwpos', 'hooks') listeners_hook_path = Path(HOOKS_LISTENERS_DIR, hook) lve_utils_hook_path = Path(lve_utils_hooks_dir, hook) # remove old hook pointing to symlink to lve_utils if 'lve_utils' in str(listeners_hook_path.resolve()) or \ 'python3.7' in str(listeners_hook_path.resolve()): listeners_hook_path.unlink() if not listeners_hook_path.exists() and lve_utils_hook_path.exists(): listeners_hook_path.symlink_to(lve_utils_hook_path) def uninstall_single_hook(hook): """ Uninstall single hook """ listeners_hook_path = Path(HOOKS_LISTENERS_DIR, hook) if listeners_hook_path.is_symlink(): listeners_hook_path.unlink() def install_default_panel_hooks() -> None: """ Install wpos_user_dirs_hook.py hook """ for hook in DEFAULT_WPOS_HOOKS: install_single_hook(hook) def uninstall_default_panel_hooks() -> None: """ Uninstall wpos_user_dirs_hook.py hook """ for hook in DEFAULT_WPOS_HOOKS: uninstall_single_hook(hook) def install_dynamic_panel_hooks() -> None: """ Install panel WPOS hooks. """ subprocess.run([INSTALL_CACHING_HOOKS_UTILITY, '-i'], capture_output=True) for hook in DYNAMIC_WPOS_HOOKS: install_single_hook(hook) def uninstall_dynamic_panel_hooks() -> None: """ Remove panel WPOS hooks. """ subprocess.run([INSTALL_CACHING_HOOKS_UTILITY, '-d'], capture_output=True) for hook in DYNAMIC_WPOS_HOOKS: uninstall_single_hook(hook) def _install_hooks(): """ Install all hooks """ install_default_panel_hooks() if is_wpos_supported() and any_suite_allowed_on_server(): if is_module_allowed_for_user(OBJECT_CACHE_FEATURE): install_yum_universal_hook_alt_php() install_dynamic_panel_hooks() def _uninstall_hooks(): """ Uninstall all hooks """ uninstall_yum_universal_hook_alt_php() uninstall_dynamic_panel_hooks() uninstall_default_panel_hooks() def main(): """ Install or uninstall panel and yum/dnf universal hooks. """ if '--install' in sys.argv: _install_hooks() elif '--uninstall' in sys.argv: _uninstall_hooks() if __name__ == "__main__": main()
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply