Merge branch 'v2.3.4' into v2.3.5-dev

This commit is contained in:
usmannasir
2023-08-29 11:42:41 +05:00
14 changed files with 128 additions and 18 deletions

View File

@@ -77,7 +77,7 @@
<!-- HELPERS -->
{% with version="2.3.4.3" %}
{% with version="2.3.4.5" %}
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/assets/finalBase/finalBase.css' %}">

View File

@@ -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():

View File

@@ -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

View File

@@ -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)

View File

@@ -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:

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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():

View File

@@ -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()

View File

@@ -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

View File

@@ -21,8 +21,10 @@
</h3>
<div class="example-box-wrapper">
<strong style="margin:2%; color: red">{% trans "Before installing Mautic, we will change the PHP version of the website to PHP 8.0, which is supported by Mautic." %}</strong>
<form name="websiteCreationForm" action="/" id="createPackages" class="form-horizontal bordered-row">
<form style="margin-top:1%" name="websiteCreationForm" action="/" id="createPackages" class="form-horizontal bordered-row">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Administrator Username" %}</label>

View File

@@ -554,7 +554,7 @@
</a>
</div>
<div class="col-md-3 panel-body">F
<div class="col-md-3 panel-body">
<a ng-click="fetchRewriteFules()" href=""
title="{% trans 'Add Rewrite Rules (.htaccess)' %}">
<img src="{% static 'images/icons/pencilcase.png' %}" width="65" class="mr-10">

View File

@@ -4247,6 +4247,15 @@ StrictHostKeyChecking no
else:
return ACLManager.loadErrorJson('installStatus', 0)
#### Before installing mautic change php to 8.0
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{self.domain}/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)
mailUtilities.checkHome()
extraArgs = {}