Merge branch 'v2.3.3-dev' into stable
@@ -5,7 +5,7 @@ class CLMain():
|
||||
self.path = '/usr/local/CyberCP/version.txt'
|
||||
#versionInfo = json.loads(open(self.path, 'r').read())
|
||||
self.version = '2.3'
|
||||
self.build = '1'
|
||||
self.build = '2'
|
||||
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
|
||||
@@ -40,18 +40,42 @@ DIR=/etc/mail/spamassassin
|
||||
if [ -d "$DIR" ]; then
|
||||
sa-update
|
||||
else
|
||||
echo "Please install spamassassin through the CyberPanel interface before proceeding"
|
||||
echo "Please install SpamAssasin through the CyberPanel interface before proceeding"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f /etc/os-release ]; then
|
||||
OS=$(head -1 /etc/os-release)
|
||||
UBUNTUVERSION=$(sed '6q;d' /etc/os-release)
|
||||
CENTOSVERSION=$(sed '5q;d' /etc/os-release)
|
||||
CLNVERSION=$(sed '3q;d' /etc/os-release)
|
||||
### OS Detection
|
||||
Server_OS=""
|
||||
Server_OS_Version=""
|
||||
if grep -q -E "CentOS Linux 7|CentOS Linux 8" /etc/os-release ; then
|
||||
Server_OS="CentOS"
|
||||
elif grep -q "AlmaLinux-8" /etc/os-release ; then
|
||||
Server_OS="AlmaLinux"
|
||||
elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
|
||||
Server_OS="CloudLinux"
|
||||
elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then
|
||||
Server_OS="Ubuntu"
|
||||
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
|
||||
Server_OS="openEuler"
|
||||
else
|
||||
echo -e "Unable to detect your system..."
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$CENTOSVERSION" = "VERSION_ID=\"7\"" ]; then
|
||||
Server_OS_Version=$(grep VERSION_ID /etc/os-release | awk -F[=,] '{print $2}' | tr -d \" | head -c2 | tr -d . )
|
||||
|
||||
echo -e "System: $Server_OS $Server_OS_Version detected...\n"
|
||||
|
||||
if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] || [[ "$Server_OS" = "RockyLinux" ]] ; then
|
||||
Server_OS="CentOS"
|
||||
#CloudLinux gives version id like 7.8, 7.9, so cut it to show first number only
|
||||
#treat CloudLinux, Rocky and Alma as CentOS
|
||||
fi
|
||||
|
||||
if [[ $Server_OS = "CentOS" ]] && [[ "$Server_OS_Version" = "7" ]] ; then
|
||||
|
||||
setenforce 0
|
||||
yum install -y perl yum-utils perl-CPAN
|
||||
@@ -68,7 +92,7 @@ if [ "$CENTOSVERSION" = "VERSION_ID=\"7\"" ]; then
|
||||
|
||||
freshclam -v
|
||||
|
||||
elif [ "$CENTOSVERSION" = "VERSION_ID=\"8\"" ]; then
|
||||
elif [[ $Server_OS = "CentOS" ]] && [[ "$Server_OS_Version" = "8" ]] ; then
|
||||
|
||||
setenforce 0
|
||||
yum install -y perl yum-utils perl-CPAN
|
||||
@@ -107,7 +131,7 @@ elif [ "$CLNVERSION" = "ID=\"cloudlinux\"" ]; then
|
||||
|
||||
freshclam -v
|
||||
|
||||
elif [ "$OS" = "NAME=\"Ubuntu\"" ]; then
|
||||
elif [[ $Server_OS = "Ubuntu" ]]; then
|
||||
|
||||
apt-get install -y libmysqlclient-dev
|
||||
|
||||
@@ -133,8 +157,8 @@ echo "/^Received:/ HOLD" >>/etc/postfix/header_checks
|
||||
|
||||
systemctl restart postfix
|
||||
|
||||
if [ "$OS" = "NAME=\"Ubuntu\"" ]; then
|
||||
wget https://github.com/MailScanner/v5/releases/download/5.3.3-1/MailScanner-5.3.3-1.noarch.deb
|
||||
if [[ $Server_OS = "Ubuntu" ]]; then
|
||||
wget https://github.com/MailScanner/v5/releases/download/5.4.4-1/MailScanner-5.4.4-1.noarch.deb
|
||||
dpkg -i *.noarch.deb
|
||||
|
||||
mkdir /var/run/MailScanner
|
||||
@@ -144,10 +168,9 @@ if [ "$OS" = "NAME=\"Ubuntu\"" ]; then
|
||||
chown -R postfix:postfix /var/lock/subsys/MailScanner
|
||||
chown -R postfix:postfix /var/spool/MailScanner
|
||||
|
||||
elif [ "$OS" = "NAME=\"CentOS Linux\"" ]; then
|
||||
wget https://github.com/MailScanner/v5/releases/download/5.3.3-1/MailScanner-5.3.3-1.rhel.noarch.rpm
|
||||
elif [[ $Server_OS = "CentOS" ]]; then
|
||||
wget https://github.com/MailScanner/v5/releases/download/5.4.4-1/MailScanner-5.4.4-1.rhel.noarch.rpm
|
||||
rpm -Uvh *.rhel.noarch.rpm
|
||||
|
||||
elif [ "$OS" = "NAME=\"CloudLinux\"" ]; then
|
||||
wget https://github.com/MailScanner/v5/releases/download/5.3.3-1/MailScanner-5.3.3-1.rhel.noarch.rpm
|
||||
rpm -Uvh *.rhel.noarch.rpm
|
||||
|
||||
@@ -1,26 +1,52 @@
|
||||
#!/bin/bash
|
||||
## Uninstall Mailscanner CyberPanel
|
||||
|
||||
if [ -f /etc/os-release ]; then
|
||||
OS=$(head -1 /etc/os-release)
|
||||
UBUNTUVERSION=$(sed '6q;d' /etc/os-release)
|
||||
CENTOSVERSION=$(sed '5q;d' /etc/os-release)
|
||||
CLNVERSION=$(sed '3q;d' /etc/os-release)
|
||||
### OS Detection
|
||||
Server_OS=""
|
||||
Server_OS_Version=""
|
||||
if grep -q -E "CentOS Linux 7|CentOS Linux 8" /etc/os-release ; then
|
||||
Server_OS="CentOS"
|
||||
elif grep -q "AlmaLinux-8" /etc/os-release ; then
|
||||
Server_OS="AlmaLinux"
|
||||
elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
|
||||
Server_OS="CloudLinux"
|
||||
elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then
|
||||
Server_OS="Ubuntu"
|
||||
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
|
||||
Server_OS="openEuler"
|
||||
else
|
||||
echo -e "Unable to detect your system..."
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
Server_OS_Version=$(grep VERSION_ID /etc/os-release | awk -F[=,] '{print $2}' | tr -d \" | head -c2 | tr -d . )
|
||||
|
||||
echo -e "System: $Server_OS $Server_OS_Version detected...\n"
|
||||
|
||||
if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] || [[ "$Server_OS" = "RockyLinux" ]] ; then
|
||||
Server_OS="CentOS"
|
||||
#CloudLinux gives version id like 7.8, 7.9, so cut it to show first number only
|
||||
#treat CloudLinux, Rocky and Alma as CentOS
|
||||
fi
|
||||
|
||||
systemctl stop mailscanner
|
||||
|
||||
if [ "$OS" = "NAME=\"Ubuntu\"" ]; then
|
||||
apt purge -y mailscanner
|
||||
|
||||
elif
|
||||
[ "$OS" = "NAME=\"CentOS Linux\"" ]
|
||||
then
|
||||
if [[ $Server_OS = "CentOS" ]] && [[ "$Server_OS_Version" = "7" ]] ; then
|
||||
|
||||
yum remove -y MailScanner
|
||||
|
||||
elif [ "$OS" = "NAME=\"CloudLinux\"" ]; then
|
||||
elif [[ $Server_OS = "CentOS" ]] && [[ "$Server_OS_Version" = "8" ]] ; then
|
||||
|
||||
yum remove -y MailScanner
|
||||
|
||||
elif [[ $Server_OS = "Ubuntu" ]]; then
|
||||
|
||||
apt purge -y mailscanner
|
||||
|
||||
fi
|
||||
|
||||
sed -i 's/\/^Received:\/ HOLD/\/^Received:\/ IGNORE/g' /etc/postfix/header_checks
|
||||
|
||||
@@ -72,7 +72,7 @@ class secMiddleware:
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
if request.build_absolute_uri().find('api/verifyConn') > -1 or request.build_absolute_uri().find('webhook') > -1 or request.build_absolute_uri().find('saveSpamAssassinConfigurations') > -1 or request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
|
||||
if request.build_absolute_uri().find('api/remoteTransfer') > -1 or request.build_absolute_uri().find('api/verifyConn') > -1 or request.build_absolute_uri().find('webhook') > -1 or request.build_absolute_uri().find('saveSpamAssassinConfigurations') > -1 or request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
|
||||
continue
|
||||
if key == 'key' or key == 'cert' or key == 'recordContentAAAA' or key == 'backupDestinations' or key == 'ports' \
|
||||
or key == 'imageByPass' or key == 'passwordByPass' or key == 'cronCommand' \
|
||||
|
||||
@@ -138,7 +138,7 @@ class IncJobs(multi.Thread):
|
||||
backupExcludesFile = '/home/%s/backup-exclude.conf' % (self.website.domain)
|
||||
resticBackupExcludeCMD = ' --exclude-file=%s' % (backupExcludesFile)
|
||||
|
||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s --exclude /home/%s/backup --exclude /home/%s/incbackup' % (
|
||||
command = 'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s --exclude /home/%s/backup --exclude /home/%s/incbackup' % (
|
||||
key, secret, self.website.domain, backupPath, self.passwordFile, self.website.domain, self.website.domain)
|
||||
|
||||
# If /home/%s/backup-exclude.conf file exists lets pass this to restic by appending the command to end.
|
||||
@@ -184,7 +184,7 @@ class IncJobs(multi.Thread):
|
||||
|
||||
key, secret = self.getAWSData()
|
||||
|
||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s forget %s --password-file %s' % (
|
||||
command = 'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s forget %s --password-file %s' % (
|
||||
key, secret, self.website, snapshotID, self.passwordFile)
|
||||
|
||||
result = ProcessUtilities.outputExecutioner(command, self.externalApp)
|
||||
@@ -195,7 +195,7 @@ class IncJobs(multi.Thread):
|
||||
logging.statusWriter(self.statusPath, 'Failed: %s. [5009]' % (result), 1)
|
||||
return 0
|
||||
|
||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s prune --password-file %s' % (
|
||||
command = 'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s prune --password-file %s' % (
|
||||
key, secret, self.website, self.passwordFile)
|
||||
|
||||
ProcessUtilities.outputExecutioner(command, self.externalApp)
|
||||
@@ -204,7 +204,7 @@ class IncJobs(multi.Thread):
|
||||
|
||||
key, secret = self.getAWSData()
|
||||
|
||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s restore %s --password-file %s --target %s' % (
|
||||
command = 'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s restore %s --password-file %s --target %s' % (
|
||||
key, secret, self.website, snapshotID, self.passwordFile, self.restoreTarget)
|
||||
|
||||
result = ProcessUtilities.outputExecutioner(command, self.externalApp)
|
||||
@@ -764,7 +764,7 @@ class IncJobs(multi.Thread):
|
||||
logging.statusWriter(self.statusPath, result, 1)
|
||||
else:
|
||||
key, secret = self.getAWSData()
|
||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s init --password-file %s' % (
|
||||
command = 'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s init --password-file %s' % (
|
||||
key, secret, self.website.domain, self.passwordFile)
|
||||
result = ProcessUtilities.outputExecutioner(command, self.externalApp)
|
||||
|
||||
@@ -939,6 +939,4 @@ Subject: %s
|
||||
|
||||
except BaseException as msg:
|
||||
logging.statusWriter(self.statusPath, "%s [903:DeleteSnapShot][5009]" % (str(msg)), 1)
|
||||
return 0
|
||||
|
||||
|
||||
return 0
|
||||
50
README.md
@@ -1,32 +1,34 @@
|
||||
# CyberPanel
|
||||
|
||||
Webhosting control panel that uses OpenLiteSpeed as web server.
|
||||
Web Hosting Control Panel that uses OpenLiteSpeed as the underlying Web Server.
|
||||
|
||||
## Features
|
||||
## Features & Services
|
||||
|
||||
* Different Level Of users.
|
||||
* Different User Access Levels (via ACLs).
|
||||
* Auto SSL.
|
||||
* FTP Server.
|
||||
* Light weight DNS Server (PowerDNS).
|
||||
* PHPMYAdmin.
|
||||
* Email Support (Rainloop).
|
||||
* FileManager.
|
||||
* Light-weight DNS Server (PowerDNS).
|
||||
* phpMyAdmin to manage DBs (MariaDB).
|
||||
* Email Support (SnappyMail).
|
||||
* File Manager.
|
||||
* PHP Managment.
|
||||
* Firewall (FirewallD & ConfigServer Firewall Intregration).
|
||||
* One click Backup and Restore.
|
||||
* Firewall (FirewallD & ConfigServer Firewall Integration).
|
||||
* One-click Backups and Restores.
|
||||
|
||||
# Supported PHPs
|
||||
# Supported PHP Versions
|
||||
|
||||
* PHP 5.3
|
||||
* PHP 5.4
|
||||
* PHP 5.5
|
||||
* PHP 5.6
|
||||
* PHP 7.0
|
||||
* PHP 7.1
|
||||
* PHP 7.2
|
||||
* PHP 7.3
|
||||
* PHP 7.4
|
||||
* PHP 8.1
|
||||
* PHP 8.0
|
||||
* PHP 7.4
|
||||
* PHP 7.3
|
||||
* PHP 7.2
|
||||
* PHP 7.1
|
||||
* PHP 7.0
|
||||
* PHP 5.6
|
||||
* PHP 5.5
|
||||
* PHP 5.4
|
||||
* PHP 5.3
|
||||
|
||||
|
||||
# Installation Instructions
|
||||
|
||||
@@ -35,7 +37,7 @@ Webhosting control panel that uses OpenLiteSpeed as web server.
|
||||
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
|
||||
```
|
||||
|
||||
# Upgrading
|
||||
# Upgrading CyberPanel
|
||||
|
||||
|
||||
```
|
||||
@@ -45,8 +47,10 @@ sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgr
|
||||
# Resources
|
||||
|
||||
* [Official Site.](https://cyberpanel.net)
|
||||
* [Documentation.](https://docs.cyberpanel.net)
|
||||
* [Forums.](https://forums.cyberpanel.net)
|
||||
* [Docs (Old).](https://docs.cyberpanel.net)
|
||||
* [Docs (New).](https://community.cyberpanel.net/docs)
|
||||
* [Changelog.](https://community.cyberpanel.net/t/change-logs/161)
|
||||
* [Forums.](https://community.cyberpanel.net)
|
||||
* [Discord.](https://discord.gg/g8k8Db3)
|
||||
* [Facebook Group.](https://www.facebook.com/groups/cyberpanel)
|
||||
|
||||
* [YouTube Channel.](https://www.youtube.com/channel/UCS6sgUWEhaFl1TO238Ck0xw)
|
||||
|
||||
52
README.md.bak
Normal file
@@ -0,0 +1,52 @@
|
||||
# CyberPanel
|
||||
|
||||
Webhosting control panel that uses OpenLiteSpeed as web server.
|
||||
|
||||
## Features
|
||||
|
||||
* Different Level Of users.
|
||||
* Auto SSL.
|
||||
* FTP Server.
|
||||
* Light weight DNS Server (PowerDNS).
|
||||
* PHPMYAdmin.
|
||||
* Email Support (Rainloop).
|
||||
* FileManager.
|
||||
* PHP Managment.
|
||||
* Firewall (FirewallD & ConfigServer Firewall Intregration).
|
||||
* One click Backup and Restore.
|
||||
|
||||
# Supported PHPs
|
||||
|
||||
* PHP 5.3
|
||||
* PHP 5.4
|
||||
* PHP 5.5
|
||||
* PHP 5.6
|
||||
* PHP 7.0
|
||||
* PHP 7.1
|
||||
* PHP 7.2
|
||||
* PHP 7.3
|
||||
* PHP 7.4
|
||||
* PHP 8.0
|
||||
|
||||
# Installation Instructions
|
||||
|
||||
|
||||
```
|
||||
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
|
||||
```
|
||||
|
||||
# Upgrading
|
||||
|
||||
|
||||
```
|
||||
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
|
||||
```
|
||||
|
||||
# Resources
|
||||
|
||||
* [Official Site.](https://cyberpanel.net)
|
||||
* [Documentation.](https://docs.cyberpanel.net)
|
||||
* [Forums.](https://forums.cyberpanel.net)
|
||||
* [Discord.](https://discord.gg/g8k8Db3)
|
||||
* [Facebook Group.](https://www.facebook.com/groups/cyberpanel)
|
||||
|
||||
@@ -435,10 +435,14 @@ def remoteTransfer(request):
|
||||
|
||||
## Accounts to transfer is a path to file, containing accounts.
|
||||
|
||||
|
||||
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
|
||||
execPath = execPath + " remoteTransfer --ipAddress " + ipAddress + " --dir " + dir + " --accountsToTransfer " + path
|
||||
execPath = execPath + " remoteTransfer --ipAddress " + ipAddress.rstrip('\n') + " --dir " + dir + " --accountsToTransfer " + path
|
||||
ProcessUtilities.popenExecutioner(execPath)
|
||||
|
||||
if os.path.exists('/usr/local/CyberCP/debug'):
|
||||
logging.writeToFile('Repor of %s' % repr(execPath))
|
||||
|
||||
return HttpResponse(json.dumps({"transferStatus": 1, "dir": dir}))
|
||||
|
||||
##
|
||||
|
||||
@@ -1163,6 +1163,10 @@ class BackupManager:
|
||||
|
||||
r = requests.post(url, data=finalData, verify=False)
|
||||
|
||||
if os.path.exists('/usr/local/CyberCP/debug'):
|
||||
message = 'Remote transfer initiation status: %s' % (r.text)
|
||||
logging.CyberCPLogFileWriter.writeToFile(message)
|
||||
|
||||
data = json.loads(r.text)
|
||||
|
||||
if data['transferStatus'] == 1:
|
||||
|
||||
41
baseTemplate/static/baseTemplate/cyber-panel-logo.svg
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="60px" height="60px" viewBox="0 0 60 60" enable-background="new 0 0 60 60" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#B5D8F2" d="M29.999,15.916c0.864,0,1.731,0.084,2.59,0.244l-9.428-9.427c-0.087-0.086-0.154-0.188-0.211-0.295
|
||||
L1.095,28.292c-0.943,0.945-0.943,2.478,0,3.426l3.633,3.621c0.032-0.036,0.063-0.078,0.102-0.119l15.222-15.213
|
||||
C22.708,17.366,26.239,15.916,29.999,15.916z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#61D2B4" d="M34.723,14.808l2.766-2.123c0.541-0.428,1.098-0.635,1.694-0.635c0.899,0,1.741,0.515,2.146,1.311
|
||||
c0.007,0.016,0.014,0.033,0.021,0.047c0.243,0.506,0.517,1.541-0.383,2.71c-0.005,0.006-0.01,0.017-0.016,0.025l-2.159,2.737
|
||||
l1.218,1.215c3.249,3.279,4.688,8.016,3.849,12.55l9.564-9.567c0.045-0.048,0.094-0.083,0.148-0.12L31.713,1.1
|
||||
c-0.46-0.456-1.068-0.711-1.712-0.711S28.747,0.644,28.29,1.1l-3.684,3.687c0.113,0.051,0.217,0.114,0.302,0.205L34.723,14.808z"
|
||||
/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#61D2B4" d="M25.216,45.24l-2.725,2.096c-0.386,0.291-0.926,0.623-1.692,0.623c-0.004,0-0.005,0-0.007,0
|
||||
c-0.003,0-0.005,0-0.007,0c-0.039,0-0.079,0-0.123-0.01c-0.829-0.045-1.608-0.549-1.981-1.27c-0.006-0.02-0.02-0.045-0.025-0.063
|
||||
c-0.433-0.893-0.298-1.875,0.387-2.758l2.114-2.68l-1.304-1.303c-3.24-3.329-4.608-7.923-3.752-12.433l-9.528,9.519
|
||||
c-0.038,0.043-0.082,0.071-0.125,0.105l21.84,21.839c0.458,0.456,1.067,0.703,1.711,0.703s1.252-0.247,1.712-0.703l3.636-3.64
|
||||
c-0.131-0.058-0.255-0.141-0.363-0.251L25.216,45.24z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#B5D8F2" d="M58.904,28.292l-3.611-3.612c-0.038,0.048-0.077,0.102-0.121,0.144l-15.25,15.242
|
||||
c-2.66,2.643-6.19,4.103-9.951,4.103c-0.863,0-1.731-0.087-2.592-0.246l9.354,9.347c0.108,0.109,0.188,0.231,0.249,0.364
|
||||
l21.923-21.915C59.848,30.771,59.848,29.237,58.904,28.292z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#F5D10A" d="M39.402,14.922l-8.952,11.357l0.343,0.465c0.464,0.639,1.924,2.747,4.738,6.851
|
||||
c0.168,0.243,0.222,1.063-0.24,1.418L21.302,45.752c-0.223,0.166-0.351,0.229-0.502,0.229c-0.004,0-0.005-0.01-0.007-0.01
|
||||
c-0.003,0-0.003,0.01-0.007,0.01c-0.145-0.01-0.292-0.104-0.349-0.213c-0.047-0.094-0.142-0.293,0.158-0.685l8.935-11.333
|
||||
l-5.062-7.282c-0.322-0.457-0.214-1.129,0.239-1.476l14.001-10.753c0.24-0.189,0.37-0.214,0.475-0.214
|
||||
c0.163,0,0.317,0.098,0.386,0.233C39.664,14.459,39.614,14.639,39.402,14.922z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
BIN
baseTemplate/static/baseTemplate/images/agreement.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
baseTemplate/static/baseTemplate/images/change-license.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
baseTemplate/static/baseTemplate/images/change.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
baseTemplate/static/baseTemplate/images/close-32.png
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
41
baseTemplate/static/baseTemplate/images/cyber-panel-logo.svg
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="60px" height="60px" viewBox="0 0 60 60" enable-background="new 0 0 60 60" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#B5D8F2" d="M29.999,15.916c0.864,0,1.731,0.084,2.59,0.244l-9.428-9.427c-0.087-0.086-0.154-0.188-0.211-0.295
|
||||
L1.095,28.292c-0.943,0.945-0.943,2.478,0,3.426l3.633,3.621c0.032-0.036,0.063-0.078,0.102-0.119l15.222-15.213
|
||||
C22.708,17.366,26.239,15.916,29.999,15.916z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#61D2B4" d="M34.723,14.808l2.766-2.123c0.541-0.428,1.098-0.635,1.694-0.635c0.899,0,1.741,0.515,2.146,1.311
|
||||
c0.007,0.016,0.014,0.033,0.021,0.047c0.243,0.506,0.517,1.541-0.383,2.71c-0.005,0.006-0.01,0.017-0.016,0.025l-2.159,2.737
|
||||
l1.218,1.215c3.249,3.279,4.688,8.016,3.849,12.55l9.564-9.567c0.045-0.048,0.094-0.083,0.148-0.12L31.713,1.1
|
||||
c-0.46-0.456-1.068-0.711-1.712-0.711S28.747,0.644,28.29,1.1l-3.684,3.687c0.113,0.051,0.217,0.114,0.302,0.205L34.723,14.808z"
|
||||
/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#61D2B4" d="M25.216,45.24l-2.725,2.096c-0.386,0.291-0.926,0.623-1.692,0.623c-0.004,0-0.005,0-0.007,0
|
||||
c-0.003,0-0.005,0-0.007,0c-0.039,0-0.079,0-0.123-0.01c-0.829-0.045-1.608-0.549-1.981-1.27c-0.006-0.02-0.02-0.045-0.025-0.063
|
||||
c-0.433-0.893-0.298-1.875,0.387-2.758l2.114-2.68l-1.304-1.303c-3.24-3.329-4.608-7.923-3.752-12.433l-9.528,9.519
|
||||
c-0.038,0.043-0.082,0.071-0.125,0.105l21.84,21.839c0.458,0.456,1.067,0.703,1.711,0.703s1.252-0.247,1.712-0.703l3.636-3.64
|
||||
c-0.131-0.058-0.255-0.141-0.363-0.251L25.216,45.24z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#B5D8F2" d="M58.904,28.292l-3.611-3.612c-0.038,0.048-0.077,0.102-0.121,0.144l-15.25,15.242
|
||||
c-2.66,2.643-6.19,4.103-9.951,4.103c-0.863,0-1.731-0.087-2.592-0.246l9.354,9.347c0.108,0.109,0.188,0.231,0.249,0.364
|
||||
l21.923-21.915C59.848,30.771,59.848,29.237,58.904,28.292z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#F5D10A" d="M39.402,14.922l-8.952,11.357l0.343,0.465c0.464,0.639,1.924,2.747,4.738,6.851
|
||||
c0.168,0.243,0.222,1.063-0.24,1.418L21.302,45.752c-0.223,0.166-0.351,0.229-0.502,0.229c-0.004,0-0.005-0.01-0.007-0.01
|
||||
c-0.003,0-0.003,0.01-0.007,0.01c-0.145-0.01-0.292-0.104-0.349-0.213c-0.047-0.094-0.142-0.293,0.158-0.685l8.935-11.333
|
||||
l-5.062-7.282c-0.322-0.457-0.214-1.129,0.239-1.476l14.001-10.753c0.24-0.189,0.37-0.214,0.475-0.214
|
||||
c0.163,0,0.317,0.098,0.386,0.233C39.664,14.459,39.614,14.639,39.402,14.922z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 32 KiB |
BIN
baseTemplate/static/baseTemplate/images/delete.png
Executable file
|
After Width: | Height: | Size: 894 B |
BIN
baseTemplate/static/baseTemplate/images/docker.png
Executable file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/add-ssl.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/change-php.png
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/checklist.png
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/compose.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/delete-ftp.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/domain-registration.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/domains.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/file.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/ftp-upload.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/git-logo.png
Executable file
|
After Width: | Height: | Size: 877 B |
BIN
baseTemplate/static/baseTemplate/images/icons/joomla-logo.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/laptop.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/locked.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/log-file-format.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/magento.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/mailing.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/mautic.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/office-material.png
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/open_basedir.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/paper-plane.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/pencilcase.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/post-office.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/prestashop.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/repeat.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/sort.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/warning.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/web-domain.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
baseTemplate/static/baseTemplate/images/icons/wordpress.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
baseTemplate/static/baseTemplate/images/license-status.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
baseTemplate/static/baseTemplate/images/litespeed-logo.png
Executable file
|
After Width: | Height: | Size: 22 KiB |
BIN
baseTemplate/static/baseTemplate/images/litespeed.png
Executable file
|
After Width: | Height: | Size: 32 KiB |
BIN
baseTemplate/static/baseTemplate/images/loading.gif
Executable file
|
After Width: | Height: | Size: 33 KiB |
BIN
baseTemplate/static/baseTemplate/images/lsON.png
Executable file
|
After Width: | Height: | Size: 933 B |
BIN
baseTemplate/static/baseTemplate/images/mariadb.png
Executable file
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 30 KiB |
BIN
baseTemplate/static/baseTemplate/images/not-available-preview.png
Executable file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
baseTemplate/static/baseTemplate/images/powerdns.png
Executable file
|
After Width: | Height: | Size: 17 KiB |
BIN
baseTemplate/static/baseTemplate/images/pureftpd.png
Executable file
|
After Width: | Height: | Size: 47 KiB |
BIN
baseTemplate/static/baseTemplate/images/webPanel.png
Executable file
|
After Width: | Height: | Size: 3.2 KiB |
@@ -76,7 +76,7 @@
|
||||
|
||||
<!-- HELPERS -->
|
||||
|
||||
{% with version="2.1.2" %}
|
||||
{% with version="2.3.2" %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/assets/finalBase/finalBase.css' %}">
|
||||
|
||||
@@ -275,6 +275,10 @@
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
<a class="header-btn" target="_blank" href="https://www.youtube.com/channel/UCS6sgUWEhaFl1TO238Ck0xw?sub_confirmation=1"
|
||||
title="{% trans 'Youtube Channel' %}">
|
||||
<i class="glyph-icon icon-youtube"></i>
|
||||
</a>
|
||||
<a class="header-btn" target="_blank" href="https://go.cyberpanel.net/community"
|
||||
title="{% trans 'Community' %}">
|
||||
<i class="glyph-icon icon-comments"></i>
|
||||
@@ -297,31 +301,31 @@
|
||||
<ul id="sidebar-menu">
|
||||
<li class="header"><span>{% trans "Overview" %}</span></li>
|
||||
<li>
|
||||
<a href="#" title="{% trans 'Server IP Address' %}">
|
||||
<a id="sidebar-menu-item-server-ip-address" href="#" title="{% trans 'Server IP Address' %}">
|
||||
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}"
|
||||
data-original-title=".icon-laptop"></i>
|
||||
<span style="color: #488a3f;font-weight: bold;">{{ ipAddress }}</span>
|
||||
</a>
|
||||
<a href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
|
||||
<a id="sidebar-menu-item-dashboard" href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
|
||||
<i class="glyph-icon icon-dashboard"></i>
|
||||
<span>{% trans "Dashboard" %}</span>
|
||||
</a>
|
||||
{% if admin or versionManagement %}
|
||||
<a href="{% url 'versionManagment' %}"
|
||||
<a id="sidebar-menu-item-version-management" href="{% url 'versionManagment' %}"
|
||||
title="{% trans 'Version Management' %}">
|
||||
<i class="glyph-icon tooltip-button icon-info"
|
||||
title="{% trans 'Version Management' %}" data-original-title=".icon-cloud-upload"
|
||||
aria-describedby="tooltip896208"></i>
|
||||
<span>{% trans "Version Management" %}</span>
|
||||
</a>
|
||||
<a href="{% url 'design' %}"
|
||||
<a id="sidebar-menu-item-design" href="{% url 'design' %}"
|
||||
title="{% trans 'Design' %}">
|
||||
<i class="glyph-icon tooltip-button icon-cog"
|
||||
title="{% trans 'Design' %}" data-original-title=".icon-cloud-upload"
|
||||
aria-describedby="tooltip896208"></i>
|
||||
<span>{% trans "Design" %}</span>
|
||||
</a>
|
||||
<a href="https://go.cyberpanel.net/cloud"
|
||||
<a id="sidebar-menu-item-connect" href="https://go.cyberpanel.net/cloud"
|
||||
title="{% trans 'Connect' %}">
|
||||
<i class="glyph-icon tooltip-button icon-link" title="{% trans 'Connect' %}"
|
||||
data-original-title=".icon-cloud-upload" aria-describedby="tooltip896208"></i>
|
||||
@@ -339,7 +343,7 @@
|
||||
<li class="divider"></li>
|
||||
<li class="header"><span>{% trans "Main" %}</span></li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-users">
|
||||
<a href="{% url 'loadUsersHome' %}" title="{% trans 'Users' %}">
|
||||
<i class="glyph-icon icon-users" title="{% trans 'Users' %}"></i>
|
||||
<span>{% trans "Users" %}</span>
|
||||
@@ -389,6 +393,40 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li id="sidebar-menu-item-websites">
|
||||
|
||||
<!-------------WordPress--------------------------->
|
||||
<li>
|
||||
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'WordPress' %}">
|
||||
<div class="glyph-icon icon-wordpress" title="{% trans 'WordPress' %}"></div>
|
||||
<span>{% trans "WordPress" %}</span>
|
||||
</a>
|
||||
<div class="sidebar-submenu">
|
||||
|
||||
<ul>
|
||||
{% if admin or createWebsite %}
|
||||
<li><a href="{% url 'createWordpress' %}"
|
||||
title="{% trans 'Deploy WordPress' %}"><span>{% trans "Deploy WordPress" %}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li><a href="{% url 'ListWPSites' %}"
|
||||
title="{% trans 'List WordPress' %}"><span>{% trans "List WordPress" %}</span></a>
|
||||
</li>
|
||||
<li><a href="{% url 'ConfigurePlugins' %}"
|
||||
title="{% trans 'ConfigurePlugins' %}"><span>{% trans "Configure Plugins" %}</span></a>
|
||||
</li>
|
||||
<li><a href="{% url 'RestoreBackups' %}"
|
||||
title="{% trans 'RestoreBackups' %}"><span>{% trans "Restore Backups" %}</span></a>
|
||||
</li>
|
||||
<li><a href="{% url 'RemoteBackupConfig' %}"
|
||||
title="{% trans 'Remote Backup' %}"><span>{% trans "Remote Backup" %}</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'Websites' %}">
|
||||
<div class="glyph-icon icon-globe" title="{% trans 'Websites' %}"></div>
|
||||
@@ -397,11 +435,12 @@
|
||||
<div class="sidebar-submenu">
|
||||
|
||||
<ul>
|
||||
{% if admin or createWebsite %}
|
||||
{% if admin or createWebsite %}
|
||||
<li><a href="{% url 'createWebsite' %}"
|
||||
title="{% trans 'Create Website' %}"><span>{% trans "Create Website" %}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<li><a href="{% url 'listWebsites' %}"
|
||||
title="{% trans 'List Websites' %}"><span>{% trans "List Websites" %}</span></a>
|
||||
</li>
|
||||
@@ -430,7 +469,7 @@
|
||||
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
<li>
|
||||
<li id="sidebar-menu-item-packages">
|
||||
<a id="packageHome" href="{% url 'packagesHome' %}" title="{% trans 'Packages' %}">
|
||||
<i class="glyph-icon icon-cubes"></i>
|
||||
<span>{% trans "Packages" %}</span>
|
||||
@@ -462,7 +501,7 @@
|
||||
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
<li>
|
||||
<li id="sidebar-menu-item-databases">
|
||||
<a title="{% trans 'Databases' %}">
|
||||
<i class="glyph-icon icon-database" title="{% trans 'Databases' %}"></i>
|
||||
<span>{% trans "Databases" %}</span>
|
||||
@@ -497,7 +536,7 @@
|
||||
|
||||
{% if dnsAsWhole %}
|
||||
|
||||
<li class="dnsAsWhole">
|
||||
<li id="sidebar-menu-item-dns" class="dnsAsWhole">
|
||||
<a title="{% trans 'DNS' %}">
|
||||
<i class="glyph-icon icon-sitemap"></i>
|
||||
<span>{% trans "DNS" %}</span>
|
||||
@@ -545,7 +584,7 @@
|
||||
|
||||
{% if emailAsWhole %}
|
||||
|
||||
<li class="emailAsWhole">
|
||||
<li id="sidebar-menu-item-email" class="emailAsWhole">
|
||||
<a href="{% url 'loadEmailHome' %}" title="{% trans 'Email' %}">
|
||||
<i class="glyph-icon icon-paper-plane"></i>
|
||||
<span>{% trans "Email" %}</span>
|
||||
@@ -584,7 +623,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if admin or createEmail %}
|
||||
<li><a href="/rainloop/index.php" title="{% trans 'Access Webmail' %}"
|
||||
<li><a href="/snappymail/index.php" title="{% trans 'Access Webmail' %}"
|
||||
target="_blank"><span>{% trans "Access Webmail" %}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
@@ -596,7 +635,7 @@
|
||||
{% endif %}
|
||||
{% if ftpAsWhole %}
|
||||
|
||||
<li class="ftpAsWhole">
|
||||
<li id="sidebar-menu-item-ftp" class="ftpAsWhole">
|
||||
<a href="{% url 'ftpHome' %}" title="{% trans 'FTP' %}">
|
||||
<i class="glyph-icon icon-cloud-upload"></i>
|
||||
<span>{% trans "FTP" %}</span>
|
||||
@@ -626,7 +665,7 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-backup">
|
||||
<a href="{% url 'loadBackupHome' %}" title="{% trans 'Backup' %}">
|
||||
<i class="glyph-icon tooltip-button icon-copy" title=".icon-folder"></i>
|
||||
<span>{% trans "Backup" %}</span>
|
||||
@@ -670,7 +709,7 @@
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-incremental-backup">
|
||||
<a href="{% url 'loadBackupHome' %}" title="{% trans 'Incremental Backup - Beta' %}">
|
||||
<i class="glyph-icon tooltip-button icon-save" title="Incremental Backup"></i>
|
||||
<span>{% trans "Incremental Backup" %}</span>
|
||||
@@ -704,7 +743,7 @@
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-ssl">
|
||||
<a href="{% url 'loadSSLHome' %}" title="{% trans 'Backup' %}">
|
||||
<i class="glyph-icon tooltip-button icon-lock" title="{% trans 'SSL' %}"></i>
|
||||
<span>{% trans "SSL" %}</span>
|
||||
@@ -762,7 +801,7 @@
|
||||
{# </div><!-- .sidebar-submenu -->#}
|
||||
{# </li>#}
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-cloudlinux">
|
||||
<a href="#" title="{% trans 'CloudLinux' %}">
|
||||
<i class="glyph-icon icon-linecons-fire"></i>
|
||||
<span>{% trans "CloudLinux" %}</span>
|
||||
@@ -794,7 +833,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-containerization">
|
||||
<a href="#" title="{% trans 'Containerization' %}">
|
||||
<i class="glyph-icon icon-linecons-fire"></i>
|
||||
<span>{% trans "Containerization" %}</span>
|
||||
@@ -811,7 +850,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-docker">
|
||||
<a href="#" title="{% trans 'Docker' %}">
|
||||
<i class="glyph-icon icon-cogs"></i>
|
||||
<span>{% trans "Docker Manager" %}</span>
|
||||
@@ -834,7 +873,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-tuning">
|
||||
<a href="#" title="{% trans 'Tuning' %}">
|
||||
<i class="glyph-icon icon-adjust"></i>
|
||||
<span>{% trans "Tuning" %}</span>
|
||||
@@ -853,7 +892,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-server-status">
|
||||
<a href="#" title="{% trans 'Server Status' %}">
|
||||
<i class="glyph-icon icon-cog"></i>
|
||||
<span>{% trans "Server Status" %}</span>
|
||||
@@ -878,7 +917,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-php">
|
||||
<a href="{% url 'loadPHPHome' %}" title="{% trans 'PHP' %}">
|
||||
<i class="glyph-icon icon-code"></i>
|
||||
<span>{% trans "PHP" %}</span>
|
||||
@@ -897,7 +936,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-server-status">
|
||||
<a href="{% url 'logsHome' %}" title="{% trans 'Server Status' %}">
|
||||
<i class="glyph-icon icon-file"></i>
|
||||
<span>{% trans "Logs" %}</span>
|
||||
@@ -931,7 +970,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-security">
|
||||
<a href="{% url 'securityHome' %}" title="{% trans 'Security' %}">
|
||||
<i class="glyph-icon icon-shield"></i>
|
||||
<span>{% trans "Security" %}</span>
|
||||
@@ -968,7 +1007,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li class="emailAsWhole">
|
||||
<li id="sidebar-menu-item-mail-settings" class="emailAsWhole">
|
||||
<a href="#" title="{% trans 'Mail Settings' %}">
|
||||
<i class="glyph-icon icon-envelope"></i>
|
||||
<span>{% trans "Mail Settings" %}</span>
|
||||
@@ -1000,7 +1039,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-manage-services">
|
||||
<a href="#" title="{% trans 'Manage Services' %}">
|
||||
<i class="glyph-icon icon-folder-open"></i>
|
||||
<span>{% trans "Manage Services" %}</span>
|
||||
@@ -1028,7 +1067,7 @@
|
||||
</div><!-- .sidebar-submenu -->
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<li id="sidebar-menu-item-plugins">
|
||||
<a href="#" title="{% trans 'Plugins' %}">
|
||||
<i class="glyph-icon icon-plug"></i>
|
||||
<span>{% trans "Plugins" %}</span>
|
||||
|
||||
1102
baseTemplate/templates/baseTemplate/index.html.bak
Normal file
@@ -19,7 +19,7 @@ from plogical.httpProc import httpProc
|
||||
# Create your views here.
|
||||
|
||||
VERSION = '2.3'
|
||||
BUILD = 1
|
||||
BUILD = 2
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -119,10 +119,18 @@ def versionManagment(request):
|
||||
output = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
Currentcomt = output.rstrip("\n")
|
||||
notechk = True;
|
||||
notechk = True
|
||||
|
||||
# command ="git fetch -C /usr/local/CyberCP/"
|
||||
# output = ProcessUtilities.outputExecutioner(command)
|
||||
#
|
||||
# command ="git -C /usr/local/CyberCP/ log %s..%s --pretty=oneline | wc -l" % ( Currentcomt, latestcomit)
|
||||
# output = ProcessUtilities.outputExecutioner(command)
|
||||
#
|
||||
# numCommits = output.rstrip("\n")
|
||||
|
||||
if(Currentcomt == latestcomit):
|
||||
notechk = False;
|
||||
notechk = False
|
||||
|
||||
|
||||
template = 'baseTemplate/versionManagment.html'
|
||||
@@ -241,6 +249,13 @@ def design(request):
|
||||
cosmetic = CyberPanelCosmetic()
|
||||
cosmetic.save()
|
||||
|
||||
val = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(val)
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson('reboot', 0)
|
||||
|
||||
finalData = {}
|
||||
|
||||
if request.method == 'POST':
|
||||
|
||||
@@ -70,4 +70,9 @@ class cliParser:
|
||||
parser.add_argument('--siteTitle', help='Site Title for application installers.')
|
||||
parser.add_argument('--path', help='Path for application installers.')
|
||||
|
||||
### Convert to LSWS Ent via cli
|
||||
|
||||
parser.add_argument('--licenseKey', help='LiteSpeed Enterprise License key')
|
||||
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
@@ -1582,6 +1582,18 @@ def main():
|
||||
wm = WebsiteManager()
|
||||
wm.installJoomla(1, data)
|
||||
|
||||
elif args.function == "switchTOLSWS":
|
||||
|
||||
completeCommandExample = 'cyberpanel switchTOLSWS --licenseKey <Your lsws key here or you can enter TRIAL)'
|
||||
|
||||
if not args.licenseKey:
|
||||
print("\n\nPlease enter LiteSpeed License key. For example:\n\n" + completeCommandExample + "\n\n")
|
||||
return
|
||||
|
||||
from serverStatus.serverStatusUtil import ServerStatusUtil
|
||||
|
||||
ServerStatusUtil.switchTOLSWSCLI(args.licenseKey)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
149
cyberpanel.sh
@@ -5,8 +5,8 @@
|
||||
#set -u
|
||||
|
||||
|
||||
#CyberPanel installer script for CentOS 7.X, CentOS 8.X, CloudLinux 7.X, RockyLinux 8.X, Ubuntu 18.04, Ubuntu 20.04 , Ubuntu 20.10 and AlmaLinux 8.X
|
||||
#For whoever may edit this script, please follow :
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, openEuler 20.03 and openEuler 22.03
|
||||
#For whoever may edit this script, please follow:
|
||||
#Please use Pre_Install_xxx() and Post_Install_xxx() if you want to something respectively before or after the panel installation
|
||||
#and update below accordingly
|
||||
#Please use variable/functions name as MySomething or My_Something, and please try not to use too-short abbreviation :)
|
||||
@@ -16,13 +16,13 @@
|
||||
#Set_Default_Variables() ---> set some default variable for later use
|
||||
#Check_Root() ---> check for root
|
||||
#Check_Server_IP() ---> check for server IP and geolocation at country level
|
||||
#Check_OS() ---> check system , support on centos7/8, rockylinux 8.x , almalinux 8.x ubutnu18/20 and cloudlinux 7 , 8 is untested.
|
||||
#Check_OS() ---> check system , support on CentOS 7/8, RockyLinux 8, AlmaLinux 8, Ubuntu 18/20, openEuler 20.03/22.03 and CloudLinux 7, 8 is untested.
|
||||
#Check_Virtualization() ---> check for virtualizaon , #LXC not supported# , some edit needed on OVZ
|
||||
#Check_Panel() ---> check to make sure no other panel is installed
|
||||
#Check_Process() ---> check no other process like Apache is running
|
||||
#Check_Provider() ---> check the provider, certain provider like Alibaba or Tencent Yun may need some special change
|
||||
#Check_Provider() ---> check the provider, certain provider like Alibaba or Tencent Cloud may need some special change
|
||||
#Check_Argument() ---> parse argument and go to Argument_Mode() or Interactive_Mode() respectively
|
||||
#Pre_Install_Setup_Repository() ---> setup/install repositories for centos system.
|
||||
#Pre_Install_Setup_Repository() ---> setup/install repositories for CentOS and openEuler system.
|
||||
#go to Pre_Install_Setup_CN_Repository() if server is within China.
|
||||
#Pre_Install_Setup_Git_URL() ---> form up github URL , use Gitee for servers within China.
|
||||
#Pre_Install_Required_Components() ---> install required softwares and git clone it
|
||||
@@ -33,7 +33,7 @@
|
||||
#Post_Install_Required_Components() ---> install some required softwares.
|
||||
#Post_Install_PHP_Session_Setup() ---> set up PHP session
|
||||
#Post_Install_PHP_TimezoneDB() ---> set up PHP timezoneDB
|
||||
#Post_Install_Regenerate_Cert() ---> regenerate cert for :7080 and :8090 to avoid Chrome on MacOS blocking.
|
||||
#Post_Install_Regenerate_Cert() ---> regenerate cert for :7080 and :8090 to avoid Chrome on macOS blocking.
|
||||
#Post_Install_Regenerate_Webadmin_Console_Passwd() ---> regenerate the webadmin console password
|
||||
#Post_Install_Setup_Watchdog() ---> set up watchdog script for webserver and MariaDB.
|
||||
#Post_Install_Setup_Utility() ---> set up utility script for some handy features
|
||||
@@ -252,7 +252,6 @@ else
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
if ! uname -m | grep -q x86_64 ; then
|
||||
echo -e "x86_64 system is required...\n"
|
||||
exit
|
||||
@@ -266,24 +265,26 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
|
||||
Server_OS="CloudLinux"
|
||||
elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10" /etc/os-release ; then
|
||||
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then
|
||||
Server_OS="Ubuntu"
|
||||
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
|
||||
Server_OS="openEuler"
|
||||
else
|
||||
echo -e "Unable to detect your system..."
|
||||
echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x...\n"
|
||||
Debug_Log2 "CyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x... [404]"
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03... [404]"
|
||||
exit
|
||||
fi
|
||||
|
||||
Server_OS_Version=$(grep VERSION_ID /etc/os-release | awk -F[=,] '{print $2}' | tr -d \" | head -c2 | tr -d . )
|
||||
#to make 20.04 display as 20
|
||||
#to make 20.04 display as 20, etc.
|
||||
|
||||
echo -e "System: $Server_OS $Server_OS_Version detected...\n"
|
||||
|
||||
if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] || [[ "$Server_OS" = "RockyLinux" ]] ; then
|
||||
Server_OS="CentOS"
|
||||
#CloudLinux gives version id like 7.8 , 7.9 , so cut it to show first number only
|
||||
#treat CL , Rocky and Alma as CentOS
|
||||
#CloudLinux gives version id like 7.8, 7.9, so cut it to show first number only
|
||||
#treat CloudLinux, Rocky and Alma as CentOS
|
||||
fi
|
||||
|
||||
if [[ "$Debug" = "On" ]] ; then
|
||||
@@ -830,12 +831,6 @@ if [[ $Server_OS = "CentOS" ]] ; then
|
||||
rm -f /etc/yum.repos.d/epel.repo
|
||||
rm -f /etc/yum.repos.d/epel.repo.rpmsave
|
||||
|
||||
yum install -y yum-plugin-copr
|
||||
Check_Return "yum repo" "no_exit"
|
||||
yum copr enable -y copart/restic
|
||||
Check_Return "yum repo" "no_exit"
|
||||
|
||||
|
||||
if [[ "$Server_OS_Version" = "8" ]]; then
|
||||
rpm --import https://cyberpanel.sh/www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
|
||||
rpm --import https://cyberpanel.sh/dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
|
||||
@@ -865,6 +860,10 @@ if [[ $Server_OS = "CentOS" ]] ; then
|
||||
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||
Check_Return "yum repo" "no_exit"
|
||||
|
||||
yum install -y yum-plugin-copr
|
||||
Check_Return "yum repo" "no_exit"
|
||||
yum copr enable -y copart/restic
|
||||
Check_Return "yum repo" "no_exit"
|
||||
yum install -y yum-plugin-priorities
|
||||
Check_Return "yum repo" "no_exit"
|
||||
curl -o /etc/yum.repos.d/powerdns-auth-43.repo https://cyberpanel.sh/repo.powerdns.com/repo-files/centos-auth-43.repo
|
||||
@@ -890,6 +889,25 @@ EOF
|
||||
Check_Return "yum repo" "no_exit"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $Server_OS = "openEuler" ]]; then
|
||||
rpm --import https://cyberpanel.sh/rpms.litespeedtech.com/centos/RPM-GPG-KEY-litespeed
|
||||
#import the LiteSpeed GPG key
|
||||
yum clean all
|
||||
sed -i "s|gpgcheck=1|gpgcheck=0|g" /etc/yum.repos.d/openEuler.repo
|
||||
sed -i "s|repo.openeuler.org|mirror.efaith.com.hk/openeuler|g" /etc/yum.repos.d/openEuler.repo
|
||||
|
||||
if [[ "$Server_OS_Version" = "20" ]]; then
|
||||
dnf install --nogpg -y https://repo.yaro.ee/yaro-release-20.03LTS-latest.oe1.noarch.rpm
|
||||
Check_Return "yum repo" "no_exit"
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS_Version" = "22" ]]; then
|
||||
dnf install --nogpg -y https://repo.yaro.ee/yaro-release-22.03LTS-latest.oe2203.noarch.rpm
|
||||
Check_Return "yum repo" "no_exit"
|
||||
fi
|
||||
fi
|
||||
|
||||
Debug_Log2 "Setting up repositories...,1"
|
||||
|
||||
if [[ "$Server_Country" = "CN" ]] ; then
|
||||
@@ -977,7 +995,7 @@ Pre_Install_Required_Components() {
|
||||
|
||||
Debug_Log2 "Installing necessary components..,3"
|
||||
|
||||
if [[ "$Server_OS" = "CentOS" ]] ; then
|
||||
if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]] ; then
|
||||
yum update -y
|
||||
if [[ "$Server_OS_Version" = "7" ]] ; then
|
||||
yum install -y wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel gpgme-devel curl-devel git socat openssl-devel MariaDB-shared mariadb-devel yum-utils python36u python36u-pip python36u-devel zip unzip bind-utils
|
||||
@@ -989,6 +1007,11 @@ if [[ "$Server_OS" = "CentOS" ]] ; then
|
||||
Check_Return
|
||||
dnf install -y gpgme-devel
|
||||
Check_Return
|
||||
elif [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "22" ]] ; then
|
||||
dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git python3-devel tar socat python3 zip unzip bind-utils
|
||||
Check_Return
|
||||
dnf install -y gpgme-devel
|
||||
Check_Return
|
||||
fi
|
||||
ln -s /usr/bin/pip3 /usr/bin/pip
|
||||
else
|
||||
@@ -998,8 +1021,13 @@ else
|
||||
apt install -y --allow-downgrades libgnutls30=3.6.13-2ubuntu1.3
|
||||
fi
|
||||
|
||||
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip
|
||||
Check_Return
|
||||
if [[ "$Server_OS_Version" = "22" ]] ; then
|
||||
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip libmariadb-dev-compat libmariadb-dev
|
||||
Check_Return
|
||||
else
|
||||
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip
|
||||
Check_Return
|
||||
fi
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y python3-pip
|
||||
Check_Return
|
||||
@@ -1027,8 +1055,13 @@ Retry_Command "pip install --default-timeout=3600 virtualenv==16.7.9"
|
||||
|
||||
Download_Requirement
|
||||
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "22" ]] ; then
|
||||
python3 -m venv /usr/local/CyberPanel
|
||||
Check_Return
|
||||
else
|
||||
virtualenv -p /usr/bin/python3 /usr/local/CyberPanel
|
||||
Check_Return
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" != "20" ]] ; then
|
||||
# shellcheck disable=SC1091
|
||||
@@ -1114,7 +1147,7 @@ elif [[ "$Server_OS" = "Ubuntu" ]] ; then
|
||||
fi
|
||||
|
||||
if ! grep -q "pid_max" /etc/rc.local 2>/dev/null ; then
|
||||
if [[ $Server_OS = "CentOS" ]] ; then
|
||||
if [[ $Server_OS = "CentOS" ]] || [[ $Server_OS = "openEuler" ]] ; then
|
||||
echo "echo 1000000 > /proc/sys/kernel/pid_max
|
||||
echo 1 > /sys/kernel/mm/ksm/run" >>/etc/rc.d/rc.local
|
||||
chmod +x /etc/rc.d/rc.local
|
||||
@@ -1187,6 +1220,10 @@ if ! grep -q "pid_max" /etc/rc.local 2>/dev/null ; then
|
||||
systemctl mask systemd-resolved >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Backup previous resolv.conf file
|
||||
cp /etc/resolv.conf /etc/resolv.conf_bak
|
||||
|
||||
# Delete resolv.conf file
|
||||
rm -f /etc/resolv.conf
|
||||
|
||||
if [[ "$Server_Provider" = "Tencent Cloud" ]] ; then
|
||||
@@ -1204,6 +1241,21 @@ if ! grep -q "pid_max" /etc/rc.local 2>/dev/null ; then
|
||||
sleep 3
|
||||
#take a break ,or installer will break
|
||||
|
||||
# Check Connectivity
|
||||
if ping -q -c 1 -W 1 cyberpanel.sh >/dev/null; then
|
||||
echo -e "\nSuccessfully set up nameservers..\n"
|
||||
echo -e "\nThe network is up.. :)\n"
|
||||
echo -e "\nContinue installation..\n"
|
||||
else
|
||||
echo -e "\nThe network is down.. :(\n"
|
||||
rm -f /etc/resolv.conf
|
||||
mv /etc/resolv.conf_bak /etc/resolv.conf
|
||||
systemctl restart systemd-networkd >/dev/null 2>&1
|
||||
echo -e "\nReturns the nameservers settings to default..\n"
|
||||
echo -e "\nContinue installation..\n"
|
||||
sleep 3
|
||||
fi
|
||||
|
||||
cp /etc/resolv.conf /etc/resolv.conf-tmp
|
||||
|
||||
Line1="$(grep -n "f.write('nameserver 8.8.8.8')" installCyberPanel.py | head -n 1 | cut -d: -f1)"
|
||||
@@ -1282,7 +1334,7 @@ sed -i "s|https://www.litespeedtech.com/|https://cyberpanel.sh/www.litespeedtech
|
||||
sed -i 's|composer.sh|composer_cn.sh|g' install.py
|
||||
sed -i 's|./composer_cn.sh|COMPOSER_ALLOW_SUPERUSER=1 ./composer_cn.sh|g' install.py
|
||||
sed -i 's|http://www.litespeedtech.com|https://cyberpanel.sh/www.litespeedtech.com|g' install.py
|
||||
sed -i 's|https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip|https://cyberpanel.sh/www.rainloop.net/repository/webmail/rainloop-community-latest.zip|g' install.py
|
||||
sed -i 's|https://snappymail.eu/repository/latest.tar.gz|https://cyberpanel.sh/www.snappymail.eu/repository/latest.tar.gz|g' install.py
|
||||
|
||||
sed -i "s|rep.cyberpanel.net|cyberpanel.sh/rep.cyberpanel.net|g" installCyberPanel.py
|
||||
sed -i "s|rep.cyberpanel.net|cyberpanel.sh/rep.cyberpanel.net|g" install.py
|
||||
@@ -1396,7 +1448,7 @@ fi
|
||||
}
|
||||
|
||||
Post_Install_Addon_Mecached_LSMCD() {
|
||||
if [[ $Server_OS = "CentOS" ]]; then
|
||||
if [[ $Server_OS = "CentOS" ]] || [[ $Server_OS = "openEuler" ]]; then
|
||||
yum groupinstall "Development Tools" -y
|
||||
yum install autoconf automake zlib-devel openssl-devel expat-devel pcre-devel libmemcached-devel cyrus-sasl* -y
|
||||
wget -O lsmcd-master.zip https://cyberpanel.sh/codeload.github.com/litespeedtech/lsmcd/zip/master
|
||||
@@ -1450,6 +1502,18 @@ if [[ $Server_OS = "Ubuntu" ]]; then
|
||||
systemctl start memcached
|
||||
fi
|
||||
fi
|
||||
if [[ $Server_OS = "openEuler" ]]; then
|
||||
#yum install -y lsphp??-memcached lsphp??-pecl-memcached
|
||||
if [[ $Total_RAM -eq "2048" ]] || [[ $Total_RAM -gt "2048" ]]; then
|
||||
Post_Install_Addon_Mecached_LSMCD
|
||||
else
|
||||
yum install -y memcached
|
||||
sed -i 's|OPTIONS=""|OPTIONS="-l 127.0.0.1 -U 0"|g' /etc/sysconfig/memcached
|
||||
#turn off UDP and bind to 127.0.0.1 only
|
||||
systemctl enable memcached
|
||||
systemctl start memcached
|
||||
fi
|
||||
fi
|
||||
|
||||
if pgrep "lsmcd" ; then
|
||||
echo -e "\n\nLiteSpeed Memcached installed and running..."
|
||||
@@ -1493,6 +1557,10 @@ else
|
||||
systemctl start redis
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS" = "openEuler" ]]; then
|
||||
yum install -y lsphp??-redis redis
|
||||
fi
|
||||
|
||||
if pgrep "redis" ; then
|
||||
echo -e "\n\nRedis installed and running..."
|
||||
touch /home/cyberpanel/redis
|
||||
@@ -1530,7 +1598,7 @@ for PHP_Version in /usr/local/lsws/lsphp?? ;
|
||||
do
|
||||
PHP_INI_Path=$(find "$PHP_Version" -name php.ini)
|
||||
|
||||
if [[ "$Server_OS" = "CentOS" ]]; then
|
||||
if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]]; then
|
||||
if [[ ! -d "${PHP_Version}/tmp" ]]; then
|
||||
mkdir "${PHP_Version}/tmp"
|
||||
fi
|
||||
@@ -1598,7 +1666,7 @@ if [[ "$Watchdog" = "On" ]]; then
|
||||
nohup watchdog mariadb >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS" = "CentOS" ]]; then
|
||||
if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]]; then
|
||||
echo "nohup watchdog lsws > /dev/null 2>&1 &
|
||||
nohup watchdog mariadb > /dev/null 2>&1 &" >>/etc/rc.d/rc.local
|
||||
else
|
||||
@@ -1617,7 +1685,7 @@ fi
|
||||
}
|
||||
|
||||
Post_Install_Display_Final_Info() {
|
||||
RainloopAdminPass=$(grep SetPassword /usr/local/CyberCP/public/rainloop.php| sed -e 's|$oConfig->SetPassword(||g' -e "s|');||g" -e "s|'||g")
|
||||
snappymailAdminPass=$(grep SetPassword /usr/local/CyberCP/public/snappymail.php| sed -e 's|$oConfig->SetPassword(||g' -e "s|');||g" -e "s|'||g")
|
||||
Elapsed_Time="$((Time_Count / 3600)) hrs $(((SECONDS / 60) % 60)) min $((Time_Count % 60)) sec"
|
||||
echo "###################################################################"
|
||||
echo " CyberPanel Successfully Installed "
|
||||
@@ -1639,9 +1707,9 @@ fi
|
||||
#echo " WebAdmin console username: admin "
|
||||
#echo " WebAdmin console password: $Webadmin_Pass "
|
||||
#echo " "
|
||||
#echo " Visit: https://$Server_IP:8090/rainloop/?admin "
|
||||
#echo " Rainloop Admin username: admin "
|
||||
#echo " Rainloop Admin password: $RainloopAdminPass "
|
||||
#echo " Visit: https://$Server_IP:8090/snappymail/?admin "
|
||||
#echo " snappymail Admin username: admin "
|
||||
#echo " snappymail Admin password: $snappymailAdminPass "
|
||||
echo " "
|
||||
echo -e " Run \e[31mcyberpanel help\e[39m to get FAQ info"
|
||||
echo -e " Run \e[31mcyberpanel upgrade\e[39m to upgrade it to latest version."
|
||||
@@ -1723,7 +1791,14 @@ rm -f /root/cyberpanel/cert_conf
|
||||
|
||||
Post_Install_Required_Components() {
|
||||
Debug_Log2 "Finalization..,80"
|
||||
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "22" ]] ; then
|
||||
python3 -m venv /usr/local/CyberCP
|
||||
Check_Return
|
||||
else
|
||||
virtualenv -p /usr/bin/python3 /usr/local/CyberCP
|
||||
Check_Return
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "20" ]] ; then
|
||||
# shellcheck disable=SC1091
|
||||
@@ -1789,13 +1864,14 @@ mkdir -p /etc/opendkim
|
||||
|
||||
echo '/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/adminPass.py --password $@' > /usr/bin/adminPass
|
||||
echo "systemctl restart lscpd" >> /usr/bin/adminPass
|
||||
echo "echo \$@ > /etc/cyberpanel/adminPass" >> /usr/bin/adminPass
|
||||
chmod 700 /usr/bin/adminPass
|
||||
|
||||
rm -f /usr/bin/php
|
||||
ln -s /usr/local/lsws/lsphp74/bin/php /usr/bin/php
|
||||
|
||||
if [[ "$Server_OS" = "CentOS" ]] ; then
|
||||
#all centos7/8 post change goes here
|
||||
#all centos 7/8 post change goes here
|
||||
|
||||
sed -i 's|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|g' /usr/local/lsws/{lsphp72,lsphp73}/etc/php.ini
|
||||
#fix php.ini & issue
|
||||
@@ -1834,10 +1910,8 @@ if [[ "$Server_OS" = "CentOS" ]] ; then
|
||||
fi
|
||||
|
||||
elif [[ "$Server_OS" = "Ubuntu" ]] ; then
|
||||
#all ubuntu18/20 post change goes here
|
||||
|
||||
#all ubuntu 18/20 post change goes here
|
||||
sed -i 's|/usr/local/lsws/bin/lswsctrl restart|systemctl restart lsws|g' /var/spool/cron/crontabs/root
|
||||
|
||||
if [[ ! -f /usr/sbin/ipset ]] ; then
|
||||
ln -s /sbin/ipset /usr/sbin/ipset
|
||||
fi
|
||||
@@ -1852,9 +1926,12 @@ elif [[ "$Server_OS" = "Ubuntu" ]] ; then
|
||||
:
|
||||
fi
|
||||
|
||||
elif [[ "$Server_OS" = "openEuler" ]] ; then
|
||||
sed -i 's|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|g' /usr/local/lsws/{lsphp72,lsphp73}/etc/php.ini
|
||||
#fix php.ini & issue
|
||||
sed -i 's|/usr/local/lsws/bin/lswsctrl restart|systemctl restart lsws|g' /var/spool/cron/root
|
||||
fi
|
||||
|
||||
|
||||
if [[ "$Server_Edition" = "OLS" ]]; then
|
||||
Word="OpenLiteSpeed"
|
||||
else
|
||||
|
||||
1963
cyberpanel.sh.bak
Normal file
@@ -4,8 +4,8 @@
|
||||
#set -x
|
||||
#set -u
|
||||
|
||||
#CyberPanel installer script for CentOS 7.X, CentOS 8.X, CloudLinux 7.X, Ubuntu 18.04 and Ubuntu 20.04
|
||||
#For whoever may edit this script, please follow :
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, openEuler 20.03 and openEuler 22.03
|
||||
#For whoever may edit this script, please follow:
|
||||
#Please use Pre_Install_xxx() and Post_Install_xxx() if you want to something respectively before or after the panel installation
|
||||
#and update below accordingly
|
||||
#Please use variable/functions name as MySomething or My_Something, and please try not to use too-short abbreviation :)
|
||||
@@ -121,22 +121,24 @@ elif grep -q "AlmaLinux-8" /etc/os-release ; then
|
||||
Server_OS="AlmaLinux"
|
||||
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10" /etc/os-release ; then
|
||||
Server_OS="Ubuntu"
|
||||
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
|
||||
Server_OS="openEuler"
|
||||
else
|
||||
echo -e "Unable to detect your system..."
|
||||
echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, CloudLinux 7.x and AlmaLinux 8.x...\n"
|
||||
Debug_Log2 "CyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x... [404]"
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03... [404]"
|
||||
exit
|
||||
fi
|
||||
|
||||
Server_OS_Version=$(grep VERSION_ID /etc/os-release | awk -F[=,] '{print $2}' | tr -d \" | head -c2 | tr -d . )
|
||||
#to make 20.04 display as 20
|
||||
#to make 20.04 display as 20, etc.
|
||||
|
||||
echo -e "System: $Server_OS $Server_OS_Version detected...\n"
|
||||
|
||||
if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] ; then
|
||||
Server_OS="CentOS"
|
||||
#CloudLinux gives version id like 7.8 , 7.9 , so cut it to show first number only
|
||||
#treat CL and Alma as CentOS
|
||||
#CloudLinux gives version id like 7.8, 7.9, so cut it to show first number only
|
||||
#treat CloudLinux, Rocky and Alma as CentOS
|
||||
fi
|
||||
|
||||
if [[ "$Debug" = "On" ]] ; then
|
||||
@@ -392,15 +394,16 @@ EOF
|
||||
|
||||
#all pre-upgrade operation for CentOS 7
|
||||
elif [[ "$Server_OS_Version" = "8" ]] ; then
|
||||
cat <<EOF >/etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo
|
||||
[powertools-for-cyberpanel]
|
||||
name=CentOS Linux \$releasever - PowerTools
|
||||
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=PowerTools&infra=\$infra
|
||||
baseurl=http://mirror.centos.org/\$contentdir/\$releasever/PowerTools/\$basearch/os/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
EOF
|
||||
# cat <<EOF >/etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo
|
||||
#[powertools-for-cyberpanel]
|
||||
#name=CentOS Linux \$releasever - PowerTools
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=PowerTools&infra=\$infra
|
||||
#baseurl=http://mirror.centos.org/\$contentdir/\$releasever/PowerTools/\$basearch/os/
|
||||
#gpgcheck=1
|
||||
#enabled=1
|
||||
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
#EOF
|
||||
rm -f /etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo
|
||||
|
||||
if [[ "$Server_Country" = "CN" ]] ; then
|
||||
dnf --nogpg install -y https://cyberpanel.sh/mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm
|
||||
@@ -445,6 +448,18 @@ elif [[ "$Server_OS" = "Ubuntu" ]] ; then
|
||||
fi
|
||||
#all pre-upgrade operation for Ubuntu 20
|
||||
fi
|
||||
if [[ "$Server_OS" = "openEuler" ]] ; then
|
||||
rm -f /etc/yum.repos.d/CyberPanel.repo
|
||||
rm -f /etc/yum.repos.d/litespeed.repo
|
||||
|
||||
yum clean all
|
||||
yum update -y
|
||||
|
||||
dnf 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 python3-devel tar socat bind-utils
|
||||
dnf install gpgme-devel -y
|
||||
dnf install python3 -y
|
||||
fi
|
||||
#all pre-upgrade operation for openEuler
|
||||
}
|
||||
|
||||
Download_Requirement() {
|
||||
@@ -505,6 +520,11 @@ elif [[ "$Server_OS" = "Ubuntu" ]] ; then
|
||||
Check_Return
|
||||
pip3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt
|
||||
Check_Return
|
||||
elif [[ "$Server_OS" = "openEuler" ]] ; then
|
||||
pip3 install --default-timeout=3600 virtualenv==16.7.9
|
||||
Check_Return
|
||||
pip3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt
|
||||
Check_Return
|
||||
fi
|
||||
|
||||
#virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel
|
||||
|
||||
@@ -23,10 +23,12 @@ check_OS() {
|
||||
Server_OS="Ubuntu"
|
||||
elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
|
||||
Server_OS="openEuler"
|
||||
else
|
||||
echo -e "Unable to detect your system..."
|
||||
echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x...\n"
|
||||
Debug_Log2 "CyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x... [404]"
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03... [404]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -37,8 +39,8 @@ check_OS() {
|
||||
|
||||
if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] || [[ "$Server_OS" = "RockyLinux" ]] ; then
|
||||
Server_OS="CentOS"
|
||||
#CloudLinux gives version id like 7.8 , 7.9 , so cut it to show first number only
|
||||
#treat CL , Rocky and Alma as CentOS
|
||||
#CloudLinux gives version id like 7.8, 7.9, so cut it to show first number only
|
||||
#treat CloudLinux, Rocky and Alma as CentOS
|
||||
fi
|
||||
|
||||
}
|
||||
@@ -212,7 +214,7 @@ phpmyadmin_limits() {
|
||||
read TMP_YN
|
||||
if [[ $TMP_YN == "Y" ]] || [[ $TMP_YN == "y" ]] ; then
|
||||
|
||||
if [[ "$SERVER_OS" == "CentOS" ]] ; then
|
||||
if [[ "$SERVER_OS" == "CentOS" ]] || [[ "$SERVER_OS" == "openEuler" ]] ; then
|
||||
php_ini_path="/usr/local/lsws/lsphp73/etc/php.ini"
|
||||
fi
|
||||
|
||||
@@ -238,6 +240,9 @@ install_php_redis() {
|
||||
if [[ $SERVER_OS == "Ubuntu" ]] ; then
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis lsphp70-redis
|
||||
fi
|
||||
if [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
#dnf install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis
|
||||
fi
|
||||
echo -e "\nRedis extension for PHP has been installed..."
|
||||
exit
|
||||
}
|
||||
@@ -252,6 +257,9 @@ install_redis() {
|
||||
if [[ ! -f /usr/bin/redis-cli ]] && [[ $SERVER_OS == "Ubuntu" ]] ; then
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y redis
|
||||
fi
|
||||
if [[ ! -f /usr/bin/redis-cli ]] && [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
yum install -y redis
|
||||
fi
|
||||
if ifconfig -a | grep inet6 ; then
|
||||
echo -e "\n IPv6 detected..."
|
||||
else
|
||||
@@ -288,7 +296,7 @@ read TMP_YN
|
||||
if [[ -f /usr/local/lsmcd/bin/lsmcd ]] ; then
|
||||
echo -e "\nLiteSpeed Memcached is already installed..."
|
||||
else
|
||||
if [[ $SERVER_OS == "CentOS" ]] ; then
|
||||
if [[ $SERVER_OS == "CentOS" ]] || [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
yum groupinstall "Development Tools" -y
|
||||
yum install autoconf automake zlib-devel openssl-devel expat-devel pcre-devel libmemcached-devel cyrus-sasl* -y
|
||||
elif [[ $SERVER_OS == "Ubuntu" ]] ; then
|
||||
@@ -329,6 +337,11 @@ read TMP_YN
|
||||
if [[ ! -f /usr/bin/memcached ]] && [[ $SERVER_OS == "Ubuntu" ]] ; then
|
||||
DEBIAN_FRONTEND=noninteractive apt install memcached -y
|
||||
fi
|
||||
if [[ ! -f /usr/bin/memcached ]] && [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
yum install memcached -y
|
||||
sed -i 's|OPTIONS=""|OPTIONS="-l 127.0.0.1 -U 0"|g' /etc/sysconfig/memcached
|
||||
#this will disbale UDP and bind to 127.0.0.1 to prevent UDP amplification attack
|
||||
fi
|
||||
if systemctl is-active --quiet memcached ; then
|
||||
systemctl status memcached
|
||||
else
|
||||
@@ -351,6 +364,9 @@ install_php_memcached() {
|
||||
if [[ $SERVER_OS == "Ubuntu" ]] ; then
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y lsphp74-memcached lsphp73-memcached lsphp72-memcached lsphp71-memcached lsphp70-memcached
|
||||
fi
|
||||
if [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
#yum install -y lsphp74-memcached lsphp73-memcached lsphp72-memcached lsphp71-memcached
|
||||
fi
|
||||
echo -e "\nMemcached extension for PHP has been installed..."
|
||||
exit
|
||||
}
|
||||
|
||||
2
faq.sh
@@ -52,7 +52,7 @@ ${BLUE}------------------------------------------------------------${NC}
|
||||
|
||||
${PURPLE}6.${NC} How to raise upload limit for cyberpanel's phpMyAdmin and File Manager?
|
||||
|
||||
edit file ${RED}/usr/local/lsws/lsphp73/etc/php.ini${NC} for CentOS
|
||||
edit file ${RED}/usr/local/lsws/lsphp73/etc/php.ini${NC} for CentOS or openEuler
|
||||
|
||||
${RED}/usr/local/lsws/lsphp73/etc/php/7.3/litespeed/php.ini${NC} for Ubbuntu
|
||||
|
||||
|
||||
@@ -654,6 +654,16 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
} else {
|
||||
if (functionName === "startPoint") {
|
||||
completePathToFile = $scope.currentPath;
|
||||
// check if there is any path in QS
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
QSPath = urlParams.get('path')
|
||||
|
||||
if (QSPath !== null) {
|
||||
completePathToFile = QSPath
|
||||
}
|
||||
|
||||
//
|
||||
} else if (functionName === "doubleClick") {
|
||||
completePathToFile = $scope.currentPath + "/" + node.innerHTML;
|
||||
} else if (functionName === "homeFetch") {
|
||||
@@ -674,7 +684,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var data = {
|
||||
completeStartingPath: completePathToFile,
|
||||
method: "listForTable",
|
||||
home: homePathBack,
|
||||
home: "/",
|
||||
domainRandomSeed: domainRandomSeed,
|
||||
domainName: domainName
|
||||
};
|
||||
@@ -1201,9 +1211,10 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
pathbase = $scope.currentPath;
|
||||
}
|
||||
|
||||
|
||||
$scope.extractionLoading = false;
|
||||
|
||||
var completeFileToExtract = $scope.currentRPath + "/" + allFilesAndFolders[0];
|
||||
var completeFileToExtract = pathbase + "/" + allFilesAndFolders[0];
|
||||
var extractionType = "";
|
||||
|
||||
if (findFileExtension(completeFileToExtract) == "gz") {
|
||||
@@ -1825,4 +1836,4 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -90,7 +90,6 @@ def controller(request):
|
||||
else:
|
||||
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)
|
||||
|
||||
|
||||
fm = FM(request, data)
|
||||
|
||||
if method == 'listForTable':
|
||||
@@ -211,21 +210,25 @@ def FileManagerRoot(request):
|
||||
|
||||
try:
|
||||
|
||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||
data = {
|
||||
"name": "Filemanager",
|
||||
"IP": ipAddressLocal
|
||||
}
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
|
||||
import requests
|
||||
response = requests.post(url, data=json.dumps(data))
|
||||
Status = response.json()['status']
|
||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||
data = {
|
||||
"name": "Filemanager",
|
||||
"IP": ipAddressLocal
|
||||
}
|
||||
|
||||
if(Status == 1):
|
||||
template = 'baseTemplate/FileManager.html'
|
||||
import requests
|
||||
response = requests.post(url, data=json.dumps(data))
|
||||
Status = response.json()['status']
|
||||
|
||||
if(Status == 1):
|
||||
template = 'baseTemplate/FileManager.html'
|
||||
else:
|
||||
return redirect("https://cyberpanel.net/cyberpanel-addons")
|
||||
else:
|
||||
return redirect("https://cyberpanel.net/cyberpanel-addons")
|
||||
|
||||
template = 'baseTemplate/FileManager.html'
|
||||
except BaseException as msg:
|
||||
template = 'baseTemplate/FileManager.html'
|
||||
|
||||
|
||||
10
install.sh
@@ -22,6 +22,16 @@ apt install -y -qq wget curl
|
||||
elif echo $OUTPUT | grep -q "Ubuntu 20.04" ; then
|
||||
apt install -y -qq wget curl
|
||||
SERVER_OS="Ubuntu"
|
||||
elif echo $OUTPUT | grep -q "openEuler 20.03" ; then
|
||||
echo -e "\nDetecting openEuler 20.03...\n"
|
||||
SERVER_OS="openEuler"
|
||||
yum install curl wget -y 1> /dev/null
|
||||
yum update curl wget ca-certificates -y 1> /dev/null
|
||||
elif echo $OUTPUT | grep -q "openEuler 22.03" ; then
|
||||
echo -e "\nDetecting openEuler 22.03...\n"
|
||||
SERVER_OS="openEuler"
|
||||
yum install curl wget -y 1> /dev/null
|
||||
yum update curl wget ca-certificates -y 1> /dev/null
|
||||
else
|
||||
|
||||
echo -e "\nUnable to detect your OS...\n"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[CyberPanel]
|
||||
name=CyberPanel
|
||||
baseurl=https://rep.cyberpanel.net/
|
||||
gpgkey=https://rep.cyberpanel.net/RPM-GPG-KEY-cyberpanel
|
||||
gpgcheck=1
|
||||
@@ -1,5 +0,0 @@
|
||||
[CyberPanel]
|
||||
name=CyberPanel
|
||||
baseurl=https://rep.cyberpanel.net/
|
||||
gpgkey=https://rep.cyberpanel.net/RPM-GPG-KEY-cyberpanel
|
||||
gpgcheck=1
|
||||
@@ -119,7 +119,7 @@ def recursive_permissions(path, dir_mode=755, file_mode=644, topdir=True):
|
||||
# Set recursive chown for a path
|
||||
# recursive_chown(my_path, 'root', 'root')
|
||||
# for changing group recursively without affecting user
|
||||
# recursive_chown('/usr/local/lscp/cyberpanel/rainloop/data', -1, 'lscpd')
|
||||
# recursive_chown('/usr/local/lscp/cyberpanel/snappymail/data', -1, 'lscpd')
|
||||
|
||||
# explicitly set permissions for directories/folders to 0755 and files to 0644
|
||||
# recursive_permissions(my_path, 755, 644)
|
||||
|
||||
190
install/filesPermsUtilities.py.bak
Normal file
@@ -0,0 +1,190 @@
|
||||
import os
|
||||
import shutil
|
||||
import pathlib
|
||||
import stat
|
||||
|
||||
|
||||
def mkdir_p(path, exist_ok=True):
|
||||
"""
|
||||
Creates the directory and paths leading up to it like unix mkdir -p .
|
||||
Defaults to exist_ok so if it exists were not throwing fatal errors
|
||||
https://docs.python.org/3.7/library/os.html#os.makedirs
|
||||
"""
|
||||
if not os.path.exists(path):
|
||||
print('creating directory: ' + path)
|
||||
os.makedirs(path, exist_ok)
|
||||
|
||||
|
||||
def chmod_digit(file_path, perms):
|
||||
"""
|
||||
Helper function to chmod like you would in unix without having to preface 0o or converting to octal yourself.
|
||||
Credits: https://stackoverflow.com/a/60052847/1621381
|
||||
"""
|
||||
try:
|
||||
os.chmod(file_path, int(str(perms), base=8))
|
||||
except:
|
||||
print(f'Could not chmod : {file_path} to {perms}')
|
||||
pass
|
||||
|
||||
|
||||
def touch(filepath: str, exist_ok=True):
|
||||
"""
|
||||
Touches a file like unix `touch somefile` would.
|
||||
"""
|
||||
try:
|
||||
pathlib.Path(filepath).touch(exist_ok)
|
||||
except FileExistsError:
|
||||
print('Could touch : ' + filepath)
|
||||
pass
|
||||
|
||||
|
||||
def symlink(src, dst):
|
||||
"""
|
||||
Symlink a path to another if the src exists.
|
||||
"""
|
||||
try:
|
||||
if os.access(src, os.R_OK):
|
||||
os.symlink(src, dst)
|
||||
except:
|
||||
print(f'Could not symlink Source: {src} > Destination: {dst}')
|
||||
pass
|
||||
|
||||
|
||||
def chown(path, user, group=-1):
|
||||
"""
|
||||
Chown file/path to user/group provided. Passing -1 to user or group will leave it unchanged.
|
||||
Useful if just changing user or group vs both.
|
||||
"""
|
||||
try:
|
||||
shutil.chown(path, user, group)
|
||||
except PermissionError:
|
||||
print(f'Could not change permissions for: {path} to {user}:{group}')
|
||||
pass
|
||||
|
||||
|
||||
def recursive_chown(path, owner, group=-1):
|
||||
"""
|
||||
Recursively chown a path and contents to owner.
|
||||
https://docs.python.org/3/library/shutil.html
|
||||
"""
|
||||
for dirpath, dirnames, filenames in os.walk(path):
|
||||
try:
|
||||
shutil.chown(dirpath, owner, group)
|
||||
except PermissionError:
|
||||
print('Could not change permissions for: ' + dirpath + ' to: ' + owner)
|
||||
pass
|
||||
for filename in filenames:
|
||||
try:
|
||||
shutil.chown(os.path.join(dirpath, filename), owner, group)
|
||||
except PermissionError:
|
||||
print('Could not change permissions for: ' + os.path.join(dirpath, filename) + ' to: ' + owner)
|
||||
pass
|
||||
|
||||
|
||||
def recursive_permissions(path, dir_mode=755, file_mode=644, topdir=True):
|
||||
"""
|
||||
Recursively chmod a path and contents to mode.
|
||||
Defaults to chmod top level directory but can be optionally
|
||||
toggled off when you want to chmod only contents of like a user's homedir vs homedir itself
|
||||
https://docs.python.org/3.6/library/os.html#os.walk
|
||||
"""
|
||||
|
||||
# Here we are converting the integers to string and then to octal.
|
||||
# so this function doesn't need to be called with 0o prefixed for the file and dir mode
|
||||
dir_mode = int(str(dir_mode), base=8)
|
||||
file_mode = int(str(file_mode), base=8)
|
||||
|
||||
if topdir:
|
||||
# Set chmod on top level path
|
||||
try:
|
||||
os.chmod(path, dir_mode)
|
||||
except:
|
||||
print('Could not chmod :' + path + ' to ' + str(dir_mode))
|
||||
for root, dirs, files in os.walk(path):
|
||||
for d in dirs:
|
||||
try:
|
||||
os.chmod(os.path.join(root, d), dir_mode)
|
||||
except:
|
||||
print('Could not chmod :' + os.path.join(root, d) + ' to ' + str(dir_mode))
|
||||
pass
|
||||
for f in files:
|
||||
try:
|
||||
os.chmod(os.path.join(root, f), file_mode)
|
||||
except:
|
||||
print('Could not chmod :' + path + ' to ' + str(file_mode))
|
||||
pass
|
||||
|
||||
|
||||
# Left intentionally here for reference.
|
||||
# Set recursive chown for a path
|
||||
# recursive_chown(my_path, 'root', 'root')
|
||||
# for changing group recursively without affecting user
|
||||
# recursive_chown('/usr/local/lscp/cyberpanel/rainloop/data', -1, 'lscpd')
|
||||
|
||||
# explicitly set permissions for directories/folders to 0755 and files to 0644
|
||||
# recursive_permissions(my_path, 755, 644)
|
||||
|
||||
# Fix permissions and use default values
|
||||
# recursive_permissions(my_path)
|
||||
# =========================================================
|
||||
# Below is a helper class for getting and working with permissions
|
||||
# Original credits to : https://github.com/keysemble/perfm
|
||||
|
||||
def perm_octal_digit(rwx):
|
||||
digit = 0
|
||||
if rwx[0] == 'r':
|
||||
digit += 4
|
||||
if rwx[1] == 'w':
|
||||
digit += 2
|
||||
if rwx[2] == 'x':
|
||||
digit += 1
|
||||
return digit
|
||||
|
||||
|
||||
class FilePerm:
|
||||
def __init__(self, filepath):
|
||||
filemode = stat.filemode(os.stat(filepath).st_mode)
|
||||
permissions = [filemode[-9:][i:i + 3] for i in range(0, len(filemode[-9:]), 3)]
|
||||
self.filepath = filepath
|
||||
self.access_dict = dict(zip(['user', 'group', 'other'], [list(perm) for perm in permissions]))
|
||||
|
||||
def mode(self):
|
||||
mode = 0
|
||||
for shift, digit in enumerate(self.octal()[::-1]):
|
||||
mode += digit << (shift * 3)
|
||||
return mode
|
||||
|
||||
def digits(self):
|
||||
"""Get the octal chmod equivalent value 755 in single string"""
|
||||
return "".join(map(str, self.octal()))
|
||||
|
||||
def octal(self):
|
||||
"""Get the octal value in a list [7, 5, 5]"""
|
||||
return [perm_octal_digit(p) for p in self.access_dict.values()]
|
||||
|
||||
def access_bits(self, access):
|
||||
if access in self.access_dict.keys():
|
||||
r, w, x = self.access_dict[access]
|
||||
return [r == 'r', w == 'w', x == 'x']
|
||||
|
||||
def update_bitwise(self, settings):
|
||||
def perm_list(read=False, write=False, execute=False):
|
||||
pl = ['-', '-', '-']
|
||||
if read:
|
||||
pl[0] = 'r'
|
||||
if write:
|
||||
pl[1] = 'w'
|
||||
if execute:
|
||||
pl[2] = 'x'
|
||||
return pl
|
||||
|
||||
self.access_dict = dict(
|
||||
[(access, perm_list(read=r, write=w, execute=x)) for access, [r, w, x] in settings.items()])
|
||||
os.chmod(self.filepath, self.mode())
|
||||
|
||||
# project_directory = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||
# home_directory = os.path.expanduser('~')
|
||||
# print(f'Path: {home_directory} Mode: {FilePerm(home_directory).mode()} Octal: {FilePerm(home_directory).octal()} '
|
||||
# f'Digits: {FilePerm(home_directory).digits()}')
|
||||
# Example: Output
|
||||
# Path: /home/cooluser Mode: 493 Octal: [7, 5, 5] Digits: 755
|
||||
@@ -15,7 +15,7 @@ from stat import *
|
||||
import stat
|
||||
|
||||
VERSION = '2.3'
|
||||
BUILD = 1
|
||||
BUILD = 2
|
||||
|
||||
char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}
|
||||
|
||||
@@ -33,6 +33,7 @@ def generate_pass(length=14):
|
||||
centos = 0
|
||||
ubuntu = 1
|
||||
cent8 = 2
|
||||
openeuler = 3
|
||||
|
||||
|
||||
def get_distro():
|
||||
@@ -45,8 +46,8 @@ def get_distro():
|
||||
if line == "DISTRIB_ID=Ubuntu\n":
|
||||
distro = ubuntu
|
||||
|
||||
elif exists("/etc/os-release"):
|
||||
distro_file = "/etc/os-release"
|
||||
elif exists("/etc/redhat-release"):
|
||||
distro_file = "/etc/redhat-release"
|
||||
distro = centos
|
||||
|
||||
data = open('/etc/redhat-release', 'r').read()
|
||||
@@ -57,6 +58,10 @@ def get_distro():
|
||||
return cent8
|
||||
if data.find('Rocky Linux release 8') > -1 or data.find('Rocky Linux 8') > -1 or data.find('rocky:8') > -1:
|
||||
return cent8
|
||||
|
||||
elif exists("/etc/openEuler-release"):
|
||||
distro_file = "/etc/openEuler-release"
|
||||
distro = openeuler
|
||||
|
||||
else:
|
||||
logging.InstallLog.writeToFile("Can't find linux release file - fatal error")
|
||||
@@ -96,6 +101,7 @@ class preFlightsChecks:
|
||||
debug = 1
|
||||
cyberPanelMirror = "mirror.cyberpanel.net/pip"
|
||||
cdn = 'cyberpanel.sh'
|
||||
SnappyVersion = '2.15.3'
|
||||
|
||||
def __init__(self, rootPath, ip, path, cwd, cyberPanelPath, distro, remotemysql=None, mysqlhost=None, mysqldb=None,
|
||||
mysqluser=None, mysqlpassword=None, mysqlport=None):
|
||||
@@ -267,7 +273,7 @@ class preFlightsChecks:
|
||||
def setup_account_cyberpanel(self):
|
||||
try:
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = "yum install sudo -y"
|
||||
preFlightsChecks.call(command, self.distro, command,
|
||||
command,
|
||||
@@ -358,7 +364,7 @@ class preFlightsChecks:
|
||||
def install_psmisc(self):
|
||||
self.stdOut("Install psmisc")
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = "yum -y install psmisc"
|
||||
else:
|
||||
command = "apt-get -y install psmisc"
|
||||
@@ -487,6 +493,9 @@ password="%s"
|
||||
if not os.path.exists("/usr/local/CyberCP/public"):
|
||||
os.mkdir("/usr/local/CyberCP/public")
|
||||
|
||||
command = "/usr/local/CyberPanel/bin/python manage.py collectstatic --noinput --clear"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
## Moving static content to lscpd location
|
||||
command = 'mv static /usr/local/CyberCP/public/'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
@@ -546,7 +555,7 @@ password="%s"
|
||||
command = "chown -R root:root /usr/local/lscp"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop/data"
|
||||
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = "chmod 700 /usr/local/CyberCP/cli/cyberPanel.py"
|
||||
@@ -638,7 +647,7 @@ password="%s"
|
||||
command = "find /usr/local/CyberCP/ -name '*.pyc' -delete"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == cent8 or self.distro == centos:
|
||||
if self.distro == cent8 or self.distro == centos or self.distro == openeuler:
|
||||
command = 'chown root:pdns /etc/pdns/pdns.conf'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
@@ -648,11 +657,11 @@ password="%s"
|
||||
command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = 'mkdir -p/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/'
|
||||
command = 'mkdir -p/usr/local/lscp/cyberpanel/snappymail/data/_data_/_default_/configs/'
|
||||
|
||||
rainloopinipath = '/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini'
|
||||
snappymailinipath = '/usr/local/lscp/cyberpanel/snappymail/data/_data_/_default_/configs/application.ini'
|
||||
|
||||
command = 'chmod 600 /usr/local/CyberCP/public/rainloop.php'
|
||||
command = 'chmod 600 /usr/local/CyberCP/public/snappymail.php'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
###
|
||||
@@ -687,7 +696,7 @@ password="%s"
|
||||
def install_unzip(self):
|
||||
self.stdOut("Install unzip")
|
||||
try:
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'yum -y install unzip'
|
||||
else:
|
||||
command = 'apt-get -y install unzip'
|
||||
@@ -699,7 +708,7 @@ password="%s"
|
||||
def install_zip(self):
|
||||
self.stdOut("Install zip")
|
||||
try:
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'yum -y install zip'
|
||||
else:
|
||||
command = 'apt-get -y install zip'
|
||||
@@ -719,7 +728,7 @@ password="%s"
|
||||
preFlightsChecks.call(command, self.distro, '[download_install_phpmyadmin]',
|
||||
command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = 'unzip /usr/local/CyberCP/public/phpmyadmin.zip -d /usr/local/CyberCP/public/'
|
||||
command = 'unzip /usr/local/CyberCP/public/phpmyadmin.zip -d /usr/local/CyberCP/public/phpmyadmin'
|
||||
preFlightsChecks.call(command, self.distro, '[download_install_phpmyadmin]',
|
||||
command, 1, 0, os.EX_OSERR)
|
||||
|
||||
@@ -809,12 +818,14 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
||||
command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
elif self.distro == cent8:
|
||||
|
||||
command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
elif self.distro == openeuler:
|
||||
command = 'dnf install postfix -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
else:
|
||||
command = 'apt-get -y install debconf-utils'
|
||||
@@ -838,6 +849,8 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
||||
command = 'yum --enablerepo=gf-plus -y install dovecot23 dovecot23-mysql'
|
||||
elif self.distro == cent8:
|
||||
command = 'dnf install --enablerepo=gf-plus dovecot23 dovecot23-mysql -y'
|
||||
elif self.distro == openeuler:
|
||||
command = 'dnf install dovecot -y'
|
||||
else:
|
||||
command = 'apt-get -y install dovecot-mysql dovecot-imapd dovecot-pop3d'
|
||||
|
||||
@@ -1236,24 +1249,28 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
||||
if not os.path.exists("/usr/local/CyberCP/public"):
|
||||
os.mkdir("/usr/local/CyberCP/public")
|
||||
|
||||
if os.path.exists("/usr/local/CyberCP/public/rainloop"):
|
||||
if os.path.exists("/usr/local/CyberCP/public/snappymail"):
|
||||
return 0
|
||||
|
||||
os.chdir("/usr/local/CyberCP/public")
|
||||
|
||||
command = 'wget https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip'
|
||||
command = 'wget https://github.com/the-djmaze/snappymail/releases/download/v%s/snappymail-%s.zip' % (preFlightsChecks.SnappyVersion, preFlightsChecks.SnappyVersion)
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
#############
|
||||
|
||||
command = 'unzip rainloop-community-latest.zip -d /usr/local/CyberCP/public/rainloop'
|
||||
command = 'unzip snappymail-%s.zip -d /usr/local/CyberCP/public/snappymail' % (preFlightsChecks.SnappyVersion)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
os.remove("rainloop-community-latest.zip")
|
||||
try:
|
||||
os.remove("snappymail-%s.zip" % (preFlightsChecks.SnappyVersion))
|
||||
except:
|
||||
pass
|
||||
|
||||
#######
|
||||
|
||||
os.chdir("/usr/local/CyberCP/public/rainloop")
|
||||
os.chdir("/usr/local/CyberCP/public/snappymail")
|
||||
|
||||
command = 'find . -type d -exec chmod 755 {} \;'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
@@ -1277,15 +1294,16 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
||||
|
||||
labsData = """[labs]
|
||||
imap_folder_list_limit = 0
|
||||
autocreate_system_folders = On
|
||||
"""
|
||||
|
||||
writeToFile = open(labsPath, 'w')
|
||||
writeToFile = open(labsPath, 'a')
|
||||
writeToFile.write(labsData)
|
||||
writeToFile.close()
|
||||
|
||||
iPath = os.listdir('/usr/local/CyberCP/public/rainloop/rainloop/v/')
|
||||
iPath = os.listdir('/usr/local/CyberCP/public/snappymail/snappymail/v/')
|
||||
|
||||
path = "/usr/local/CyberCP/public/rainloop/rainloop/v/%s/include.php" % (iPath[0])
|
||||
path = "/usr/local/CyberCP/public/snappymail/snappymail/v/%s/include.php" % (iPath[0])
|
||||
|
||||
data = open(path, 'r').readlines()
|
||||
writeToFile = open(path, 'w')
|
||||
@@ -1299,8 +1317,22 @@ imap_folder_list_limit = 0
|
||||
|
||||
writeToFile.close()
|
||||
|
||||
includeFileOldPath = '/usr/local/CyberCP/public/snappymail/_include.php'
|
||||
includeFileNewPath = '/usr/local/CyberCP/public/snappymail/include.php'
|
||||
|
||||
if os.path.exists(includeFileOldPath):
|
||||
writeToFile = open(includeFileOldPath, 'a')
|
||||
writeToFile.write("\ndefine('APP_DATA_FOLDER_PATH', '/usr/local/lscp/cyberpanel/rainloop/data/');\n")
|
||||
writeToFile.close()
|
||||
|
||||
command = 'mv %s %s' % (includeFileOldPath, includeFileNewPath)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = "sed -i 's|autocreate_system_folders = Off|autocreate_system_folders = On|g' %s" % (labsPath)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
except BaseException as msg:
|
||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [downoad_and_install_rainloop]")
|
||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [downoad_and_install_snappymail]")
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -1441,14 +1473,14 @@ imap_folder_list_limit = 0
|
||||
except:
|
||||
pass
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'adduser lscpd -M -d /usr/local/lscp'
|
||||
else:
|
||||
command = 'useradd lscpd -M -d /usr/local/lscp'
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'groupadd lscpd'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
# Added group in useradd for Ubuntu
|
||||
@@ -1668,21 +1700,21 @@ imap_folder_list_limit = 0
|
||||
try:
|
||||
## first install crontab
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'yum install cronie -y'
|
||||
else:
|
||||
command = 'apt-get -y install cron'
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'systemctl enable crond'
|
||||
else:
|
||||
command = 'systemctl enable cron'
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'systemctl start crond'
|
||||
else:
|
||||
command = 'systemctl start cron'
|
||||
@@ -1692,8 +1724,9 @@ imap_folder_list_limit = 0
|
||||
##
|
||||
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
openEulerPath = '/etc/openEuler-release'
|
||||
|
||||
if os.path.exists(CentOSPath):
|
||||
if os.path.exists(CentOSPath) or os.path.exists(openEulerPath):
|
||||
cronPath = '/var/spool/cron/root'
|
||||
else:
|
||||
cronPath = '/var/spool/cron/crontabs/root'
|
||||
@@ -1709,6 +1742,15 @@ imap_folder_list_limit = 0
|
||||
7 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
|
||||
0 0 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Daily
|
||||
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Weekly
|
||||
|
||||
*/30 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '30 Minutes'
|
||||
0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '1 Hour'
|
||||
0 */6 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '6 Hours'
|
||||
0 */12 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '12 Hours'
|
||||
0 1 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '1 Day'
|
||||
0 0 */3 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '3 Days'
|
||||
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '1 Week'
|
||||
|
||||
*/3 * * * * if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi
|
||||
"""
|
||||
|
||||
@@ -1731,11 +1773,11 @@ imap_folder_list_limit = 0
|
||||
|
||||
writeToFile.close()
|
||||
|
||||
if not os.path.exists(CentOSPath):
|
||||
if not os.path.exists(CentOSPath) or not os.path.exists(openEulerPath):
|
||||
command = 'chmod 600 %s' % (cronPath)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'systemctl restart crond.service'
|
||||
else:
|
||||
command = 'systemctl restart cron.service'
|
||||
@@ -1762,7 +1804,7 @@ imap_folder_list_limit = 0
|
||||
|
||||
def install_rsync(self):
|
||||
try:
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'yum -y install rsync'
|
||||
else:
|
||||
command = 'apt-get -y install rsync'
|
||||
@@ -1820,13 +1862,17 @@ imap_folder_list_limit = 0
|
||||
try:
|
||||
if self.distro == centos:
|
||||
command = 'yum -y install opendkim'
|
||||
elif self.distro == cent8:
|
||||
elif self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'dnf install opendkim -y'
|
||||
else:
|
||||
command = 'apt-get -y install opendkim'
|
||||
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'dnf install opendkim-tools -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.distro == ubuntu:
|
||||
command = 'apt install opendkim-tools -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
@@ -2027,6 +2073,26 @@ milter_default_action = accept
|
||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [enableDisableEmail]")
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def fixSudoers():
|
||||
try:
|
||||
distroPath = '/etc/lsb-release'
|
||||
|
||||
if not os.path.exists(distroPath):
|
||||
fileName = '/etc/sudoers'
|
||||
data = open(fileName, 'r').readlines()
|
||||
|
||||
writeDataToFile = open(fileName, 'w')
|
||||
for line in data:
|
||||
if line.find("root") > -1 and line.find("ALL=(ALL)") > -1 and line[0] != '#':
|
||||
writeDataToFile.writelines('root ALL=(ALL:ALL) ALL\n')
|
||||
else:
|
||||
writeDataToFile.write(line)
|
||||
writeDataToFile.close()
|
||||
|
||||
except IOError as err:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def setUpFirstAccount():
|
||||
try:
|
||||
@@ -2039,14 +2105,19 @@ milter_default_action = accept
|
||||
try:
|
||||
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
openEulerPath = '/etc/openEuler-release'
|
||||
|
||||
if os.path.exists(CentOSPath) or os.path.exists(openEulerPath):
|
||||
if self.distro == centos:
|
||||
command = 'yum install -y yum-plugin-copr'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
command = 'yum copr enable -y copart/restic'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if os.path.exists(CentOSPath):
|
||||
command = 'yum install -y yum-plugin-copr'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
command = 'yum copr enable -y copart/restic'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
command = 'yum install -y restic'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
command = 'restic self-update'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
else:
|
||||
command = 'apt-get update -y'
|
||||
@@ -2054,6 +2125,9 @@ milter_default_action = accept
|
||||
|
||||
command = 'apt-get install restic -y'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = 'restic self-update'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
except:
|
||||
pass
|
||||
@@ -2062,8 +2136,9 @@ milter_default_action = accept
|
||||
try:
|
||||
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
openEulerPath = '/etc/openEuler-release'
|
||||
|
||||
if os.path.exists(CentOSPath):
|
||||
if os.path.exists(CentOSPath) or os.path.exists(openEulerPath):
|
||||
command = 'mkdir -p /opt/cpvendor/etc/'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
@@ -2270,6 +2345,7 @@ def main():
|
||||
checks.setupPHPAndComposer()
|
||||
checks.fix_selinux_issue()
|
||||
checks.install_psmisc()
|
||||
checks.fixSudoers()
|
||||
|
||||
if args.postfix is None:
|
||||
checks.install_postfix_dovecot()
|
||||
@@ -2337,10 +2413,10 @@ def main():
|
||||
# checks.disablePackegeUpdates()
|
||||
|
||||
try:
|
||||
# command = 'mkdir -p /usr/local/lscp/cyberpanel/rainloop/data/data/default/configs/'
|
||||
# command = 'mkdir -p /usr/local/lscp/cyberpanel/snappymail/data/data/default/configs/'
|
||||
# subprocess.call(shlex.split(command))
|
||||
|
||||
writeToFile = open('/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini', 'a')
|
||||
writeToFile = open('/usr/local/lscp/cyberpanel/snappymail/data/_data_/_default_/configs/application.ini', 'a')
|
||||
|
||||
writeToFile.write("""
|
||||
[security]
|
||||
@@ -2353,23 +2429,23 @@ admin_password = "12345"
|
||||
|
||||
content = """<?php
|
||||
|
||||
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
|
||||
include '/usr/local/CyberCP/public/rainloop/index.php';
|
||||
$_ENV['snappymail_INCLUDE_AS_API'] = true;
|
||||
include '/usr/local/CyberCP/public/snappymail/index.php';
|
||||
|
||||
$oConfig = \RainLoop\Api::Config();
|
||||
$oConfig = \snappymail\Api::Config();
|
||||
$oConfig->SetPassword('%s');
|
||||
echo $oConfig->Save() ? 'Done' : 'Error';
|
||||
|
||||
?>""" % (randomPassword.generate_pass())
|
||||
|
||||
writeToFile = open('/usr/local/CyberCP/public/rainloop.php', 'w')
|
||||
writeToFile = open('/usr/local/CyberCP/public/snappymail.php', 'w')
|
||||
writeToFile.write(content)
|
||||
writeToFile.close()
|
||||
|
||||
command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php'
|
||||
command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/snappymail.php'
|
||||
subprocess.call(shlex.split(command))
|
||||
|
||||
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop/data"
|
||||
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/snappymail/data"
|
||||
subprocess.call(shlex.split(command))
|
||||
except:
|
||||
pass
|
||||
|
||||
2383
install/install.py.bak
Normal file
@@ -14,6 +14,7 @@ import time
|
||||
centos = 0
|
||||
ubuntu = 1
|
||||
cent8 = 2
|
||||
openeuler = 3
|
||||
|
||||
|
||||
def get_Ubuntu_release():
|
||||
@@ -71,7 +72,7 @@ class InstallCyberPanel:
|
||||
command = 'yum install -y openlitespeed'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
else:
|
||||
command = 'yum install -y openlitespeed'
|
||||
command = 'dnf install -y openlitespeed'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
else:
|
||||
@@ -248,7 +249,11 @@ class InstallCyberPanel:
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
if self.distro == cent8:
|
||||
command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* --exclude lsphp73-pecl-zip -y'
|
||||
command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* --exclude lsphp73-pecl-zip --exclude *imagick* -y'
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
if self.distro == openeuler:
|
||||
command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* -y'
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
def installMySQL(self, mysql):
|
||||
@@ -272,7 +277,7 @@ class InstallCyberPanel:
|
||||
command = "apt-get -y install mariadb-server"
|
||||
elif self.distro == centos:
|
||||
command = 'yum --enablerepo=mariadb -y install MariaDB-server MariaDB-client'
|
||||
elif self.distro == cent8:
|
||||
elif self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'dnf -y install mariadb-server'
|
||||
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
@@ -369,7 +374,7 @@ class InstallCyberPanel:
|
||||
elif self.distro == centos:
|
||||
command = "yum install -y pure-ftpd"
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
elif self.distro == cent8:
|
||||
elif self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'dnf install pure-ftpd -y'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
@@ -405,7 +410,7 @@ class InstallCyberPanel:
|
||||
except:
|
||||
logging.InstallLog.writeToFile("[ERROR] Could not create directory for FTP SSL")
|
||||
|
||||
if (self.distro == centos or self.distro == cent8) or (
|
||||
if (self.distro == centos or self.distro == cent8 or self.distro == openeuler) or (
|
||||
self.distro == ubuntu and get_Ubuntu_release() == 18.14):
|
||||
command = 'openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem'
|
||||
else:
|
||||
@@ -502,7 +507,7 @@ class InstallCyberPanel:
|
||||
def installPowerDNS(self):
|
||||
try:
|
||||
|
||||
if self.distro == ubuntu or self.distro == cent8:
|
||||
if self.distro == ubuntu or self.distro == cent8 or self.distro == openeuler:
|
||||
command = 'systemctl stop systemd-resolved'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
command = 'systemctl disable systemd-resolved.service'
|
||||
@@ -555,7 +560,7 @@ class InstallCyberPanel:
|
||||
InstallCyberPanel.stdOut("Configuring PowerDNS..", 1)
|
||||
|
||||
os.chdir(self.cwd)
|
||||
if self.distro == centos or self.distro == cent8:
|
||||
if self.distro == centos or self.distro == cent8 or self.distro == openeuler:
|
||||
dnsPath = "/etc/pdns/pdns.conf"
|
||||
else:
|
||||
dnsPath = "/etc/powerdns/pdns.conf"
|
||||
|
||||
@@ -7,7 +7,7 @@ import requests
|
||||
class InstallLog:
|
||||
fileName = "/var/log/installLogs.txt"
|
||||
currentPercent = '10'
|
||||
LogURL = 'https://cloud.cyberpanel.net/servers/RecvData'
|
||||
LogURL = 'https://platform.cyberpersons.com/servers/RecvData'
|
||||
ServerIP = ''
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -86,7 +86,7 @@ if [[ $SERVER_COUNTRY == "CN" ]] ; then
|
||||
#sed -i "${line2}i\ \ \ \ \ \ \ \ command = 'wget cyberpanel.sh/cyberpanel-git.tar.gz'" install.py
|
||||
sed -i 's|wget https://rpms.litespeedtech.com/debian/|wget --no-check-certificate https://rpms.litespeedtech.com/debian/|g' install.py
|
||||
sed -i 's|https://repo.powerdns.com/repo-files/centos-auth-42.repo|https://'$DOWNLOAD_SERVER'/powerdns/powerdns.repo|g' installCyberPanel.py
|
||||
sed -i 's|https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip|https://'$DOWNLOAD_SERVER'/misc/rainloop-community-latest.zip|g' install.py
|
||||
sed -i 's|https://snappymail.eu/repository/latest.tar.gz|https://'$DOWNLOAD_SERVER'/repository/latest.tar.gz|g' install.py
|
||||
|
||||
sed -i 's|rpm -ivh https://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm|curl -o /etc/yum.repos.d/litespeed.repo https://'$DOWNLOAD_SERVER'/litespeed/litespeed.repo|g' install.py
|
||||
|
||||
|
||||
1290
install/venvsetup.sh.bak
Normal file
@@ -259,7 +259,7 @@
|
||||
<div class="card mb-3" style="max-width: 540px;">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img src="/static/images/new-design-list-websites-square.png" alt="..."
|
||||
<img src="{% static 'baseTemplate/images/new-design-list-websites-square.png' %}" alt="..."
|
||||
class="object-fit">
|
||||
</div>
|
||||
<div class="col-md-8 ml-5">
|
||||
@@ -292,7 +292,7 @@
|
||||
<form id="loginForm" action="/" class="col-md-8 col-md-offset-2">
|
||||
<h1 class="text-transform-upr text-center panel-body text-bold"
|
||||
style="padding-bottom: 0px; color: #33CCCC;">
|
||||
<img class="center-block text-center my-20" src="{% static 'images/cyber-panel-logo.svg' %}">
|
||||
<img class="center-block text-center my-20" src="{% static 'baseTemplate/cyber-panel-logo.svg' %}">
|
||||
CyberPanel
|
||||
</h1>
|
||||
<h4 class="text-muted text-center mb-10">Web Hosting Control Panel</h4>
|
||||
@@ -317,7 +317,7 @@
|
||||
<i class="glyph-icon icon-unlock-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<img id="verifyingLogin" class="center-block" src="{% static 'images/loading.gif' %}">
|
||||
<img id="verifyingLogin" class="center-block" src="{% static 'baseTemplate/images/loading.gif' %}">
|
||||
</div>
|
||||
|
||||
<div ng-hide="verifyCode" class="form-group">
|
||||
|
||||
@@ -19,7 +19,7 @@ from django.utils import translation
|
||||
# Create your views here.
|
||||
|
||||
VERSION = '2.3'
|
||||
BUILD = 1
|
||||
BUILD = 2
|
||||
|
||||
|
||||
def verifyLogin(request):
|
||||
|
||||
@@ -183,7 +183,7 @@ class MailServerManager(multi.Thread):
|
||||
checker = 0
|
||||
count = 1
|
||||
for items in emails:
|
||||
dic = {'id': count, 'email': items.email}
|
||||
dic = {'id': count, 'email': items.email, 'DiskUsage': '%sMB' % items.DiskUsage}
|
||||
count = count + 1
|
||||
|
||||
if checker == 0:
|
||||
@@ -543,6 +543,7 @@ class MailServerManager(multi.Thread):
|
||||
|
||||
for items in records:
|
||||
dic = {'email': items.email,
|
||||
'DiskUsage': '%sMB' % items.DiskUsage
|
||||
}
|
||||
|
||||
if checker == 0:
|
||||
@@ -1475,7 +1476,7 @@ milter_default_action = accept
|
||||
command = "chown -R root:root /usr/local/lscp"
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop/data"
|
||||
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/snappymail/data"
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = "chmod 700 /usr/local/CyberCP/cli/cyberPanel.py"
|
||||
|
||||
1713
mailServer/mailserverManager.py.bak
Normal file
@@ -24,6 +24,7 @@ class EUsers(models.Model):
|
||||
email = models.CharField(primary_key=True, max_length=80)
|
||||
password = models.CharField(max_length=200)
|
||||
mail = models.CharField(max_length=200, default='')
|
||||
DiskUsage = models.CharField(max_length=200, default='0')
|
||||
|
||||
|
||||
class Meta:
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="/rainloop/index.php" title="{% trans 'Access Webmail' %}"
|
||||
<a href="/snappymail/index.php" title="{% trans 'Access Webmail' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "Access Webmail" %}
|
||||
|
||||
121
mailServer/templates/mailServer/index.html.bak
Normal file
@@ -0,0 +1,121 @@
|
||||
{% extends "baseTemplate/index.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Mail Functions - CyberPanel" %}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{% load static %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "Mail Functions" %}</h2>
|
||||
<p>{% trans "Manage email accounts on this page." %}</p>
|
||||
</div>
|
||||
|
||||
<div class="panel col-md-12">
|
||||
<div class="panel-body">
|
||||
<h3 class="content-box-header">
|
||||
{% trans "Available Functions" %}
|
||||
</h3>
|
||||
|
||||
<div class="example-box-wrapper">
|
||||
<div class="row">
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="{% url 'createEmailAccount' %}" title="{% trans 'Create Email' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "Create Email" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-plus-square"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="{% url 'listEmails' %}" title="{% trans 'List Emails' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "List Emails" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-plus-square"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="{% url 'deleteEmailAccount' %}" title="{% trans 'Delete Email' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "Delete Email" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-trash"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="{% url 'emailForwarding' %}" title="{% trans 'Email Forwarding' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "Email Forwarding" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-plus-square"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="{% url 'changeEmailAccountPassword' %}" title="{% trans 'Change Password' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "Change Password" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-key"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="{% url 'dkimManager' %}" title="{% trans 'DKIM Manager' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "DKIM Manager" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-key"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 btn-min-width">
|
||||
<a href="/snappymail/index.php" title="{% trans 'Access Webmail' %}"
|
||||
class="tile-box tile-box-shortcut btn-primary">
|
||||
<div class="tile-header">
|
||||
{% trans "Access Webmail" %}
|
||||
</div>
|
||||
<div class="tile-content-wrapper">
|
||||
<i class="fa fa-key"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -163,12 +163,14 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Emails" %}</th>
|
||||
<th>{% trans "Disk Usage" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="record in records track by $index">
|
||||
<td ng-bind="record.email"></td>
|
||||
<td ng-bind="record.DiskUsage"></td>
|
||||
<td>
|
||||
<a data-toggle="modal" data-target="#settings"
|
||||
ng-click="changePasswordInitial(record.email)"
|
||||
|
||||
281
managePHP/php81.xml
Normal file
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" ?>
|
||||
<php>
|
||||
<name>php81</name>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-debuginfo</extensionName>
|
||||
<extensionDescription>Debug information for package lsphp81</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-igbinary-debuginfo</extensionName>
|
||||
<extensionDescription>Debug information for package lsphp81-pecl-igbinary</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-mcrypt-debuginfo</extensionName>
|
||||
<extensionDescription>lsphp81 lsphp81-pecl-mcrypt-debuginfo Extension</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-bcmath</extensionName>
|
||||
<extensionDescription>A extension for PHP applications for using the bcmath library.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-common</extensionName>
|
||||
<extensionDescription>Common files for PHP.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-dba</extensionName>
|
||||
<extensionDescription>A database abstraction layer extension for PHP applications.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-devel</extensionName>
|
||||
<extensionDescription>Files needed for building PHP extensions.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-enchant</extensionName>
|
||||
<extensionDescription>Enchant spelling extension for PHP applications.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-gd</extensionName>
|
||||
<extensionDescription>A extension for PHP applications for using the gd graphics library.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-gmp</extensionName>
|
||||
<extensionDescription>A extension for PHP applications for using the GNU MP library.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-imap</extensionName>
|
||||
<extensionDescription>A extension for PHP applications that use IMAP.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-intl</extensionName>
|
||||
<extensionDescription>Internationalization extension for PHP applications.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-json</extensionName>
|
||||
<extensionDescription>lsphp81 Json PHP Extension</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-ldap</extensionName>
|
||||
<extensionDescription>A extension for PHP applications that use LDAP.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-mbstring</extensionName>
|
||||
<extensionDescription>A extension for PHP applications which need multi-byte string handling.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-mysqlnd</extensionName>
|
||||
<extensionDescription>A extension for PHP applications that use MySQL databases.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-odbc</extensionName>
|
||||
<extensionDescription>A extension for PHP applications that use ODBC databases.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-opcache</extensionName>
|
||||
<extensionDescription>The Zend OPcache.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pdo</extensionName>
|
||||
<extensionDescription>A database access abstraction extension for PHP applications.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pear</extensionName>
|
||||
<extensionDescription>PHP Extension and Application Repository framework.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-apcu</extensionName>
|
||||
<extensionDescription>APC User Cache.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-apcu-devel</extensionName>
|
||||
<extensionDescription>APCu developer files (header).</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-apcu-panel</extensionName>
|
||||
<extensionDescription>APCu control panel.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-igbinary</extensionName>
|
||||
<extensionDescription>Replacement for the standard PHP serializer.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-igbinary-devel</extensionName>
|
||||
<extensionDescription>Igbinary developer files (header).</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-mcrypt</extensionName>
|
||||
<extensionDescription>lsphp81 lsphp81-pecl-mcrypt Extension.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-memcache</extensionName>
|
||||
<extensionDescription>Extension to work with the Memcached caching daemon.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-memcached</extensionName>
|
||||
<extensionDescription>Extension to work with the Memcached caching daemon.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-msgpack</extensionName>
|
||||
<extensionDescription>API for communicating with MessagePack serialization.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-msgpack-devel</extensionName>
|
||||
<extensionDescription>MessagePack developer files (header).</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-redis</extensionName>
|
||||
<extensionDescription>Extension for communicating with the Redis key-value store.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pgsql</extensionName>
|
||||
<extensionDescription>A PostgreSQL database extension for PHP.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-process</extensionName>
|
||||
<extensionDescription>extensions for PHP script using system process interfaces.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pspell</extensionName>
|
||||
<extensionDescription>A extension for PHP applications for using pspell interfaces.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-recode</extensionName>
|
||||
<extensionDescription>A extension for PHP applications for using the recode library.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-snmp</extensionName>
|
||||
<extensionDescription>A extension for PHP applications that query SNMP-managed devices.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-soap</extensionName>
|
||||
<extensionDescription>A extension for PHP applications that use the SOAP protocol.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-tidy</extensionName>
|
||||
<extensionDescription>Standard PHP extension provides tidy library support.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-xml</extensionName>
|
||||
<extensionDescription>A module for PHP applications which use XML.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-xmlrpc</extensionName>
|
||||
<extensionDescription>A extension for PHP applications which use the XML-RPC protocol.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-zip</extensionName>
|
||||
<extensionDescription>ZIP archive management extension for PHP</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-mcrypt</extensionName>
|
||||
<extensionDescription>Standard PHP extension provides mcrypt library support.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-dbg</extensionName>
|
||||
<extensionDescription>php73-dbg lsphp81-package</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-ioncube</extensionName>
|
||||
<extensionDescription>ioncube loaders</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pecl-imagick</extensionName>
|
||||
<extensionDescription>Extension to create and modify images using ImageMagick</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-sodium</extensionName>
|
||||
<extensionDescription>The php-sodium extension provides strong encryption capabilities in an easy and consistent way.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
</php>
|
||||
@@ -297,6 +297,11 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
|
||||
$scope.fetchPHPDetails = function () {
|
||||
var phpSelection = $scope.phpSelection;
|
||||
if (!phpSelection) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
$scope.canNotFetch = true;
|
||||
$scope.detailsSaved = true;
|
||||
@@ -309,8 +314,6 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
url = "/managephp/getCurrentPHPConfig";
|
||||
|
||||
var phpSelection = $scope.phpSelection;
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
};
|
||||
@@ -440,14 +443,16 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
};
|
||||
|
||||
$scope.fetchAdvancePHPDetails = function () {
|
||||
var phpSelection = $scope.phpSelection;
|
||||
if (!phpSelection) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
$scope.savebtnAdvance = true;
|
||||
|
||||
|
||||
url = "/managephp/getCurrentAdvancedPHPConfig";
|
||||
|
||||
var phpSelection = $scope.phpSelection;
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
};
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
<div class="example-box-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
|
||||
<li class="col-md-2 nav-item tab-mod active">
|
||||
<li class="col-md-2 nav-item tab-mod active" ng-click="fetchPHPDetails()">
|
||||
<a href="#tab-example-1" data-toggle="tab" class="h4 nav-link">
|
||||
<i class="fa fa-cog btn-icon"></i>
|
||||
<span>{% trans "Basic" %}</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li class="col-md-2 tab-mod nav-item">
|
||||
<li class="col-md-2 tab-mod nav-item" ng-click="fetchAdvancePHPDetails()">
|
||||
<a href="#tab-example-3" data-toggle="tab" class="h4 nav-link">
|
||||
<i class="fa fa-cogs btn-icon"></i>
|
||||
<span>{% trans "Advanced" %}</span>
|
||||
|
||||
131
managePHP/ubuntuphp81.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" ?>
|
||||
<php>
|
||||
<name>php81</name>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-common</extensionName>
|
||||
<extensionDescription>Most of what you need.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-curl</extensionName>
|
||||
<extensionDescription>Curl (common web tools) required for PHP</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-dbg</extensionName>
|
||||
<extensionDescription>Debugging extension</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-dev</extensionName>
|
||||
<extensionDescription>Development features almost always required.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-imap</extensionName>
|
||||
<extensionDescription>Email extensions for PHP.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-intl</extensionName>
|
||||
<extensionDescription>Extensions for countries other than the U.S.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-json</extensionName>
|
||||
<extensionDescription>PHP extensions for JavaScript Object Notation.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-ldap</extensionName>
|
||||
<extensionDescription>PHP extensions for LDAP (directory access protocol)</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-modules-source</extensionName>
|
||||
<extensionDescription>PHP source modules for virtually everything. Very large.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-mysql</extensionName>
|
||||
<extensionDescription>PHP extension for MySQL or MariaDB databases.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-opcache</extensionName>
|
||||
<extensionDescription>PHP low-level caching of code. Very important for performance.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pgsql</extensionName>
|
||||
<extensionDescription>A PostgreSQL database extension for PHP.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-pspell</extensionName>
|
||||
<extensionDescription>PHP spell checking extensions.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-recode</extensionName>
|
||||
<extensionDescription>PHP extension to transform data between different character sets.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-snmp</extensionName>
|
||||
<extensionDescription>PHP network management extensions.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-sqlite3</extensionName>
|
||||
<extensionDescription>An extension for PHP applications that use the SQLite v3 features.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-sybase</extensionName>
|
||||
<extensionDescription>An extension for PHP applications that use Sybase databases.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-tidy</extensionName>
|
||||
<extensionDescription>PHP extensions for manipulating HTML, XHTML and XML documents.</extensionDescription>
|
||||
<status>1</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-ioncube</extensionName>
|
||||
<extensionDescription>ioncube loaders</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-imagick</extensionName>
|
||||
<extensionDescription>Extension to create and modify images using ImageMagick</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
<extension>
|
||||
<extensionName>lsphp81-sodium</extensionName>
|
||||
<extensionDescription>The php-sodium extension provides strong encryption capabilities in an easy and consistent way.</extensionDescription>
|
||||
<status>0</status>
|
||||
</extension>
|
||||
|
||||
</php>
|
||||
@@ -1237,7 +1237,36 @@ def installExtensions(request):
|
||||
phpExtension.save()
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
newPHP81 = PHP(phpVers="php81")
|
||||
newPHP81.save()
|
||||
|
||||
php81Path = ''
|
||||
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
php81Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php81.xml')
|
||||
else:
|
||||
php81Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp81.xml')
|
||||
|
||||
php81 = ElementTree.parse(php81Path)
|
||||
|
||||
php81Extensions = php81.findall('extension')
|
||||
|
||||
for extension in php81Extensions:
|
||||
extensionName = extension.find('extensionName').text
|
||||
extensionDescription = extension.find('extensionDescription').text
|
||||
status = int(extension.find('status').text)
|
||||
|
||||
phpExtension = installedPackages(phpVers=newPHP81,
|
||||
extensionName=extensionName,
|
||||
description=extensionDescription,
|
||||
status=status)
|
||||
|
||||
phpExtension.save()
|
||||
except:
|
||||
pass
|
||||
|
||||
proc = httpProc(request, 'managePHP/installExtensions.html',
|
||||
{'phps': PHPManager.findPHPVersions()}, 'admin')
|
||||
return proc.render()
|
||||
@@ -1261,34 +1290,71 @@ def getExtensionsInformation(request):
|
||||
data = json.loads(request.body)
|
||||
phpVers = data['phpSelection']
|
||||
|
||||
phpVers = "php" + PHPManager.getPHPString(phpVers)
|
||||
phpVers = f"lsphp{PHPManager.getPHPString(phpVers)}"
|
||||
|
||||
php = PHP.objects.get(phpVers=phpVers)
|
||||
# php = PHP.objects.get(phpVers=phpVers)
|
||||
|
||||
records = php.installedpackages_set.all()
|
||||
if os.path.exists('/etc/lsb-release'):
|
||||
command = f'apt list | grep {phpVers}'
|
||||
else:
|
||||
command = 'yum list installed'
|
||||
resultInstalled = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
command = f'yum list | grep {phpVers} | xargs -n3 | column -t'
|
||||
|
||||
result = ProcessUtilities.outputExecutioner(command).split('\n')
|
||||
|
||||
#records = php.installedpackages_set.all()
|
||||
|
||||
json_data = "["
|
||||
checker = 0
|
||||
counter = 1
|
||||
|
||||
for items in records:
|
||||
for items in result:
|
||||
if os.path.exists('/etc/lsb-release'):
|
||||
if items.find(phpVers) > -1:
|
||||
if items.find('installed') == -1:
|
||||
status = "Not-Installed"
|
||||
else:
|
||||
status = "Installed"
|
||||
|
||||
if items.status == 0:
|
||||
status = "Not-Installed"
|
||||
dic = {'id': counter,
|
||||
'phpVers': phpVers,
|
||||
'extensionName': items.split('/')[0],
|
||||
'description': items,
|
||||
'status': status
|
||||
}
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
checker = 1
|
||||
else:
|
||||
json_data = json_data + ',' + json.dumps(dic)
|
||||
counter += 1
|
||||
else:
|
||||
status = "Installed"
|
||||
ResultExt = items.split(' ')
|
||||
extesnion = ResultExt[0]
|
||||
|
||||
dic = {'id': items.id,
|
||||
'phpVers': items.phpVers.phpVers,
|
||||
'extensionName': items.extensionName,
|
||||
'description': items.description,
|
||||
'status': status
|
||||
}
|
||||
if extesnion.find(phpVers) > -1:
|
||||
if resultInstalled.find(extesnion) == -1:
|
||||
status = "Not-Installed"
|
||||
else:
|
||||
status = "Installed"
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
checker = 1
|
||||
else:
|
||||
json_data = json_data + ',' + json.dumps(dic)
|
||||
dic = {'id': counter,
|
||||
'phpVers': phpVers,
|
||||
'extensionName': extesnion,
|
||||
'description': items,
|
||||
'status': status
|
||||
}
|
||||
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
checker = 1
|
||||
else:
|
||||
json_data = json_data + ',' + json.dumps(dic)
|
||||
counter += 1
|
||||
|
||||
json_data = json_data + ']'
|
||||
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||
@@ -1381,14 +1447,14 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 1
|
||||
ext.save()
|
||||
else:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 1
|
||||
# ext.save()
|
||||
# else:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
@@ -1400,15 +1466,15 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 1
|
||||
ext.save()
|
||||
|
||||
else:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 1
|
||||
# ext.save()
|
||||
#
|
||||
# else:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
@@ -1420,15 +1486,15 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 1
|
||||
ext.save()
|
||||
|
||||
else:
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# if ProcessUtilities.outputExecutioner(checkCommand).find(extensionName) > -1:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 1
|
||||
# ext.save()
|
||||
#
|
||||
# else:
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
@@ -1440,9 +1506,9 @@ def getRequestStatus(request):
|
||||
command = "sudo rm -f " + phpUtilities.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
ext.status = 0
|
||||
ext.save()
|
||||
# ext = installedPackages.objects.get(extensionName=extensionName)
|
||||
# ext.status = 0
|
||||
# ext.save()
|
||||
|
||||
final_json = json.dumps({'finished': 1, 'extensionRequestStatus': 1,
|
||||
'error_message': "None",
|
||||
|
||||
BIN
phpmyadmin.zip
@@ -16,8 +16,8 @@ from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||
from plogical.mysqlUtilities import mysqlUtilities
|
||||
class ClusterManager:
|
||||
|
||||
LogURL = "https://cloud.cyberpanel.net/HighAvailability/RecvData"
|
||||
UptimeURL = "https://cloud.cyberpanel.net/servers/UptimeReport"
|
||||
LogURL = "https://platform.cyberpersons.com/HighAvailability/RecvData"
|
||||
UptimeURL = "https://platform.cyberpersons.com/servers/UptimeReport"
|
||||
ClusterFile = '/home/cyberpanel/cluster'
|
||||
CloudConfig = '/home/cyberpanel/cloud'
|
||||
vhostConfPath = '/usr/local/lsws/conf/vhosts'
|
||||
|
||||
@@ -9,7 +9,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||
|
||||
class UpgradeCyberPanel:
|
||||
|
||||
LogURL = "https://cloud.cyberpanel.net/settings/RecvData"
|
||||
LogURL = "https://platform.cyberpersons.com/settings/RecvData"
|
||||
|
||||
def __init__(self, branch, mail, dns, ftp):
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#!/usr/local/CyberCP/bin/python
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||
import django
|
||||
|
||||
django.setup()
|
||||
from IncBackups.IncBackupsControl import IncJobs
|
||||
from IncBackups.models import BackupJob
|
||||
@@ -22,6 +24,7 @@ import requests
|
||||
import socket
|
||||
from websiteFunctions.models import NormalBackupJobs, NormalBackupJobLogs
|
||||
from boto3.s3.transfer import TransferConfig
|
||||
|
||||
try:
|
||||
from s3Backups.models import BackupPlan, BackupLogs
|
||||
import boto3
|
||||
@@ -63,7 +66,7 @@ class IncScheduler(multi.Thread):
|
||||
tempPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
for job in BackupJob.objects.all():
|
||||
logging.statusWriter(IncScheduler.logPath, 'Job Description:\n\n Destination: %s, Frequency: %s.\n ' % (
|
||||
job.destination, job.frequency), 1)
|
||||
job.destination, job.frequency), 1)
|
||||
if job.frequency == type:
|
||||
for web in job.jobsites_set.all():
|
||||
logging.statusWriter(IncScheduler.logPath, 'Backing up %s.' % (web.website), 1)
|
||||
@@ -129,7 +132,7 @@ class IncScheduler(multi.Thread):
|
||||
web = Websites.objects.get(domain=website)
|
||||
|
||||
message = '[%s Cron] Checking if %s has any pending commits on %s.' % (
|
||||
type, website, time.strftime("%m.%d.%Y_%H-%M-%S"))
|
||||
type, website, time.strftime("%m.%d.%Y_%H-%M-%S"))
|
||||
finalText = '%s\n' % (message)
|
||||
GitLogs(owner=web, type='INFO', message=message).save()
|
||||
|
||||
@@ -148,7 +151,7 @@ class IncScheduler(multi.Thread):
|
||||
data['domain'] = gitConf['domain']
|
||||
data['folder'] = gitConf['folder']
|
||||
data['commitMessage'] = 'Auto commit by CyberPanel %s cron on %s' % (
|
||||
type, time.strftime('%m-%d-%Y_%H-%M-%S'))
|
||||
type, time.strftime('%m-%d-%Y_%H-%M-%S'))
|
||||
|
||||
if gitConf['autoCommit'] == type:
|
||||
|
||||
@@ -182,7 +185,7 @@ class IncScheduler(multi.Thread):
|
||||
finalText = '%s\n%s' % (finalText, message)
|
||||
|
||||
message = '[%s Cron] Finished checking for %s on %s.' % (
|
||||
type, website, time.strftime("%m.%d.%Y_%H-%M-%S"))
|
||||
type, website, time.strftime("%m.%d.%Y_%H-%M-%S"))
|
||||
finalText = '%s\n%s' % (finalText, message)
|
||||
logging.SendEmail(web.adminEmail, web.adminEmail, finalText, 'Git report for %s.' % (web.domain))
|
||||
GitLogs(owner=web, type='INFO', message=message).save()
|
||||
@@ -333,7 +336,7 @@ class IncScheduler(multi.Thread):
|
||||
if retValues[0] == 0:
|
||||
GDriveJobLogs(owner=items, status=backupSchedule.ERROR,
|
||||
message='[ERROR] Backup failed for %s, error: %s moving on..' % (
|
||||
website.domain, retValues[1])).save()
|
||||
website.domain, retValues[1])).save()
|
||||
continue
|
||||
|
||||
completeFileToSend = retValues[1] + ".tar.gz"
|
||||
@@ -380,7 +383,7 @@ class IncScheduler(multi.Thread):
|
||||
|
||||
print("job com[leted")
|
||||
|
||||
#logging.writeToFile('job completed')
|
||||
# logging.writeToFile('job completed')
|
||||
|
||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||
data = {
|
||||
@@ -392,73 +395,72 @@ class IncScheduler(multi.Thread):
|
||||
response = requests.post(url, data=json.dumps(data))
|
||||
Status = response.json()['status']
|
||||
|
||||
if (Status == 1):
|
||||
if (Status == 1) or ProcessUtilities.decideServer() == ProcessUtilities.ent:
|
||||
try:
|
||||
|
||||
page_token = None
|
||||
while True:
|
||||
response = drive.files().list(q="name='%s-%s'" % (items.name,ipAddress),
|
||||
spaces='drive',
|
||||
response = drive.files().list(q="name='%s-%s'" % (items.name, ipAddress),
|
||||
spaces='drive',
|
||||
fields='nextPageToken, files(id, name)',
|
||||
pageToken=page_token).execute()
|
||||
for file in response.get('files', []):
|
||||
# Process change
|
||||
#print('Fetch Main folder ID: %s (%s)' % (file.get('name'), file.get('id')))
|
||||
#logging.writeToFile('Fetch Main folder ID: %s (%s)' % (file.get('name'), file.get('id')))
|
||||
mainfolder_id= file.get('id')
|
||||
# print('Fetch Main folder ID: %s (%s)' % (file.get('name'), file.get('id')))
|
||||
# logging.writeToFile('Fetch Main folder ID: %s (%s)' % (file.get('name'), file.get('id')))
|
||||
mainfolder_id = file.get('id')
|
||||
page_token = response.get('nextPageToken', None)
|
||||
if page_token is None:
|
||||
break
|
||||
#print("new job started ")
|
||||
# print("new job started ")
|
||||
try:
|
||||
page_token = None
|
||||
while True:
|
||||
response = drive.files().list(q="'%s' in parents"%(mainfolder_id),
|
||||
spaces='drive',
|
||||
fields='nextPageToken, files(id, name, createdTime)',
|
||||
pageToken=page_token).execute()
|
||||
response = drive.files().list(q="'%s' in parents" % (mainfolder_id),
|
||||
spaces='drive',
|
||||
fields='nextPageToken, files(id, name, createdTime)',
|
||||
pageToken=page_token).execute()
|
||||
for file in response.get('files', []):
|
||||
# Process change
|
||||
#print('Fetch all folders in main folder: %s (%s) time:-%s' % (file.get('name'), file.get('id'), file.get('createdTime')))
|
||||
#logging.writeToFile('Fetch all folders in main folder: %s (%s) time:-%s' % (file.get('name'), file.get('id'),file.get('createdTime')))
|
||||
# print('Fetch all folders in main folder: %s (%s) time:-%s' % (file.get('name'), file.get('id'), file.get('createdTime')))
|
||||
# logging.writeToFile('Fetch all folders in main folder: %s (%s) time:-%s' % (file.get('name'), file.get('id'),file.get('createdTime')))
|
||||
ab = file.get('createdTime')[:10]
|
||||
filename = file.get('name')
|
||||
fileDeleteID = file.get('id')
|
||||
timestamp = time.mktime(datetime.datetime.strptime(ab,"%Y-%m-%d").timetuple())
|
||||
timestamp = time.mktime(datetime.datetime.strptime(ab, "%Y-%m-%d").timetuple())
|
||||
CUrrenttimestamp = time.time()
|
||||
timerrtention = gDriveData['FileRetentiontime']
|
||||
if(timerrtention == '1d'):
|
||||
if (timerrtention == '1d'):
|
||||
new = CUrrenttimestamp - float(86400)
|
||||
if(new>=timestamp):
|
||||
resp=drive.files().delete(fileId=fileDeleteID).execute()
|
||||
logging.writeToFile('Delete file %s '%filename)
|
||||
elif(timerrtention == '1w'):
|
||||
if (new >= timestamp):
|
||||
resp = drive.files().delete(fileId=fileDeleteID).execute()
|
||||
logging.writeToFile('Delete file %s ' % filename)
|
||||
elif (timerrtention == '1w'):
|
||||
new = CUrrenttimestamp - float(604800)
|
||||
if (new >= timestamp):
|
||||
resp = drive.files().delete(fileId=fileDeleteID).execute()
|
||||
logging.writeToFile('Delete file %s '%filename)
|
||||
logging.writeToFile('Delete file %s ' % filename)
|
||||
elif (timerrtention == '1m'):
|
||||
new = CUrrenttimestamp - float(2592000)
|
||||
if (new >= timestamp):
|
||||
resp = drive.files().delete(fileId=fileDeleteID).execute()
|
||||
logging.writeToFile('Delete file %s '%filename)
|
||||
logging.writeToFile('Delete file %s ' % filename)
|
||||
elif (timerrtention == '6m'):
|
||||
new = CUrrenttimestamp - float(15552000)
|
||||
if (new >= timestamp):
|
||||
resp = drive.files().delete(fileId=fileDeleteID).execute()
|
||||
logging.writeToFile('Delete file %s '%filename)
|
||||
logging.writeToFile('Delete file %s ' % filename)
|
||||
page_token = response.get('nextPageToken', None)
|
||||
if page_token is None:
|
||||
break
|
||||
|
||||
# logging.writeToFile('Createtime list - %s'%Createtime)
|
||||
# logging.writeToFile('Createtime list - %s'%Createtime)
|
||||
|
||||
except BaseException as msg:
|
||||
print('An error occurred fetch child: %s' % msg)
|
||||
logging.writeToFile('An error occurred fetch child: %s' % msg)
|
||||
|
||||
print('An error occurred fetch child: %s' % msg)
|
||||
logging.writeToFile('An error occurred fetch child: %s' % msg)
|
||||
except BaseException as msg:
|
||||
logging.writeToFile('job not completed [ERROR:]..%s'%msg)
|
||||
logging.writeToFile('job not completed [ERROR:]..%s' % msg)
|
||||
|
||||
except BaseException as msg:
|
||||
GDriveJobLogs(owner=items, status=backupSchedule.ERROR,
|
||||
@@ -521,7 +523,7 @@ class IncScheduler(multi.Thread):
|
||||
NormalBackupJobLogs.objects.filter(owner=backupjob).delete()
|
||||
NormalBackupJobLogs(owner=backupjob, status=backupSchedule.INFO,
|
||||
message='Starting %s backup on %s..' % (
|
||||
type, time.strftime("%m.%d.%Y_%H-%M-%S"))).save()
|
||||
type, time.strftime("%m.%d.%Y_%H-%M-%S"))).save()
|
||||
|
||||
if oldJobContinue:
|
||||
NormalBackupJobLogs(owner=backupjob, status=backupSchedule.INFO,
|
||||
@@ -877,6 +879,15 @@ Automatic backup failed for %s on %s.
|
||||
except:
|
||||
config = {}
|
||||
|
||||
eDomains = website.domains_set.all()
|
||||
|
||||
for eDomain in eDomains:
|
||||
for email in eDomain.eusers_set.all():
|
||||
emailPath = '/home/vmail/%s/%s' % (website.domain, email.email.split('@')[0])
|
||||
email.DiskUsage = virtualHostUtilities.getDiskUsageofPath(emailPath)
|
||||
email.save()
|
||||
print('Disk Usage of %s is %s' % (email.email, email.DiskUsage))
|
||||
|
||||
config['DiskUsage'], config['DiskUsagePercentage'] = virtualHostUtilities.getDiskUsage(
|
||||
"/home/" + website.domain, website.package.diskSpace)
|
||||
|
||||
@@ -935,19 +946,420 @@ Automatic backup failed for %s on %s.
|
||||
|
||||
if config['pluginUpdates'] == 'Enabled':
|
||||
command = 'wp plugin update --all --minor --allow-root --path=/home/%s/public_html' % (
|
||||
config['domainName'])
|
||||
config['domainName'])
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
### Themes, for plugins we will do minor updates only.
|
||||
|
||||
if config['themeUpdates'] == 'Enabled':
|
||||
command = 'wp theme update --all --minor --allow-root --path=/home/%s/public_html' % (
|
||||
config['domainName'])
|
||||
config['domainName'])
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
except BaseException as msg:
|
||||
logging.writeToFile('%s. [WPUpdates:767]' % (str(msg)))
|
||||
|
||||
@staticmethod
|
||||
def RemoteBackup(function):
|
||||
try:
|
||||
from websiteFunctions.models import RemoteBackupSchedule, RemoteBackupsites, WPSites
|
||||
from loginSystem.models import Administrator
|
||||
import json
|
||||
import time
|
||||
from plogical.applicationInstaller import ApplicationInstaller
|
||||
for config in RemoteBackupSchedule.objects.all():
|
||||
try:
|
||||
configbakup = json.loads(config.config)
|
||||
backuptype = configbakup['BackupType']
|
||||
if backuptype == 'Only DataBase':
|
||||
Backuptype = "3"
|
||||
elif backuptype == 'Only Website':
|
||||
Backuptype = "2"
|
||||
else:
|
||||
Backuptype = "1"
|
||||
except:
|
||||
continue
|
||||
try:
|
||||
allRemoteBackupsiteobj = RemoteBackupsites.objects.filter(owner=config.pk)
|
||||
for i in allRemoteBackupsiteobj:
|
||||
backupsiteID = i.WPsites
|
||||
wpsite = WPSites.objects.get(pk=backupsiteID)
|
||||
AdminID = wpsite.owner.admin_id
|
||||
Admin = Administrator.objects.get(pk=AdminID)
|
||||
|
||||
Lastrun = config.lastrun
|
||||
Currenttime = float(time.time())
|
||||
|
||||
if config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(1800)
|
||||
#if float(al) >= float(Lastrun):
|
||||
#if 1 == 1:
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = config.RemoteBackupConfig.configtype
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(3600)
|
||||
#if float(al) >= float(Lastrun):
|
||||
# if 1 == 1:
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = config.RemoteBackupConfig.configtype
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(21600)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = "SFTP"
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(43200)
|
||||
#if float(al) >= float(Lastrun):
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = "SFTP"
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(86400)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = "SFTP"
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(259200)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = "SFTP"
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(604800)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
extraArgs['Backuptype'] = Backuptype
|
||||
extraArgs['BackupDestination'] = "SFTP"
|
||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||
status, msg, backupID = background.WPCreateBackup()
|
||||
if status == 1:
|
||||
filename = msg
|
||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||
config.id)
|
||||
command = f"rm -r {filename}"
|
||||
ProcessUtilities.executioner(command)
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
except BaseException as msg:
|
||||
print("Error in Sites:%s" % str(msg))
|
||||
continue
|
||||
except BaseException as msg:
|
||||
print("Error: [RemoteBackup]: %s" % str(msg))
|
||||
logging.writeToFile('%s. [RemoteBackup]' % (str(msg)))
|
||||
|
||||
@staticmethod
|
||||
def SendTORemote(FileName, RemoteBackupID):
|
||||
import pysftp
|
||||
import json
|
||||
import pysftp as sftp
|
||||
from websiteFunctions.models import RemoteBackupConfig
|
||||
|
||||
try:
|
||||
RemoteBackupOBJ = RemoteBackupConfig.objects.get(pk=RemoteBackupID)
|
||||
config = json.loads(RemoteBackupOBJ.config)
|
||||
HostName = config['Hostname']
|
||||
Username = config['Username']
|
||||
Password = config['Password']
|
||||
Path = config['Path']
|
||||
|
||||
cnopts = sftp.CnOpts()
|
||||
cnopts.hostkeys = None
|
||||
|
||||
with pysftp.Connection(HostName, username=Username, password=Password, cnopts=cnopts) as sftp:
|
||||
print("Connection succesfully stablished ... ")
|
||||
|
||||
try:
|
||||
with sftp.cd(Path):
|
||||
sftp.put(FileName)
|
||||
except:
|
||||
sftp.mkdir(Path)
|
||||
with sftp.cd(Path):
|
||||
sftp.put(FileName)
|
||||
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
logging.writeToFile('%s. [SendTORemote]' % (str(msg)))
|
||||
|
||||
@staticmethod
|
||||
def SendToS3Cloud(FileName, RemoteBackupCofigID, backupID, scheduleID):
|
||||
import boto3
|
||||
import json
|
||||
import time
|
||||
from websiteFunctions.models import RemoteBackupConfig, WPSitesBackup, RemoteBackupSchedule
|
||||
import plogical.randomPassword as randomPassword
|
||||
try:
|
||||
print("UPloading to S3")
|
||||
Backupobj = WPSitesBackup.objects.get(pk=backupID)
|
||||
backupConfig = json.loads(Backupobj.config)
|
||||
websitedomain = backupConfig['WebDomain']
|
||||
RemoteBackupOBJ = RemoteBackupConfig.objects.get(pk=RemoteBackupCofigID)
|
||||
config = json.loads(RemoteBackupOBJ.config)
|
||||
provider = config['Provider']
|
||||
if provider == "Backblaze":
|
||||
EndURl = config['EndUrl']
|
||||
elif provider == "Amazon":
|
||||
EndURl = "https://s3.us-east-1.amazonaws.com"
|
||||
elif provider == "Wasabi":
|
||||
EndURl = "https://s3.wasabisys.com"
|
||||
|
||||
AccessKey = config['AccessKey']
|
||||
SecertKey = config['SecertKey']
|
||||
|
||||
session = boto3.session.Session()
|
||||
|
||||
client = session.client(
|
||||
's3',
|
||||
endpoint_url=EndURl,
|
||||
aws_access_key_id=AccessKey,
|
||||
aws_secret_access_key=SecertKey,
|
||||
verify=False
|
||||
)
|
||||
|
||||
# ############Creating Bucket
|
||||
# BucketName = randomPassword.generate_pass().lower()
|
||||
# print("BucketName...%s"%BucketName)
|
||||
#
|
||||
# try:
|
||||
# client.create_bucket(Bucket=BucketName)
|
||||
# except BaseException as msg:
|
||||
# print("Error in Creating bucket...: %s" % str(msg))
|
||||
# logging.writeToFile("Create bucket error---%s:" % str(msg))
|
||||
|
||||
|
||||
####getting Bucket from backup schedule
|
||||
Scheduleobj = RemoteBackupSchedule.objects.get(pk=scheduleID)
|
||||
Scheduleconfig = json.loads(Scheduleobj.config)
|
||||
BucketName = Scheduleconfig['BucketName']
|
||||
#####Uploading File
|
||||
|
||||
uploadfilename = 'backup-' + websitedomain + "-" + time.strftime("%m.%d.%Y_%H-%M-%S")
|
||||
print("uploadfilename....%s"%uploadfilename)
|
||||
|
||||
try:
|
||||
res = client.upload_file(Filename=FileName, Bucket=BucketName, Key=uploadfilename)
|
||||
print("res of Uploading...: %s" % res)
|
||||
|
||||
except BaseException as msg:
|
||||
print("Error in Uploading...: %s" % msg)
|
||||
|
||||
###################### version id, this only applied to blackbaze
|
||||
try:
|
||||
|
||||
s3 = boto3.resource(
|
||||
's3',
|
||||
endpoint_url=EndURl,
|
||||
aws_access_key_id=AccessKey,
|
||||
aws_secret_access_key=SecertKey,
|
||||
)
|
||||
|
||||
bucket = BucketName
|
||||
key = uploadfilename
|
||||
versions = s3.Bucket(bucket).object_versions.filter(Prefix=key)
|
||||
data = {}
|
||||
|
||||
for version in versions:
|
||||
obj = version.get()
|
||||
print("VersionId---%s:" % obj.get('VersionId'))
|
||||
data['backupVersionId'] = obj.get('VersionId')
|
||||
|
||||
ab = os.path.getsize(FileName)
|
||||
filesize = float(ab) / 1024.0
|
||||
|
||||
backupConfig['uploadfilename'] = uploadfilename
|
||||
backupConfig['backupVersionId'] = data['backupVersionId']
|
||||
backupConfig['BucketName'] = BucketName
|
||||
backupConfig['Uplaodingfilesize'] = filesize
|
||||
Backupobj.config = json.dumps(backupConfig)
|
||||
Backupobj.save()
|
||||
|
||||
except BaseException as msg:
|
||||
print("Version ID Error: %s"%str(msg))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
print('%s. [SendToS3Cloud]' % (str(msg)))
|
||||
logging.writeToFile('%s. [SendToS3Cloud]' % (str(msg)))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='CyberPanel Installer')
|
||||
@@ -955,6 +1367,10 @@ def main():
|
||||
parser.add_argument('--planName', help='Plan name for AWS!')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.function == '30 Minutes' or args.function == '30 Minutes' or args.function == '1 Hour' or args.function == '6 Hours' or args.function == '12 Hours' or args.function == '1 Day' or args.function == '3 Days' or args.function == '1 Week':
|
||||
IncScheduler.RemoteBackup(args.function)
|
||||
return 0
|
||||
|
||||
if args.function == 'forceRunAWSBackup':
|
||||
IncScheduler.forceRunAWSBackup(args.planName)
|
||||
return 0
|
||||
@@ -970,12 +1386,15 @@ def main():
|
||||
###
|
||||
|
||||
IncScheduler.startBackup(args.function)
|
||||
|
||||
IncScheduler.runGoogleDriveBackups(args.function)
|
||||
IncScheduler.git(args.function)
|
||||
IncScheduler.checkDiskUsage()
|
||||
IncScheduler.startNormalBackups(args.function)
|
||||
IncScheduler.runAWSBackups(args.function)
|
||||
|
||||
ib.join()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -18,6 +18,7 @@ from shlex import split
|
||||
from .CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||
from dockerManager.models import Containers
|
||||
from re import compile
|
||||
|
||||
class ACLManager:
|
||||
|
||||
|
||||
@@ -542,6 +543,32 @@ class ACLManager:
|
||||
|
||||
return websiteNames
|
||||
|
||||
@staticmethod
|
||||
def getPHPString(phpVersion):
|
||||
|
||||
if phpVersion == "PHP 5.3":
|
||||
php = "53"
|
||||
elif phpVersion == "PHP 5.4":
|
||||
php = "54"
|
||||
elif phpVersion == "PHP 5.5":
|
||||
php = "55"
|
||||
elif phpVersion == "PHP 5.6":
|
||||
php = "56"
|
||||
elif phpVersion == "PHP 7.0":
|
||||
php = "70"
|
||||
elif phpVersion == "PHP 7.1":
|
||||
php = "71"
|
||||
elif phpVersion == "PHP 7.2":
|
||||
php = "72"
|
||||
elif phpVersion == "PHP 7.3":
|
||||
php = "73"
|
||||
elif phpVersion == "PHP 7.4":
|
||||
php = "74"
|
||||
elif phpVersion == "PHP 8.0":
|
||||
php = "80"
|
||||
|
||||
return php
|
||||
|
||||
@staticmethod
|
||||
def searchWebsiteObjects(currentACL, userID, searchTerm):
|
||||
|
||||
@@ -615,7 +642,7 @@ class ACLManager:
|
||||
doms = items.websites_set.all().order_by('domain')
|
||||
for dom in doms:
|
||||
domainsList.append(dom.domain)
|
||||
for childs in items.childdomains_set.all():
|
||||
for childs in dom.childdomains_set.all():
|
||||
domainsList.append(childs.domain)
|
||||
|
||||
return domainsList
|
||||
@@ -646,6 +673,7 @@ class ACLManager:
|
||||
@staticmethod
|
||||
def checkOwnership(domain, admin, currentACL):
|
||||
|
||||
|
||||
try:
|
||||
childDomain = ChildDomains.objects.get(domain=domain)
|
||||
|
||||
@@ -891,4 +919,59 @@ class ACLManager:
|
||||
else:
|
||||
dic['dnsAsWhole'] = 0
|
||||
|
||||
@staticmethod
|
||||
def GetALLWPObjects(currentACL, userID):
|
||||
from websiteFunctions.models import WPSites
|
||||
|
||||
wpsites = WPSites.objects.none()
|
||||
websites = ACLManager.findWebsiteObjects(currentACL, userID)
|
||||
|
||||
for website in websites:
|
||||
wpsites |= website.wpsites_set.all()
|
||||
|
||||
return wpsites
|
||||
|
||||
@staticmethod
|
||||
def GetServerIP():
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
ipData = f.read()
|
||||
return ipData.split('\n', 1)[0]
|
||||
|
||||
@staticmethod
|
||||
def CheckForPremFeature(feature):
|
||||
try:
|
||||
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.ent:
|
||||
return 1
|
||||
|
||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||
data = {
|
||||
"name": feature,
|
||||
"IP": ACLManager.GetServerIP()
|
||||
}
|
||||
|
||||
import requests
|
||||
response = requests.post(url, data=json.dumps(data))
|
||||
return response.json()['status']
|
||||
except:
|
||||
return 1
|
||||
|
||||
@staticmethod
|
||||
def CheckIPBackupObjectOwner(currentACL, backupobj, user):
|
||||
if currentACL['admin'] == 1:
|
||||
return 1
|
||||
elif backupobj.owner == user:
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def CheckIPPluginObjectOwner(currentACL, backupobj, user):
|
||||
if currentACL['admin'] == 1:
|
||||
return 1
|
||||
elif backupobj.owner == user:
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from packages.models import Package
|
||||
from baseTemplate.models import version
|
||||
|
||||
VERSION = '2.3'
|
||||
BUILD = 1
|
||||
BUILD = 2
|
||||
|
||||
if not os.geteuid() == 0:
|
||||
sys.exit("\nOnly root can run this script\n")
|
||||
|
||||