bug fix for ubuntu and docker manager

This commit is contained in:
Usman Nasir
2019-07-24 22:37:37 +05:00
parent 33ed372cec
commit 91c9c22f38
20 changed files with 156 additions and 90 deletions

View File

@@ -10,14 +10,32 @@ class secMiddleware:
def __call__(self, request): def __call__(self, request):
try: try:
uID = request.session['userID'] uID = request.session['userID']
if request.session['ipAddr'] == request.META.get('REMOTE_ADDR'): ipAddr = request.META.get('REMOTE_ADDR')
pass
if ipAddr.find('.') > -1:
if request.session['ipAddr'] == ipAddr:
pass
else:
del request.session['userID']
del request.session['ipAddr']
logging.writeToFile(request.META.get('REMOTE_ADDR'))
final_dic = {'error_message': "Session reuse detected, IPAddress logged.",
"errorMessage": "Session reuse detected, IPAddress logged."}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
else: else:
logging.writeToFile(request.META.get('REMOTE_ADDR')) ipAddr = request.META.get('REMOTE_ADDR').split(':')[:3]
final_dic = {'error_message': "Session reuse detected, IPAddress logged.",
"errorMessage": "Session reuse detected, IPAddress logged."} if request.session['ipAddr'] == ipAddr:
final_json = json.dumps(final_dic) pass
return HttpResponse(final_json) else:
del request.session['userID']
del request.session['ipAddr']
logging.writeToFile(request.META.get('REMOTE_ADDR'))
final_dic = {'error_message': "Session reuse detected, IPAddress logged.",
"errorMessage": "Session reuse detected, IPAddress logged."}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
except: except:
pass pass
if request.method == 'POST': if request.method == 'POST':
@@ -40,9 +58,9 @@ class secMiddleware:
else: else:
continue continue
if request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('filemanager') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1: if request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('filemanager') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
continue continue
if key == 'passwordByPass' or key == 'cronCommand' or key == 'emailMessage' or key == 'configData' or key == 'rewriteRules' or key == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' or key == 'fileContent': if key == 'imageByPass' or key == 'passwordByPass' or key == 'cronCommand' or key == 'emailMessage' or key == 'configData' or key == 'rewriteRules' or key == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' or key == 'fileContent':
continue continue
if value.find(';') > -1 or value.find('&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \ if value.find(';') > -1 or value.find('&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(")") > -1 \ or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(")") > -1 \

View File

@@ -1035,8 +1035,7 @@ class BackupManager:
## ##
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py" execPath = "python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
execPath = execPath + " remoteBackupRestore --backupDirComplete " + backupDirComplete + " --backupDir " + str( execPath = execPath + " remoteBackupRestore --backupDirComplete " + backupDirComplete + " --backupDir " + str(
backupDir) backupDir)
@@ -1074,14 +1073,14 @@ class BackupManager:
status = ProcessUtilities.outputExecutioner(command) status = ProcessUtilities.outputExecutioner(command)
if status.find("completed[success]") > -1: if status.find("completed[success]") > -1:
command = "sudo rm -rf " + removalPath command = "rm -rf " + removalPath
# subprocess.call(shlex.split(command)) ProcessUtilities.executioner(command)
data_ret = {'remoteTransferStatus': 1, 'error_message': "None", "status": status, "complete": 1} data_ret = {'remoteTransferStatus': 1, 'error_message': "None", "status": status, "complete": 1}
json_data = json.dumps(data_ret) json_data = json.dumps(data_ret)
return HttpResponse(json_data) return HttpResponse(json_data)
elif status.find("[5010]") > -1: elif status.find("[5010]") > -1:
command = "sudo rm -rf " + removalPath command = "sudo rm -rf " + removalPath
# subprocess.call(shlex.split(command)) ProcessUtilities.executioner(command)
data = {'remoteTransferStatus': 0, 'error_message': status, data = {'remoteTransferStatus': 0, 'error_message': status,
"status": "None", "complete": 0} "status": "None", "complete": 0}
json_data = json.dumps(data) json_data = json.dumps(data)

View File

@@ -190,7 +190,7 @@ class DatabaseManager:
userName = data['dbUserName'] userName = data['dbUserName']
dbPassword = data['dbPassword'] dbPassword = data['dbPassword']
db = Databases.objects.get(dbName=userName) db = Databases.objects.get(dbUser=userName)
admin = Administrator.objects.get(pk=userID) admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(db.website.domain, admin, currentACL) == 1: if ACLManager.checkOwnership(db.website.domain, admin, currentACL) == 1:

View File

@@ -386,10 +386,14 @@ class FirewallManager:
FirewallUtilities.deleteRule("tcp", updateFW.port, "0.0.0.0/0") FirewallUtilities.deleteRule("tcp", updateFW.port, "0.0.0.0/0")
updateFW.port = sshPort updateFW.port = sshPort
updateFW.save() updateFW.save()
FirewallUtilities.addRule('tcp', sshPort, "0.0.0.0/0")
except: except:
try: try:
newFireWallRule = FirewallRules(name="SSHCustom", port=sshPort, proto="tcp") newFireWallRule = FirewallRules(name="SSHCustom", port=sshPort, proto="tcp")
newFireWallRule.save() newFireWallRule.save()
FirewallUtilities.addRule('tcp', sshPort, "0.0.0.0/0")
command = 'firewall-cmd --permanent --remove-service=ssh'
ProcessUtilities.executioner(command)
except BaseException, msg: except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg)) logging.CyberCPLogFileWriter.writeToFile(str(msg))

