mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 01:06:09 +01:00
bug fix: https://github.com/usmannasir/cyberpanel/issues/987 ftp issue on alma9
This commit is contained in:
@@ -621,6 +621,8 @@ gpgcheck=1
|
|||||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if get_Ubuntu_release() > 21.00:
|
if get_Ubuntu_release() > 21.00:
|
||||||
### change mysql md5 to crypt
|
### change mysql md5 to crypt
|
||||||
|
|
||||||
@@ -629,6 +631,19 @@ gpgcheck=1
|
|||||||
|
|
||||||
command = "systemctl restart pure-ftpd-mysql.service"
|
command = "systemctl restart pure-ftpd-mysql.service"
|
||||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
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)
|
InstallCyberPanel.stdOut("PureFTPD configured!", 1)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class FTPUtilities:
|
|||||||
|
|
||||||
ProcessUtilities.decideDistro()
|
ProcessUtilities.decideDistro()
|
||||||
|
|
||||||
if ProcessUtilities.ubuntu22Check == 1:
|
if ProcessUtilities.ubuntu22Check == 1 or ProcessUtilities.alma9check:
|
||||||
from crypt import crypt, METHOD_SHA512
|
from crypt import crypt, METHOD_SHA512
|
||||||
FTPPass = crypt(password, METHOD_SHA512)
|
FTPPass = crypt(password, METHOD_SHA512)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class ProcessUtilities(multi.Thread):
|
|||||||
ubuntu = 0
|
ubuntu = 0
|
||||||
ubuntu20 = 3
|
ubuntu20 = 3
|
||||||
ubuntu22Check = 0
|
ubuntu22Check = 0
|
||||||
|
alma9check = 0
|
||||||
server_address = '/usr/local/lscpd/admin/comm.sock'
|
server_address = '/usr/local/lscpd/admin/comm.sock'
|
||||||
token = "unset"
|
token = "unset"
|
||||||
portPath = '/usr/local/lscp/conf/bind.conf'
|
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 \
|
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 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:
|
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.cent8
|
||||||
return ProcessUtilities.centos
|
return ProcessUtilities.centos
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import docker
|
|
||||||
|
|
||||||
client = docker.from_env()
|
|
||||||
print (client.ping())
|
|
||||||
@@ -70,6 +70,32 @@ class Upgrade:
|
|||||||
' "restoreBackup": 0, "addDeleteDestinations": 0, "scheduleBackups": 0, "remoteBackups": 0, "googleDriveBackups": 1, "manageSSL": 1, ' \
|
' "restoreBackup": 0, "addDeleteDestinations": 0, "scheduleBackups": 0, "remoteBackups": 0, "googleDriveBackups": 1, "manageSSL": 1, ' \
|
||||||
'"hostnameSSL": 0, "mailServerSSL": 0 }'
|
'"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
|
@staticmethod
|
||||||
def decideCentosVersion():
|
def decideCentosVersion():
|
||||||
|
|
||||||
@@ -1183,6 +1209,17 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL
|
|||||||
command = "systemctl restart pure-ftpd-mysql.service"
|
command = "systemctl restart pure-ftpd-mysql.service"
|
||||||
Upgrade.executioner(command, command, 0)
|
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:
|
try:
|
||||||
connection.close()
|
connection.close()
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user