@@ -679,7 +679,6 @@ def install_postfix_davecot(self):
679
679
680
680
try :
681
681
if self .distro == centos :
682
-
683
682
command = 'yum remove postfix -y'
684
683
preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
685
684
elif self .distro == ubuntu :
@@ -693,7 +692,7 @@ def install_postfix_davecot(self):
693
692
if self .distro == centos :
694
693
command = 'yum install --enablerepo=CyberPanel -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
695
694
elif self .distro == cent8 :
696
- command = 'dnf install postfix postfix-mysql -y '
695
+ command = 'dnf --enablerepo=CyberPanel install postfix postfix-mysql-y '
697
696
else :
698
697
command = 'apt-get -y debconf-utils'
699
698
preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
@@ -721,6 +720,8 @@ def install_postfix_davecot(self):
721
720
722
721
if self .distro == centos or self .distro == cent8 :
723
722
command = 'yum --enablerepo=CyberPanel -y install dovecot dovecot-mysql'
723
+ elif self .distro == cent8 :
724
+ command = 'dnf --enablerepe=CyberPanel install dovecot23 dovecot23-mysql -y'
724
725
else :
725
726
command = 'apt-get -y install dovecot-mysql'
726
727
@@ -1703,8 +1704,10 @@ def modSecPreReqs(self):
1703
1704
1704
1705
def installOpenDKIM (self ):
1705
1706
try :
1706
- if self .distro == centos or self . distro == cent8 :
1707
+ if self .distro == centos :
1707
1708
command = 'yum -y install opendkim'
1709
+ elif self .distro == cent8 :
1710
+ command = 'dnf --enablerepe=CyberPanel opendkim -y'
1708
1711
else :
1709
1712
command = 'apt-get -y install opendkim'
1710
1713
@@ -1833,60 +1836,6 @@ def installOne(package):
1833
1836
1834
1837
return res # Though probably not used
1835
1838
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
-
1890
1839
@staticmethod
1891
1840
def enableDisableDNS (state ):
1892
1841
try :
@@ -1973,69 +1922,18 @@ def setUpFirstAccount():
1973
1922
except :
1974
1923
pass
1975
1924
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
-
2032
1925
def installRestic (self ):
2033
1926
try :
2034
1927
2035
1928
CentOSPath = '/etc/redhat-release'
2036
1929
2037
1930
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
+
2039
1937
preFlightsChecks .call (command , self .distro , command , command , 1 , 0 , os .EX_OSERR )
2040
1938
else :
2041
1939
command = 'apt-get update -y'
0 commit comments