View File

@@ -267,7 +267,7 @@ class FTPManager:
data = json.loads(self.request.body) data = json.loads(self.request.body)
userName = data['ftpUserName'] userName = data['ftpUserName']
password = data['ftpPassword'] password = data['passwordByPass']
admin = Administrator.objects.get(pk=userID) admin = Administrator.objects.get(pk=userID)
ftp = Users.objects.get(user=userName) ftp = Users.objects.get(user=userName)

View File

@@ -328,7 +328,7 @@ app.controller('listFTPAccounts', function ($scope, $http) {
var data = { var data = {
ftpUserName: globalFTPUsername, ftpUserName: globalFTPUsername,
ftpPassword: $scope.ftpPassword, passwordByPass: $scope.ftpPassword,
}; };
var config = { var config = {

View File

@@ -1151,7 +1151,7 @@ class preFlightsChecks:
'Change permissions for client.', 1, 0, os.EX_OSERR) 'Change permissions for client.', 1, 0, os.EX_OSERR)
impFile = ['/etc/pure-ftpd/pure-ftpd.conf', '/etc/pure-ftpd/pureftpd-pgsql.conf', '/etc/pure-ftpd/pureftpd-mysql.conf', '/etc/pure-ftpd/pureftpd-ldap.conf', impFile = ['/etc/pure-ftpd/pure-ftpd.conf', '/etc/pure-ftpd/pureftpd-pgsql.conf', '/etc/pure-ftpd/pureftpd-mysql.conf', '/etc/pure-ftpd/pureftpd-ldap.conf',
'/etc/dovecot/dovecot.conf', '/etc/pdns/pdns.conf'] '/etc/dovecot/dovecot.conf', '/etc/pdns/pdns.conf', '/etc/pure-ftpd/db/mysql.conf']
for items in impFile: for items in impFile:
command = 'chmod 600 %s' % (items) command = 'chmod 600 %s' % (items)
@@ -2470,6 +2470,7 @@ enabled=1"""
FirewallUtilities.addRule("tcp", "993") FirewallUtilities.addRule("tcp", "993")
FirewallUtilities.addRule("udp", "53") FirewallUtilities.addRule("udp", "53")
FirewallUtilities.addRule("tcp", "53") FirewallUtilities.addRule("tcp", "53")
FirewallUtilities.addRule("udp", "443")
FirewallUtilities.addRule("tcp", "40110-40210") FirewallUtilities.addRule("tcp", "40110-40210")
logging.InstallLog.writeToFile("FirewallD installed and configured!") logging.InstallLog.writeToFile("FirewallD installed and configured!")

View File

@@ -599,7 +599,7 @@ class InstallCyberPanel:
"/etc/resolv.conf'", 1, 1, os.EX_OSERR) "/etc/resolv.conf'", 1, 1, os.EX_OSERR)
if self.distro == centos: if self.distro == centos:
command = 'yum -y install epel-release yum-plugin-priorities' command = 'yum -y install epel-release'
install.preFlightsChecks.call(command, self.distro, '[installPowerDNS]', install.preFlightsChecks.call(command, self.distro, '[installPowerDNS]',
'Install PowerDNS', 'Install PowerDNS',
1, 1, os.EX_OSERR) 1, 1, os.EX_OSERR)

View File

@@ -15,6 +15,7 @@ import CyberCP.settings as settings
from models import ACL from models import ACL
from plogical.acl import ACLManager from plogical.acl import ACLManager
from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.csrf import ensure_csrf_cookie
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
# Create your views here. # Create your views here.
def verifyLogin(request): def verifyLogin(request):
@@ -116,7 +117,15 @@ def verifyLogin(request):
if hashPassword.check_password(admin.password, password): if hashPassword.check_password(admin.password, password):
request.session['userID'] = admin.pk request.session['userID'] = admin.pk
request.session['ipAddr'] = request.META.get('REMOTE_ADDR')
ipAddr = request.META.get('REMOTE_ADDR')
if ipAddr.find(':') > -1:
ipAddr = ipAddr.split(':')[:3]
request.session['ipAddr'] = ''.join(ipAddr)
else:
request.session['ipAddr'] = request.META.get('REMOTE_ADDR')
request.session.set_expiry(3600) request.session.set_expiry(3600)
data = {'userID': admin.pk, 'loginStatus': 1, 'error_message': "None"} data = {'userID': admin.pk, 'loginStatus': 1, 'error_message': "None"}
json_data = json.dumps(data) json_data = json.dumps(data)
@@ -195,6 +204,9 @@ def loadLoginPage(request):
newFWRule = FirewallRules(name="ftptls", proto="tcp", port="40110-40210") newFWRule = FirewallRules(name="ftptls", proto="tcp", port="40110-40210")
newFWRule.save() newFWRule.save()
newFWRule = FirewallRules(name="quic", proto="udp", port="443")
newFWRule.save()
if numberOfAdministrator == 0: if numberOfAdministrator == 0:
ACLManager.createDefaultACLs() ACLManager.createDefaultACLs()
acl = ACL.objects.get(name='admin') acl = ACL.objects.get(name='admin')

View File

@@ -377,7 +377,7 @@ class MailServerManager:
data = json.loads(self.request.body) data = json.loads(self.request.body)
email = data['email'] email = data['email']
password = data['password'] password = data['passwordByPass']
emailDB = EUsers.objects.get(email=email) emailDB = EUsers.objects.get(email=email)
@@ -393,6 +393,8 @@ class MailServerManager:
password = '{CRYPT}%s' % (password) password = '{CRYPT}%s' % (password)
emailDB.password = password emailDB.password = password
else: else:
password = bcrypt.hashpw(str(password), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
emailDB.password = password emailDB.password = password
emailDB.save() emailDB.save()

View File

@@ -391,7 +391,7 @@ app.controller('changeEmailPassword', function ($scope, $http) {
var data = { var data = {
domain: domain, domain: domain,
email: email, email: email,
password: password, passwordByPass: password,
}; };
var config = { var config = {

View File

@@ -49,6 +49,8 @@ class CyberCPLogFileWriter:
statusFile.close() statusFile.close()
print(mesg + '\n') print(mesg + '\n')
except BaseException, msg: except BaseException, msg:
CyberCPLogFileWriter.writeToFile(str(msg) + ' [statusWriter]') pass
print str(msg) #CyberCPLogFileWriter.writeToFile(str(msg) + ' [statusWriter]')
#print str(msg)

View File

@@ -102,7 +102,13 @@ class backupUtilities:
databasesXML = Element('Databases') databasesXML = Element('Databases')
for items in databases: for items in databases:
dbuser = DBUsers.objects.get(user=items.dbUser) try:
dbuser = DBUsers.objects.get(user=items.dbUser)
except:
dbusers = DBUsers.objects.all().filter(user=items.dbUser)
for it in dbusers:
dbuser = it
break
databaseXML = Element('database') databaseXML = Element('database')
@@ -154,8 +160,8 @@ class backupUtilities:
metaFileXML.append(dnsRecordsXML) metaFileXML.append(dnsRecordsXML)
except: except BaseException, msg:
pass logging.CyberCPLogFileWriter.statusWriter(status, '%s. [158:prepMeta]' % (str(msg)))
## Email accounts XML ## Email accounts XML
@@ -175,9 +181,8 @@ class backupUtilities:
emailRecordsXML.append(emailRecordXML) emailRecordsXML.append(emailRecordXML)
metaFileXML.append(emailRecordsXML) metaFileXML.append(emailRecordsXML)
except BaseException, msg:
except: logging.CyberCPLogFileWriter.statusWriter(status, '%s. [179:prepMeta]' % (str(msg)))
pass
## Email meta generated! ## Email meta generated!
@@ -1009,25 +1014,45 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
## ##
command = 'mkdir -p %s' % (backupPath) if not os.path.exists(backupPath) or not os.path.islink(backupPath):
ProcessUtilities.executioner(command) command = 'mkdir -p %s' % (backupPath)
ProcessUtilities.executioner(command)
else:
return 0
command = 'chown -R %s:%s %s' % (website.externalApp, website.externalApp, backupPath) if not os.path.exists(backupPath) or not os.path.islink(backupPath):
ProcessUtilities.executioner(command) command = 'chown -R %s:%s %s' % (website.externalApp, website.externalApp, backupPath)
ProcessUtilities.executioner(command)
else:
return 0
## ##
if not os.path.exists(tempStoragePath) or not os.path.islink(tempStoragePath):
command = 'mkdir -p %s' % (tempStoragePath)
ProcessUtilities.executioner(command)
else:
return 0
command = 'mkdir -p %s' % (tempStoragePath) if not os.path.exists(tempStoragePath) or not os.path.islink(tempStoragePath):
ProcessUtilities.executioner(command) command = 'chown -R %s:%s %s' % (website.externalApp, website.externalApp, tempStoragePath)
ProcessUtilities.executioner(command)
command = 'chown -R %s:%s %s' % (website.externalApp, website.externalApp, tempStoragePath) else:
ProcessUtilities.executioner(command) return 0
## ##
if not os.path.exists(status) or not os.path.islink(status):
command = 'touch %s' % (status)
ProcessUtilities.executioner(command)
else:
return 0
if not os.path.exists(status) or not os.path.islink(status):
command = 'chown cyberpanel:cyberpanel %s' % (status)
ProcessUtilities.executioner(command)
else:
return 0
command = 'chown cyberpanel:cyberpanel %s' % (status)
ProcessUtilities.executioner(command)
result = backupUtilities.prepareBackupMeta(backupDomain, backupName, tempStoragePath, backupPath) result = backupUtilities.prepareBackupMeta(backupDomain, backupName, tempStoragePath, backupPath)
@@ -1052,11 +1077,6 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
backupMetaData = ElementTree.parse(result[2]) backupMetaData = ElementTree.parse(result[2])
if os.path.islink(status) or os.path.islink(tempStoragePath or os.path.islink(backupPath)) or os.path.islink(
result[2]):
logging.CyberCPLogFileWriter.writeToFile('symlinked.')
return 0
databases = backupMetaData.findall('Databases/database') databases = backupMetaData.findall('Databases/database')
for database in databases: for database in databases:

View File

@@ -514,31 +514,35 @@ class cPanelImporter:
start = 0 start = 0
for items in data: for items in data:
if items.find('SOA') > -1: try:
SOACheck = 1 if items.find('SOA') > -1:
continue SOACheck = 1
continue
if SOACheck == 1 and items.find(')') > -1: if SOACheck == 1 and items.find(')') > -1:
SOACheck = 0 SOACheck = 0
start = 1 start = 1
continue continue
else: else:
pass pass
if start == 1: if start == 1:
if len(items) > 3: if len(items) > 3:
if items.find("DKIM1") > -1: if items.find("DKIM1") > -1:
continue continue
RecordsData = items.split('\t') RecordsData = items.split('\t')
if RecordsData[3] == 'A': if RecordsData[3] == 'A':
RecordsData[4] = ipAddress RecordsData[4] = ipAddress
if RecordsData[0].find(topLevelDomain) > -1: if RecordsData[0].find(topLevelDomain) > -1:
DNS.createDNSRecord(zone, RecordsData[0].replace('.', ''), RecordsData[3], RecordsData[4], 0, RecordsData[1]) DNS.createDNSRecord(zone, RecordsData[0].replace('.', ''), RecordsData[3], RecordsData[4], 0, RecordsData[1])
else: else:
DNS.createDNSRecord(zone, RecordsData[0] + '.' + topLevelDomain , RecordsData[3], RecordsData[4], 0, DNS.createDNSRecord(zone, RecordsData[0] + '.' + topLevelDomain , RecordsData[3], RecordsData[4], 0,
RecordsData[1]) RecordsData[1])
except BaseException, msg:
message = 'Failed while creating DNS entry for %s, error message: %s.' % (topLevelDomain, str(msg))
logging.statusWriter(self.logFile, message, 1)
message = 'DNS records successfully created for %s.' % (topLevelDomain) message = 'DNS records successfully created for %s.' % (topLevelDomain)
logging.statusWriter(self.logFile, message, 1) logging.statusWriter(self.logFile, message, 1)
@@ -599,7 +603,7 @@ class cPanelImporter:
try: try:
cursor.execute("CREATE DATABASE " + items.replace('.sql', '')) cursor.execute("CREATE DATABASE " + items.replace('.sql', ''))
except BaseException, msg: except BaseException, msg:
message = 'Error while restoring database %s from backup file %s, error message: %s' % (items.replace('.sql', ''), self.backupFile, str(msg)) message = 'Failed while restoring database %s from backup file %s, error message: %s' % (items.replace('.sql', ''), self.backupFile, str(msg))
logging.statusWriter(self.logFile, message, 1) logging.statusWriter(self.logFile, message, 1)
command = 'sudo mysql -u root -p' + password + ' ' + items.replace('.sql', '') command = 'sudo mysql -u root -p' + password + ' ' + items.replace('.sql', '')
@@ -632,7 +636,7 @@ class cPanelImporter:
try: try:
cursor.execute(items) cursor.execute(items)
except BaseException, msg: except BaseException, msg:
message = 'Error while restoring database %s from backup file %s, error message: %s' % ( message = 'Failed while restoring database %s from backup file %s, error message: %s' % (
items.replace('.sql', ''), self.backupFile, str(msg)) items.replace('.sql', ''), self.backupFile, str(msg))
logging.statusWriter(self.logFile, message, 1) logging.statusWriter(self.logFile, message, 1)
@@ -684,6 +688,8 @@ class cPanelImporter:
pass pass
else: else:
return 0 return 0
if self.RestoreDatabases(): if self.RestoreDatabases():
pass pass
else: else:
@@ -811,10 +817,13 @@ def main():
for items in os.listdir(args.path): for items in os.listdir(args.path):
if items.endswith('.tar.gz'): if items.endswith('.tar.gz'):
finalPath = '%s/%s' % (args.path.rstrip('/'), items) finalPath = '%s/%s' % (args.path.rstrip('/'), items)
cI = cPanelImporter(finalPath, LogFile) try:
if cI.MainController(): cI = cPanelImporter(finalPath, LogFile)
pass if cI.MainController():
else: pass
else:
pass
except:
pass pass
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -132,6 +132,8 @@ class mailUtilities:
emailAcct.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (domain, userName) emailAcct.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (domain, userName)
emailAcct.save() emailAcct.save()
else: else:
password = bcrypt.hashpw(str(password), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
emailAcct = EUsers(emailOwner=emailDomain, email=finalEmailUsername, password=password) emailAcct = EUsers(emailOwner=emailDomain, email=finalEmailUsername, password=password)
emailAcct.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (domain, userName) emailAcct.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (domain, userName)
emailAcct.save() emailAcct.save()

View File

@@ -321,12 +321,6 @@ class remoteTransferUtilities:
"%I-%M-%S-%a-%b-%Y") + "]" + " Backup Restore complete\n") "%I-%M-%S-%a-%b-%Y") + "]" + " Backup Restore complete\n")
writeToFile.writelines("completed[success]") writeToFile.writelines("completed[success]")
try:
shutil.rmtree("/home/backup/transfer-" + dir)
except:
pass
except BaseException, msg: except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [remoteTransferUtilities.startRestore]") logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [remoteTransferUtilities.startRestore]")

View File

@@ -1443,7 +1443,7 @@ class Upgrade:
impFile = ['/etc/pure-ftpd/pure-ftpd.conf', '/etc/pure-ftpd/pureftpd-pgsql.conf', impFile = ['/etc/pure-ftpd/pure-ftpd.conf', '/etc/pure-ftpd/pureftpd-pgsql.conf',
'/etc/pure-ftpd/pureftpd-mysql.conf', '/etc/pure-ftpd/pureftpd-ldap.conf', '/etc/pure-ftpd/pureftpd-mysql.conf', '/etc/pure-ftpd/pureftpd-ldap.conf',
'/etc/dovecot/dovecot.conf', '/etc/pdns/pdns.conf'] '/etc/dovecot/dovecot.conf', '/etc/pdns/pdns.conf', '/etc/pure-ftpd/db/mysql.conf']
for items in impFile: for items in impFile:
command = 'chmod 600 %s' % (items) command = 'chmod 600 %s' % (items)
@@ -1508,7 +1508,7 @@ class Upgrade:
@staticmethod @staticmethod
def upgradePDNS(): def upgradePDNS():
command = "yum install epel-release yum-plugin-priorities && curl -o /etc/yum.repos.d/powerdns-auth-42.repo https://repo.powerdns.com/repo-files/centos-auth-42.repo && yum --enablerepo=epel install pdns" command = "yum install epel-release && curl -o /etc/yum.repos.d/powerdns-auth-42.repo https://repo.powerdns.com/repo-files/centos-auth-42.repo && yum --enablerepo=epel install pdns"
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
@staticmethod @staticmethod
@@ -1572,6 +1572,9 @@ enabled=1"""
os.chdir("/usr/local") os.chdir("/usr/local")
command = 'yum remove yum-plugin-priorities -y'
Upgrade.executioner(command, 'remove yum-plugin-priorities', 0)
## Current Version ## Current Version
Version = version.objects.get(pk=1) Version = version.objects.get(pk=1)

View File

@@ -57,22 +57,22 @@ class ServerStatusUtil:
except: except:
pass pass
command = 'wget https://www.litespeedtech.com/packages/5.0/lsws-5.3.5-ent-x86_64-linux.tar.gz' command = 'wget https://www.litespeedtech.com/packages/5.0/lsws-5.3.8-ent-x86_64-linux.tar.gz'
if ServerStatusUtil.executioner(command, statusFile) == 0: if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0 return 0
command = 'tar zxf lsws-5.3.5-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP' command = 'tar zxf lsws-5.3.8-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP'
if ServerStatusUtil.executioner(command, statusFile) == 0: if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0 return 0
writeSerial = open('/usr/local/CyberCP/lsws-5.3.5/serial.no', 'w') writeSerial = open('/usr/local/CyberCP/lsws-5.3.8/serial.no', 'w')
writeSerial.writelines(licenseKey) writeSerial.writelines(licenseKey)
writeSerial.close() writeSerial.close()
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-5.3.5/') shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-5.3.8/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-5.3.5/') shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-5.3.8/')
os.chdir('/usr/local/CyberCP/lsws-5.3.5/') os.chdir('/usr/local/CyberCP/lsws-5.3.8/')
command = 'chmod +x install.sh' command = 'chmod +x install.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0: if ServerStatusUtil.executioner(command, statusFile) == 0:
@@ -99,7 +99,7 @@ class ServerStatusUtil:
pass pass
try: try:
os.rmdir("/usr/local/CyberCP/lsws-5.3.5") os.rmdir("/usr/local/CyberCP/lsws-5.3.8")
except: except:
pass pass

View File

@@ -328,7 +328,7 @@ app.controller('listFTPAccounts', function ($scope, $http) {
var data = { var data = {
ftpUserName: globalFTPUsername, ftpUserName: globalFTPUsername,
ftpPassword: $scope.ftpPassword, passwordByPass: $scope.ftpPassword,
}; };
var config = { var config = {

View File

@@ -391,7 +391,7 @@ app.controller('changeEmailPassword', function ($scope, $http) {
var data = { var data = {
domain: domain, domain: domain,
email: email, email: email,
password: password, passwordByPass: password,
}; };
var config = { var config = {