mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-15 01:54:17 +02:00
add php 8.2 and also add support for cloud linux 8
This commit is contained in:
@@ -136,68 +136,70 @@ class preFlightsChecks:
|
||||
|
||||
def mountTemp(self):
|
||||
try:
|
||||
## On OpenVZ there is an issue using .tempdisk for /tmp as it breaks network on container after reboot.
|
||||
# ## On OpenVZ there is an issue using .tempdisk for /tmp as it breaks network on container after reboot.
|
||||
#
|
||||
# if subprocess.check_output('systemd-detect-virt').decode("utf-8").find("openvz") > -1:
|
||||
#
|
||||
# varTmp = "/var/tmp /tmp none bind 0 0\n"
|
||||
#
|
||||
# fstab = "/etc/fstab"
|
||||
# writeToFile = open(fstab, "a")
|
||||
# writeToFile.writelines(varTmp)
|
||||
# writeToFile.close()
|
||||
#
|
||||
# else:
|
||||
#
|
||||
# command = "dd if=/dev/zero of=/usr/.tempdisk bs=100M count=15"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# command = "mkfs.ext4 -F /usr/.tempdisk"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# command = "mkdir -p /usr/.tmpbak/"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# command = "cp -pr /tmp/* /usr/.tmpbak/"
|
||||
# subprocess.call(command, shell=True)
|
||||
#
|
||||
# command = "mount -o loop,rw,nodev,nosuid,noexec,nofail /usr/.tempdisk /tmp"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# command = "chmod 1777 /tmp"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# command = "cp -pr /usr/.tmpbak/* /tmp/"
|
||||
# subprocess.call(command, shell=True)
|
||||
#
|
||||
# command = "rm -rf /usr/.tmpbak"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# command = "mount --bind /tmp /var/tmp"
|
||||
# preFlightsChecks.call(command, self.distro, command,
|
||||
# command,
|
||||
# 1, 0, os.EX_OSERR)
|
||||
#
|
||||
# tmp = "/usr/.tempdisk /tmp ext4 loop,rw,noexec,nosuid,nodev,nofail 0 0\n"
|
||||
# varTmp = "/tmp /var/tmp none bind 0 0\n"
|
||||
#
|
||||
# fstab = "/etc/fstab"
|
||||
# writeToFile = open(fstab, "a")
|
||||
# writeToFile.writelines(tmp)
|
||||
# writeToFile.writelines(varTmp)
|
||||
# writeToFile.close()
|
||||
|
||||
if subprocess.check_output('systemd-detect-virt').decode("utf-8").find("openvz") > -1:
|
||||
|
||||
varTmp = "/var/tmp /tmp none bind 0 0\n"
|
||||
|
||||
fstab = "/etc/fstab"
|
||||
writeToFile = open(fstab, "a")
|
||||
writeToFile.writelines(varTmp)
|
||||
writeToFile.close()
|
||||
|
||||
else:
|
||||
|
||||
command = "dd if=/dev/zero of=/usr/.tempdisk bs=100M count=15"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
command = "mkfs.ext4 -F /usr/.tempdisk"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
command = "mkdir -p /usr/.tmpbak/"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
command = "cp -pr /tmp/* /usr/.tmpbak/"
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
command = "mount -o loop,rw,nodev,nosuid,noexec,nofail /usr/.tempdisk /tmp"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
command = "chmod 1777 /tmp"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
command = "cp -pr /usr/.tmpbak/* /tmp/"
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
command = "rm -rf /usr/.tmpbak"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
command = "mount --bind /tmp /var/tmp"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
tmp = "/usr/.tempdisk /tmp ext4 loop,rw,noexec,nosuid,nodev,nofail 0 0\n"
|
||||
varTmp = "/tmp /var/tmp none bind 0 0\n"
|
||||
|
||||
fstab = "/etc/fstab"
|
||||
writeToFile = open(fstab, "a")
|
||||
writeToFile.writelines(tmp)
|
||||
writeToFile.writelines(varTmp)
|
||||
writeToFile.close()
|
||||
pass
|
||||
|
||||
except BaseException as msg:
|
||||
preFlightsChecks.stdOut('[ERROR] ' + str(msg))
|
||||
|
||||
@@ -204,6 +204,9 @@ class InstallCyberPanel:
|
||||
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp81*'
|
||||
os.system(command)
|
||||
|
||||
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp82*'
|
||||
os.system(command)
|
||||
|
||||
elif self.distro == centos:
|
||||
command = 'yum -y groupinstall lsphp-all'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
@@ -241,7 +244,7 @@ class InstallCyberPanel:
|
||||
command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* --exclude lsphp73-pecl-zip --exclude *imagick* -y --skip-broken'
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
command = 'dnf install lsphp81* --exclude *imagick* -y --skip-broken'
|
||||
command = 'dnf install lsphp81* lsphp82* --exclude *imagick* -y --skip-broken'
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
if self.distro == openeuler:
|
||||
|
||||
Reference in New Issue
Block a user