diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index 82634c4c6..132665a12 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1517,6 +1517,42 @@ def main(): wm = WebsiteManager() 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__": diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 4676d320c..81db3a009 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -945,7 +945,8 @@ $parameters = array( try: os.remove('/usr/local/CyberCP/joomla.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: 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' 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) 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) command = 'mv %s%s/* %s' % (finalPath, dbUser, finalPath) - ProcessUtilities.executioner(command) + ProcessUtilities.executioner(command, None, True) 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) - 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" % ( dbUser, siteName, finalPath) - ProcessUtilities.executioner(command, externalApp) + ProcessUtilities.executioner(command, externalApp, True) installUtilities.reStartLiteSpeedSocket() + content = """ + ===================================================================== + Joomla Successfully installed, login details below: + Username: admin + Password: %s + ===================================================================== + """ % (self.extraArgs['password']) + + print(content) + statusFile = open(tempStatusPath, 'w') statusFile.writelines("Successfully Installed. [200]") statusFile.close()