diff --git a/CLScript/CloudLinuxDomains.py b/CLScript/CloudLinuxDomains.py index 8f0355394..e9d8b2811 100755 --- a/CLScript/CloudLinuxDomains.py +++ b/CLScript/CloudLinuxDomains.py @@ -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() + diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index 0766e95b6..3627950c6 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -77,7 +77,7 @@ - {% with version="2.3.5.2" %} + {% with version="2.3.5.3" %} diff --git a/baseTemplate/templates/baseTemplate/versionManagment.html b/baseTemplate/templates/baseTemplate/versionManagment.html index 933030bf2..59c9ed28f 100755 --- a/baseTemplate/templates/baseTemplate/versionManagment.html +++ b/baseTemplate/templates/baseTemplate/versionManagment.html @@ -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) { diff --git a/cyberpanel.sh b/cyberpanel.sh index 51bac4176..3a3e2cbe4 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -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 </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 </etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo #[powertools-for-cyberpanel] diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index ae70929f6..9643ea94f 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -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' diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index c4aa2e1d2..36c79021b 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -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: diff --git a/plogical/DockerSites.py b/plogical/DockerSites.py index a58c0ee56..d1c8556bc 100644 --- a/plogical/DockerSites.py +++ b/plogical/DockerSites.py @@ -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': diff --git a/plogical/csf.py b/plogical/csf.py index a2eca9ff0..f0fc56ffa 100755 --- a/plogical/csf.py +++ b/plogical/csf.py @@ -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] != '#'): diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index 17ba04849..a12378e29 100644 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -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 #### diff --git a/websiteFunctions/templates/websiteFunctions/createDomain.html b/websiteFunctions/templates/websiteFunctions/createDomain.html index 80914250c..580ae961c 100755 --- a/websiteFunctions/templates/websiteFunctions/createDomain.html +++ b/websiteFunctions/templates/websiteFunctions/createDomain.html @@ -93,11 +93,14 @@
-

{% trans "Create Sub/Addon Domain" %}

+

{% trans "Create Sub/Addon Domain" %} - {% trans "Learn about Sub/Addon Domains" %}

{% trans "Create Sub/Addon domains. " %}

-