Skip to content
Permalink
Browse files

bug fix: install process

  • Loading branch information...
usmannasir committed Sep 18, 2019
1 parent 9a78d85 commit d165e1d1cf50b7b8cb1bc1002e104d139de74f3d
Showing with 15 additions and 13 deletions.
  1. +4 −3 install/install.py
  2. +10 −9 serverStatus/serverStatusUtil.py
  3. +1 −1 serverStatus/templates/serverStatus/litespeedStatus.html
@@ -1025,19 +1025,21 @@ def download_install_CyberPanel(self, mysqlPassword, mysql):

logging.InstallLog.writeToFile("settings.py updated!")

self.setupVirtualEnv(self.distro)

### Applying migrations


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]',
'CyberPanel Make Migrations',
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]',
'CyberPanel Migrate',1, 1, os.EX_OSERR)

@@ -3847,7 +3849,6 @@ def main():
checks.configureOpenDKIM()

checks.modSecPreReqs()
checks.setupVirtualEnv(distro)
checks.installLSCPD()
checks.setupLSCPDDaemon()
checks.fixCyberPanelPermissions()
@@ -145,15 +145,9 @@ def recover():
if os.path.exists('/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)

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
def createWebsite(website):
try:
@@ -285,9 +279,16 @@ def switchTOLSWS(licenseKey):
ProcessUtilities.killLiteSpeed()

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:
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. [404]", 1)
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Failed to create backup of current LSWS. [cp][404]", 1)
ServerStatusUtil.recover()
return 0

@@ -146,7 +146,7 @@ <h3 class="content-box-header">
<form action="/" class="form-horizontal bordered-row">

<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">
<input type="text" class="form-control" ng-model="licenseKey"
required>

0 comments on commit d165e1d

Please sign in to comment.
You can’t perform that action at this time.