mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
upgraded prestashop version to 1.7.8
This commit is contained in:
@@ -27,6 +27,7 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
REMOTE = 0
|
REMOTE = 0
|
||||||
PORT = '3306'
|
PORT = '3306'
|
||||||
MauticVersion = '4.1.2'
|
MauticVersion = '4.1.2'
|
||||||
|
PrestaVersion = '1.7.8.3'
|
||||||
|
|
||||||
def __init__(self, installApp, extraArgs):
|
def __init__(self, installApp, extraArgs):
|
||||||
multi.Thread.__init__(self)
|
multi.Thread.__init__(self)
|
||||||
@@ -142,7 +143,7 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
|
|
||||||
## checking for directories/files
|
## checking for directories/files
|
||||||
|
|
||||||
if self.dataLossCheck(finalPath, tempStatusPath) == 0:
|
if self.dataLossCheck(finalPath, tempStatusPath, externalApp) == 0:
|
||||||
raise BaseException('Directory is not empty.')
|
raise BaseException('Directory is not empty.')
|
||||||
|
|
||||||
####
|
####
|
||||||
@@ -392,13 +393,23 @@ $parameters = array(
|
|||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg) + ' [ApplicationInstaller.installWPCLI]')
|
logging.writeToFile(str(msg) + ' [ApplicationInstaller.installWPCLI]')
|
||||||
|
|
||||||
def dataLossCheck(self, finalPath, tempStatusPath):
|
def dataLossCheck(self, finalPath, tempStatusPath, user=None):
|
||||||
|
|
||||||
|
if user == None:
|
||||||
dirFiles = os.listdir(finalPath)
|
dirFiles = os.listdir(finalPath)
|
||||||
|
|
||||||
if len(dirFiles) <= 3:
|
if len(dirFiles) <= 3:
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
else:
|
||||||
|
command = 'ls %s | wc -l' % (finalPath)
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, user, True).rstrip('\n')
|
||||||
|
|
||||||
|
if int(result) <= 3:
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
def installGit(self):
|
def installGit(self):
|
||||||
try:
|
try:
|
||||||
@@ -544,19 +555,19 @@ $parameters = array(
|
|||||||
|
|
||||||
## Security Check
|
## Security Check
|
||||||
|
|
||||||
command = 'chmod 755 %s' % (self.permPath)
|
# command = 'chmod 755 %s' % (self.permPath)
|
||||||
ProcessUtilities.executioner(command)
|
# ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
if finalPath.find("..") > -1:
|
if finalPath.find("..") > -1:
|
||||||
raise BaseException("Specified path must be inside virtual host home.")
|
raise BaseException("Specified path must be inside virtual host home.")
|
||||||
|
|
||||||
if not os.path.exists(finalPath):
|
### if directory already exists no issues.
|
||||||
command = 'mkdir -p ' + finalPath
|
command = 'mkdir -p ' + finalPath
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
## checking for directories/files
|
## checking for directories/files
|
||||||
|
|
||||||
if self.dataLossCheck(finalPath, tempStatusPath) == 0:
|
if self.dataLossCheck(finalPath, tempStatusPath, externalApp) == 0:
|
||||||
raise BaseException('Directory is not empty.')
|
raise BaseException('Directory is not empty.')
|
||||||
|
|
||||||
####
|
####
|
||||||
@@ -717,9 +728,6 @@ $parameters = array(
|
|||||||
# remove the downloaded files
|
# remove the downloaded files
|
||||||
|
|
||||||
if not os.path.exists(ProcessUtilities.debugPath):
|
if not os.path.exists(ProcessUtilities.debugPath):
|
||||||
from filemanager.filemanager import FileManager
|
|
||||||
fm = FileManager(None, None)
|
|
||||||
fm.fixPermissions(self.masterDomain)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mysqlUtilities.deleteDatabase(dbName, dbUser)
|
mysqlUtilities.deleteDatabase(dbName, dbUser)
|
||||||
@@ -807,19 +815,19 @@ $parameters = array(
|
|||||||
|
|
||||||
## Security Check
|
## Security Check
|
||||||
|
|
||||||
command = 'chmod 755 %s' % (self.permPath)
|
#command = 'chmod 755 %s' % (self.permPath)
|
||||||
ProcessUtilities.executioner(command)
|
#ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
if finalPath.find("..") > -1:
|
if finalPath.find("..") > -1:
|
||||||
raise BaseException('Specified path must be inside virtual host home.')
|
raise BaseException('Specified path must be inside virtual host home.')
|
||||||
|
|
||||||
if not os.path.exists(finalPath):
|
### create folder if exists then move on
|
||||||
command = 'mkdir -p ' + finalPath
|
command = 'mkdir -p ' + finalPath
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
## checking for directories/files
|
## checking for directories/files
|
||||||
|
|
||||||
if self.dataLossCheck(finalPath, tempStatusPath) == 0:
|
if self.dataLossCheck(finalPath, tempStatusPath, externalApp) == 0:
|
||||||
raise BaseException('Directory is not empty.')
|
raise BaseException('Directory is not empty.')
|
||||||
|
|
||||||
####
|
####
|
||||||
@@ -828,11 +836,11 @@ $parameters = array(
|
|||||||
statusFile.writelines('Downloading and extracting PrestaShop Core..,30')
|
statusFile.writelines('Downloading and extracting PrestaShop Core..,30')
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
|
|
||||||
command = "wget https://download.prestashop.com/download/releases/prestashop_1.7.4.2.zip -P %s" % (
|
command = "wget https://download.prestashop.com/download/releases/prestashop_%s.zip -P %s" % (ApplicationInstaller.PrestaVersion,
|
||||||
finalPath)
|
finalPath)
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
command = "unzip -o %sprestashop_1.7.4.2.zip -d " % (finalPath) + finalPath
|
command = "unzip -o %sprestashop_%s.zip -d " % (finalPath, ApplicationInstaller.PrestaVersion) + finalPath
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
command = "unzip -o %sprestashop.zip -d " % (finalPath) + finalPath
|
command = "unzip -o %sprestashop.zip -d " % (finalPath) + finalPath
|
||||||
@@ -866,13 +874,6 @@ $parameters = array(
|
|||||||
command = "rm -rf " + finalPath + "install"
|
command = "rm -rf " + finalPath + "install"
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
from filemanager.filemanager import FileManager
|
|
||||||
|
|
||||||
fm = FileManager(None, None)
|
|
||||||
fm.fixPermissions(self.masterDomain)
|
|
||||||
|
|
||||||
statusFile = open(tempStatusPath, 'w')
|
statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines("Successfully Installed. [200]")
|
statusFile.writelines("Successfully Installed. [200]")
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
@@ -900,16 +901,13 @@ $parameters = array(
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
command = 'chmod 750 %s' % (self.permPath)
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
statusFile = open(self.tempStatusPath, 'w')
|
statusFile = open(self.tempStatusPath, 'w')
|
||||||
statusFile.writelines(str(msg) + " [404]")
|
statusFile.writelines(str(msg) + " [404]")
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def installJoomla(self):
|
def installJoomla(self):
|
||||||
|
return 0
|
||||||
try:
|
try:
|
||||||
|
|
||||||
domainName = self.extraArgs['domain']
|
domainName = self.extraArgs['domain']
|
||||||
@@ -922,8 +920,8 @@ $parameters = array(
|
|||||||
self.tempStatusPath = tempStatusPath
|
self.tempStatusPath = tempStatusPath
|
||||||
|
|
||||||
permPath = '/home/%s/public_html' % (domainName)
|
permPath = '/home/%s/public_html' % (domainName)
|
||||||
command = 'chmod 755 %s' % (permPath)
|
#command = 'chmod 755 %s' % (permPath)
|
||||||
ProcessUtilities.executioner(command)
|
#ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
## Get Joomla
|
## Get Joomla
|
||||||
|
|
||||||
@@ -982,7 +980,7 @@ $parameters = array(
|
|||||||
command = 'mkdir %s' % (finalPath)
|
command = 'mkdir %s' % (finalPath)
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
if self.dataLossCheck(finalPath, tempStatusPath) == 0:
|
if self.dataLossCheck(finalPath, tempStatusPath, externalApp) == 0:
|
||||||
raise BaseException('Directory is not empty.')
|
raise BaseException('Directory is not empty.')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -690,17 +690,17 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
{# <div class="col-md-3 panel-body">#}
|
||||||
|
{##}
|
||||||
<a href="{$ joomlaInstallURL $}" target="_blank"
|
{# <a href="{$ joomlaInstallURL $}" target="_blank"#}
|
||||||
title="{% trans 'Install Joomla with LSCache' %}">
|
{# title="{% trans 'Install Joomla with LSCache' %}">#}
|
||||||
<img src="{% static 'images/icons/joomla-logo.png' %}" width="65" class="mr-10">
|
{# <img src="{% static 'images/icons/joomla-logo.png' %}" width="65" class="mr-10">#}
|
||||||
</a>
|
{# </a>#}
|
||||||
<a href="{$ joomlaInstallURL $}" target="_blank"
|
{# <a href="{$ joomlaInstallURL $}" target="_blank"#}
|
||||||
title="{% trans 'Install Joomla with LSCache' %}">
|
{# title="{% trans 'Install Joomla with LSCache' %}">#}
|
||||||
<span class="h4">{% trans "Joomla" %}</span>
|
{# <span class="h4">{% trans "Joomla" %}</span>#}
|
||||||
</a>
|
{# </a>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
<a href="/websites/{{ childDomain }}/manageGIT" target="_blank"
|
<a href="/websites/{{ childDomain }}/manageGIT" target="_blank"
|
||||||
@@ -728,16 +728,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
{# <div class="col-md-3 panel-body">#}
|
||||||
<a href="{$ installMagentoURL $}" target="_blank"
|
{# <a href="{$ installMagentoURL $}" target="_blank"#}
|
||||||
title="{% trans 'Install Magento' %}">
|
{# title="{% trans 'Install Magento' %}">#}
|
||||||
<img src="{% static 'images/icons/magento.png' %}" width="65" class="mr-10">
|
{# <img src="{% static 'images/icons/magento.png' %}" width="65" class="mr-10">#}
|
||||||
</a>
|
{# </a>#}
|
||||||
<a href="{$ installMagentoURL $}" target="_blank"
|
{# <a href="{$ installMagentoURL $}" target="_blank"#}
|
||||||
title="{% trans 'Install Magento' %}">
|
{# title="{% trans 'Install Magento' %}">#}
|
||||||
<span class="h4">{% trans "Magento" %}</span>
|
{# <span class="h4">{% trans "Magento" %}</span>#}
|
||||||
</a>
|
{# </a>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1003,7 +1003,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
{% comment %}<div class="col-md-3 panel-body">
|
||||||
<a href="{$ joomlaInstallURL $}" target="_self"
|
<a href="{$ joomlaInstallURL $}" target="_self"
|
||||||
title="{% trans 'Install Joomla with LSCache' %}">
|
title="{% trans 'Install Joomla with LSCache' %}">
|
||||||
<img src="{% static 'images/icons/joomla-logo.png' %}" width="65" class="mr-10">
|
<img src="{% static 'images/icons/joomla-logo.png' %}" width="65" class="mr-10">
|
||||||
@@ -1012,7 +1012,7 @@
|
|||||||
title="{% trans 'Install Joomla with LSCache' %}">
|
title="{% trans 'Install Joomla with LSCache' %}">
|
||||||
<span class="h4">{% trans "Joomla" %}</span>
|
<span class="h4">{% trans "Joomla" %}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>{% endcomment %}
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
<a href="/websites/{{ domain }}/manageGIT" target="_self"
|
<a href="/websites/{{ domain }}/manageGIT" target="_self"
|
||||||
@@ -1036,16 +1036,16 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
{# <div class="col-md-3 panel-body">#}
|
||||||
<a href="{$ installMagentoURL $}" target="_self"
|
{# <a href="{$ installMagentoURL $}" target="_self"#}
|
||||||
title="{% trans 'Install Magento' %}">
|
{# title="{% trans 'Install Magento' %}">#}
|
||||||
<img src="{% static 'images/icons/magento.png' %}" width="65" class="mr-10">
|
{# <img src="{% static 'images/icons/magento.png' %}" width="65" class="mr-10">#}
|
||||||
</a>
|
{# </a>#}
|
||||||
<a href="{$ installMagentoURL $}" target="_self"
|
{# <a href="{$ installMagentoURL $}" target="_self"#}
|
||||||
title="{% trans 'Install Magento' %}">
|
{# title="{% trans 'Install Magento' %}">#}
|
||||||
<span class="h4">{% trans "Magento" %}</span>
|
{# <span class="h4">{% trans "Magento" %}</span>#}
|
||||||
</a>
|
{# </a>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
<a href="{$ installMauticURL $}" target="_self"
|
<a href="{$ installMauticURL $}" target="_self"
|
||||||
|
|||||||
Reference in New Issue
Block a user