mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
cent8 repo
This commit is contained in:
@@ -398,7 +398,13 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
install_required() {
|
install_required() {
|
||||||
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
|
||||||
|
if [[ $CENTOS_8 == "True" ]] ; then
|
||||||
|
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel8.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||||
|
elif [[ $CENTOS_8 == "False" ]] ; then
|
||||||
|
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $SERVER_COUNTRY == "CN" ]] ; then
|
if [[ $SERVER_COUNTRY == "CN" ]] ; then
|
||||||
mkdir /root/.config
|
mkdir /root/.config
|
||||||
mkdir /root/.config/pip
|
mkdir /root/.config/pip
|
||||||
@@ -421,6 +427,8 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
|
|||||||
timeout 10 rpm --import https://$DOWNLOAD_SERVER/ius/RPM-GPG-KEY-IUS-7
|
timeout 10 rpm --import https://$DOWNLOAD_SERVER/ius/RPM-GPG-KEY-IUS-7
|
||||||
timeout 10 rpm --import https://repo.dovecot.org/DOVECOT-REPO-GPG
|
timeout 10 rpm --import https://repo.dovecot.org/DOVECOT-REPO-GPG
|
||||||
timeout 10 rpm --import https://copr-be.cloud.fedoraproject.org/results/copart/restic/pubkey.gpg
|
timeout 10 rpm --import https://copr-be.cloud.fedoraproject.org/results/copart/restic/pubkey.gpg
|
||||||
|
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-EP-8
|
||||||
|
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-GF-8
|
||||||
yum clean all
|
yum clean all
|
||||||
yum update -y
|
yum update -y
|
||||||
yum autoremove epel-release -y
|
yum autoremove epel-release -y
|
||||||
@@ -432,7 +440,7 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
|
|||||||
check_return
|
check_return
|
||||||
fi
|
fi
|
||||||
if [[ $CENTOS_8 == "True" ]] ; then
|
if [[ $CENTOS_8 == "True" ]] ; then
|
||||||
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
|
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
|
||||||
check_return
|
check_return
|
||||||
dnf --enablerepo=PowerTools install gpgme-devel -y
|
dnf --enablerepo=PowerTools install gpgme-devel -y
|
||||||
check_return
|
check_return
|
||||||
|
|||||||
4
install/CyberPanel8.repo
Normal file
4
install/CyberPanel8.repo
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[CyberPanel]
|
||||||
|
name=CyberPanel
|
||||||
|
baseurl=https://rep8.cyberpanel.net/
|
||||||
|
gpgcheck=1
|
||||||
@@ -679,7 +679,6 @@ class preFlightsChecks:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if self.distro == centos:
|
if self.distro == centos:
|
||||||
|
|
||||||
command = 'yum remove postfix -y'
|
command = 'yum remove postfix -y'
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
elif self.distro == ubuntu:
|
elif self.distro == ubuntu:
|
||||||
@@ -693,7 +692,7 @@ class preFlightsChecks:
|
|||||||
if self.distro == centos:
|
if self.distro == centos:
|
||||||
command = 'yum install --enablerepo=CyberPanel -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
|
command = 'yum install --enablerepo=CyberPanel -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
|
||||||
elif self.distro == cent8:
|
elif self.distro == cent8:
|
||||||
command = 'dnf install postfix postfix-mysql -y'
|
command = 'dnf --enablerepo=CyberPanel install postfix postfix-mysql-y '
|
||||||
else:
|
else:
|
||||||
command = 'apt-get -y debconf-utils'
|
command = 'apt-get -y debconf-utils'
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
@@ -721,6 +720,8 @@ class preFlightsChecks:
|
|||||||
|
|
||||||
if self.distro == centos or self.distro == cent8:
|
if self.distro == centos or self.distro == cent8:
|
||||||
command = 'yum --enablerepo=CyberPanel -y install dovecot dovecot-mysql'
|
command = 'yum --enablerepo=CyberPanel -y install dovecot dovecot-mysql'
|
||||||
|
elif self.distro == cent8:
|
||||||
|
command = 'dnf --enablerepe=CyberPanel install dovecot23 dovecot23-mysql -y'
|
||||||
else:
|
else:
|
||||||
command = 'apt-get -y install dovecot-mysql'
|
command = 'apt-get -y install dovecot-mysql'
|
||||||
|
|
||||||
@@ -1703,8 +1704,10 @@ imap_folder_list_limit = 0
|
|||||||
|
|
||||||
def installOpenDKIM(self):
|
def installOpenDKIM(self):
|
||||||
try:
|
try:
|
||||||
if self.distro == centos or self.distro == cent8:
|
if self.distro == centos:
|
||||||
command = 'yum -y install opendkim'
|
command = 'yum -y install opendkim'
|
||||||
|
elif self.distro == cent8:
|
||||||
|
command = 'dnf --enablerepe=CyberPanel opendkim -y'
|
||||||
else:
|
else:
|
||||||
command = 'apt-get -y install opendkim'
|
command = 'apt-get -y install opendkim'
|
||||||
|
|
||||||
@@ -1833,60 +1836,6 @@ milter_default_action = accept
|
|||||||
|
|
||||||
return res # Though probably not used
|
return res # Though probably not used
|
||||||
|
|
||||||
def setupVirtualEnv(self, distro):
|
|
||||||
try:
|
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
count = 0
|
|
||||||
if distro == ubuntu:
|
|
||||||
# You can't install all at once! So install one at a time.
|
|
||||||
preFlightsChecks.stdOut("Installing python prerequisites", 1)
|
|
||||||
preFlightsChecks.installOne('libcurl4-gnutls-dev')
|
|
||||||
preFlightsChecks.installOne('libgnutls-dev')
|
|
||||||
preFlightsChecks.installOne('libgcrypt20-dev')
|
|
||||||
preFlightsChecks.installOne('libattr1')
|
|
||||||
preFlightsChecks.installOne('libattr1-dev')
|
|
||||||
preFlightsChecks.installOne('liblzma-dev')
|
|
||||||
preFlightsChecks.installOne('libgpgme-dev')
|
|
||||||
preFlightsChecks.installOne('libmariadbclient-dev')
|
|
||||||
preFlightsChecks.installOne('libcurl4-gnutls-dev')
|
|
||||||
preFlightsChecks.installOne('libssl-dev')
|
|
||||||
preFlightsChecks.installOne('nghttp2')
|
|
||||||
preFlightsChecks.installOne('libnghttp2-dev')
|
|
||||||
preFlightsChecks.installOne('idn2')
|
|
||||||
preFlightsChecks.installOne('libidn2-dev')
|
|
||||||
preFlightsChecks.installOne('libidn2-0-dev')
|
|
||||||
preFlightsChecks.installOne('librtmp-dev')
|
|
||||||
preFlightsChecks.installOne('libpsl-dev')
|
|
||||||
preFlightsChecks.installOne('nettle-dev')
|
|
||||||
preFlightsChecks.installOne('libgnutls28-dev')
|
|
||||||
preFlightsChecks.installOne('libldap2-dev')
|
|
||||||
preFlightsChecks.installOne('libgssapi-krb5-2')
|
|
||||||
preFlightsChecks.installOne('libk5crypto3')
|
|
||||||
preFlightsChecks.installOne('libkrb5-dev')
|
|
||||||
preFlightsChecks.installOne('libcomerr2')
|
|
||||||
preFlightsChecks.installOne('libldap2-dev')
|
|
||||||
preFlightsChecks.installOne('python-gpg')
|
|
||||||
preFlightsChecks.installOne('python-gpgme')
|
|
||||||
else:
|
|
||||||
command = "yum install -y libattr-devel xz-devel gpgme-devel mariadb-devel curl-devel"
|
|
||||||
preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
os.chdir(self.cwd)
|
|
||||||
|
|
||||||
command = "chmod +x venvsetup.sh"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "./venvsetup.sh"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
except OSError as msg:
|
|
||||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [setupVirtualEnv]")
|
|
||||||
return 0
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def enableDisableDNS(state):
|
def enableDisableDNS(state):
|
||||||
try:
|
try:
|
||||||
@@ -1973,69 +1922,18 @@ milter_default_action = accept
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def p3(distro):
|
|
||||||
### Virtual Env 3
|
|
||||||
|
|
||||||
if distro == centos:
|
|
||||||
command = 'yum -y install python36 -y'
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = 'virtualenv -p python3 /usr/local/CyberPanel/p3'
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
env_path = '/usr/local/CyberPanel/p3'
|
|
||||||
subprocess.call(['virtualenv', env_path])
|
|
||||||
activate_this = os.path.join(env_path, 'bin', 'activate_this.py')
|
|
||||||
exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'), dict(__file__=activate_this))
|
|
||||||
|
|
||||||
command = "pip3 install --ignore-installed -r %s" % ('/usr/local/CyberCP/WebTerminal/requirments.txt')
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
else:
|
|
||||||
command = 'apt install -y python3-pip'
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = 'apt install build-essential libssl-dev libffi-dev python3-dev -y'
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = 'apt install -y python3-venv'
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = 'virtualenv -p python3 /usr/local/CyberPanel/p3'
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
env_path = '/usr/local/CyberPanel/p3'
|
|
||||||
subprocess.call(['virtualenv', env_path])
|
|
||||||
activate_this = os.path.join(env_path, 'bin', 'activate_this.py')
|
|
||||||
exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'), dict(__file__=activate_this))
|
|
||||||
|
|
||||||
command = "pip3 install --ignore-installed -r %s" % ('/usr/local/CyberCP/WebTerminal/requirments.txt')
|
|
||||||
preFlightsChecks.call(command, distro, '[install python36]',
|
|
||||||
'install python36',
|
|
||||||
1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
def installRestic(self):
|
def installRestic(self):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
CentOSPath = '/etc/redhat-release'
|
CentOSPath = '/etc/redhat-release'
|
||||||
|
|
||||||
if os.path.exists(CentOSPath):
|
if os.path.exists(CentOSPath):
|
||||||
|
|
||||||
|
if self.distro == centos:
|
||||||
command = 'yum --enablerepo=CyberPanel install restic -y'
|
command = 'yum --enablerepo=CyberPanel install restic -y'
|
||||||
|
else:
|
||||||
|
command = 'dnf --enablerepe=CyberPanel restic -y'
|
||||||
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
else:
|
else:
|
||||||
command = 'apt-get update -y'
|
command = 'apt-get update -y'
|
||||||
|
|||||||
@@ -213,8 +213,10 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
if self.distro == ubuntu:
|
if self.distro == ubuntu:
|
||||||
command = "apt-get -y install mariadb-server"
|
command = "apt-get -y install mariadb-server"
|
||||||
else:
|
elif self.distro == centos:
|
||||||
command = 'yum --enablerepo=CyberPanel -y install mariadb-server'
|
command = 'yum --enablerepo=CyberPanel -y install mariadb-server'
|
||||||
|
elif self.distro == cent8:
|
||||||
|
command = 'dnf -y install mariadb-server'
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
@@ -327,8 +329,10 @@ class InstallCyberPanel:
|
|||||||
def installPureFTPD(self):
|
def installPureFTPD(self):
|
||||||
if self.distro == ubuntu:
|
if self.distro == ubuntu:
|
||||||
command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro)
|
command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro)
|
||||||
else:
|
elif self.distro == centos:
|
||||||
command = "yum install -y pure-ftpd"
|
command = "yum install -y pure-ftpd"
|
||||||
|
elif self.distro == cent8:
|
||||||
|
command = 'dnf --enablerepe=CyberPanel install pure-ftpd -y'
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class StagingSetup(multi.Thread):
|
|||||||
|
|
||||||
masterPath = '/home/%s/public_html' % (masterDomain)
|
masterPath = '/home/%s/public_html' % (masterDomain)
|
||||||
|
|
||||||
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' % (
|
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' % (
|
||||||
domain, masterPath, path)
|
domain, masterPath, path)
|
||||||
ProcessUtilities.executioner(command, website.externalApp)
|
ProcessUtilities.executioner(command, website.externalApp)
|
||||||
|
|
||||||
|
|||||||
@@ -2760,14 +2760,11 @@ StrictHostKeyChecking no
|
|||||||
writeToFile.write(message)
|
writeToFile.write(message)
|
||||||
writeToFile.close()
|
writeToFile.close()
|
||||||
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = tempStatusPath
|
extraArgs['tempStatusPath'] = tempStatusPath
|
||||||
|
|
||||||
st = StagingSetup('startCloning', extraArgs)
|
st = StagingSetup('startCloning', extraArgs)
|
||||||
st.start()
|
st.start()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data_ret = {'status': 1, 'error_message': 'None', 'tempStatusPath': tempStatusPath}
|
data_ret = {'status': 1, 'error_message': 'None', 'tempStatusPath': tempStatusPath}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user