mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 17:56:12 +01:00
Merge branch 'usmannasir:stable' into stable
This commit is contained in:
@@ -5,7 +5,7 @@ class CLMain():
|
|||||||
self.path = '/usr/local/CyberCP/version.txt'
|
self.path = '/usr/local/CyberCP/version.txt'
|
||||||
#versionInfo = json.loads(open(self.path, 'r').read())
|
#versionInfo = json.loads(open(self.path, 'r').read())
|
||||||
self.version = '2.3'
|
self.version = '2.3'
|
||||||
self.build = '8'
|
self.build = '9'
|
||||||
|
|
||||||
ipFile = "/etc/cyberpanel/machineIP"
|
ipFile = "/etc/cyberpanel/machineIP"
|
||||||
f = open(ipFile)
|
f = open(ipFile)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from plogical.httpProc import httpProc
|
|||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
VERSION = '2.3'
|
VERSION = '2.3'
|
||||||
BUILD = 8
|
BUILD = 9
|
||||||
|
|
||||||
|
|
||||||
@ensure_csrf_cookie
|
@ensure_csrf_cookie
|
||||||
|
|||||||
@@ -1060,7 +1060,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]] ; then
|
|||||||
#!/bin/bash
|
#!/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
|
Check_Return
|
||||||
elif [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "22" ]] ; then
|
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
|
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
|
||||||
|
|||||||
@@ -548,6 +548,7 @@ fi
|
|||||||
|
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. /usr/local/CyberPanel/bin/activate
|
. /usr/local/CyberPanel/bin/activate
|
||||||
|
pip install --upgrade setuptools packaging
|
||||||
|
|
||||||
Download_Requirement
|
Download_Requirement
|
||||||
|
|
||||||
@@ -691,6 +692,7 @@ if [ "$Server_OS" = "Ubuntu" ]; then
|
|||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. /usr/local/CyberCP/bin/activate
|
. /usr/local/CyberCP/bin/activate
|
||||||
Check_Return
|
Check_Return
|
||||||
|
pip install --upgrade setuptools packaging
|
||||||
pip3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt
|
pip3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt
|
||||||
Check_Return
|
Check_Return
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from stat import *
|
|||||||
import stat
|
import stat
|
||||||
|
|
||||||
VERSION = '2.3'
|
VERSION = '2.3'
|
||||||
BUILD = 8
|
BUILD = 9
|
||||||
|
|
||||||
char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}
|
char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}
|
||||||
|
|
||||||
|
|||||||
@@ -1389,9 +1389,7 @@ Automatic backup failed for %s on %s.
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def SendTORemote(FileName, RemoteBackupID):
|
def SendTORemote(FileName, RemoteBackupID):
|
||||||
import pysftp
|
|
||||||
import json
|
import json
|
||||||
import pysftp as sftp
|
|
||||||
from websiteFunctions.models import RemoteBackupConfig
|
from websiteFunctions.models import RemoteBackupConfig
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from packages.models import Package
|
|||||||
from baseTemplate.models import version
|
from baseTemplate.models import version
|
||||||
|
|
||||||
VERSION = '2.3'
|
VERSION = '2.3'
|
||||||
BUILD = 8
|
BUILD = 9
|
||||||
|
|
||||||
if not os.geteuid() == 0:
|
if not os.geteuid() == 0:
|
||||||
sys.exit("\nOnly root can run this script\n")
|
sys.exit("\nOnly root can run this script\n")
|
||||||
|
|||||||
@@ -3015,8 +3015,8 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
from managePHP.phpManager import PHPManager
|
from managePHP.phpManager import PHPManager
|
||||||
from websiteFunctions.website import WebsiteManager
|
from websiteFunctions.website import WebsiteManager
|
||||||
from packages.models import Package
|
from packages.models import Package
|
||||||
import pysftp
|
#import pysftp
|
||||||
import pysftp as sftp
|
#import pysftp as sftp
|
||||||
import boto3
|
import boto3
|
||||||
|
|
||||||
if os.path.exists(ProcessUtilities.debugPath):
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ except:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
VERSION = '2.3'
|
VERSION = '2.3'
|
||||||
BUILD = 8
|
BUILD = 9
|
||||||
|
|
||||||
|
|
||||||
## I am not the monster that you think I am..
|
## I am not the monster that you think I am..
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import random
|
|||||||
import string
|
import string
|
||||||
|
|
||||||
VERSION = '2.3'
|
VERSION = '2.3'
|
||||||
BUILD = 8
|
BUILD = 9
|
||||||
|
|
||||||
CENTOS7 = 0
|
CENTOS7 = 0
|
||||||
CENTOS8 = 1
|
CENTOS8 = 1
|
||||||
@@ -3556,12 +3556,60 @@ pm.max_spare_servers = 3
|
|||||||
#Upgrade.executioner(command, 'fix csf if there', 0)
|
#Upgrade.executioner(command, 'fix csf if there', 0)
|
||||||
|
|
||||||
if os.path.exists('/etc/csf'):
|
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 = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py"
|
||||||
execPath = execPath + " removeCSF"
|
execPath = execPath + " removeCSF"
|
||||||
Upgrade.executioner(execPath, 'fix csf if there', 0)
|
Upgrade.executioner(execPath, 'fix csf if there', 0)
|
||||||
|
|
||||||
execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py"
|
execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py"
|
||||||
execPath = execPath + " installCSF"
|
execPath = execPath + " installCSF"
|
||||||
|
|
||||||
|
# Restore the files
|
||||||
|
print("Restoring files...")
|
||||||
|
restore_files()
|
||||||
|
|
||||||
|
|
||||||
Upgrade.executioner(execPath, 'fix csf if there', 0)
|
Upgrade.executioner(execPath, 'fix csf if there', 0)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ bcrypt==4.2.0
|
|||||||
beautifulsoup4==4.12.3
|
beautifulsoup4==4.12.3
|
||||||
boto3==1.34.153
|
boto3==1.34.153
|
||||||
botocore==1.34.153
|
botocore==1.34.153
|
||||||
cloudflare==2.8.13
|
cloudflare==2.20.0
|
||||||
cryptography==43.0.0
|
cryptography==43.0.0
|
||||||
cffi==1.14.3
|
cffi
|
||||||
Django==4.2.14
|
Django==4.2.14
|
||||||
docker==7.1.0
|
docker==7.1.0
|
||||||
google-api-core==2.19.1
|
google-api-core==2.19.1
|
||||||
@@ -14,14 +14,13 @@ google-auth-httplib2==0.2.0
|
|||||||
google-auth-oauthlib==1.2.1
|
google-auth-oauthlib==1.2.1
|
||||||
googleapis-common-protos==1.63.2
|
googleapis-common-protos==1.63.2
|
||||||
ipaddress==1.0.23
|
ipaddress==1.0.23
|
||||||
mysqlclient==2.0.1
|
mysqlclient
|
||||||
oauthlib==3.2.2
|
oauthlib==3.2.2
|
||||||
paramiko==3.4.1
|
paramiko==3.4.1
|
||||||
pexpect==4.9.0
|
pexpect==4.9.0
|
||||||
psutil==5.7.3
|
psutil
|
||||||
py3dns==4.0.2
|
py3dns==4.0.2
|
||||||
pyOpenSSL==24.2.1
|
pyOpenSSL==24.2.1
|
||||||
pysftp==0.2.9
|
|
||||||
pyotp
|
pyotp
|
||||||
PyYAML==6.0.1
|
PyYAML==6.0.1
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ EXPIRE = 3
|
|||||||
### Version
|
### Version
|
||||||
|
|
||||||
VERSION = '2.3'
|
VERSION = '2.3'
|
||||||
BUILD = 8
|
BUILD = 9
|
||||||
|
|
||||||
|
|
||||||
def serverStatusHome(request):
|
def serverStatusHome(request):
|
||||||
|
|||||||
Reference in New Issue
Block a user