diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index cb5181209..cb5b75580 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -77,7 +77,7 @@ - {% with version="2.3.4.3" %} + {% with version="2.3.4.5" %} diff --git a/cloudAPI/cloudManager.py b/cloudAPI/cloudManager.py index ebb6b5f6b..a62696ac1 100755 --- a/cloudAPI/cloudManager.py +++ b/cloudAPI/cloudManager.py @@ -2832,6 +2832,9 @@ class CloudManager: command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + ## ipFile = "/etc/cyberpanel/machineIP" @@ -2852,6 +2855,9 @@ class CloudManager: command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + for website in Websites.objects.all(): import tldextract extractDomain = tldextract.extract(website.domain) @@ -2897,6 +2903,9 @@ class CloudManager: command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + from websiteFunctions.models import ChildDomains for website in ChildDomains.objects.all(): diff --git a/install/install.py b/install/install.py index 1ab1b78ef..8fe180987 100755 --- a/install/install.py +++ b/install/install.py @@ -1872,7 +1872,7 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout'; 0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py hourlyCleanup >/dev/null 2>&1 0 0 1 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup >/dev/null 2>&1 0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/upgradeCritical.py >/dev/null 2>&1 -0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 +0 0 * * 4 /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 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 diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index 66249eb2a..d4c852494 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -665,6 +665,9 @@ class MailServerManager(multi.Thread): command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + import tldextract extractDomain = tldextract.extract(domainName) @@ -730,6 +733,9 @@ class MailServerManager(multi.Thread): command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + import tldextract extractDomain = tldextract.extract(domainName) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index ac6c3cace..eff196b29 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -1389,11 +1389,6 @@ Automatic backup failed for %s on %s. print('%s. [SendToS3Cloud]' % (str(msg))) logging.writeToFile('%s. [SendToS3Cloud]' % (str(msg))) - @staticmethod - def FixMailSSL(): - for website in Websites.objects.all(): - virtualHostUtilities.setupAutoDiscover(1, '/home/cyberpanel/templogs', website.domain, website.admin) - @staticmethod def v2Backups(function): try: diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 9138f4967..93793add5 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -31,7 +31,7 @@ class ApplicationInstaller(multi.Thread): LOCALHOST = 'localhost' REMOTE = 0 PORT = '3306' - MauticVersion = '4.4.0' + MauticVersion = '4.4.9' PrestaVersion = '1.7.8.3' def __init__(self, installApp, extraArgs): @@ -99,14 +99,34 @@ class ApplicationInstaller(multi.Thread): password = self.extraArgs['password'] email = self.extraArgs['email'] - FNULL = open(os.devnull, 'w') - ## Open Status File statusFile = open(tempStatusPath, 'w') statusFile.writelines('Setting up paths,0') statusFile.close() + + ### lets first find php path + + from plogical.phpUtilities import phpUtilities + + vhFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf' + + phpPath = phpUtilities.GetPHPVersionFromFile(vhFile) + + ### basically for now php 8.0 is being checked + + if not os.path.exists(phpPath): + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('PHP 8.0 missing installing now..,20') + statusFile.close() + phpUtilities.InstallSaidPHP('80') + + + FNULL = open(os.devnull, 'w') + + + finalPath = '' self.permPath = '' @@ -242,7 +262,7 @@ $parameters = array( command = 'cp %s %s/app/config/local.php' % (localDB, finalPath) ProcessUtilities.executioner(command, externalApp) - command = "/usr/local/lsws/lsphp80/bin/php bin/console mautic:install http://%s -f" % (finalURL) + command = f"{phpPath} bin/console mautic:install http://%s -f" % (finalURL) result = ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath) if result.find('Install complete') == -1: @@ -528,6 +548,32 @@ $parameters = array( statusFile.writelines('Setting up paths,0') statusFile.close() + #### Before installing wordpress change php to 8.0 + + from plogical.virtualHostUtilities import virtualHostUtilities + + completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf' + + execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py" + execPath = execPath + " changePHP --phpVersion 'PHP 8.0' --path " + completePathToConfigFile + ProcessUtilities.executioner(execPath) + + ### lets first find php path + + from plogical.phpUtilities import phpUtilities + + vhFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf' + + phpPath = phpUtilities.GetPHPVersionFromFile(vhFile) + + ### basically for now php 8.0 is being checked + + if not os.path.exists(phpPath): + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('PHP 8.0 missing installing now..,20') + statusFile.close() + phpUtilities.InstallSaidPHP('80') + finalPath = '' self.permPath = '' @@ -584,8 +630,8 @@ $parameters = array( dbName, dbUser, dbPassword = self.dbCreation(tempStatusPath, website) self.permPath = '/home/%s/public_html' % (website.domain) - php = PHPManager.getPHPString(website.phpSelection) - FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + #php = PHPManager.getPHPString(website.phpSelection) + FinalPHPPath = phpPath ## Security Check diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index 0ed38152b..25ab026a4 100755 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -120,6 +120,9 @@ class DNS: command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + import tldextract extractDomain = tldextract.extract(domain) @@ -526,6 +529,9 @@ class DNS: command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + import tldextract extractDomain = tldextract.extract(domain) diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index 2954cfc09..b4a69ce0d 100755 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -314,6 +314,9 @@ class mailUtilities: command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' ProcessUtilities.executioner(command) + command = 'chown cyberpanel:cyberpanel /usr/local/CyberCP/lib/python3.10/site-packages/tldextract/.suffix_cache/urls/*.tldextract.json' + ProcessUtilities.executioner(command, None, True) + import tldextract actualDomain = virtualHostName diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index ff567bc56..4a0a130d7 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -191,7 +191,6 @@ class phpUtilities: str(msg) + " [savePHPConfigAdvance]") print("0,"+str(msg)) - @staticmethod def GetStagingInJson(stagings): try: @@ -217,6 +216,36 @@ class phpUtilities: except BaseException as msg: return msg + @staticmethod + def GetPHPVersionFromFile(vhFile): + if ProcessUtilities.decideServer() == ProcessUtilities.OLS: + command = f'grep -Eo "/usr/local/lsws/lsphp[0-9]+/bin/lsphp" {vhFile}' + result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + + result = result.rsplit("lsphp", 1)[0] + "php" + return result + + else: + command = f'grep -Eo -m 1 "php[0-9]+" {vhFile}' + result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + result = f'/usr/local/lsws/ls{result}/bin/lsphp' + result = result.rsplit("lsphp", 1)[0] + "php" + return result + + @staticmethod + def InstallSaidPHP(php): + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: + command = f'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp{php}*' + else: + command = f'dnf install lsphp{php}* --exclude lsphp73-pecl-zip --exclude *imagick* -y --skip-broken' + + + ProcessUtilities.executioner(command, None, True) + + + + + def main(): diff --git a/plogical/renew.py b/plogical/renew.py index 8f16c9d05..fd54a15e6 100644 --- a/plogical/renew.py +++ b/plogical/renew.py @@ -142,6 +142,11 @@ class Renew: except BaseException as msg: logging.writeToFile(str(msg) + '. Renew.SSLObtainer') + @staticmethod + def FixMailSSL(): + for website in Websites.objects.all(): + virtualHostUtilities.setupAutoDiscover(1, '/home/cyberpanel/templogs', website.domain, website.admin) + if __name__ == "__main__": sslOB = Renew() diff --git a/plogical/upgrade.py b/plogical/upgrade.py index ef969ca67..5cb08e55e 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2794,7 +2794,7 @@ vmail 0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py hourlyCleanup >/dev/null 2>&1 0 0 1 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup >/dev/null 2>&1 0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/upgradeCritical.py >/dev/null 2>&1 -0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 +0 0 * * 4 /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 7 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null */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 """ @@ -2833,7 +2833,7 @@ vmail 0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py hourlyCleanup >/dev/null 2>&1 0 0 1 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup >/dev/null 2>&1 0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/upgradeCritical.py >/dev/null 2>&1 -0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 +0 0 * * 4 /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 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 diff --git a/websiteFunctions/templates/websiteFunctions/installMautic.html b/websiteFunctions/templates/websiteFunctions/installMautic.html index dbda62697..b3388b446 100755 --- a/websiteFunctions/templates/websiteFunctions/installMautic.html +++ b/websiteFunctions/templates/websiteFunctions/installMautic.html @@ -21,8 +21,10 @@
+ {% trans "Before installing Mautic, we will change the PHP version of the website to PHP 8.0, which is supported by Mautic." %} -
+ +
diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html index 5e06f00e1..9a9c6e966 100755 --- a/websiteFunctions/templates/websiteFunctions/website.html +++ b/websiteFunctions/templates/websiteFunctions/website.html @@ -554,7 +554,7 @@
-