bug fix: install process

This commit is contained in:
Usman Nasir
2019-09-18 15:06:58 +05:00
parent 9a78d85e2f
commit d165e1d1cf
3 changed files with 15 additions and 13 deletions

View File

@@ -1025,19 +1025,21 @@ class preFlightsChecks:
logging.InstallLog.writeToFile("settings.py updated!") logging.InstallLog.writeToFile("settings.py updated!")
self.setupVirtualEnv(self.distro)
### Applying migrations ### Applying migrations
os.chdir("CyberCP") os.chdir("CyberCP")
command = "python manage.py makemigrations" command = "/usr/local/CyberCP/bin/python2 manage.py makemigrations"
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
'CyberPanel Make Migrations', 'CyberPanel Make Migrations',
1, 1, os.EX_OSERR) 1, 1, os.EX_OSERR)
## ##
command = "python manage.py migrate" command = "/usr/local/CyberCP/bin/python2 manage.py migrate"
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
'CyberPanel Migrate',1, 1, os.EX_OSERR) 'CyberPanel Migrate',1, 1, os.EX_OSERR)
@@ -3847,7 +3849,6 @@ def main():
checks.configureOpenDKIM() checks.configureOpenDKIM()
checks.modSecPreReqs() checks.modSecPreReqs()
checks.setupVirtualEnv(distro)
checks.installLSCPD() checks.installLSCPD()
checks.setupLSCPDDaemon() checks.setupLSCPDDaemon()
checks.fixCyberPanelPermissions() checks.fixCyberPanelPermissions()

View File

@@ -145,15 +145,9 @@ class ServerStatusUtil:
if os.path.exists('/usr/local/lsws'): if os.path.exists('/usr/local/lsws'):
shutil.rmtree('/usr/local/lsws') shutil.rmtree('/usr/local/lsws')
command = 'tar -zxvf /usr/local/olsBackup.tar.gz -C /usr/local/' command = 'mv /usr/local/lsws.bak /usr/local/lsws'
ServerStatusUtil.executioner(command, FNULL) ServerStatusUtil.executioner(command, FNULL)
command = 'mv /usr/local/usr/local/lsws /usr/local'
ServerStatusUtil.executioner(command, FNULL)
if os.path.exists('/usr/local/usr'):
shutil.rmtree('/usr/local/usr')
@staticmethod @staticmethod
def createWebsite(website): def createWebsite(website):
try: try:
@@ -285,9 +279,16 @@ class ServerStatusUtil:
ProcessUtilities.killLiteSpeed() ProcessUtilities.killLiteSpeed()
if os.path.exists('/usr/local/lsws'): if os.path.exists('/usr/local/lsws'):
command = 'tar -zcvf /usr/local/olsBackup.tar.gz /usr/local/lsws' command = 'mkdir /usr/local/lsws.bak'
if ServerStatusUtil.executioner(command, FNULL) == 0: if ServerStatusUtil.executioner(command, FNULL) == 0:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [404]", 1) logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [mkdir] [404]", 1)
ServerStatusUtil.recover()
return 0
command = 'cp -R /usr/local/lsws/* /usr/local/lsws.bak/'
if ServerStatusUtil.executioner(command, FNULL) == 0:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Failed to create backup of current LSWS. [cp][404]", 1)
ServerStatusUtil.recover() ServerStatusUtil.recover()
return 0 return 0

View File

@@ -146,7 +146,7 @@
<form action="/" class="form-horizontal bordered-row"> <form action="/" class="form-horizontal bordered-row">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "License Key" %}</label> <label class="col-sm-3 control-label">{% trans "LiteSpeed Serial No. (License Key)" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control" ng-model="licenseKey" <input type="text" class="form-control" ng-model="licenseKey"
required> required>