diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 6dcb2763f..533808973 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -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) diff --git a/plogical/ftpUtilities.py b/plogical/ftpUtilities.py index 716b633ce..85eccb1f9 100755 --- a/plogical/ftpUtilities.py +++ b/plogical/ftpUtilities.py @@ -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: diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 8995df590..c6cbe4289 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -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 diff --git a/plogical/test.py b/plogical/test.py index f95c1eb65..e69de29bb 100644 --- a/plogical/test.py +++ b/plogical/test.py @@ -1,4 +0,0 @@ -import docker - -client = docker.from_env() -print (client.ping()) \ No newline at end of file diff --git a/plogical/upgrade.py b/plogical/upgrade.py index efceee14d..3ba583dd3 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -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: