Linux evo.fastest-server.com 5.14.0-284.1101.el9.tuxcare.11.els11.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 14 13:30:35 UTC 2026 x86_64
LiteSpeed
Server IP : 103.249.112.113 & Your IP : 216.73.217.135
Domains : 988 Domain
User : tanishks
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
l.v.e-manager /
utils /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-09-04 11:50
downgrades
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
activate
2.3
KB
-rwxr-xr-x
2026-08-11 11:38
autorestore.py
11.18
KB
-rwxr-xr-x
2026-08-11 11:38
cache_phpdata.py
7.27
KB
-rwxr-xr-x
2026-08-11 11:38
cache_rubygems.py
1.42
KB
-rwxr-xr-x
2026-08-11 11:38
clinfo.php
216
B
-rw-r--r--
2026-08-11 11:38
cloudlinux-awp-installer.py
5.29
KB
-rwxr-xr-x
2026-08-11 11:38
cloudlinux-cli-user.py
491
B
-rwxr-xr-x
2026-08-11 11:38
cloudlinux-cli.py
490
B
-rwxr-xr-x
2026-08-11 11:38
cloudlinux-selector.py
654
B
-rwxr-xr-x
2026-08-11 11:38
cloudlinux-xray.py
807
B
-rwxr-xr-x
2026-08-11 11:38
cloudlinux_cli.py
48.11
KB
-rw-r--r--
2026-08-11 11:38
cloudlinux_cli_user.py
19.98
KB
-rw-r--r--
2026-08-11 11:38
cpanel_api.py
11.39
KB
-rw-r--r--
2026-08-11 11:38
create_translate_template.py
505
B
-rwxr-xr-x
2026-08-11 11:38
delete-isp-plugin.sh
318
B
-rwxr-xr-x
2026-08-11 11:38
dynamicui.py
4.53
KB
-rwxr-xr-x
2026-08-11 11:38
dynamicui_base.py
565
B
-rw-r--r--
2026-08-11 11:38
dynamicui_cpanel.py
3.05
KB
-rw-r--r--
2026-08-11 11:38
dynamicui_da.py
2.44
KB
-rw-r--r--
2026-08-11 11:38
dynamicui_plesk.py
1.25
KB
-rw-r--r--
2026-08-11 11:38
fix-nodejs-environments.py
3.59
KB
-rwxr-xr-x
2026-08-11 11:38
generate_locale_files_for_plesk.py
2.97
KB
-rwxr-xr-x
2026-08-11 11:38
install-cpanel-plugin.sh
1.38
KB
-rwxr-xr-x
2026-08-11 11:38
install-plesk-plugin.sh
1.8
KB
-rwxr-xr-x
2026-08-11 11:38
installsupergrp.sh
991
B
-rwxr-xr-x
2026-08-11 11:38
libcagefs.py
7.61
KB
-rw-r--r--
2026-08-11 11:38
libcloudlinux.py
38.66
KB
-rw-r--r--
2026-08-11 11:38
libsupport.py
2.45
KB
-rw-r--r--
2026-08-11 11:38
node_wrapper
272
B
-rwxr-xr-x
2026-08-11 11:38
npm_wrapper
1.69
KB
-rwxr-xr-x
2026-08-11 11:38
plesk-cgi.sh
3.15
KB
-rwxr-xr-x
2026-08-11 11:38
plesk_nginx_php_sync.py
5.87
KB
-rw-r--r--
2026-08-11 11:38
python_wrapper
572
B
-rwxr-xr-x
2026-08-11 11:38
set_env_vars.py
4.57
KB
-rwxr-xr-x
2026-08-11 11:38
sync_locales.py
2.97
KB
-rwxr-xr-x
2026-08-11 11:38
ui_package_installer.py
4.93
KB
-rw-r--r--
2026-08-11 11:38
Save
Rename
#!/opt/cloudlinux/venv/bin/python3 -sbb # coding:utf-8 # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT # for details see LVEMAN-622: Create autorestore quota limits after 1.0-9.9 update from __future__ import print_function from __future__ import division from __future__ import absolute_import from future.utils import iteritems import glob import gzip import os import sys import shutil import subprocess import time UPDATE_USER = "/scripts/modcpuser" UPDATE_QUOTA = "/scripts/editquota" QUOTA_CONF = "/etc/quota.conf" USERS_DIR = "/var/cpanel/users" PACKAGES_DIR = "/var/cpanel/packages" PLAN_KEYS = ["HASCGI", "HASDKIM", "HASSPF", "QUOTA", "BWLIMIT", "MAXPOP", "MAXFTP", "MAXLST", "MAXSQL", "MAXSUB", "MAXPARK", "MAXADDON", "MAX_EMAIL_PER_HOUR", "MAX_DEFER_FAIL_PERCENTAGE"] class Main(object): """ """ _cached_quota = {} _cached_users = {} _cached_packages = {} _packages = {} _users = {} def __init__(self, backup_varcpanel, backup_etcquota): """ Constructor """ self._backup_etcquota = backup_etcquota self._backup_varcpanel = backup_varcpanel self._load_quota_cache() def run(self): """ Run main action """ # load packages data self._load_packages() # load users conf self._load_users() self._load_users_quota() # load varcpanel cache for all users self._load_varcpanel_cache() # create backup user configs before restore self._backup_users() # check users differs self._check_users() def _load_quota_cache(self): """ Load cached quota settings """ # load backup files f = gzip.open(self._backup_etcquota, "rb") for line in f: line = line.strip() if not line: continue user, value = line.split("=") self._cached_quota[user.strip()] = value.strip() f.close() def _load_varcpanel_cache(self): """ Load cache for users and packages """ # Use argv-list subprocess (no shell=True) so any shell metacharacter # in self._backup_varcpanel (sys.argv[1] forwarded verbatim from # __main__) is treated as a literal filename arg to tar instead of # being interpreted by /bin/bash. Validate the backup tarball is a # real file the caller can read before invoking tar so corrupted / # path-traversal argv values fail fast with a clear error. backup = os.path.realpath(self._backup_varcpanel) if not os.path.isfile(backup): print("Backup archive not found or not a regular file: %s" % backup) sys.exit(1) # Extract into a private per-run directory created with the secure # tempfile helper (mode 0700, unpredictable name) so a co-located # local user cannot pre-populate the destination with symlinks that # tar would follow when extracting as root. import tempfile extract_root = tempfile.mkdtemp(prefix="lvemgr-autorestore-") try: # CLOS-5521 (F-07): defensive tar flags. Extraction runs as root # because autorestore is an admin utility; without these flags a # tampered archive could preserve unexpected uid/gid on the # extracted files or a setuid/setgid bit that persists briefly # in the tempdir. The subsequent code only reads plain-text # cache files, so neither ownership nor exact permissions matter # to the caller. Refutation still holds (tempfile.mkdtemp # destination + explicit member list); this is belt-and-braces. params = ["/bin/tar", "--no-same-owner", "--no-same-permissions", "-C", extract_root, "-xf", backup, USERS_DIR.lstrip("/"), PACKAGES_DIR.lstrip("/")] p = subprocess.Popen(params, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if err: print(err) sys.exit(0) # load users cache users_cache_dir = extract_root + USERS_DIR for cache_path in glob.glob("%s/*" % users_cache_dir): data = self._read_file(cache_path) username = cache_path.split("/")[-1] self._cached_users[username] = data # load packages cache packages_cache_dir = extract_root + PACKAGES_DIR for cache_path in glob.glob("%s/*" % packages_cache_dir): if not os.path.isfile(cache_path): # skip extensions directory continue data = self._read_file(cache_path) if "CGI" in data: data["CGI"] = {"y": "1", "n": "0"}.get(data["CGI"], data["CGI"]) username = cache_path.split("/")[-1] self._cached_packages[username] = data finally: shutil.rmtree(extract_root, ignore_errors=True) def _load_packages(self): """ Load current packages configures """ for package_path in glob.glob("%s/*" % PACKAGES_DIR): if not os.path.isfile(package_path): continue pack = self._read_file(package_path) if "CGI" in pack: pack["CGI"] = {"y": "1", "n": "0"}.get(pack["CGI"], pack["CGI"]) self._packages[package_path.split("/")[-1]] = pack def _load_users(self): """ Load current users settings """ for user_path in glob.glob("%s/*" % USERS_DIR): if not os.path.isfile(user_path): continue user = self._read_file(user_path) self._users[user_path.split("/")[-1]] = user def _load_users_quota(self): """ Load config file with all users quotas """ quota = self._read_file(QUOTA_CONF) for user, value in iteritems(quota): if user in self._users: self._users[user]["QUOTA"] = value def _check_users(self): """ Check users settings """ for username, conf in iteritems(self._users): if not self._is_need_restore_settings(username, conf): # skip if different values continue # restore only users with package values print("Restore %s" % username) # reset to backup quota settings if username in self._cached_quota \ and conf["QUOTA"] != self._cached_quota[username]: # reset quota config params = [UPDATE_QUOTA, username, "%sM" % self._cached_quota[username]] p = subprocess.Popen(params, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # print params out, err = p.communicate() if err: print("UPDATE_QUOTA error:") print(err) # skip users without cache if username not in self._cached_users: print(" %s has not cached data - skip" % username) continue # skip users with plan differ from cached if self._cached_users[username]["PLAN"] != conf["PLAN"]: print(" %s changed plan from '%s' to '%s' - skip" % \ (username, self._cached_users[username]["PLAN"], conf["PLAN"])) continue # reset to backup limits settings for key in PLAN_KEYS: if key in self._cached_users[username] \ and conf[key] != self._cached_users[username][key]: # check difference between old package value and current package value if conf["PLAN"] in self._cached_packages and conf["PLAN"] in self._packages \ and self._cached_packages[conf["PLAN"]].get(key) \ != self._packages[conf["PLAN"]].get(key): print("Package value '%s' was changed - skip" % key) continue params = [UPDATE_USER, "--user", username, "--action", "set", "--key", key, "--value", self._cached_users[username][key]] p = subprocess.Popen(params, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # print params out, err = p.communicate() if err: print("UPDATE_USER error:") print(err) def _backup_users(self): """ Backup users configs files before restore """ ts = time.time() # backup users directory backup_dir = "%s.%s" % (USERS_DIR, ts) shutil.copytree(USERS_DIR, backup_dir) # backup quota.conf file backup_file = "%s.%s" % (QUOTA_CONF, ts) shutil.copy2(QUOTA_CONF, backup_file) def _is_need_restore_settings(self, username, conf): """ Compare plan settings and users config :return: bool. if true - need restore data, false - no """ if "default" == conf["PLAN"]: # default plan has no settings, but has user personal settings return True if conf["PLAN"] not in self._packages: # if user current plan no in packages - skip it print(" %s plan no in current packages - skip" % username) return False COMPARE_KEYS = {"CGI": "HASCGI"} for key, value in iteritems(self._packages[conf["PLAN"]]): if key not in ["CGI", "DIGESTAUTH", "HASSHELL"] + PLAN_KEYS: continue conf_key = COMPARE_KEYS.get(key, key) if conf_key in conf and conf[conf_key] != value: return False return True def _read_file(self, filename): """ helper util """ result = {} u = open(filename, "r") for line in u: line = line.strip() if not line or line.startswith("#"): continue key, value = line.split("=") result[key.strip()] = value.strip() u.close() return result if "__main__" == __name__: if len(sys.argv[1:]) < 2: print("%s <backup_varcpanel> <backup_etcquota>" % sys.argv[0]) sys.exit(1) # Validate both backup paths exist and are regular files before doing # anything with them. Pin to realpath so a symlink trick cannot redirect # the read into a path the operator did not name on the command line. backup_varcpanel = os.path.realpath(sys.argv[1]) backup_etcquota = os.path.realpath(sys.argv[2]) for path in (backup_varcpanel, backup_etcquota): if not os.path.isfile(path): print("Backup path is not a regular file: %s" % path) sys.exit(1) Main(backup_varcpanel, backup_etcquota).run() #./autorestore.py /backup/cpbackup/weekly/dirs/_var_cpanel.tar.gz /backup/cpbackup/weekly/files/_etc_quota.conf.gz