Merge branch 'usmannasir:stable' into stable

This commit is contained in:
hlshell
2024-11-29 23:38:41 +08:00
committed by GitHub
12 changed files with 64 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ class CLMain():
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)

View File

@@ -21,7 +21,7 @@ from plogical.httpProc import httpProc
# Create your views here.
VERSION = '2.3'
BUILD = 8
BUILD = 9
@ensure_csrf_cookie

View File

@@ -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

View File

@@ -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

View File

@@ -15,7 +15,7 @@ from stat import *
import stat
VERSION = '2.3'
BUILD = 8
BUILD = 9
char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}

View File

@@ -1389,9 +1389,7 @@ Automatic backup failed for %s on %s.
@staticmethod
def SendTORemote(FileName, RemoteBackupID):
import pysftp
import json
import pysftp as sftp
from websiteFunctions.models import RemoteBackupConfig
try:

View File

@@ -13,7 +13,7 @@ from packages.models import Package
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")

View File

@@ -3015,8 +3015,8 @@ class ApplicationInstaller(multi.Thread):
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):

View File

@@ -54,7 +54,7 @@ except:
pass
VERSION = '2.3'
BUILD = 8
BUILD = 9
## I am not the monster that you think I am..

View File

@@ -18,7 +18,7 @@ import random
import string
VERSION = '2.3'
BUILD = 8
BUILD = 9
CENTOS7 = 0
CENTOS8 = 1
@@ -3556,12 +3556,60 @@ pm.max_spare_servers = 3
#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)

View File

@@ -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

View File

@@ -26,7 +26,7 @@ EXPIRE = 3
### Version
VERSION = '2.3'
BUILD = 8
BUILD = 9
def serverStatusHome(request):