mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-04 03:10:44 +01:00
Merge branch 'v2.3.5' into v3.0.0-dev
This commit is contained in:
@@ -17,10 +17,11 @@ from CLScript.CLMain import CLMain
|
||||
|
||||
class CloudLinuxDomains(CLMain):
|
||||
|
||||
def __init__(self, name, owner):
|
||||
def __init__(self, name, owner, with_php):
|
||||
CLMain.__init__(self)
|
||||
self.owner = owner
|
||||
self.name = name
|
||||
self.with_php = with_php
|
||||
|
||||
def listAll(self):
|
||||
data = {}
|
||||
@@ -47,16 +48,20 @@ class CloudLinuxDomains(CLMain):
|
||||
print(json.dumps(final))
|
||||
|
||||
|
||||
import argparse
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='CyberPanel CloudLinux Manager')
|
||||
parser.add_argument('-o', '--owner', help='Owner')
|
||||
parser.add_argument('-n', '--name', help='Owner')
|
||||
parser.add_argument('-p', '--with-php', help='False (X-Ray support only)')
|
||||
parser.add_argument('-p', '--with-php', action='store_true', help='False (X-Ray support only)')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
pi = CloudLinuxDomains(args.name, args.owner)
|
||||
# Assuming CloudLinuxDomains class exists
|
||||
pi = CloudLinuxDomains(args.name, args.owner, args.with_php)
|
||||
try:
|
||||
pi.listAll()
|
||||
except:
|
||||
pi.listAll()
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<!-- HELPERS -->
|
||||
|
||||
{% with version="2.3.5.2" %}
|
||||
{% with version="2.3.5.3" %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/assets/finalBase/finalBase.css' %}">
|
||||
|
||||
|
||||
@@ -119,12 +119,16 @@
|
||||
// Function to populate the branch dropdown
|
||||
function populateBranches(branches) {
|
||||
var branchSelect = document.getElementById("branchSelect");
|
||||
branches.forEach((branch) => {
|
||||
for (let i = branches.length - 1; i >= 0; i--) {
|
||||
const branch = branches[i];
|
||||
var option = document.createElement("option");
|
||||
option.value = branch;
|
||||
option.text = branch;
|
||||
branchSelect.appendChild(option);
|
||||
});
|
||||
if (branch.startsWith("v") && branch.indexOf("dev") === -1 && branch.indexOf("version-counter") === -1) {
|
||||
branchSelect.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getBranches(url, branches, page) {
|
||||
|
||||
@@ -863,6 +863,15 @@ EOF
|
||||
|
||||
dnf config-manager --set-enabled PowerTools > /dev/null 2>&1
|
||||
dnf config-manager --set-enabled powertools > /dev/null 2>&1
|
||||
|
||||
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
|
||||
[mariadb]
|
||||
name = MariaDB
|
||||
baseurl = https://rpm.mariadb.org/10.6/rhel/\$releasever/\$basearch
|
||||
gpgkey= https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||
gpgcheck=1
|
||||
EOF
|
||||
|
||||
|
||||
# cat <<EOF >/etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo
|
||||
#[powertools-for-cyberpanel]
|
||||
|
||||
@@ -37,6 +37,16 @@ def get_Ubuntu_release():
|
||||
return release
|
||||
|
||||
|
||||
def FetchCloudLinuxVersion():
|
||||
if os.path.exists('/etc/os-release'):
|
||||
data = open('/etc/os-release', 'r').read()
|
||||
if (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (data.find('8.9') > -1 or data.find('Anatoly Levchenko') > -1):
|
||||
return 89
|
||||
elif (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (data.find('8.8') > -1 or data.find('Anatoly Filipchenko') > -1):
|
||||
return 88
|
||||
else:
|
||||
return -1
|
||||
|
||||
class InstallCyberPanel:
|
||||
mysql_Root_password = ""
|
||||
mysqlPassword = ""
|
||||
@@ -349,17 +359,32 @@ gpgcheck=1
|
||||
command = 'dnf install mariadb-server -y'
|
||||
elif self.distro == cent8 or self.distro == openeuler:
|
||||
|
||||
command = 'curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.11'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
if FetchCloudLinuxVersion() >= 88:
|
||||
repo = '/etc/yum.repos.d/mariadb.repo'
|
||||
repoContent = '''
|
||||
[mariadb]
|
||||
name = MariaDB
|
||||
baseurl = https://rpm.mariadb.org/10.6/rhel/$releasever/$basearch
|
||||
gpgkey= https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||
gpgcheck=1
|
||||
'''
|
||||
WriteToFile = open(repo, 'w')
|
||||
WriteToFile.write(repoContent)
|
||||
WriteToFile.close()
|
||||
|
||||
command = 'yum remove mariadb* -y'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
else:
|
||||
|
||||
command = 'sudo dnf -qy module disable mariadb'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
command = 'curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.11'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
|
||||
command = 'sudo dnf module reset mariadb -y'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
command = 'yum remove mariadb* -y'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
|
||||
command = 'sudo dnf -qy module disable mariadb'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
|
||||
command = 'sudo dnf module reset mariadb -y'
|
||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
|
||||
|
||||
|
||||
command = 'dnf install MariaDB-server MariaDB-client MariaDB-backup -y'
|
||||
|
||||
@@ -542,7 +542,7 @@ class MailServerManager(multi.Thread):
|
||||
|
||||
for items in records:
|
||||
dic = {'email': items.email,
|
||||
'DiskUsage': '%sMB' % items.DiskUsage
|
||||
'DiskUsage': '%sMB' % items.DiskUsage.rstrip('MB')
|
||||
}
|
||||
|
||||
if checker == 0:
|
||||
|
||||
@@ -3,6 +3,8 @@ import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from random import randint
|
||||
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
|
||||
try:
|
||||
@@ -44,6 +46,60 @@ class Docker_Sites(multi.Thread):
|
||||
except:
|
||||
pass
|
||||
|
||||
command = 'cat /etc/csf/csf.conf'
|
||||
result = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
if result.find('SECTION:Initial Settings') > -1:
|
||||
|
||||
from plogical.csf import CSF
|
||||
from plogical.virtualHostUtilities import virtualHostUtilities
|
||||
currentSettings = CSF.fetchCSFSettings()
|
||||
|
||||
tcpIN = currentSettings['tcpIN']
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.writeToFile(f'TCPIN docker: {tcpIN}')
|
||||
|
||||
|
||||
|
||||
if tcpIN.find('8088') == -1:
|
||||
|
||||
ports = f'{tcpIN},8088'
|
||||
|
||||
portsPath = '/home/cyberpanel/' + str(randint(1000, 9999))
|
||||
|
||||
if os.path.exists(portsPath):
|
||||
os.remove(portsPath)
|
||||
|
||||
writeToFile = open(portsPath, 'w')
|
||||
writeToFile.write(ports)
|
||||
writeToFile.close()
|
||||
|
||||
execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/csf.py"
|
||||
execPath = execPath + f" modifyPorts --protocol TCP_IN --ports " + portsPath
|
||||
ProcessUtilities.executioner(execPath)
|
||||
|
||||
tcpOUT = currentSettings['tcpOUT']
|
||||
if tcpOUT.find('8088') == -1:
|
||||
|
||||
ports = f'{tcpOUT},8088'
|
||||
|
||||
portsPath = '/home/cyberpanel/' + str(randint(1000, 9999))
|
||||
|
||||
if os.path.exists(portsPath):
|
||||
os.remove(portsPath)
|
||||
|
||||
writeToFile = open(portsPath, 'w')
|
||||
writeToFile.write(ports)
|
||||
writeToFile.close()
|
||||
|
||||
execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/csf.py"
|
||||
execPath = execPath + f" modifyPorts --protocol TCP_OUT --ports " + portsPath
|
||||
ProcessUtilities.executioner(execPath)
|
||||
|
||||
|
||||
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
if self.function_run == 'DeployWPContainer':
|
||||
|
||||
@@ -160,10 +160,10 @@ def configservercsfiframe(request):
|
||||
for items in data:
|
||||
if items.find('TCP_IN') > -1 and items.find('=') > -1 and (items[0] != '#'):
|
||||
writeToConf.writelines(
|
||||
'TCP_IN = "20,21,22,25,53,80,110,995,143,443,465,587,993,995,1025,7080,8090,40110:40210"\n')
|
||||
'TCP_IN = "20,21,22,25,53,80,110,995,143,443,465,587,993,995,1025,7080,8090,40110:40210,8088,5678"\n')
|
||||
elif items.find('TCP_OUT') > -1 and items.find('=') > -1 and (items[0] != '#'):
|
||||
writeToConf.writelines(
|
||||
'TCP_OUT = "20,21,22,25,43,53,80,110,113,443,587,993,995,8090,40110:40210"\n')
|
||||
'TCP_OUT = "20,21,22,25,43,53,80,110,113,443,587,993,995,8090,40110:40210,8088,5678"\n')
|
||||
elif items.find('UDP_IN') > -1 and items.find('=') > -1 and (items[0] != '#'):
|
||||
writeToConf.writelines('UDP_IN = "20,21,53,443"\n')
|
||||
elif items.find('UDP_OUT') > -1 and items.find('=') > -1 and (items[0] != '#'):
|
||||
|
||||
@@ -76,12 +76,17 @@ class virtualHostUtilities:
|
||||
except:
|
||||
CurrentHostName = ''
|
||||
|
||||
if not skipRDNSCheck:
|
||||
if not os.path.exists('/home/cyberpanel/postfix'):
|
||||
if skipRDNSCheck:
|
||||
pass
|
||||
else:
|
||||
if os.path.exists('/home/cyberpanel/postfix'):
|
||||
pass
|
||||
else:
|
||||
message = 'This server does not come with postfix installed. [404]'
|
||||
print(message)
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, message)
|
||||
logging.CyberCPLogFileWriter.writeToFile(message)
|
||||
return 0
|
||||
|
||||
|
||||
####
|
||||
|
||||
@@ -93,11 +93,14 @@
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "Create Sub/Addon Domain" %}</h2>
|
||||
<h2>{% trans "Create Sub/Addon Domain" %} - <a target="_blank"
|
||||
href="https://cyberpanel.net/KnowledgeBase/home/create-sub-addon-domain/"
|
||||
style="height: 23px;line-height: 21px;"
|
||||
class="btn btn-border btn-alt border-red btn-link font-red"
|
||||
title=""><span>{% trans "Learn about Sub/Addon Domains" %}</span></a></h2>
|
||||
<p>{% trans "Create Sub/Addon domains. " %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-controller="websitePages" class="panel">
|
||||
<div class="panel-body">
|
||||
<h3 class="content-box-header">
|
||||
|
||||
Reference in New Issue
Block a user