diff --git a/cyberpanel.sh b/cyberpanel.sh index f5182bffe..c76bf6e45 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -398,7 +398,13 @@ fi 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 mkdir /root/.config 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://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://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 update -y yum autoremove epel-release -y @@ -432,7 +440,7 @@ if [[ $SERVER_OS == "CentOS" ]] ; then check_return fi 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 dnf --enablerepo=PowerTools install gpgme-devel -y check_return diff --git a/install/CyberPanel8.repo b/install/CyberPanel8.repo new file mode 100644 index 000000000..74586b25e --- /dev/null +++ b/install/CyberPanel8.repo @@ -0,0 +1,4 @@ +[CyberPanel] +name=CyberPanel +baseurl=https://rep8.cyberpanel.net/ +gpgcheck=1 \ No newline at end of file diff --git a/install/install.py b/install/install.py index 5dd6625f4..1ae87ef4e 100755 --- a/install/install.py +++ b/install/install.py @@ -679,7 +679,6 @@ class preFlightsChecks: try: if self.distro == centos: - command = 'yum remove postfix -y' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) elif self.distro == ubuntu: @@ -693,7 +692,7 @@ class preFlightsChecks: if self.distro == centos: command = 'yum install --enablerepo=CyberPanel -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre' elif self.distro == cent8: - command = 'dnf install postfix postfix-mysql -y' + command = 'dnf --enablerepo=CyberPanel install postfix postfix-mysql-y ' else: command = 'apt-get -y debconf-utils' 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: command = 'yum --enablerepo=CyberPanel -y install dovecot dovecot-mysql' + elif self.distro == cent8: + command = 'dnf --enablerepe=CyberPanel install dovecot23 dovecot23-mysql -y' else: command = 'apt-get -y install dovecot-mysql' @@ -1703,8 +1704,10 @@ imap_folder_list_limit = 0 def installOpenDKIM(self): try: - if self.distro == centos or self.distro == cent8: + if self.distro == centos: command = 'yum -y install opendkim' + elif self.distro == cent8: + command = 'dnf --enablerepe=CyberPanel opendkim -y' else: command = 'apt-get -y install opendkim' @@ -1833,60 +1836,6 @@ milter_default_action = accept 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 def enableDisableDNS(state): try: @@ -1973,69 +1922,18 @@ milter_default_action = accept except: 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): try: CentOSPath = '/etc/redhat-release' if os.path.exists(CentOSPath): - command = 'yum --enablerepo=CyberPanel install restic -y' + + if self.distro == centos: + 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) else: command = 'apt-get update -y' diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index dc263b9a0..d0f91994b 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -213,8 +213,10 @@ class InstallCyberPanel: if self.distro == ubuntu: command = "apt-get -y install mariadb-server" - else: + elif self.distro == centos: 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) @@ -327,8 +329,10 @@ class InstallCyberPanel: def installPureFTPD(self): if self.distro == ubuntu: command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro) - else: + elif self.distro == centos: 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) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index 2084337e2..dd0351fc0 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -66,7 +66,7 @@ class StagingSetup(multi.Thread): 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) ProcessUtilities.executioner(command, website.externalApp) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 9a6703db5..553c27774 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -2760,14 +2760,11 @@ StrictHostKeyChecking no writeToFile.write(message) writeToFile.close() - extraArgs['tempStatusPath'] = tempStatusPath st = StagingSetup('startCloning', extraArgs) st.start() - - data_ret = {'status': 1, 'error_message': 'None', 'tempStatusPath': tempStatusPath} json_data = json.dumps(data_ret) return HttpResponse(json_data)