Skip to content
Permalink
Browse files
cent8 repo
  • Loading branch information
usmannasir committed Apr 12, 2020
1 parent f92c661 commit dc2461dceec680e8501f9f1a21c61536a942ed75
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 122 deletions.
@@ -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
@@ -0,0 +1,4 @@
[CyberPanel]
name=CyberPanel
baseurl=https://rep8.cyberpanel.net/
gpgcheck=1
@@ -679,7 +679,6 @@ def install_postfix_davecot(self):

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 @@ def install_postfix_davecot(self):
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 @@ def install_postfix_davecot(self):

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 @@ def modSecPreReqs(self):

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 @@ def installOne(package):

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 @@ def setUpFirstAccount():
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'
@@ -213,8 +213,10 @@ def installMySQL(self, mysql):

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 @@ def fixMariaDB(self):
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)

@@ -66,7 +66,7 @@ def startCloning(self):

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)

@@ -2760,14 +2760,11 @@ def startCloning(self, userID=None, data=None):
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)

0 comments on commit dc2461d

Please sign in to comment.