Skip to content

Commit

Permalink
Merge branch 'usmannasir:stable' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
hlshell authored Nov 29, 2024
2 parents a4ab92a + 6f28d39 commit 4ff8fba
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CLScript/CLMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion baseTemplate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Create your views here.

VERSION = '2.3'
BUILD = 8
BUILD = 9


@ensure_csrf_cookie
Expand Down
2 changes: 1 addition & 1 deletion cyberpanel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cyberpanel_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ fi

# shellcheck disable=SC1091
. /usr/local/CyberPanel/bin/activate
pip install --upgrade setuptools packaging

Download_Requirement

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import stat

VERSION = '2.3'
BUILD = 8
BUILD = 9

char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}

Expand Down
2 changes: 0 additions & 2 deletions plogical/IncScheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion plogical/adminPass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions plogical/applicationInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion plogical/backupUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
pass

VERSION = '2.3'
BUILD = 8
BUILD = 9


## I am not the monster that you think I am..
Expand Down
50 changes: 49 additions & 1 deletion plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import string

VERSION = '2.3'
BUILD = 8
BUILD = 9

CENTOS7 = 0
CENTOS8 = 1
Expand Down Expand Up @@ -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)


Expand Down
9 changes: 4 additions & 5 deletions requirments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion serverStatus/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
### Version

VERSION = '2.3'
BUILD = 8
BUILD = 9


def serverStatusHome(request):
Expand Down

0 comments on commit 4ff8fba

Please sign in to comment.