From 923f7c1d40a201854c81dce40e629c2fd76a2947 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 10 Apr 2020 16:50:11 +0500 Subject: [PATCH] push more packages to repo --- cyberpanel.sh | 2 +- install/install.py | 32 +++----------------------------- install/installCyberPanel.py | 29 +---------------------------- plogical/applicationInstaller.py | 2 -- plogical/test.py | 9 --------- plogical/upgrade.py | 2 -- 6 files changed, 5 insertions(+), 71 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 02108bd87..7ff51b0c8 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1305,7 +1305,7 @@ fi fi #fix php.ini & issue -clear +#clear echo "###################################################################" echo " CyberPanel Successfully Installed " echo " " diff --git a/install/install.py b/install/install.py index 285150620..5dd6625f4 100755 --- a/install/install.py +++ b/install/install.py @@ -677,24 +677,9 @@ class preFlightsChecks: def install_postfix_davecot(self): self.stdOut("Install dovecot - first remove postfix") - if self.distro == centos: - path = '/etc/yum.repos.d/dovecot.repo' - content = """[dovecot-2.3-latest] -name=Dovecot 2.3 CentOS $releasever - $basearch -baseurl=http://repo.dovecot.org/ce-2.3-latest/centos/$releasever/RPMS/$basearch -gpgkey=https://repo.dovecot.org/DOVECOT-REPO-GPG -gpgcheck=1 -enabled=1""" - writeToFile = open(path, 'w') - writeToFile.write(content) - writeToFile.close() - try: if self.distro == centos: - command = 'yum -y install http://cyberpanel.sh/gf-release-latest.gf.el7.noarch.rpm' - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - command = 'yum remove postfix -y' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) elif self.distro == ubuntu: @@ -706,7 +691,7 @@ enabled=1""" self.stdOut("Install dovecot - do the install") if self.distro == centos: - command = 'yum install --enablerepo=gf-plus -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: command = 'dnf install postfix postfix-mysql -y' else: @@ -735,7 +720,7 @@ enabled=1""" ## if self.distro == centos or self.distro == cent8: - command = 'yum -y install dovecot dovecot-mysql' + command = 'yum --enablerepo=CyberPanel -y install dovecot dovecot-mysql' else: command = 'apt-get -y install dovecot-mysql' @@ -2050,14 +2035,7 @@ milter_default_action = accept CentOSPath = '/etc/redhat-release' if os.path.exists(CentOSPath): - - command = 'yum install yum-utils -y' - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = 'yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/copart/restic/repo/epel-7/copart-restic-epel-7.repo' - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = 'yum install restic -y' + command = 'yum --enablerepo=CyberPanel install restic -y' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) else: command = 'apt-get update -y' @@ -2066,10 +2044,6 @@ milter_default_action = accept command = 'apt-get install restic -y' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - cronTab = '/etc/crontab' - - data = open(cronTab, 'r').read() - except: pass diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index d9a92a084..dc263b9a0 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -207,28 +207,6 @@ class InstallCyberPanel: install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - def setup_mariadb_repo(self): - try: - - if self.distro == ubuntu: - # Only needed if the repo is broken or we need the latest version. - # command = "apt-get -y install software-properties-common" - # command = "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8" - # command = "add-apt-repository 'deb [arch=amd64] http://mirror.zol.co.zw/mariadb/repo/10.3/ubuntu bionic main'" - return - - InstallCyberPanel.stdOut("Setting up MariaDB Repo..", 1) - - os.chdir(self.cwd) - shutil.copy("mysql/MariaDB.repo","/etc/yum.repos.d/MariaDB.repo") - - InstallCyberPanel.stdOut("MariaDB repo set!", 1) - - - except BaseException as msg: - logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [setup_mariadb_repo]") - return 0 - def installMySQL(self, mysql): ############## Install mariadb ###################### @@ -236,7 +214,7 @@ class InstallCyberPanel: if self.distro == ubuntu: command = "apt-get -y install mariadb-server" else: - command = 'yum -y install mariadb-server' + command = 'yum --enablerepo=CyberPanel -y install mariadb-server' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) @@ -500,11 +478,6 @@ class InstallCyberPanel: # ". This may need to be fixed manually as 'echo \"nameserver 8.8.8.8\"> " # "/etc/resolv.conf'", 1, 1, os.EX_OSERR) - if self.distro == centos: - command = 'curl -o /etc/yum.repos.d/powerdns-auth-42.repo ' \ - 'https://repo.powerdns.com/repo-files/centos-auth-42.repo' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - if self.distro == cent8: command = 'dnf config-manager --set-enabled PowerTools' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 18cc8c125..57b3909ed 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -166,8 +166,6 @@ class ApplicationInstaller(multi.Thread): command = 'apt -y install git' ProcessUtilities.executioner(command) else: - command = 'yum -y install http://repo.iotti.biz/CentOS/7/noarch/lux-release-7-1.noarch.rpm' - ProcessUtilities.executioner(command) command = 'yum install git -y' ProcessUtilities.executioner(command) diff --git a/plogical/test.py b/plogical/test.py index 012282b14..e69de29bb 100755 --- a/plogical/test.py +++ b/plogical/test.py @@ -1,9 +0,0 @@ -import os -import subprocess -rootdir = '/home/repo.cyberpanel.net/public_html/epel/Packages' - -for subdir, dirs, files in os.walk(rootdir): - for file in files: - if file.endswith('.rpm'): - command = 'rpm --resign %s/%s' % (subdir, file) - subprocess.call(command, shell=True) \ No newline at end of file diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 64653f606..3f965f126 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1282,8 +1282,6 @@ class Upgrade: command = 'apt -y install git' Upgrade.executioner(command, 'installGit', 0) else: - command = 'sudo yum -y install http://repo.iotti.biz/CentOS/7/noarch/lux-release-7-1.noarch.rpm' - Upgrade.executioner(command, 'installGit', 0) command = 'sudo yum install git -y' Upgrade.executioner(command, 'installGit', 0)