This commit is contained in:
usmannasir
2024-07-19 19:25:29 +05:00
parent 494dc6c600
commit 60e447fb07
5 changed files with 58 additions and 5 deletions

View File

@@ -621,6 +621,8 @@ gpgcheck=1
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
if get_Ubuntu_release() > 21.00:
### change mysql md5 to crypt
@@ -629,6 +631,19 @@ gpgcheck=1
command = "systemctl restart pure-ftpd-mysql.service"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
else:
try:
clAPVersion = FetchCloudLinuxAlmaVersionVersion()
type = clAPVersion.split('-')[0]
version = int(clAPVersion.split('-')[1])
if type == 'al' and version >= 90:
command = "sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' /etc/pure-ftpd/pureftpd-mysql.conf"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
except:
pass
InstallCyberPanel.stdOut("PureFTPD configured!", 1)

View File

@@ -145,7 +145,7 @@ class FTPUtilities:
ProcessUtilities.decideDistro()
if ProcessUtilities.ubuntu22Check == 1:
if ProcessUtilities.ubuntu22Check == 1 or ProcessUtilities.alma9check:
from crypt import crypt, METHOD_SHA512
FTPPass = crypt(password, METHOD_SHA512)
else:

View File

@@ -19,6 +19,7 @@ class ProcessUtilities(multi.Thread):
ubuntu = 0
ubuntu20 = 3
ubuntu22Check = 0
alma9check = 0
server_address = '/usr/local/lscpd/admin/comm.sock'
token = "unset"
portPath = '/usr/local/lscp/conf/bind.conf'
@@ -180,6 +181,10 @@ class ProcessUtilities(multi.Thread):
if open('/etc/redhat-release', 'r').read().find('CentOS Linux release 8') > -1 or open('/etc/redhat-release', 'r').read().find('AlmaLinux release 8') > -1 \
or open('/etc/redhat-release', 'r').read().find('Rocky Linux release 8') > -1 \
or open('/etc/redhat-release', 'r').read().find('Rocky Linux release 9') > -1 or open('/etc/redhat-release', 'r').read().find('AlmaLinux release 9') > -1:
## this is check only
if open(distroPath, 'r').read().find('AlmaLinux release 9') > -1 or open(distroPath, 'r').read().find('Rocky Linux release 9') > -1:
ProcessUtilities.alma9check = 1
return ProcessUtilities.cent8
return ProcessUtilities.centos

View File

@@ -1,4 +0,0 @@
import docker
client = docker.from_env()
print (client.ping())

View File

@@ -70,6 +70,32 @@ class Upgrade:
' "restoreBackup": 0, "addDeleteDestinations": 0, "scheduleBackups": 0, "remoteBackups": 0, "googleDriveBackups": 1, "manageSSL": 1, ' \
'"hostnameSSL": 0, "mailServerSSL": 0 }'
@staticmethod
def FetchCloudLinuxAlmaVersionVersion():
if os.path.exists('/etc/os-release'):
data = open('/etc/os-release', 'r').read()
if (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (
data.find('8.9') > -1 or data.find('Anatoly Levchenko') > -1 or data.find('VERSION="8.') > -1):
return 'cl-89'
elif (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (
data.find('8.8') > -1 or data.find('Anatoly Filipchenko') > -1):
return 'cl-88'
elif (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (
data.find('9.4') > -1 or data.find('VERSION="9.') > -1):
return 'cl-88'
elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (
data.find('8.9') > -1 or data.find('Midnight Oncilla') > -1 or data.find('VERSION="8.') > -1):
return 'al-88'
elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (
data.find('8.7') > -1 or data.find('Stone Smilodon') > -1):
return 'al-87'
elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (
data.find('9.4') > -1 or data.find('9.3') > -1 or data.find('Shamrock Pampas') > -1 or data.find(
'Seafoam Ocelot') > -1 or data.find('VERSION="9.') > -1):
return 'al-93'
else:
return -1
@staticmethod
def decideCentosVersion():
@@ -1183,6 +1209,17 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL
command = "systemctl restart pure-ftpd-mysql.service"
Upgrade.executioner(command, command, 0)
try:
clAPVersion = Upgrade.FetchCloudLinuxAlmaVersionVersion()
type = clAPVersion.split('-')[0]
version = int(clAPVersion.split('-')[1])
if type == 'al' and version >= 90:
command = "sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' /etc/pure-ftpd/pureftpd-mysql.conf"
Upgrade.executioner(command, command, 0)
except:
pass
try:
connection.close()
except: