diff --git a/CLScript/CLMain.py b/CLScript/CLMain.py index 64590cf5b..7fe666ab5 100644 --- a/CLScript/CLMain.py +++ b/CLScript/CLMain.py @@ -5,7 +5,7 @@ def __init__(self): self.path = '/usr/local/CyberCP/version.txt' #versionInfo = json.loads(open(self.path, 'r').read()) self.version = '2.3' - self.build = '8' + self.build = '9' ipFile = "/etc/cyberpanel/machineIP" f = open(ipFile) diff --git a/baseTemplate/views.py b/baseTemplate/views.py index 29359d7a9..14b80d9d5 100755 --- a/baseTemplate/views.py +++ b/baseTemplate/views.py @@ -21,7 +21,7 @@ # Create your views here. VERSION = '2.3' -BUILD = 8 +BUILD = 9 @ensure_csrf_cookie diff --git a/cyberpanel.sh b/cyberpanel.sh index d361b3171..769e27132 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1060,7 +1060,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]] ; then #!/bin/bash - dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel MariaDB-server MariaDB-client MariaDB-devel curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils gpgme-devel + dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel MariaDB-server MariaDB-client MariaDB-devel curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils gpgme-devel openssl-devel Check_Return elif [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "22" ]] ; then dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git python3-devel tar socat python3 zip unzip bind-utils diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index c5fc84eff..ccd8dd2fb 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -548,6 +548,7 @@ fi # shellcheck disable=SC1091 . /usr/local/CyberPanel/bin/activate +pip install --upgrade setuptools packaging Download_Requirement @@ -691,6 +692,7 @@ if [ "$Server_OS" = "Ubuntu" ]; then # shellcheck disable=SC1091 . /usr/local/CyberCP/bin/activate Check_Return + pip install --upgrade setuptools packaging pip3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt Check_Return else diff --git a/install/install.py b/install/install.py index 12fa1b46c..c01206e09 100755 --- a/install/install.py +++ b/install/install.py @@ -15,7 +15,7 @@ import stat VERSION = '2.3' -BUILD = 8 +BUILD = 9 char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'} diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 1ee4a8f8f..b42623e32 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -1389,9 +1389,7 @@ def RemoteBackup(function): @staticmethod def SendTORemote(FileName, RemoteBackupID): - import pysftp import json - import pysftp as sftp from websiteFunctions.models import RemoteBackupConfig try: diff --git a/plogical/adminPass.py b/plogical/adminPass.py index 4e74dae57..cb1dc308d 100755 --- a/plogical/adminPass.py +++ b/plogical/adminPass.py @@ -13,7 +13,7 @@ from baseTemplate.models import version VERSION = '2.3' -BUILD = 8 +BUILD = 9 if not os.geteuid() == 0: sys.exit("\nOnly root can run this script\n") diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 910e57d09..0f89134dc 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -3015,8 +3015,8 @@ def RestoreWPbackupNow(self): from managePHP.phpManager import PHPManager from websiteFunctions.website import WebsiteManager from packages.models import Package - import pysftp - import pysftp as sftp + #import pysftp + #import pysftp as sftp import boto3 if os.path.exists(ProcessUtilities.debugPath): diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index 7972c92ee..3e1552883 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -54,7 +54,7 @@ pass VERSION = '2.3' -BUILD = 8 +BUILD = 9 ## I am not the monster that you think I am.. diff --git a/plogical/upgrade.py b/plogical/upgrade.py index edb136ae0..068f99870 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -18,7 +18,7 @@ import string VERSION = '2.3' -BUILD = 8 +BUILD = 9 CENTOS7 = 0 CENTOS8 = 1 @@ -3556,12 +3556,60 @@ def upgrade(branch): #Upgrade.executioner(command, 'fix csf if there', 0) if os.path.exists('/etc/csf'): + ##### Function to backup custom csf files and restore + + from datetime import datetime + + # List of files to backup + FILES = [ + "/etc/csf/csf.allow", + "/etc/csf/csf.deny", + "/etc/csf/csf.conf", + "/etc/csf/csf.ignore", + "/etc/csf/csf.rignore", + "/etc/csf/csf.blocklists", + "/etc/csf/csf.dyndns" + ] + + # Directory for backups + BACKUP_DIR = f"/home/cyberpanel/csf_backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}" + + # Backup function + def backup_files(): + os.makedirs(BACKUP_DIR, exist_ok=True) + for file in FILES: + if os.path.exists(file): + shutil.copy(file, BACKUP_DIR) + print(f"Backed up: {file}") + else: + print(f"File not found, skipping: {file}") + + # Restore function + def restore_files(): + for file in FILES: + backup_file = os.path.join(BACKUP_DIR, os.path.basename(file)) + if os.path.exists(backup_file): + shutil.copy(backup_file, file) + print(f"Restored: {file}") + else: + print(f"Backup not found for: {file}") + + # Backup the files + print("Backing up files...") + backup_files() + execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py" execPath = execPath + " removeCSF" Upgrade.executioner(execPath, 'fix csf if there', 0) execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py" execPath = execPath + " installCSF" + + # Restore the files + print("Restoring files...") + restore_files() + + Upgrade.executioner(execPath, 'fix csf if there', 0) diff --git a/requirments.txt b/requirments.txt index e0efc946b..2b93af895 100755 --- a/requirments.txt +++ b/requirments.txt @@ -2,9 +2,9 @@ bcrypt==4.2.0 beautifulsoup4==4.12.3 boto3==1.34.153 botocore==1.34.153 -cloudflare==2.8.13 +cloudflare==2.20.0 cryptography==43.0.0 -cffi==1.14.3 +cffi Django==4.2.14 docker==7.1.0 google-api-core==2.19.1 @@ -14,14 +14,13 @@ google-auth-httplib2==0.2.0 google-auth-oauthlib==1.2.1 googleapis-common-protos==1.63.2 ipaddress==1.0.23 -mysqlclient==2.0.1 +mysqlclient oauthlib==3.2.2 paramiko==3.4.1 pexpect==4.9.0 -psutil==5.7.3 +psutil py3dns==4.0.2 pyOpenSSL==24.2.1 -pysftp==0.2.9 pyotp PyYAML==6.0.1 requests==2.32.3 diff --git a/serverStatus/views.py b/serverStatus/views.py index 73c1df3b3..12c797283 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -26,7 +26,7 @@ ### Version VERSION = '2.3' -BUILD = 8 +BUILD = 9 def serverStatusHome(request):