mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-06-27 10:48:40 +02:00
Merge branch 'v2.3.5-dev' of https://github.com/usmannasir/cyberpanel into v2.3.5-dev
This commit is contained in:
@@ -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' %}">
|
||||
|
||||
|
||||
@@ -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():
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -70,3 +70,4 @@ DocumentRoot /usr/local/lsws/DEFAULT/html
|
||||
DocumentRoot /usr/local/lsws/DEFAULT/html
|
||||
</VirtualHost>
|
||||
Include /usr/local/lsws/conf/modsec.conf
|
||||
Include /usr/local/lsws/conf/pre_main_global.conf
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1963,11 +2009,14 @@ $parameters = array(
|
||||
|
||||
wpobj = WPSites.objects.get(pk=self.data['WPid'])
|
||||
|
||||
php = PHPManager.getPHPString(wpobj.owner.phpSelection)
|
||||
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
||||
|
||||
|
||||
|
||||
#get wp version
|
||||
path_to_wordpress = wpobj.path
|
||||
command = f"wp --path='{path_to_wordpress}' core version --skip-plugins --skip-themes"
|
||||
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp --path='{path_to_wordpress}' core version --skip-plugins --skip-themes"
|
||||
Wp_version = ProcessUtilities.outputExecutioner(command, wpobj.owner.externalApp)
|
||||
old_wp_version = Wp_version.rstrip('\n')
|
||||
logging.writeToFile("Old site wp version:%s"% old_wp_version)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -191,7 +191,6 @@ class phpUtilities:
|
||||
str(msg) + " [savePHPConfigAdvance]")
|
||||
print("0,"+str(msg))
|
||||
|
||||
|
||||
@staticmethod
|
||||
def GetStagingInJson(stagings):
|
||||
try:
|
||||
@@ -217,6 +216,46 @@ 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 WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile):
|
||||
result = phpUtilities.GetPHPVersionFromFile(vhFile)
|
||||
command = result + " -v | awk '/^PHP/ {print $2}'"
|
||||
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
return f"PHP {php_version}"
|
||||
|
||||
|
||||
|
||||
@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():
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -70,3 +70,4 @@ DocumentRoot /usr/local/lsws/DEFAULT/html
|
||||
DocumentRoot /usr/local/lsws/DEFAULT/html
|
||||
</VirtualHost>
|
||||
Include /usr/local/lsws/conf/modsec.conf
|
||||
Include /usr/local/lsws/conf/pre_main_global.conf
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -61,66 +61,48 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-sticky-note btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right" title="State"> </i>
|
||||
<span ng-bind="web.state" style="text-transform: none"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-map-marker btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right" title="IP Address"> </i>
|
||||
<span ng-bind="web.ipAddress"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right"
|
||||
title="SSL"> </i>
|
||||
<span><a ng-click="issueSSL(web.domain)" href=""
|
||||
style="text-transform: none">{% trans "Issue SSL" %}</a></span>
|
||||
</div>
|
||||
<div class="col-md-3 content-box-header">
|
||||
|
||||
<span ng-bind="web.phpVersion"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-hdd-o btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="Disk Usage"> </i>
|
||||
<span ng-bind="web.diskUsed" style="text-transform: none"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-cubes btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="Packages"> </i>
|
||||
<span ng-bind="web.package" style="text-transform: none"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-user btn-icon text-muted" data-toggle="tooltip" data-placement="right"
|
||||
title="Owner"> </i>
|
||||
<span ng-bind="web.admin" style="text-transform: none"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--table cellpadding="0" cellspacing="0" border="0" class="table" style="margin:0px 0px; id="datatable-example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP Address</th>
|
||||
<th>Package</th>
|
||||
<th>Owner</th>
|
||||
<th>State</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td ng-bind="web.ipAddress"></td>
|
||||
<td ng-bind="web.package"></td>
|
||||
<td ng-bind="web.admin"></td>
|
||||
<td ng-bind="web.state"></td>
|
||||
<td ng-bind="web.adminEmail"></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table-->
|
||||
|
||||
<div id="listFail" class="alert alert-danger">
|
||||
<p>{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -2411,18 +2411,28 @@ class WebsiteManager:
|
||||
logging.CyberCPLogFileWriter.writeToFile("Failed to read machine IP, error:" + str(msg))
|
||||
ipAddress = "192.168.100.1"
|
||||
|
||||
### lets first find php path
|
||||
|
||||
from plogical.phpUtilities import phpUtilities
|
||||
|
||||
|
||||
|
||||
for items in websites:
|
||||
if items.state == 0:
|
||||
state = "Suspended"
|
||||
else:
|
||||
state = "Active"
|
||||
|
||||
vhFile = f'/usr/local/lsws/conf/vhosts/{items.domain}/vhost.conf'
|
||||
|
||||
PHPVersionActual = phpUtilities.WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile)
|
||||
|
||||
DiskUsage, DiskUsagePercentage, bwInMB, bwUsage = virtualHostUtilities.FindStats(items)
|
||||
diskUsed = "%sMB" % str(DiskUsage)
|
||||
|
||||
dic = {'domain': items.domain, 'adminEmail': items.adminEmail, 'ipAddress': ipAddress,
|
||||
'admin': items.admin.userName, 'package': items.package.packageName, 'state': state,
|
||||
'diskUsed': diskUsed}
|
||||
'diskUsed': diskUsed, 'phpVersion': PHPVersionActual}
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
@@ -4247,6 +4257,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 = {}
|
||||
|
||||
Reference in New Issue
Block a user