mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 14:56:10 +01:00
v1.7.4
This commit is contained in:
@@ -10,7 +10,7 @@ class secMiddleware:
|
|||||||
def __call__(self, request):
|
def __call__(self, request):
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
try:
|
try:
|
||||||
logging.writeToFile(request.body)
|
#logging.writeToFile(request.body)
|
||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
for key, value in data.iteritems():
|
for key, value in data.iteritems():
|
||||||
if type(value) == str or type(value) == unicode:
|
if type(value) == str or type(value) == unicode:
|
||||||
|
|||||||
@@ -560,7 +560,6 @@ def changeAdminPassword(request):
|
|||||||
if numberOfAdministrator == 0:
|
if numberOfAdministrator == 0:
|
||||||
ACLManager.createDefaultACLs()
|
ACLManager.createDefaultACLs()
|
||||||
acl = ACL.objects.get(name='admin')
|
acl = ACL.objects.get(name='admin')
|
||||||
|
|
||||||
token = hashPassword.generateToken('admin', '1234567')
|
token = hashPassword.generateToken('admin', '1234567')
|
||||||
|
|
||||||
email = 'usman@cyberpersons.com'
|
email = 'usman@cyberpersons.com'
|
||||||
@@ -568,7 +567,7 @@ def changeAdminPassword(request):
|
|||||||
firstName="Cyber", lastName="Panel", acl=acl, token=token)
|
firstName="Cyber", lastName="Panel", acl=acl, token=token)
|
||||||
admin.save()
|
admin.save()
|
||||||
|
|
||||||
vers = version(currentVersion="1.7", build=3)
|
vers = version(currentVersion="1.7", build=4)
|
||||||
vers.save()
|
vers.save()
|
||||||
|
|
||||||
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
||||||
@@ -619,7 +618,6 @@ def changeAdminPassword(request):
|
|||||||
'error_message': "None"}
|
'error_message': "None"}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
os.remove(randomFile)
|
os.remove(randomFile)
|
||||||
admin = Administrator.objects.get(userName="admin")
|
admin = Administrator.objects.get(userName="admin")
|
||||||
admin.password = hashPassword.hash_password(adminPass)
|
admin.password = hashPassword.hash_password(adminPass)
|
||||||
@@ -635,9 +633,6 @@ def changeAdminPassword(request):
|
|||||||
|
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
data_ret = {"changed": 0,
|
data_ret = {"changed": 0,
|
||||||
'error_message': str(msg)}
|
'error_message': str(msg)}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from databases.databaseManager import DatabaseManager
|
|||||||
from dns.dnsManager import DNSManager
|
from dns.dnsManager import DNSManager
|
||||||
from mailServer.mailserverManager import MailServerManager
|
from mailServer.mailserverManager import MailServerManager
|
||||||
from ftp.ftpManager import FTPManager
|
from ftp.ftpManager import FTPManager
|
||||||
from manageSSL.views import issueSSL
|
from manageSSL.views import issueSSL, obtainHostNameSSL, obtainMailServerSSL
|
||||||
from plogical.backupManager import BackupManager
|
from plogical.backupManager import BackupManager
|
||||||
import userManagment.views as um
|
import userManagment.views as um
|
||||||
from packages.packagesManager import PackagesManager
|
from packages.packagesManager import PackagesManager
|
||||||
@@ -732,3 +732,13 @@ class CloudManager:
|
|||||||
return getLogsFromFile(request)
|
return getLogsFromFile(request)
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
|
def serverSSL(self, request):
|
||||||
|
try:
|
||||||
|
request.session['userID'] = self.admin.pk
|
||||||
|
if self.data['type'] == 'hostname':
|
||||||
|
return obtainHostNameSSL(request)
|
||||||
|
else:
|
||||||
|
return obtainMailServerSSL(request)
|
||||||
|
except BaseException, msg:
|
||||||
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|||||||
@@ -159,6 +159,10 @@ def router(request):
|
|||||||
return cm.deleteRule()
|
return cm.deleteRule()
|
||||||
elif controller == 'getLogsFromFile':
|
elif controller == 'getLogsFromFile':
|
||||||
return cm.getLogsFromFile(request)
|
return cm.getLogsFromFile(request)
|
||||||
|
elif controller == 'serverSSL':
|
||||||
|
return cm.serverSSL(request)
|
||||||
|
else:
|
||||||
|
return cm.ajaxPre(0, 'This function is not available in your version of CyberPanel.')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
cm = CloudManager(None)
|
cm = CloudManager(None)
|
||||||
|
|||||||
@@ -63,7 +63,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['ftpPassword']
|
||||||
path = data['path']
|
|
||||||
domainName = data['ftpDomain']
|
domainName = data['ftpDomain']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -73,10 +73,14 @@ class FTPManager:
|
|||||||
|
|
||||||
admin = Administrator.objects.get(id=userID)
|
admin = Administrator.objects.get(id=userID)
|
||||||
|
|
||||||
|
try:
|
||||||
|
path = data['path']
|
||||||
if len(path) > 0:
|
if len(path) > 0:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
path = 'None'
|
path = 'None'
|
||||||
|
except:
|
||||||
|
path = 'None'
|
||||||
|
|
||||||
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/ftpUtilities.py"
|
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/ftpUtilities.py"
|
||||||
execPath = execPath + " submitFTPCreation --domainName " + domainName + " --userName " + userName \
|
execPath = execPath + " submitFTPCreation --domainName " + domainName + " --userName " + userName \
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ class InstallCyberPanel:
|
|||||||
if res != 0:
|
if res != 0:
|
||||||
failed = True
|
failed = True
|
||||||
else:
|
else:
|
||||||
command = 'yum -y install lsphp*'
|
command = 'yum -y groupinstall lsphp-all'
|
||||||
cmd = shlex.split(command)
|
cmd = shlex.split(command)
|
||||||
res = subprocess.call(cmd)
|
res = subprocess.call(cmd)
|
||||||
if install.preFlightsChecks.resFailed(self.distro, res):
|
if install.preFlightsChecks.resFailed(self.distro, res):
|
||||||
@@ -351,6 +351,48 @@ class InstallCyberPanel:
|
|||||||
logging.InstallLog.writeToFile("LiteSpeed PHPs successfully installed!")
|
logging.InstallLog.writeToFile("LiteSpeed PHPs successfully installed!")
|
||||||
InstallCyberPanel.stdOut("LiteSpeed PHPs successfully installed!")
|
InstallCyberPanel.stdOut("LiteSpeed PHPs successfully installed!")
|
||||||
|
|
||||||
|
## only php 71
|
||||||
|
if self.distro == centos:
|
||||||
|
count = 0
|
||||||
|
while (1):
|
||||||
|
command = 'yum install lsphp71 lsphp71-json lsphp71-xmlrpc lsphp71-xml lsphp71-tidy lsphp71-soap lsphp71-snmp lsphp71-recode lsphp71-pspell lsphp71-process lsphp71-pgsql lsphp71-pear lsphp71-pdo lsphp71-opcache lsphp71-odbc lsphp71-mysqlnd lsphp71-mcrypt lsphp71-mbstring lsphp71-ldap lsphp71-intl lsphp71-imap lsphp71-gmp lsphp71-gd lsphp71-enchant lsphp71-dba lsphp71-common lsphp71-bcmath -y'
|
||||||
|
cmd = shlex.split(command)
|
||||||
|
res = subprocess.call(cmd)
|
||||||
|
if res == 1:
|
||||||
|
count = count + 1
|
||||||
|
InstallCyberPanel.stdOut(
|
||||||
|
"Trying to install LiteSpeed PHP 7.1, trying again, try number: " + str(count))
|
||||||
|
if count == 3:
|
||||||
|
logging.InstallLog.writeToFile(
|
||||||
|
"Failed to install LiteSpeed PHP 7.1, exiting installer! [installAllPHPVersions]")
|
||||||
|
InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt")
|
||||||
|
os._exit(0)
|
||||||
|
else:
|
||||||
|
logging.InstallLog.writeToFile("LiteSpeed PHP 7.1 successfully installed!")
|
||||||
|
InstallCyberPanel.stdOut("LiteSpeed PHP 7.1 successfully installed!")
|
||||||
|
break
|
||||||
|
|
||||||
|
## only php 72
|
||||||
|
count = 0
|
||||||
|
while (1):
|
||||||
|
command = 'yum install -y lsphp72 lsphp72-json lsphp72-xmlrpc lsphp72-xml lsphp72-tidy lsphp72-soap lsphp72-snmp lsphp72-recode lsphp72-pspell lsphp72-process lsphp72-pgsql lsphp72-pear lsphp72-pdo lsphp72-opcache lsphp72-odbc lsphp72-mysqlnd lsphp72-mcrypt lsphp72-mbstring lsphp72-ldap lsphp72-intl lsphp72-imap lsphp72-gmp lsphp72-gd lsphp72-enchant lsphp72-dba lsphp72-common lsphp72-bcmath'
|
||||||
|
cmd = shlex.split(command)
|
||||||
|
res = subprocess.call(cmd)
|
||||||
|
if res == 1:
|
||||||
|
count = count + 1
|
||||||
|
InstallCyberPanel.stdOut(
|
||||||
|
"Trying to install LiteSpeed PHP 7.1, trying again, try number: " + str(count))
|
||||||
|
if count == 3:
|
||||||
|
logging.InstallLog.writeToFile(
|
||||||
|
"Failed to install LiteSpeed PHP 7.1, exiting installer! [installAllPHPVersions]")
|
||||||
|
InstallCyberPanel.stdOut(
|
||||||
|
"Installation failed, consult: /var/log/installLogs.txt")
|
||||||
|
os._exit(0)
|
||||||
|
else:
|
||||||
|
logging.InstallLog.writeToFile("LiteSpeed PHP 7.1 successfully installed!")
|
||||||
|
InstallCyberPanel.stdOut("LiteSpeed PHP 7.1 successfully installed!")
|
||||||
|
break
|
||||||
|
|
||||||
## break for outer loop
|
## break for outer loop
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -143,13 +143,10 @@ def loadLoginPage(request):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
||||||
numberOfAdministrator = Administrator.objects.count()
|
numberOfAdministrator = Administrator.objects.count()
|
||||||
|
|
||||||
password = hashPassword.hash_password('1234567')
|
password = hashPassword.hash_password('1234567')
|
||||||
|
|
||||||
if numberOfAdministrator == 0:
|
if numberOfAdministrator == 0:
|
||||||
|
|
||||||
ACLManager.createDefaultACLs()
|
ACLManager.createDefaultACLs()
|
||||||
|
|
||||||
acl = ACL.objects.get(name='admin')
|
acl = ACL.objects.get(name='admin')
|
||||||
|
|
||||||
token = hashPassword.generateToken('admin', '1234567')
|
token = hashPassword.generateToken('admin', '1234567')
|
||||||
@@ -159,7 +156,7 @@ def loadLoginPage(request):
|
|||||||
firstName="Cyber",lastName="Panel", acl=acl, token=token)
|
firstName="Cyber",lastName="Panel", acl=acl, token=token)
|
||||||
admin.save()
|
admin.save()
|
||||||
|
|
||||||
vers = version(currentVersion="1.7",build=3)
|
vers = version(currentVersion="1.7", build=4)
|
||||||
vers.save()
|
vers.save()
|
||||||
|
|
||||||
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import views
|
|||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^$', views.loadSSLHome, name='loadSSLHome'),
|
url(r'^$', views.loadSSLHome, name='loadSSLHome'),
|
||||||
|
|
||||||
|
|
||||||
url(r'^manageSSL', views.manageSSL, name='manageSSL'),
|
url(r'^manageSSL', views.manageSSL, name='manageSSL'),
|
||||||
url(r'^issueSSL', views.issueSSL, name='issueSSL'),
|
url(r'^issueSSL', views.issueSSL, name='issueSSL'),
|
||||||
|
|
||||||
|
|||||||
@@ -154,12 +154,12 @@ def obtainHostNameSSL(request):
|
|||||||
output = subprocess.check_output(shlex.split(execPath))
|
output = subprocess.check_output(shlex.split(execPath))
|
||||||
|
|
||||||
if output.find("1,None") > -1:
|
if output.find("1,None") > -1:
|
||||||
data_ret = {"SSL": 1,
|
data_ret = {"status": 1, "SSL": 1,
|
||||||
'error_message': "None"}
|
'error_message': "None"}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
else:
|
else:
|
||||||
data_ret = {"SSL": 0,
|
data_ret = {"status": 0, "SSL": 0,
|
||||||
'error_message': output}
|
'error_message': output}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -167,12 +167,12 @@ def obtainHostNameSSL(request):
|
|||||||
## ssl issue ends
|
## ssl issue ends
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException,msg:
|
||||||
data_ret = {"SSL": 0,
|
data_ret = {"status": 0, "SSL": 0,
|
||||||
'error_message': str(msg)}
|
'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
data_ret = {"SSL": 0,
|
data_ret = {"status": 0, "SSL": 0,
|
||||||
'error_message': str(msg)}
|
'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -224,12 +224,12 @@ def obtainMailServerSSL(request):
|
|||||||
output = subprocess.check_output(shlex.split(execPath))
|
output = subprocess.check_output(shlex.split(execPath))
|
||||||
|
|
||||||
if output.find("1,None") > -1:
|
if output.find("1,None") > -1:
|
||||||
data_ret = {"SSL": 1,
|
data_ret = {"status": 1, "SSL": 1,
|
||||||
'error_message': "None"}
|
'error_message': "None"}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
else:
|
else:
|
||||||
data_ret = {"SSL": 0,
|
data_ret = {"status": 0, "SSL": 0,
|
||||||
'error_message': output}
|
'error_message': output}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -238,12 +238,12 @@ def obtainMailServerSSL(request):
|
|||||||
|
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException,msg:
|
||||||
data_ret = {"SSL": 0,
|
data_ret = {"status": 0, "SSL": 0,
|
||||||
'error_message': str(msg)}
|
'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except KeyError,msg:
|
except KeyError,msg:
|
||||||
data_ret = {"SSL": 0,
|
data_ret = {"status": 0, "SSL": 0,
|
||||||
'error_message': str(msg)}
|
'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -126,7 +126,6 @@ class FTPUtilities:
|
|||||||
path = path.lstrip("/")
|
path = path.lstrip("/")
|
||||||
|
|
||||||
if path != 'None':
|
if path != 'None':
|
||||||
|
|
||||||
path = "/home/" + domainName + "/public_html/" + path
|
path = "/home/" + domainName + "/public_html/" + path
|
||||||
|
|
||||||
## Security Check
|
## Security Check
|
||||||
|
|||||||
@@ -313,14 +313,16 @@ milter_default_action = accept
|
|||||||
def checkHome():
|
def checkHome():
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
|
FNULL = open(os.devnull, 'w')
|
||||||
|
|
||||||
command = "sudo mkdir " + mailUtilities.cyberPanelHome
|
command = "sudo mkdir " + mailUtilities.cyberPanelHome
|
||||||
subprocess.call(shlex.split(command))
|
subprocess.call(shlex.split(command), stdout=FNULL)
|
||||||
|
|
||||||
command = "sudo chown -R cyberpanel:cyberpanel " + mailUtilities.cyberPanelHome
|
command = "sudo chown -R cyberpanel:cyberpanel " + mailUtilities.cyberPanelHome
|
||||||
subprocess.call(shlex.split(command))
|
subprocess.call(shlex.split(command), stdout=FNULL)
|
||||||
except:
|
except:
|
||||||
command = "sudo chown -R cyberpanel:cyberpanel " + mailUtilities.cyberPanelHome
|
command = "sudo chown -R cyberpanel:cyberpanel " + mailUtilities.cyberPanelHome
|
||||||
subprocess.call(shlex.split(command))
|
subprocess.call(shlex.split(command), stdout=FNULL)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException,msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [checkHome]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [checkHome]")
|
||||||
|
|||||||
@@ -145,16 +145,6 @@ class Upgrade:
|
|||||||
Upgrade.stdOut(str(msg) + " [setupVirtualEnv]")
|
Upgrade.stdOut(str(msg) + " [setupVirtualEnv]")
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def upgradeOpenLiteSpeed():
|
|
||||||
try:
|
|
||||||
command = "yum upgrade -y openlitespeed"
|
|
||||||
if Upgrade.executioner(command) == 1:
|
|
||||||
Upgrade.stdOut('OpenLiteSpeed Upgraded.')
|
|
||||||
except OSError, msg:
|
|
||||||
Upgrade.stdOut(str(msg) + " [upgradeOpenLiteSpeed]")
|
|
||||||
os._exit(0)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def updateGunicornConf():
|
def updateGunicornConf():
|
||||||
try:
|
try:
|
||||||
@@ -204,7 +194,6 @@ WantedBy=multi-user.target"""
|
|||||||
def fileManager():
|
def fileManager():
|
||||||
## Copy File manager files
|
## Copy File manager files
|
||||||
|
|
||||||
|
|
||||||
command = "rm -rf /usr/local/lsws/Example/html/FileManager"
|
command = "rm -rf /usr/local/lsws/Example/html/FileManager"
|
||||||
Upgrade.executioner(command)
|
Upgrade.executioner(command)
|
||||||
|
|
||||||
@@ -319,6 +308,12 @@ WantedBy=multi-user.target"""
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
command = "echo 'ALTER TABLE loginSystem_administrator ADD token varchar(500);' | python manage.py dbshell"
|
||||||
|
subprocess.call(command, shell=True)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
command = "echo 'ALTER TABLE loginSystem_administrator ADD acl_id integer;' | python manage.py dbshell"
|
command = "echo 'ALTER TABLE loginSystem_administrator ADD acl_id integer;' | python manage.py dbshell"
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
@@ -448,25 +443,6 @@ WantedBy=multi-user.target"""
|
|||||||
command = "python manage.py makemigrations emailMarketing"
|
command = "python manage.py makemigrations emailMarketing"
|
||||||
Upgrade.executioner(command)
|
Upgrade.executioner(command)
|
||||||
|
|
||||||
data = open('/usr/local/CyberCP/emailMarketing/migrations/0001_initial.py', 'r').readline()
|
|
||||||
writeToFile = open('/usr/local/CyberCP/emailMarketing/migrations/0001_initial.py', 'w')
|
|
||||||
skipCheck = 0
|
|
||||||
|
|
||||||
for items in data:
|
|
||||||
if items.find('dependencies') > -1:
|
|
||||||
skipCheck = 1
|
|
||||||
|
|
||||||
if items.find(']') > -1 and skipCheck == 1:
|
|
||||||
skipCheck = 0
|
|
||||||
continue
|
|
||||||
|
|
||||||
if skipCheck == 0:
|
|
||||||
writeToFile.writelines(items)
|
|
||||||
|
|
||||||
writeToFile.close()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
command = "python manage.py migrate emailMarketing"
|
command = "python manage.py migrate emailMarketing"
|
||||||
Upgrade.executioner(command)
|
Upgrade.executioner(command)
|
||||||
except:
|
except:
|
||||||
@@ -498,6 +474,7 @@ WantedBy=multi-user.target"""
|
|||||||
count = 0
|
count = 0
|
||||||
while (1):
|
while (1):
|
||||||
command = "wget https://cyberpanel.net/CyberPanel." + versionNumbring
|
command = "wget https://cyberpanel.net/CyberPanel." + versionNumbring
|
||||||
|
#command = "wget https://cyberpanel.net/CyberPanel.1.7.4.tar.gz"
|
||||||
res = subprocess.call(shlex.split(command))
|
res = subprocess.call(shlex.split(command))
|
||||||
|
|
||||||
if res == 1:
|
if res == 1:
|
||||||
@@ -526,6 +503,7 @@ WantedBy=multi-user.target"""
|
|||||||
|
|
||||||
count = 1
|
count = 1
|
||||||
while (1):
|
while (1):
|
||||||
|
#command = "tar zxf CyberPanel.1.7.4.tar.gz"
|
||||||
command = "tar zxf CyberPanel." + versionNumbring
|
command = "tar zxf CyberPanel." + versionNumbring
|
||||||
res = subprocess.call(shlex.split(command))
|
res = subprocess.call(shlex.split(command))
|
||||||
|
|
||||||
@@ -584,10 +562,6 @@ WantedBy=multi-user.target"""
|
|||||||
## Move static files
|
## Move static files
|
||||||
|
|
||||||
Upgrade.staticContent()
|
Upgrade.staticContent()
|
||||||
|
|
||||||
## Upgrade File Manager
|
|
||||||
|
|
||||||
Upgrade.fileManager()
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -733,6 +707,35 @@ WantedBy=multi-user.target"""
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def fixPermissions():
|
||||||
|
try:
|
||||||
|
|
||||||
|
Upgrade.stdOut("Fixing permissions..")
|
||||||
|
|
||||||
|
command = 'chown -R cyberpanel:cyberpanel /usr/local/CyberCP'
|
||||||
|
cmd = shlex.split(command)
|
||||||
|
res = subprocess.call(cmd)
|
||||||
|
|
||||||
|
command = 'chown -R cyberpanel:cyberpanel /usr/local/lscp'
|
||||||
|
cmd = shlex.split(command)
|
||||||
|
res = subprocess.call(cmd)
|
||||||
|
|
||||||
|
command = 'chown -R lscpd:lscpd /usr/local/lscp/cyberpanel'
|
||||||
|
cmd = shlex.split(command)
|
||||||
|
subprocess.call(cmd)
|
||||||
|
|
||||||
|
Upgrade.stdOut("Permissions updated.")
|
||||||
|
|
||||||
|
except OSError, msg:
|
||||||
|
Upgrade.stdOut(str(msg) + " [fixPermissions]")
|
||||||
|
return 0
|
||||||
|
except ValueError, msg:
|
||||||
|
Upgrade.stdOut(str(msg) + " [fixPermissions]")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|
||||||
@@ -763,12 +766,8 @@ WantedBy=multi-user.target"""
|
|||||||
##
|
##
|
||||||
Upgrade.installPYDNS()
|
Upgrade.installPYDNS()
|
||||||
Upgrade.downloadAndUpgrade(Version, versionNumbring)
|
Upgrade.downloadAndUpgrade(Version, versionNumbring)
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
Upgrade.installTLDExtract()
|
Upgrade.installTLDExtract()
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
Upgrade.mailServerMigrations()
|
Upgrade.mailServerMigrations()
|
||||||
@@ -784,13 +783,9 @@ WantedBy=multi-user.target"""
|
|||||||
Upgrade.applyLoginSystemMigrations()
|
Upgrade.applyLoginSystemMigrations()
|
||||||
Upgrade.enableServices()
|
Upgrade.enableServices()
|
||||||
|
|
||||||
## Upgrade OpenLiteSpeed
|
|
||||||
|
|
||||||
if os.path.exists('/usr/local/lsws/bin/openlitespeed'):
|
|
||||||
Upgrade.upgradeOpenLiteSpeed()
|
|
||||||
|
|
||||||
Upgrade.setupCLI()
|
Upgrade.setupCLI()
|
||||||
Upgrade.installLSCPD()
|
Upgrade.installLSCPD()
|
||||||
|
Upgrade.fixPermissions()
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
## Upgrade version
|
## Upgrade version
|
||||||
@@ -805,6 +800,4 @@ WantedBy=multi-user.target"""
|
|||||||
|
|
||||||
Upgrade.stdOut("Upgrade Completed.")
|
Upgrade.stdOut("Upgrade Completed.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Upgrade.upgrade()
|
Upgrade.upgrade()
|
||||||
|
|||||||
Reference in New Issue
Block a user