Skip to content

Commit dc2461d

Browse files
committed
cent8 repo
1 parent f92c661 commit dc2461d

File tree

6 files changed

+33
-122
lines changed

6 files changed

+33
-122
lines changed

cyberpanel.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,13 @@ fi
398398

399399

400400
install_required() {
401-
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
401+
402+
if [[ $CENTOS_8 == "True" ]] ; then
403+
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel8.repo > /etc/yum.repos.d/CyberPanel.repo
404+
elif [[ $CENTOS_8 == "False" ]] ; then
405+
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
406+
fi
407+
402408
if [[ $SERVER_COUNTRY == "CN" ]] ; then
403409
mkdir /root/.config
404410
mkdir /root/.config/pip
@@ -421,6 +427,8 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
421427
timeout 10 rpm --import https://$DOWNLOAD_SERVER/ius/RPM-GPG-KEY-IUS-7
422428
timeout 10 rpm --import https://repo.dovecot.org/DOVECOT-REPO-GPG
423429
timeout 10 rpm --import https://copr-be.cloud.fedoraproject.org/results/copart/restic/pubkey.gpg
430+
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-EP-8
431+
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-GF-8
424432
yum clean all
425433
yum update -y
426434
yum autoremove epel-release -y
@@ -432,7 +440,7 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
432440
check_return
433441
fi
434442
if [[ $CENTOS_8 == "True" ]] ; then
435-
yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel curl-devel git tar socat mariadb-devel openssl-devel MariaDB-shared mariadb-devel
443+
yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel curl-devel git tar socat mariadb-devel openssl-devel mariadb-devel
436444
check_return
437445
dnf --enablerepo=PowerTools install gpgme-devel -y
438446
check_return

install/CyberPanel8.repo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[CyberPanel]
2+
name=CyberPanel
3+
baseurl=https://rep8.cyberpanel.net/
4+
gpgcheck=1

install/install.py

Lines changed: 12 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -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'

install/installCyberPanel.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ def installMySQL(self, mysql):
213213

214214
if self.distro == ubuntu:
215215
command = "apt-get -y install mariadb-server"
216-
else:
216+
elif self.distro == centos:
217217
command = 'yum --enablerepo=CyberPanel -y install mariadb-server'
218+
elif self.distro == cent8:
219+
command = 'dnf -y install mariadb-server'
218220

219221
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
220222

@@ -327,8 +329,10 @@ def fixMariaDB(self):
327329
def installPureFTPD(self):
328330
if self.distro == ubuntu:
329331
command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro)
330-
else:
332+
elif self.distro == centos:
331333
command = "yum install -y pure-ftpd"
334+
elif self.distro == cent8:
335+
command = 'dnf --enablerepe=CyberPanel install pure-ftpd -y'
332336

333337
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
334338

websiteFunctions/StagingSetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def startCloning(self):
6666

6767
masterPath = '/home/%s/public_html' % (masterDomain)
6868

69-
command = 'rsync -avzh --exclude "%s" --exclude "wp-content/backups" --exclude "wp-content/updraft" --exclude "wp-content/cache" --exclude "wp-content/plugins/litespeed-cache" %s/ %s' % (
69+
command = 'rsync -avzh --exclude "%s" --exclude ".git" --exclude "wp-content/backups" --exclude "wp-content/updraft" --exclude "wp-content/cache" --exclude "wp-content/plugins/litespeed-cache" %s/ %s' % (
7070
domain, masterPath, path)
7171
ProcessUtilities.executioner(command, website.externalApp)
7272

websiteFunctions/website.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,14 +2760,11 @@ def startCloning(self, userID=None, data=None):
27602760
writeToFile.write(message)
27612761
writeToFile.close()
27622762

2763-
27642763
extraArgs['tempStatusPath'] = tempStatusPath
27652764

27662765
st = StagingSetup('startCloning', extraArgs)
27672766
st.start()
27682767

2769-
2770-
27712768
data_ret = {'status': 1, 'error_message': 'None', 'tempStatusPath': tempStatusPath}
27722769
json_data = json.dumps(data_ret)
27732770
return HttpResponse(json_data)

0 commit comments

Comments
 (0)