Skip to content

Commit

Permalink
bug fix: install process
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 18, 2019
1 parent 9a78d85 commit d165e1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
7 changes: 4 additions & 3 deletions install/install.py
Expand Up @@ -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)

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

checks.modSecPreReqs()
checks.setupVirtualEnv(distro)
checks.installLSCPD()
checks.setupLSCPDDaemon()
checks.fixCyberPanelPermissions()
Expand Down
19 changes: 10 additions & 9 deletions serverStatus/serverStatusUtil.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion serverStatus/templates/serverStatus/litespeedStatus.html
Expand Up @@ -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>
Expand Down

0 comments on commit d165e1d

Please sign in to comment.