mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-06-16 03:21:30 +02:00
add cyberpanel repo
This commit is contained in:
@@ -398,6 +398,7 @@ fi
|
||||
|
||||
|
||||
install_required() {
|
||||
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||
if [[ $SERVER_COUNTRY == "CN" ]] ; then
|
||||
mkdir /root/.config
|
||||
mkdir /root/.config/pip
|
||||
@@ -425,14 +426,13 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
|
||||
yum autoremove epel-release -y
|
||||
rm -f /etc/yum.repos.d/epel.repo
|
||||
rm -f /etc/yum.repos.d/epel.repo.rpmsave
|
||||
yum install epel-release -y
|
||||
|
||||
if [[ $CENTOS_8 == "False" ]] ; then
|
||||
yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc python-devel libattr-devel xz-devel gpgme-devel mariadb-devel curl-devel python-pip git socat
|
||||
yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel gpgme-devel curl-devel git socat
|
||||
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 mariadb-devel curl-devel git platform-python-devel tar socat
|
||||
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
|
||||
check_return
|
||||
dnf --enablerepo=PowerTools install gpgme-devel -y
|
||||
check_return
|
||||
@@ -442,11 +442,6 @@ if [[ $DEV == "ON" ]] ; then
|
||||
if [[ $CENTOS_8 == "False" ]] ; then
|
||||
yum -y install yum-utils
|
||||
yum -y groupinstall development
|
||||
if [[ $SERVER_COUNTRY == "CN" ]] ; then
|
||||
wget -O /etc/yum.repos.d/ius.repo https://$DOWNLOAD_SERVER/ius/ius.repo
|
||||
else
|
||||
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
|
||||
fi
|
||||
yum -y install python36u python36u-pip python36u-devel
|
||||
check_return
|
||||
fi
|
||||
|
||||
5
install/CyberPanel.repo
Normal file
5
install/CyberPanel.repo
Normal file
@@ -0,0 +1,5 @@
|
||||
[CyberPanel]
|
||||
name=CyberPanel
|
||||
baseurl=https://repo.cyberpanel.net/
|
||||
gpgkey=https://repo.cyberpanel.net/RPM-GPG-KEY-cyberpanel
|
||||
gpgcheck=1
|
||||
@@ -304,10 +304,6 @@ class preFlightsChecks:
|
||||
except BaseException as msg:
|
||||
logging.InstallLog.writeToFile("[ERROR] setup_account_cyberpanel. " + str(msg))
|
||||
|
||||
def yum_update(self):
|
||||
command = 'yum update -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
def installCyberPanelRepo(self):
|
||||
self.stdOut("Install Cyberpanel repo")
|
||||
|
||||
@@ -333,60 +329,6 @@ class preFlightsChecks:
|
||||
command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
def enableEPELRepo(self):
|
||||
command = 'yum -y install epel-release'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
def install_pip(self):
|
||||
self.stdOut("Install pip")
|
||||
if self.distro == ubuntu:
|
||||
command = "apt-get -y install python-pip"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
elif self.distro == centos:
|
||||
command = "yum -y install python-pip"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
|
||||
def install_python_dev(self):
|
||||
self.stdOut("Install python development environment")
|
||||
|
||||
if self.distro == centos:
|
||||
command = "yum -y install python-devel"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
elif self.distro == ubuntu:
|
||||
command = "apt-get -y install python-dev"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
|
||||
|
||||
def install_gcc(self):
|
||||
self.stdOut("Install gcc")
|
||||
|
||||
if self.distro == centos:
|
||||
command = "yum -y install gcc"
|
||||
else:
|
||||
command = "apt-get -y install gcc"
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
def install_python_setup_tools(self):
|
||||
command = "yum -y install python-setuptools"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
def install_python_mysql_library(self):
|
||||
self.stdOut("Install MySQL python library")
|
||||
|
||||
if self.distro == centos:
|
||||
command = "yum install mariadb-devel gcc python36u-devel -y"
|
||||
else:
|
||||
command = "apt-get -y install libmysqlclient-dev"
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
if self.distro == ubuntu:
|
||||
command = "pip install MySQL-python"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
def fix_selinux_issue(self):
|
||||
try:
|
||||
cmd = []
|
||||
@@ -415,24 +357,11 @@ class preFlightsChecks:
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
def installGit(self):
|
||||
if os.path.exists("/etc/lsb-release"):
|
||||
command = 'apt -y install git'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
else:
|
||||
command = 'yum -y install http://repo.iotti.biz/CentOS/7/noarch/lux-release-7-1.noarch.rpm'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = 'yum install git -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
def download_install_CyberPanel(self, mysqlPassword, mysql):
|
||||
##
|
||||
|
||||
os.chdir(self.path)
|
||||
|
||||
self.installGit()
|
||||
|
||||
os.chdir('/usr/local')
|
||||
|
||||
command = "git clone https://github.com/usmannasir/cyberpanel"
|
||||
@@ -2236,9 +2165,6 @@ vmail
|
||||
command = 'systemctl enable redis'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='CyberPanel Installer')
|
||||
parser.add_argument('publicip', help='Please enter public IP for your VPS or dedicated server.')
|
||||
@@ -2307,10 +2233,6 @@ def main():
|
||||
checks.checkPythonVersion()
|
||||
checks.setup_account_cyberpanel()
|
||||
checks.installCyberPanelRepo()
|
||||
#checks.install_gcc()
|
||||
if distro == centos:
|
||||
checks.install_python_setup_tools()
|
||||
#checks.install_python_mysql_library()
|
||||
|
||||
import installCyberPanel
|
||||
|
||||
@@ -2348,7 +2270,6 @@ def main():
|
||||
checks.setup_cron()
|
||||
checks.installRestic()
|
||||
checks.installAcme()
|
||||
# checks.installdnsPython()
|
||||
|
||||
## Install and Configure OpenDKIM.
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user