From 5233759134013660abadae3f6382ae5384cd89d5 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 10 May 2024 16:43:15 +0400 Subject: [PATCH] bug fix: alma9 dovecot install --- install/install.py | 30 ++++++++++++++++++++++++++++-- install/installCyberPanel.py | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/install/install.py b/install/install.py index 9a050491b..6d408ae97 100755 --- a/install/install.py +++ b/install/install.py @@ -33,9 +33,26 @@ def generate_pass(length=14): centos = 0 ubuntu = 1 cent8 = 2 +cent9 = 4 openeuler = 3 CloudLinux8 = 0 +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): + 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('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('8.9') > -1 or data.find('Midnight Oncilla') > -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): + return 'al-93' + else: + return -1 + def get_distro(): distro = -1 @@ -835,8 +852,17 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout'; command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) elif self.distro == cent8: - command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm' - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + clAPVersion = FetchCloudLinuxAlmaVersionVersion() + type = clAPVersion.split('-')[0] + version = int(clAPVersion.split('-')[1]) + + if type == 'al' and version >= 90: + command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el9.noarch.rpm' + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + else: + command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm' + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y' preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index be125c55e..96c07e65c 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -534,7 +534,7 @@ gpgcheck=1 self.distro == ubuntu and get_Ubuntu_release() == 18.14): command = 'openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem' else: - command = 'openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem' + command = 'openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -subj "/C=US/ST=Denial/L=Sprinal-ield/O=Dis/CN=www.example.com" -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem' install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)