From a010f7982ebd44ca42984894910b94d4495d30a9 Mon Sep 17 00:00:00 2001 From: usmannasir <01-134132-158@student.bahria.edu.pk> Date: Sat, 10 Feb 2018 12:10:38 +0500 Subject: [PATCH] Bug fix to Websites and NameServer creation! --- dns/views.py | 4 ++-- filemanager/urls.py | 2 +- install/install.py | 16 ++++++++++------ install/installCyberPanel.py | 8 +++----- websiteFunctions/urls.py | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/dns/views.py b/dns/views.py index 5eecd8349..ddfd64307 100644 --- a/dns/views.py +++ b/dns/views.py @@ -143,7 +143,7 @@ def NSCreation(request): record = Records(domainOwner=newZone, domain_id=newZone.id, - name=domainForNS, + name=ns1, type="A", content=firstNSIP, ttl=3600, @@ -168,7 +168,7 @@ def NSCreation(request): record = Records(domainOwner=newZone, domain_id=newZone.id, - name=domainForNS, + name=ns2, type="A", content=secondNSIP, ttl=3600, diff --git a/filemanager/urls.py b/filemanager/urls.py index 0dbd0c48b..0dc377bc0 100644 --- a/filemanager/urls.py +++ b/filemanager/urls.py @@ -2,6 +2,6 @@ from django.conf.urls import url import views urlpatterns = [ - url(r'^(?P([\da-z\.-]+\.[a-z\.]{2,6}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.loadFileManagerHome, name='loadFileManagerHome'), + url(r'^(?P([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.loadFileManagerHome, name='loadFileManagerHome'), ] diff --git a/install/install.py b/install/install.py index e2a7c372c..8289e7366 100644 --- a/install/install.py +++ b/install/install.py @@ -33,7 +33,7 @@ class preFlightsChecks: command = "sestatus" output = subprocess.check_output(shlex.split(command)) - if output.find("disabled") > -1: + if output.find("disabled") > -1 or output.find("permissive") > -1: logging.InstallLog.writeToFile("SELinux Check OK. [checkIfSeLinuxDisabled]") preFlightsChecks.stdOut("SELinux Check OK.") return 1 @@ -45,6 +45,9 @@ class preFlightsChecks: except BaseException,msg: logging.InstallLog.writeToFile(str(msg) + "[checkIfSeLinuxDisabled]") + logging.InstallLog.writeToFile("SELinux Check OK. [checkIfSeLinuxDisabled]") + preFlightsChecks.stdOut("SELinux Check OK.") + return 1 def checkPythonVersion(self): if sys.version_info[0] == 2 and sys.version_info[1] == 7: @@ -575,8 +578,8 @@ class preFlightsChecks: count = 0 while (1): - #command = "wget http://cyberpanel.net/CyberPanel.1.6.0.tar.gz" - command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz" + command = "wget http://cyberpanel.net/CyberPanel.1.6.0.tar.gz" + #command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz" res = subprocess.call(shlex.split(command)) if res == 1: @@ -595,8 +598,8 @@ class preFlightsChecks: count = 0 while(1): - #command = "tar zxf CyberPanel.1.6.0.tar.gz" - command = "tar zxf CyberPanelTemp.tar.gz" + command = "tar zxf CyberPanel.1.6.0.tar.gz" + #command = "tar zxf CyberPanelTemp.tar.gz" res = subprocess.call(shlex.split(command)) @@ -2290,7 +2293,7 @@ class preFlightsChecks: command = "pip install certbot" cmd = shlex.split(command) - subprocess.call(cmd) + res = subprocess.call(cmd) if res == 1: count = count + 1 @@ -2335,6 +2338,7 @@ class preFlightsChecks: count = 0 while (1): + cmd = [] cmd.append("yum") cmd.append("-y") cmd.append("install") diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 314f56a95..3d2d422e7 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -698,10 +698,8 @@ class InstallCyberPanel: count = count + 1 InstallCyberPanel.stdOut("Trying to start PureFTPD instance, trying again, try number: " + str(count)) if count == 3: - logging.InstallLog.writeToFile( - "Failed to start PureFTPD instance, exiting installer! [startPureFTPD]") - InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt") - sys.exit() + logging.InstallLog.writeToFile("Failed to start PureFTPD instance, you can do this manually later using systemctl start pure-ftpd [startPureFTPD]") + break else: logging.InstallLog.writeToFile("PureFTPD instance successfully started!") InstallCyberPanel.stdOut("PureFTPD instance successfully started!") @@ -982,7 +980,7 @@ class InstallCyberPanel: count = 0 while(1): - command = 'yum -y install pcre-devel openssl-devel expat-devel geoip-devel zlib-devel udns-devel' + command = 'yum -y install pcre-devel openssl-devel expat-devel geoip-devel zlib-devel udns-devel which curl' cmd = shlex.split(command) res = subprocess.call(cmd) diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py index f145c449e..63a34ff8e 100644 --- a/websiteFunctions/urls.py +++ b/websiteFunctions/urls.py @@ -25,7 +25,7 @@ urlpatterns = [ url(r'^saveWebsiteChanges', views.saveWebsiteChanges, name='saveWebsiteChanges'), - url(r'^(?P([\da-z\.-]+\.[a-z\.]{2,6}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.domain, name='domain'), + url(r'^(?P([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.domain, name='domain'), url(r'^getDataFromLogFile', views.getDataFromLogFile, name='getDataFromLogFile'), url(r'^fetchErrorLogs', views.fetchErrorLogs, name='fetchErrorLogs'),