@@ -679,7 +679,6 @@ def install_postfix_davecot(self):
679679
680680 try :
681681 if self .distro == centos :
682-
683682 command = 'yum remove postfix -y'
684683 preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
685684 elif self .distro == ubuntu :
@@ -693,7 +692,7 @@ def install_postfix_davecot(self):
693692 if self .distro == centos :
694693 command = 'yum install --enablerepo=CyberPanel -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
695694 elif self .distro == cent8 :
696- command = 'dnf install postfix postfix-mysql -y '
695+ command = 'dnf --enablerepo=CyberPanel install postfix postfix-mysql-y '
697696 else :
698697 command = 'apt-get -y debconf-utils'
699698 preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
@@ -721,6 +720,8 @@ def install_postfix_davecot(self):
721720
722721 if self .distro == centos or self .distro == cent8 :
723722 command = 'yum --enablerepo=CyberPanel -y install dovecot dovecot-mysql'
723+ elif self .distro == cent8 :
724+ command = 'dnf --enablerepe=CyberPanel install dovecot23 dovecot23-mysql -y'
724725 else :
725726 command = 'apt-get -y install dovecot-mysql'
726727
@@ -1703,8 +1704,10 @@ def modSecPreReqs(self):
17031704
17041705 def installOpenDKIM (self ):
17051706 try :
1706- if self .distro == centos or self . distro == cent8 :
1707+ if self .distro == centos :
17071708 command = 'yum -y install opendkim'
1709+ elif self .distro == cent8 :
1710+ command = 'dnf --enablerepe=CyberPanel opendkim -y'
17081711 else :
17091712 command = 'apt-get -y install opendkim'
17101713
@@ -1833,60 +1836,6 @@ def installOne(package):
18331836
18341837 return res # Though probably not used
18351838
1836- def setupVirtualEnv (self , distro ):
1837- try :
1838-
1839- ##
1840-
1841- count = 0
1842- if distro == ubuntu :
1843- # You can't install all at once! So install one at a time.
1844- preFlightsChecks .stdOut ("Installing python prerequisites" , 1 )
1845- preFlightsChecks .installOne ('libcurl4-gnutls-dev' )
1846- preFlightsChecks .installOne ('libgnutls-dev' )
1847- preFlightsChecks .installOne ('libgcrypt20-dev' )
1848- preFlightsChecks .installOne ('libattr1' )
1849- preFlightsChecks .installOne ('libattr1-dev' )
1850- preFlightsChecks .installOne ('liblzma-dev' )
1851- preFlightsChecks .installOne ('libgpgme-dev' )
1852- preFlightsChecks .installOne ('libmariadbclient-dev' )
1853- preFlightsChecks .installOne ('libcurl4-gnutls-dev' )
1854- preFlightsChecks .installOne ('libssl-dev' )
1855- preFlightsChecks .installOne ('nghttp2' )
1856- preFlightsChecks .installOne ('libnghttp2-dev' )
1857- preFlightsChecks .installOne ('idn2' )
1858- preFlightsChecks .installOne ('libidn2-dev' )
1859- preFlightsChecks .installOne ('libidn2-0-dev' )
1860- preFlightsChecks .installOne ('librtmp-dev' )
1861- preFlightsChecks .installOne ('libpsl-dev' )
1862- preFlightsChecks .installOne ('nettle-dev' )
1863- preFlightsChecks .installOne ('libgnutls28-dev' )
1864- preFlightsChecks .installOne ('libldap2-dev' )
1865- preFlightsChecks .installOne ('libgssapi-krb5-2' )
1866- preFlightsChecks .installOne ('libk5crypto3' )
1867- preFlightsChecks .installOne ('libkrb5-dev' )
1868- preFlightsChecks .installOne ('libcomerr2' )
1869- preFlightsChecks .installOne ('libldap2-dev' )
1870- preFlightsChecks .installOne ('python-gpg' )
1871- preFlightsChecks .installOne ('python-gpgme' )
1872- else :
1873- command = "yum install -y libattr-devel xz-devel gpgme-devel mariadb-devel curl-devel"
1874- preFlightsChecks .call (command , distro , command , command , 1 , 1 , os .EX_OSERR )
1875-
1876- ##
1877-
1878- os .chdir (self .cwd )
1879-
1880- command = "chmod +x venvsetup.sh"
1881- preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
1882-
1883- command = "./venvsetup.sh"
1884- preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
1885-
1886- except OSError as msg :
1887- logging .InstallLog .writeToFile ('[ERROR] ' + str (msg ) + " [setupVirtualEnv]" )
1888- return 0
1889-
18901839 @staticmethod
18911840 def enableDisableDNS (state ):
18921841 try :
@@ -1973,69 +1922,18 @@ def setUpFirstAccount():
19731922 except :
19741923 pass
19751924
1976- @staticmethod
1977- def p3 (distro ):
1978- ### Virtual Env 3
1979-
1980- if distro == centos :
1981- command = 'yum -y install python36 -y'
1982- preFlightsChecks .call (command , distro , '[install python36]' ,
1983- 'install python36' ,
1984- 1 , 0 , os .EX_OSERR )
1985-
1986- command = 'virtualenv -p python3 /usr/local/CyberPanel/p3'
1987- preFlightsChecks .call (command , distro , '[install python36]' ,
1988- 'install python36' ,
1989- 1 , 0 , os .EX_OSERR )
1990-
1991- env_path = '/usr/local/CyberPanel/p3'
1992- subprocess .call (['virtualenv' , env_path ])
1993- activate_this = os .path .join (env_path , 'bin' , 'activate_this.py' )
1994- exec (compile (open (activate_this , "rb" ).read (), activate_this , 'exec' ), dict (__file__ = activate_this ))
1995-
1996- command = "pip3 install --ignore-installed -r %s" % ('/usr/local/CyberCP/WebTerminal/requirments.txt' )
1997- preFlightsChecks .call (command , distro , '[install python36]' ,
1998- 'install python36' ,
1999- 1 , 0 , os .EX_OSERR )
2000-
2001- else :
2002- command = 'apt install -y python3-pip'
2003- preFlightsChecks .call (command , distro , '[install python36]' ,
2004- 'install python36' ,
2005- 1 , 0 , os .EX_OSERR )
2006-
2007- command = 'apt install build-essential libssl-dev libffi-dev python3-dev -y'
2008- preFlightsChecks .call (command , distro , '[install python36]' ,
2009- 'install python36' ,
2010- 1 , 0 , os .EX_OSERR )
2011-
2012- command = 'apt install -y python3-venv'
2013- preFlightsChecks .call (command , distro , '[install python36]' ,
2014- 'install python36' ,
2015- 1 , 0 , os .EX_OSERR )
2016-
2017- command = 'virtualenv -p python3 /usr/local/CyberPanel/p3'
2018- preFlightsChecks .call (command , distro , '[install python36]' ,
2019- 'install python36' ,
2020- 1 , 0 , os .EX_OSERR )
2021-
2022- env_path = '/usr/local/CyberPanel/p3'
2023- subprocess .call (['virtualenv' , env_path ])
2024- activate_this = os .path .join (env_path , 'bin' , 'activate_this.py' )
2025- exec (compile (open (activate_this , "rb" ).read (), activate_this , 'exec' ), dict (__file__ = activate_this ))
2026-
2027- command = "pip3 install --ignore-installed -r %s" % ('/usr/local/CyberCP/WebTerminal/requirments.txt' )
2028- preFlightsChecks .call (command , distro , '[install python36]' ,
2029- 'install python36' ,
2030- 1 , 0 , os .EX_OSERR )
2031-
20321925 def installRestic (self ):
20331926 try :
20341927
20351928 CentOSPath = '/etc/redhat-release'
20361929
20371930 if os .path .exists (CentOSPath ):
2038- command = 'yum --enablerepo=CyberPanel install restic -y'
1931+
1932+ if self .distro == centos :
1933+ command = 'yum --enablerepo=CyberPanel install restic -y'
1934+ else :
1935+ command = 'dnf --enablerepe=CyberPanel restic -y'
1936+
20391937 preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
20401938 else :
20411939 command = 'apt-get update -y'
0 commit comments