mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
install joomla via cli
This commit is contained in:
@@ -1517,6 +1517,42 @@ def main():
|
|||||||
wm = WebsiteManager()
|
wm = WebsiteManager()
|
||||||
wm.installWordpress(1, data)
|
wm.installWordpress(1, data)
|
||||||
|
|
||||||
|
elif args.function == "installJoomla":
|
||||||
|
|
||||||
|
completeCommandExample = 'cyberpanel installJoomla --domainName cyberpanel.net --password helloworld --siteTitle "WordPress Site" --path helloworld (this is optional)'
|
||||||
|
|
||||||
|
if not args.domainName:
|
||||||
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
|
return
|
||||||
|
|
||||||
|
if not args.password:
|
||||||
|
print("\n\nPlease enter password. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
|
return
|
||||||
|
|
||||||
|
if not args.siteTitle:
|
||||||
|
print("\n\nPlease enter site title. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
|
return
|
||||||
|
|
||||||
|
if not args.path:
|
||||||
|
home = '1'
|
||||||
|
path = ''
|
||||||
|
else:
|
||||||
|
home = '0'
|
||||||
|
path = args.path
|
||||||
|
|
||||||
|
from websiteFunctions.website import WebsiteManager
|
||||||
|
|
||||||
|
data = {}
|
||||||
|
data['prefix'] = 'jm_'
|
||||||
|
data['siteName'] = args.siteTitle
|
||||||
|
data['domain'] = args.domainName
|
||||||
|
data['passwordByPass'] = args.password
|
||||||
|
data['home'] = home
|
||||||
|
data['path'] = path
|
||||||
|
|
||||||
|
wm = WebsiteManager()
|
||||||
|
wm.installJoomla(1, data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -945,7 +945,8 @@ $parameters = array(
|
|||||||
try:
|
try:
|
||||||
os.remove('/usr/local/CyberCP/joomla.zip')
|
os.remove('/usr/local/CyberCP/joomla.zip')
|
||||||
os.remove('/usr/local/CyberCP/lscache_plugin.zip')
|
os.remove('/usr/local/CyberCP/lscache_plugin.zip')
|
||||||
os.remove('/usr/local/CyberCP/com_lscache.zip')
|
os.remove('/usr/local/CyberCP/pkg_lscache.xml')
|
||||||
|
os.remove('/usr/local/CyberCP/pkg_script.php')
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -956,7 +957,7 @@ $parameters = array(
|
|||||||
command = 'wget https://raw.githubusercontent.com/litespeedtech/lscache-joomla/master/package/lscache-1.3.1.zip -O /usr/local/CyberCP/joomla.zip'
|
command = 'wget https://raw.githubusercontent.com/litespeedtech/lscache-joomla/master/package/lscache-1.3.1.zip -O /usr/local/CyberCP/joomla.zip'
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = 'unzip /usr/local/CyberCP/joomla.zip -d /usr/local/CyberCP/'
|
command = 'unzip -o /usr/local/CyberCP/joomla.zip -d /usr/local/CyberCP/'
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = '/home/%s/.composer/vendor/bin/joomla extension:installfile %s --www %s /usr/local/CyberCP/lscache_plugin.zip' % (self.masterDomain, dbUser, finalPath)
|
command = '/home/%s/.composer/vendor/bin/joomla extension:installfile %s --www %s /usr/local/CyberCP/lscache_plugin.zip' % (self.masterDomain, dbUser, finalPath)
|
||||||
@@ -970,13 +971,13 @@ $parameters = array(
|
|||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = 'mv %s%s/* %s' % (finalPath, dbUser, finalPath)
|
command = 'mv %s%s/* %s' % (finalPath, dbUser, finalPath)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command, None, True)
|
||||||
|
|
||||||
command = 'mv %s%s/.[^.]* %s' % (finalPath, dbUser, finalPath)
|
command = 'mv %s%s/.[^.]* %s' % (finalPath, dbUser, finalPath)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command, None, True)
|
||||||
|
|
||||||
command = "sed -i 's|$debug = 1|$debug = 0|g' %sconfiguration.php" % (finalPath)
|
command = "sed -i 's|$debug = 1|$debug = 0|g' %sconfiguration.php" % (finalPath)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command, None, True)
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
@@ -988,10 +989,20 @@ $parameters = array(
|
|||||||
|
|
||||||
command = "sed -i \"s|sitename = '%s'|sitename = '%s'|g\" %sconfiguration.php" % (
|
command = "sed -i \"s|sitename = '%s'|sitename = '%s'|g\" %sconfiguration.php" % (
|
||||||
dbUser, siteName, finalPath)
|
dbUser, siteName, finalPath)
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp, True)
|
||||||
|
|
||||||
installUtilities.reStartLiteSpeedSocket()
|
installUtilities.reStartLiteSpeedSocket()
|
||||||
|
|
||||||
|
content = """
|
||||||
|
=====================================================================
|
||||||
|
Joomla Successfully installed, login details below:
|
||||||
|
Username: admin
|
||||||
|
Password: %s
|
||||||
|
=====================================================================
|
||||||
|
""" % (self.extraArgs['password'])
|
||||||
|
|
||||||
|
print(content)
|
||||||
|
|
||||||
statusFile = open(tempStatusPath, 'w')
|
statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines("Successfully Installed. [200]")
|
statusFile.writelines("Successfully Installed. [200]")
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user