Ubuntu support

This commit is contained in:
usmannasir
2018-11-06 00:19:58 +05:00
parent c66c71e348
commit 00d9e7f942
16 changed files with 313 additions and 394 deletions

View File

@@ -41,7 +41,7 @@ app.filter('getwebsitename', function() {
if(domain !== undefined) {
domain = domain.replace("-", "");
domain = domain.replace(/-/g, '');
var domainName = domain.split(".");

View File

@@ -3,9 +3,6 @@
*/
/* Java script code to create database */
app.controller('createDatabase', function($scope,$http) {
@@ -38,8 +35,7 @@ app.controller('createDatabase', function($scope,$http) {
// getting website username
webUserName = databaseWebsite.replace("-", "");
webUserName = databaseWebsite.replace(/-/g, '');
webUserName = webUserName.split(".")[0];
if(webUserName.length > 5){
@@ -54,7 +50,7 @@ app.controller('createDatabase', function($scope,$http) {
databaseWebsite:databaseWebsite,
dbName:dbName,
dbUsername:dbUsername,
dbPassword:dbPassword,
dbPassword:dbPassword
};
var config = {
@@ -281,7 +277,6 @@ app.controller('deleteDatabase', function($scope,$http) {
/* Java script code to delete database ends here */
/* Java script code to list databases */

View File

@@ -4,10 +4,10 @@ urlpatterns = [
url(r'^$', views.emailMarketing, name='emailMarketing'),
url(r'^fetchUsers$', views.fetchUsers, name='fetchUsers'),
url(r'^enableDisableMarketing$', views.enableDisableMarketing, name='enableDisableMarketing'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/emailLists$', views.createEmailList, name='createEmailList'),
url(r'^(?P<domain>(.*))/emailLists$', views.createEmailList, name='createEmailList'),
url(r'^submitEmailList$', views.submitEmailList, name='submitEmailList'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/manageLists$', views.manageLists, name='manageLists'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/manageSMTP$', views.manageSMTP, name='manageSMTP'),
url(r'^(?P<domain>(.*))/manageLists$', views.manageLists, name='manageLists'),
url(r'^(?P<domain>(.*))/manageSMTP$', views.manageSMTP, name='manageSMTP'),
url(r'^fetchEmails$', views.fetchEmails, name='fetchEmails'),
url(r'^deleteList$', views.deleteList, name='deleteList'),
url(r'^emailVerificationJob$', views.emailVerificationJob, name='emailVerificationJob'),

View File

@@ -8,7 +8,6 @@ urlpatterns = [
url(r'^getFurtherDomains$', views.getFurtherDomains, name='getFurtherDomains'),
url(r'^enableDisableEmailLimits$', views.enableDisableEmailLimits, name='enableDisableEmailLimits'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.emailLimits, name='emailLimits'),
url(r'^changeDomainLimit$', views.changeDomainLimit, name='changeDomainLimit'),
url(r'^getFurtherEmail$', views.getFurtherEmail, name='getFurtherEmail'),
@@ -35,6 +34,8 @@ urlpatterns = [
url(r'^savePolicyServerStatus$', views.savePolicyServerStatus, name='savePolicyServerStatus'),
url(r'^(?P<domain>(.*))$', views.emailLimits, name='emailLimits'),
]

View File

@@ -14,7 +14,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
var editor = ace.edit("htmlEditorContent");
var aceEditorMode = '';
var domainName = window.location.pathname.split("/")[2];
var domainName = $("#domainNameInitial").text();
var domainRandomSeed = "";
var homePathBack = "/home/"+domainName;

View File

@@ -40,7 +40,7 @@
<!--- navigation bar ---->
<nav id="navBar" class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#"><img id="logo" src="{% static 'filemanager/images/fileManager.png' %}">{% trans " File Manager" %} </a>
<a class="navbar-brand" href="#"><img id="logo" src="{% static 'filemanager/images/fileManager.png' %}">{% trans " File Manager" %} <span style="display: none" id="domainNameInitial">{{ domainName }}</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

View File

@@ -2,10 +2,10 @@ from django.conf.urls import url
import views
urlpatterns = [
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.loadFileManagerHome, name='loadFileManagerHome'),
url(r'^changePermissions',views.changePermissions, name='changePermissions'),
url(r'^downloadFile',views.downloadFile, name='downloadFile'),
url(r'^createTemporaryFile',views.createTemporaryFile, name='createTemporaryFile'),
url(r'^changePermissions$',views.changePermissions, name='changePermissions'),
url(r'^downloadFile$',views.downloadFile, name='downloadFile'),
url(r'^createTemporaryFile$',views.createTemporaryFile, name='createTemporaryFile'),
url(r'^(?P<domain>(.*))$', views.loadFileManagerHome, name='loadFileManagerHome'),
]

View File

@@ -25,7 +25,7 @@ def loadFileManagerHome(request,domain):
currentACL = ACLManager.loadedACL(userID)
if ACLManager.checkOwnership(domain, admin, currentACL) == 1:
return render(request, 'filemanager/index.html')
return render(request, 'filemanager/index.html', {'domainName': domain})
else:
return ACLManager.loadError()
else:

227
install/install.py Executable file → Normal file
View File

@@ -9,7 +9,6 @@ from firewallUtilities import FirewallUtilities
import time
import string
import random
import socket
import errno
from os.path import *
from stat import *
@@ -17,15 +16,15 @@ from stat import *
# There can not be peace without first a great suffering.
#distros
centos=0
ubuntu=1
class preFlightsChecks:
cyberPanelMirror = "mirror.cyberpanel.net/pip"
def __init__(self, rootPath, ip, path, cwd, cyberPanelPath, distro):
def __init__(self,rootPath,ip,path,cwd,cyberPanelPath, distro):
self.ipAddr = ip
self.path = path
self.cwd = cwd
@@ -41,11 +40,32 @@ class preFlightsChecks:
print("[" + time.strftime("%I-%M-%S-%a-%b-%Y") + "] " + message + "\n")
print ("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] #########################################################################\n")
if log:
logging.InstallLog.writeToFile(message)
if do_exit:
sys.exit(code)
def checkIfSeLinuxDisabled(self):
try:
command = "sestatus"
output = subprocess.check_output(shlex.split(command))
if output.find("disabled") > -1 or output.find("permissive") > -1:
logging.InstallLog.writeToFile("SELinux Check OK. [checkIfSeLinuxDisabled]")
preFlightsChecks.stdOut("SELinux Check OK.")
return 1
else:
logging.InstallLog.writeToFile("SELinux is enabled, please disable SELinux and restart the installation!")
preFlightsChecks.stdOut("Installation failed, consult: /var/log/installLogs.txt")
os._exit(0)
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:
return 1
@@ -54,11 +74,10 @@ class preFlightsChecks:
os._exit(0)
def setup_account_cyberpanel(self):
self.stdOut("Setup Cyberpanel account")
try:
count = 0
if self.distro == centos:
count = 0
while (1):
command = "yum install sudo -y"
cmd = shlex.split(command)
@@ -116,9 +135,11 @@ class preFlightsChecks:
if res == 1:
count = count + 1
preFlightsChecks.stdOut("Not able to add user cyberpanel to system, trying again, try number: " + str(count) + "\n")
preFlightsChecks.stdOut(
"Not able to add user cyberpanel to system, trying again, try number: " + str(count) + "\n")
if count == 3:
logging.InstallLog.writeToFile("We are not able add user cyberpanel to system, exiting the installer. [setup_account_cyberpanel]")
logging.InstallLog.writeToFile(
"We are not able add user cyberpanel to system, exiting the installer. [setup_account_cyberpanel]")
preFlightsChecks.stdOut("Installation failed, consult: /var/log/installLogs.txt")
os._exit(0)
else:
@@ -168,15 +189,24 @@ class preFlightsChecks:
###############################
count = 0
self.stdOut("Create /etc/letsencrypt directory")
try:
os.mkdir("/etc/letsencrypt")
except OSError as e:
if e.errno != errno.EEXIST:
self.stdOut("Error creating /etc/letsencrypt directory: " + str(e) +
" Installer can continue without this [setup_account_cyberpanel] ",1)
while (1):
command = "mkdir /etc/letsencrypt"
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
count = count + 1
preFlightsChecks.stdOut("We are trying to create Let's Encrypt directory to store SSLs, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to create Let's Encrypt directory to store SSLs. Installer can continue without this.. [setup_account_cyberpanel]")
else:
pass
logging.InstallLog.writeToFile("Successfully created Let's Encrypt directory!")
preFlightsChecks.stdOut("Successfully created Let's Encrypt directory!")
break
##
@@ -227,7 +257,8 @@ class preFlightsChecks:
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res != 0:
logging.InstallLog.writeToFile("Unable to download Ubuntu CyberPanel installer! [installCyberPanelRepo]:"
logging.InstallLog.writeToFile(
"Unable to download Ubuntu CyberPanel installer! [installCyberPanelRepo]:"
" Error #" + str(res))
preFlightsChecks.stdOut("Unable to download Ubuntu CyberPanel installer! [installCyberPanelRepo]:"
" Error #" + str(res))
@@ -274,8 +305,6 @@ class preFlightsChecks:
logging.InstallLog.writeToFile("CyberPanel Repo added!")
preFlightsChecks.stdOut("CyberPanel Repo added!")
break
return 0
def enableEPELRepo(self):
try:
@@ -314,7 +343,6 @@ class preFlightsChecks:
return 1
def install_pip(self):
self.stdOut("Install pip")
count = 0
@@ -337,7 +365,6 @@ class preFlightsChecks:
preFlightsChecks.stdOut("PIP successfully installed!")
break
def install_python_dev(self):
self.stdOut("Install python development environment")
count = 0
@@ -360,7 +387,6 @@ class preFlightsChecks:
preFlightsChecks.stdOut("Python development tools successfully installed!")
break
def install_gcc(self):
self.stdOut("Install gcc")
count = 0
@@ -385,7 +411,6 @@ class preFlightsChecks:
break
def install_python_setup_tools(self):
self.stdOut("Install python setup tools")
count = 0
while (1):
command = "yum -y install python-setuptools"
@@ -407,7 +432,6 @@ class preFlightsChecks:
break
def install_python_requests(self):
self.stdOut("Install python requests")
try:
import requests
@@ -554,7 +578,6 @@ class preFlightsChecks:
break
def install_django(self):
self.stdOut("Install Django")
count = 0
while (1):
command = "pip install django==1.11"
@@ -594,17 +617,6 @@ class preFlightsChecks:
preFlightsChecks.stdOut("MySQL-python successfully installed!")
break
if self.distro == ubuntu:
command = "pip install MySQL-python"
res = subprocess.call(shlex.split(command))
if res != 0:
logging.InstallLog.writeToFile(
"Unable to install MySQL-python, exiting installer! [install_python_mysql_library] Error: " + str(res))
preFlightsChecks.stdOut(
"Unable to install MySQL-python, exiting installer! [install_python_mysql_library] Error: " + str(res))
os._exit(os.EX_OSERR)
def install_gunicorn(self):
self.stdOut("Install GUnicorn")
count = 0
@@ -626,7 +638,6 @@ class preFlightsChecks:
preFlightsChecks.stdOut("GUNICORN successfully installed!")
break
def setup_gunicorn(self):
try:
@@ -672,7 +683,6 @@ class preFlightsChecks:
preFlightsChecks.stdOut("Not able to setup gunicorn, see install log.")
def install_psutil(self):
self.stdOut("Install psutil")
try:
import psutil
@@ -718,9 +728,6 @@ class preFlightsChecks:
break
def fix_selinux_issue(self):
if (self.distro == ubuntu):
return
try:
cmd = []
@@ -760,7 +767,6 @@ class preFlightsChecks:
break
def download_install_CyberPanel(self,mysqlPassword, mysql):
self.stdOut("Download and install Cyberpanel")
try:
## On OpenVZ there is an issue with requests module, which needs to upgrade requests module
@@ -882,10 +888,7 @@ class preFlightsChecks:
### Applying migrations
try:
os.chdir("CyberCP")
except:
self.stdOut("Error changing to CyberCP directory - internal error!", 1, 1, os.EX_USAGE)
count = 0
@@ -979,19 +982,18 @@ class preFlightsChecks:
def install_unzip(self):
self.stdOut("Install unzip")
self.stdOut("Install zip")
try:
count = 0
while (1):
if self.distro == centos:
command = 'yum -y install unzip'
command = 'yum -y install zip'
else:
command = 'apt-get -y install unzip'
command = 'apt-get -y install zip'
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
count = count + 1
preFlightsChecks.stdOut("Unable to install unzip, trying again, try number: " + str(count))
@@ -1026,7 +1028,6 @@ class preFlightsChecks:
command = 'apt-get -y install zip'
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
@@ -1052,15 +1053,8 @@ class preFlightsChecks:
return 1
def download_install_phpmyadmin(self):
self.stdOut("Install PHP MyAdmin")
try:
directory = "/usr/local/lscp/cyberpanel/"
try:
os.chdir(directory)
except OSError as e:
msg = "Error changing to " + "/usr/local/lscp/cyberpanel/ :" + str(e) + " [download_install_phpmyadmin]"
self.stdOut(msg, 1, 1, os.EX_USAGE)
os.chdir("/usr/local/lscp/cyberpanel/")
count = 0
while(1):
@@ -1154,13 +1148,7 @@ class preFlightsChecks:
writeToFile.close()
try:
os.mkdir('/usr/local/lscp/cyberpanel/phpmyadmin/tmp')
except OSError as e:
if e.errno != errno.EEXIST:
self.stdOut("Error ceating: '/usr/local/lscp/cyberpanel/phpmyadmin/tmp' " + str(e), 1, 1, os.EX_CANTCREAT)
else:
pass
command = 'chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/phpmyadmin'
subprocess.call(shlex.split(command))
@@ -1190,7 +1178,7 @@ class preFlightsChecks:
self.stdOut("Install dovecot - do the install")
count = 0
while(1):
while (1):
if self.distro == centos:
command = 'yum install -y http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64//postfix3-3.2.4-1.gf.el7.x86_64.rpm'
else:
@@ -1207,14 +1195,14 @@ class preFlightsChecks:
# os.remove(file_name)
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
count = count + 1
preFlightsChecks.stdOut("Unable to install Postfix, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Unable to install Postfix, you will not be able to send mails and rest should work fine! [install_postfix_davecot]")
logging.InstallLog.writeToFile(
"Unable to install Postfix, you will not be able to send mails and rest should work fine! [install_postfix_davecot]")
break
else:
logging.InstallLog.writeToFile("Postfix successfully installed!")
@@ -1247,7 +1235,7 @@ class preFlightsChecks:
count = 0
while(1):
while (1):
if self.distro == centos:
command = 'yum -y install dovecot dovecot-mysql'
@@ -1260,17 +1248,17 @@ class preFlightsChecks:
if res == 1:
count = count + 1
preFlightsChecks.stdOut("Unable to install Dovecot and Dovecot-MySQL, trying again, try number: " + str(count))
preFlightsChecks.stdOut(
"Unable to install Dovecot and Dovecot-MySQL, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Unable to install install Dovecot and Dovecot-MySQL, you will not be able to send mails and rest should work fine! [install_postfix_davecot]")
logging.InstallLog.writeToFile(
"Unable to install install Dovecot and Dovecot-MySQL, you will not be able to send mails and rest should work fine! [install_postfix_davecot]")
break
else:
logging.InstallLog.writeToFile("Dovecot and Dovecot-MySQL successfully installed!")
preFlightsChecks.stdOut("Dovecot and Dovecot-MySQL successfully installed!")
break
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [install_postfix_davecot]")
return 0
@@ -1282,7 +1270,6 @@ class preFlightsChecks:
def setup_email_Passwords(self,mysqlPassword, mysql):
self.stdOut("Setup email passwords")
try:
logging.InstallLog.writeToFile("Setting up authentication for Postfix and Dovecot...")
@@ -1398,12 +1385,12 @@ class preFlightsChecks:
def setup_postfix_davecot_config(self, mysql):
self.stdOut("Configuring postfix and dovecot")
try:
logging.InstallLog.writeToFile("Configuring postfix and dovecot...")
os.chdir(self.cwd)
mysql_virtual_domains = "/etc/postfix/mysql-virtual_domains.cf"
mysql_virtual_forwardings = "/etc/postfix/mysql-virtual_forwardings.cf"
mysql_virtual_mailboxes = "/etc/postfix/mysql-virtual_mailboxes.cf"
@@ -1413,6 +1400,8 @@ class preFlightsChecks:
davecot = "/etc/dovecot/dovecot.conf"
davecotmysql = "/etc/dovecot/dovecot-sql.conf.ext"
if os.path.exists(mysql_virtual_domains):
os.remove(mysql_virtual_domains)
@@ -2041,11 +2030,7 @@ class preFlightsChecks:
#######
try:
os.chdir("/usr/local/lscp/cyberpanel")
except OSError as e:
self.stdOut("Can't change to cyberpanel directory, fatal error at this point")
count = 1
@@ -2171,7 +2156,6 @@ class preFlightsChecks:
def reStartLiteSpeed(self):
self.stdOut("Restarting Litespeed")
try:
count = 0
while(1):
@@ -2203,11 +2187,10 @@ class preFlightsChecks:
def installFirewalld(self):
try:
if self.distro == ubuntu:
return 0 # Uses AppArmor
try:
preFlightsChecks.stdOut("Enabling Firewall!")
count = 0
@@ -2364,16 +2347,6 @@ class preFlightsChecks:
count = 0
# In Ubuntu, the library that lscpd looks for is libpcre.so.1, but the one it installs is libpcre.so.3...
if self.distro == ubuntu:
command = 'ln -s /lib/x86_64-linux-gnu/libpcre.so.3 /lib/x86_64-linux-gnu/libpcre.so.1'
res = subprocess.call(shlex.split(command))
if res == 0:
self.stdOut("Created ubuntu symbolic link to pcre")
else:
self.stdOut("Error creating symbolic link to pcre: " + str(res))
while(1):
command = 'systemctl start lscpd'
@@ -2406,14 +2379,12 @@ class preFlightsChecks:
return 1
def setup_cron(self):
self.stdOut("Install and setup cron")
try:
## first install crontab
fd = open("installLogs.txt", 'a')
file = open("installLogs.txt", 'a')
count = 0
while(1):
if self.distro == centos:
command = 'yum install cronie -y'
else:
@@ -2421,7 +2392,7 @@ class preFlightsChecks:
cmd = shlex.split(command)
res = subprocess.call(cmd, stdout=fd)
res = subprocess.call(cmd, stdout=file)
if res == 1:
count = count + 1
@@ -2438,12 +2409,14 @@ class preFlightsChecks:
count = 0
while(1):
if self.distro == centos:
command = 'systemctl enable crond'
else:
command = 'systemctl enable cron'
cmd = shlex.split(command)
res = subprocess.call(cmd, stdout=fd)
res = subprocess.call(cmd, stdout=file)
if res == 1:
count = count + 1
@@ -2463,9 +2436,8 @@ class preFlightsChecks:
command = 'systemctl start crond'
else:
command = 'systemctl start cron'
cmd = shlex.split(command)
res = subprocess.call(cmd, stdout=fd)
res = subprocess.call(cmd, stdout=file)
if res == 1:
count = count + 1
@@ -2488,7 +2460,7 @@ class preFlightsChecks:
command = 'chmod +x /usr/local/CyberCP/plogical/findBWUsage.py'
cmd = shlex.split(command)
res = subprocess.call(cmd, stdout=fd)
res = subprocess.call(cmd, stdout=file)
if res == 1:
logging.InstallLog.writeToFile("1427 [setup_cron]")
@@ -2498,7 +2470,7 @@ class preFlightsChecks:
command = 'chmod +x /usr/local/CyberCP/postfixSenderPolicy/client.py'
cmd = shlex.split(command)
res = subprocess.call(cmd, stdout=fd)
res = subprocess.call(cmd, stdout=file)
if res == 1:
logging.InstallLog.writeToFile("1428 [setup_cron]")
@@ -2512,9 +2484,8 @@ class preFlightsChecks:
command = 'systemctl restart crond.service'
else:
command = 'systemctl restart cron.service'
cmd = shlex.split(command)
res = subprocess.call(cmd, stdout=fd)
res = subprocess.call(cmd, stdout=file)
if res == 1:
count = count + 1
@@ -2527,7 +2498,8 @@ class preFlightsChecks:
preFlightsChecks.stdOut("Crond successfully restarted!")
break
fd.close()
file.close()
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [setup_cron]")
@@ -2539,7 +2511,6 @@ class preFlightsChecks:
return 1
def install_default_keys(self):
self.stdOut("Installing default certificates")
try:
count = 0
@@ -2575,10 +2546,10 @@ class preFlightsChecks:
return 1
def install_rsync(self):
self.stdOut("Installing rsync")
try:
count = 0
while (1):
if self.distro == centos:
command = 'yum -y install rsync'
else:
@@ -2609,7 +2580,6 @@ class preFlightsChecks:
return 1
def test_Requests(self):
self.stdOut("Testing Requests...")
try:
import requests
getVersion = requests.get('https://cyberpanel.net/version.txt')
@@ -2675,8 +2645,7 @@ class preFlightsChecks:
print(" Visit: https://" + self.ipAddr + ":8090 ")
print(" Username: admin ")
print(" Password: 1234567 ")
print(" Database password in /etc/cyberpanel/mysqlPassword ")
print(" ")
print("###################################################################")
def installCertBot(self):
@@ -2797,6 +2766,7 @@ class preFlightsChecks:
try:
count = 0
while (1):
if self.distro == centos:
command = 'yum -y install opendkim'
else:
@@ -2937,6 +2907,7 @@ milter_default_action = accept
def setupPHPAndComposer(self):
try:
if self.distro == ubuntu:
if not os.access('/usr/local/lsws/lsphp70/bin/php', os.R_OK):
if os.access('/usr/local/lsws/lsphp70/bin/php7.0', os.R_OK):
@@ -2968,7 +2939,7 @@ milter_default_action = accept
res = subprocess.call(shlex.split(command))
except OSError, msg:
self.stdOut('Setup PHP error: ' + str(msg) + " [setupPHPAndComposer]", 1, 1, os.EX_OSERR)
logging.InstallLog.writeToFile(str(msg) + " [setupPHPAndComposer]")
return 0
@staticmethod
@@ -2976,9 +2947,10 @@ milter_default_action = accept
res = subprocess.call(shlex.split('apt-get -y install ' + package))
if res != 0:
preFlightsChecks.stdOut("Error #" + str(res) + ' installing:' + package + '. This may not be an issue ' \
'but may affect installation of something later', 1)
return res #Though probably not used
'but may affect installation of something later',
1)
return res # Though probably not used
@staticmethod
def setupVirtualEnv(distro):
@@ -3091,8 +3063,8 @@ milter_default_action = accept
install_file = '/usr/local/CyberCP/requirments.txt'
if distro == ubuntu and get_Ubuntu_release() < 18.04:
install_file_new = '/usr/local/CyberCP/requirements.txt'
fd = open(install_file,'r')
fd_new = open(install_file_new,'w')
fd = open(install_file, 'r')
fd_new = open(install_file_new, 'w')
lines = fd.readlines()
for line in lines:
if line[:6] != 'pycurl' and line[:7] != 'pygpgme':
@@ -3155,7 +3127,7 @@ milter_default_action = accept
writeToFile.close()
except OSError, msg:
preFlightsChecks.stdOut('Error disabling DNS: ' + str(msg) + " [enableDisableDNS]", 1, 0)
logging.InstallLog.writeToFile(str(msg) + " [enableDisableDNS]")
return 0
@staticmethod
@@ -3181,7 +3153,7 @@ milter_default_action = accept
writeToFile.close()
except OSError, msg:
preFlightsChecks.stdOut('Error disabling Email: ' + str(msg) + " [enableDisableEmail]", 1, 0)
logging.InstallLog.writeToFile(str(msg) + " [enableDisableEmail]")
return 0
@staticmethod
@@ -3207,10 +3179,9 @@ milter_default_action = accept
writeToFile.close()
except OSError, msg:
preFlightsChecks.stdOut('Error disabling FTP: ' + str(msg) + " [enableDisableFTP]", 1, 0)
logging.InstallLog.writeToFile(str(msg) + " [enableDisableEmail]")
return 0
def get_distro():
distro = -1
distro_file = ""
@@ -3274,13 +3245,7 @@ def main():
## Writing public IP
try:
os.mkdir("/etc/cyberpanel")
except OSError as e:
if e.errno != errno.EEXIST:
preFlightsChecks.stdOut("Error creating /etc/cyberpanel directory: " + str(e), 1, 1, os.EX_CANTCREAT)
else:
pass
machineIP = open("/etc/cyberpanel/machineIP", "w")
machineIP.writelines(args.publicip)
@@ -3299,8 +3264,7 @@ def main():
preFlightsChecks.stdOut("Single MySQL instance version will be installed.")
else:
mysql = args.mysql
preFlightsChecks.stdOut("Double MySQL instance version will be installed.")
preFlightsChecks.stdOut("Dobule MySQL instance version will be installed.")
checks.checkPythonVersion()
checks.setup_account_cyberpanel()
@@ -3323,19 +3287,21 @@ def main():
import installCyberPanel
installCyberPanel.Main(cwd, mysql, distro)
installCyberPanel.Main(cwd, mysql)
checks.fix_selinux_issue()
checks.install_psmisc()
checks.install_postfix_davecot()
checks.setup_email_Passwords(installCyberPanel.InstallCyberPanel.mysqlPassword, mysql)
checks.setup_postfix_davecot_config(mysql)
checks.install_unzip()
checks.install_zip()
checks.install_rsync()
checks.downoad_and_install_raindloop()
checks.download_install_phpmyadmin()
checks.installFirewalld()
@@ -3359,7 +3325,7 @@ def main():
checks.configureOpenDKIM()
checks.modSecPreReqs()
checks.setupVirtualEnv(distro)
checks.setupVirtualEnv()
checks.setupPHPAndComposer()
if args.postfix != None:
@@ -3381,8 +3347,7 @@ def main():
checks.enableDisableFTP('On')
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
checks.installation_successfull()
if __name__ == "__main__":
main()

View File

@@ -9,27 +9,24 @@ import shlex
import randomPassword
import errno
import MySQLdb as mariadb
import re
import time
import sys
import install
#distros
centos=0
ubuntu=1
class InstallCyberPanel:
mysql_Root_password = ""
mysqlPassword = ""
def __init__(self,rootPath,cwd,distro):
def __init__(self, rootPath, cwd, distro):
self.server_root_path = rootPath
self.cwd = cwd
self.distro=distro
self.distro = distro
@staticmethod
def stdOut(message, log = 0, exit = 0, code = os.EX_OK):
def stdOut(message, log=0, exit=0, code=os.EX_OK):
install.preFlightsChecks.stdOut(message, log, exit, code)
@@ -242,9 +239,11 @@ class InstallCyberPanel:
if res == 1:
count = count + 1
InstallCyberPanel.stdOut("Trying to install LiteSpeed PHPs, trying again, try number: " + str(count))
InstallCyberPanel.stdOut(
"Trying to install LiteSpeed PHPs, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to install LiteSpeed PHPs, exiting installer! [installAllPHPVersions]")
logging.InstallLog.writeToFile(
"Failed to install LiteSpeed PHPs, exiting installer! [installAllPHPVersions]")
InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt")
os._exit(0)
else:
@@ -254,15 +253,17 @@ class InstallCyberPanel:
## only php 71
if self.distro == centos:
count = 0
while(1):
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))
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]")
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:
@@ -290,7 +291,6 @@ class InstallCyberPanel:
InstallCyberPanel.stdOut("LiteSpeed PHP 7.1 successfully installed!")
break
## break for outer loop
break
@@ -305,14 +305,15 @@ class InstallCyberPanel:
def setup_mariadb_repo(self):
try:
if self.distro == ubuntu:
# Only needed if the repo is broken or we need the latest version.
#command = "apt-get -y install software-properties-common"
#command = "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8"
#command = "add-apt-repository 'deb [arch=amd64] http://mirror.zol.co.zw/mariadb/repo/10.3/ubuntu bionic main'"
# command = "apt-get -y install software-properties-common"
# command = "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8"
# command = "add-apt-repository 'deb [arch=amd64] http://mirror.zol.co.zw/mariadb/repo/10.3/ubuntu bionic main'"
return
try:
logging.InstallLog.writeToFile("Setting up MariaDB Repo..")
InstallCyberPanel.stdOut("Setting up MariaDB Repo..")
@@ -342,6 +343,7 @@ class InstallCyberPanel:
else:
command = 'yum -y install mariadb-server'
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
@@ -475,11 +477,9 @@ class InstallCyberPanel:
if res == 1:
count = count + 1
InstallCyberPanel.stdOut("Trying to enable MariaDB instance to start at system restart, "
"trying again, try number: " + str(count))
InstallCyberPanel.stdOut("Trying to enable MariaDB instance to start and system restart, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to enable MariaDB instance to run at system restart, "
"you can do this later using systemctl enable mysql! [installMySQL]")
logging.InstallLog.writeToFile("Failed to enable MariaDB instance to run at system restart, you can do this later using systemctl enable mysql! [installMySQL]")
break
else:
logging.InstallLog.writeToFile("MariaDB instance successfully enabled at system restart!")
@@ -637,7 +637,7 @@ class InstallCyberPanel:
writeDataToFile = open(fileName, 'w')
for line in data:
writeDataToFile.write(line.replace('utf8mb4','utf8'))
writeDataToFile.write(line.replace('utf8mb4', 'utf8'))
writeDataToFile.close()
except IOError as err:
self.stdOut("Error in setting: " + fileName + ": " + str(err), 1, 1, os.EX_OSERR)
@@ -646,7 +646,6 @@ class InstallCyberPanel:
self.stdOut("MariaDB is now setup so it can support Cyberpanel's needs")
def installPureFTPD(self):
try:
@@ -656,6 +655,7 @@ class InstallCyberPanel:
command = 'apt-get -y install pure-ftpd'
else:
command = "yum install -y pure-ftpd"
res = subprocess.call(shlex.split(command))
if res == 1:
@@ -769,18 +769,9 @@ class InstallCyberPanel:
############## Start pureftpd ######################
try:
self.stdOut("Correct configuration with pure-ftpd")
count = 0
try:
os.mkdir("/etc/pure-ftpd/conf")
os.mkdir("/etc/pure-ftpd/auth")
except OSError as e:
pass
command = 'cp /etc/pure-ftpd/pure-ftpd.conf /etc/pure-ftpd/conf/pure-ftpd.conf'
res = subprocess.call(shlex.split(command))
self.stdOut("Start the pure-ftp service")
while(1):
cmd = []
@@ -794,8 +785,7 @@ 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, you can do this manually "
"later using systemctl start pure-ftpd [startPureFTPD]")
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!")
@@ -828,9 +818,7 @@ class InstallCyberPanel:
count = 0
while(1):
command = 'openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj ' \
'"/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" ' \
'-keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem'
command = 'openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem'
res = subprocess.call(shlex.split(command))
if res == 1:
@@ -885,9 +873,7 @@ class InstallCyberPanel:
return 1
def installPowerDNS(self):
try:
count = 0
if self.distro == ubuntu:
@@ -899,7 +885,8 @@ class InstallCyberPanel:
command = 'systemctl disable systemd-resolved.service'
res = subprocess.call(shlex.split(command))
if res != 0:
InstallCyberPanel.stdOut('Unable to disable systemd.resolved, prohits install of PowerDNS, error #' +
InstallCyberPanel.stdOut(
'Unable to disable systemd.resolved, prohits install of PowerDNS, error #' +
str(res), 1, 1, os.EX_OSERR)
try:
os.rename('/etc/resolv.conf', 'etc/resolved.conf')
@@ -921,7 +908,6 @@ class InstallCyberPanel:
". This may need to be fixed manually as 'echo \"nameserver 8.8.8.8\"> "
"/etc/resolv.conf'", 1, 1, os.EX_OSERR)
if self.distro == centos:
while (1):
command = 'yum -y install epel-release yum-plugin-priorities'
@@ -930,9 +916,11 @@ class InstallCyberPanel:
if res == 1:
count = count + 1
InstallCyberPanel.stdOut("Trying to install PowerDNS Repositories, trying again, try number: " + str(count))
InstallCyberPanel.stdOut(
"Trying to install PowerDNS Repositories, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to install PowerDNS Repositories, exiting installer! [installPowerDNS]")
logging.InstallLog.writeToFile(
"Failed to install PowerDNS Repositories, exiting installer! [installPowerDNS]")
InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt")
os._exit(0)
else:
@@ -942,7 +930,7 @@ class InstallCyberPanel:
count = 0
while(1):
while (1):
command = 'curl -o /etc/yum.repos.d/powerdns-auth-master.repo ' \
'https://repo.powerdns.com/repo-files/centos-auth-master.repo'
@@ -965,7 +953,7 @@ class InstallCyberPanel:
count = 1
while(1):
while (1):
if self.distro == ubuntu:
command = "DEBIAN_FRONTEND=noninteractive apt-get -y install pdns-server pdns-backend-mysql"
res = os.system(command)
@@ -978,7 +966,8 @@ class InstallCyberPanel:
count = count + 1
InstallCyberPanel.stdOut("Trying to install PowerDNS, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to install PowerDNS, exiting installer! [installPowerDNS]")
logging.InstallLog.writeToFile(
"Failed to install PowerDNS, exiting installer! [installPowerDNS]")
InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt")
os._exit(0)
else:
@@ -995,7 +984,7 @@ class InstallCyberPanel:
return 1
def installPowerDNSConfigurations(self,mysqlPassword, mysql):
def installPowerDNSConfigurations(self, mysqlPassword, mysql):
try:
logging.InstallLog.writeToFile("Configuring PowerDNS..")
@@ -1036,11 +1025,9 @@ class InstallCyberPanel:
logging.InstallLog.writeToFile("PowerDNS configured!")
InstallCyberPanel.stdOut("PowerDNS configured!")
except IOError, msg:
logging.InstallLog.writeToFile(str(msg) + " [installPowerDNSConfigurations]")
return 0
return 1
def startPowerDNS(self):
@@ -1065,9 +1052,7 @@ class InstallCyberPanel:
count = count + 1
InstallCyberPanel.stdOut("Trying to enable PowerDNS to start and system restart, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to enable PowerDNS to run at system restart, you can "
"manually do this later using systemctl enable pdns! "
"[startPowerDNS]")
logging.InstallLog.writeToFile("Failed to enable PowerDNS to run at system restart, you can manually do this later using systemctl enable pdns! [startPowerDNS]")
InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt")
break
else:
@@ -1114,11 +1099,12 @@ class InstallCyberPanel:
count = 0
while(1):
while (1):
if self.distro == ubuntu:
command = "apt-get -y install gcc g++ make autoconf rcs"
else:
command = 'yum -y install gcc gcc-c++ make autoconf glibc rcs'
cmd = shlex.split(command)
res = subprocess.call(cmd)
@@ -1168,22 +1154,20 @@ class InstallCyberPanel:
if res == 1:
count = count + 1
InstallCyberPanel.stdOut("Trying to extract LSCPD, trying again, try number: " + str(count))
InstallCyberPanel.stdOut("Trying to configure LSCPD, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to extract LSCPD, exiting installer! [installLSCPD]")
logging.InstallLog.writeToFile("Failed to configure LSCPD, exiting installer! [installLSCPD]")
InstallCyberPanel.stdOut("Installation failed, consult: /var/log/installLogs.txt")
os._exit(0)
else:
logging.InstallLog.writeToFile("LSCPD successfully extracted!")
logging.InstallLog.writeToFile("LSCPD successfully configured!")
InstallCyberPanel.stdOut("LSCPD successfully extracted!")
break
count = 0
while(1):
command = 'openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj ' \
'"/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /usr/local/lscp/key.pem ' \
'-out /usr/local/lscp/cert.pem'
command = 'openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /usr/local/lscp/key.pem -out /usr/local/lscp/cert.pem'
cmd = shlex.split(command)
res = subprocess.call(cmd)
@@ -1244,6 +1228,7 @@ class InstallCyberPanel:
def Main(cwd, mysql, distro):
InstallCyberPanel.mysqlPassword = randomPassword.generate_pass()
InstallCyberPanel.mysql_Root_password = randomPassword.generate_pass()
file_name = '/etc/cyberpanel/mysqlPassword'
@@ -1253,6 +1238,7 @@ def Main(cwd, mysql, distro):
else:
password = open(file_name, "w")
password.writelines(InstallCyberPanel.mysql_Root_password)
password.close()
if distro == centos:
@@ -1260,7 +1246,7 @@ def Main(cwd, mysql, distro):
else:
InstallCyberPanel.mysqlPassword = InstallCyberPanel.mysql_Root_password
installer = InstallCyberPanel("/usr/local/lsws/", cwd, distro)
installer = InstallCyberPanel("/usr/local/lsws/",cwd, distro)
installer.installLiteSpeed()
installer.changePortTo80()
@@ -1268,6 +1254,7 @@ def Main(cwd, mysql, distro):
installer.installAllPHPVersions()
installer.fix_ols_configs()
installer.setup_mariadb_repo()
installer.installMySQL(mysql)
installer.changeMYSQLRootPassword()
@@ -1276,7 +1263,8 @@ def Main(cwd, mysql, distro):
if distro == ubuntu:
installer.fixMariaDB()
mysqlUtilities.createDatabaseCyberPanel("cyberpanel", "cyberpanel", InstallCyberPanel.mysqlPassword, mysql)
mysqlUtilities.createDatabaseCyberPanel("cyberpanel","cyberpanel",InstallCyberPanel.mysqlPassword, mysql)
installer.installPureFTPD()
installer.installPureFTPDConfigurations(mysql)

View File

@@ -6,35 +6,13 @@ import argparse
import os
import shlex
import socket
import install
#distros
centos=0
ubuntu=1
distro = install.get_distro()
class unInstallCyberPanel:
def fixResolvConf(self):
if distro == centos:
return
if os.access('/etc/resolv.conf', os.F_OK):
return
try:
f = open('/etc/resolv.conf', 'w')
f.write('nameserver 8.8.8.8')
f.close()
except IOError as e:
print "Unable to create /etc/resolv.conf: " + str(e) + \
". This may need to be fixed manually as 'echo \"nameserver 8.8.8.8\"> " \
"/etc/resolv.conf'"
def unInstallCyberPanelRepo(self):
if distro == centos:
try:
copyPath = "/etc/yum.repos.d/cyberpanel.repo"
os.remove(copyPath)
@@ -62,10 +40,7 @@ class unInstallCyberPanel:
def removePostfixDovecot(self):
try:
if distro == centos:
command = 'yum -y remove postfix'
else:
command = 'apt-get -y remove postfix'
cmd = shlex.split(command)
@@ -87,10 +62,7 @@ class unInstallCyberPanel:
def removeMysql(self):
try:
if distro == centos:
command = 'yum -y remove mariadb mariadb-server'
else:
command = 'apt-get -y remove mariadb-server'
cmd = shlex.split(command)
@@ -112,10 +84,7 @@ class unInstallCyberPanel:
def removeLiteSpeed(self):
try:
if distro == centos:
command = 'yum -y remove openlitespeed'
else:
command = 'apt-get --purge -y remove openlitespeed'
cmd = shlex.split(command)
@@ -149,10 +118,7 @@ class unInstallCyberPanel:
def removePureFTPD(self):
try:
if distro == centos:
command = 'yum -y remove pure-ftpd'
else:
command = 'apt-get -y remove pure-ftpd'
cmd = shlex.split(command)
@@ -170,10 +136,8 @@ class unInstallCyberPanel:
def removePowerDNS(self):
try:
if distro == centos:
command = 'yum -y remove pdns'
else:
command = 'apt-get -y remove pdns-server'
cmd = shlex.split(command)
@@ -192,10 +156,7 @@ class unInstallCyberPanel:
def removePHP(self):
try:
if distro == centos:
command = 'yum -y remove lsphp*'
else:
command = 'apt-get -y remove lsphp*'
cmd = shlex.split(command)
@@ -217,7 +178,6 @@ def Main():
remove = unInstallCyberPanel()
remove.fixResolvConf()
remove.removeLiteSpeed()
remove.removeMysql()
remove.removePostfixDovecot()

View File

@@ -348,6 +348,20 @@ class DNS:
record.save()
return
if type == 'TXT':
if Records.objects.filter(name=name, type=type, content=value).count() == 0:
record = Records(domainOwner=zone,
domain_id=zone.id,
name=name,
type=type,
content=value,
ttl=ttl,
prio=priority,
disabled=0,
auth=1)
record.save()
return
if type == 'MX':
record = Records(domainOwner=zone,
domain_id=zone.id,
@@ -359,6 +373,7 @@ class DNS:
disabled=0,
auth=1)
record.save()
return
if Records.objects.filter(name=name, type=type).count() == 0:

View File

@@ -41,7 +41,7 @@ app.filter('getwebsitename', function() {
if(domain !== undefined) {
domain = domain.replace("-", "");
domain = domain.replace(/-/g, '');
var domainName = domain.split(".");

View File

@@ -3,9 +3,6 @@
*/
/* Java script code to create database */
app.controller('createDatabase', function($scope,$http) {
@@ -38,8 +35,7 @@ app.controller('createDatabase', function($scope,$http) {
// getting website username
webUserName = databaseWebsite.replace("-", "");
webUserName = databaseWebsite.replace(/-/g, '');
webUserName = webUserName.split(".")[0];
if(webUserName.length > 5){
@@ -54,7 +50,7 @@ app.controller('createDatabase', function($scope,$http) {
databaseWebsite:databaseWebsite,
dbName:dbName,
dbUsername:dbUsername,
dbPassword:dbPassword,
dbPassword:dbPassword
};
var config = {
@@ -281,7 +277,6 @@ app.controller('deleteDatabase', function($scope,$http) {
/* Java script code to delete database ends here */
/* Java script code to list databases */

View File

@@ -14,7 +14,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
var editor = ace.edit("htmlEditorContent");
var aceEditorMode = '';
var domainName = window.location.pathname.split("/")[2];
var domainName = $("#domainNameInitial").text();
var domainRandomSeed = "";
var homePathBack = "/home/"+domainName;

View File

@@ -4,68 +4,66 @@ import views
urlpatterns = [
url(r'^$', views.loadWebsitesHome, name='loadWebsitesHome'),
url(r'^createWebsite', views.createWebsite, name='createWebsite'),
url(r'^listWebsites', views.listWebsites, name='listWebsites'),
url(r'^modifyWebsite', views.modifyWebsite, name='modifyWebsite'),
url(r'^deleteWebsite', views.deleteWebsite, name='deleteWebsite'),
url(r'^siteState', views.siteState, name='siteState'),
url(r'^createWebsite$', views.createWebsite, name='createWebsite'),
url(r'^listWebsites$', views.listWebsites, name='listWebsites'),
url(r'^modifyWebsite$', views.modifyWebsite, name='modifyWebsite'),
url(r'^deleteWebsite$', views.deleteWebsite, name='deleteWebsite'),
url(r'^siteState$', views.siteState, name='siteState'),
# Website modification url
url(r'^submitWebsiteCreation', views.submitWebsiteCreation, name='submitWebsiteCreation'),
url(r'^submitWebsiteDeletion', views.submitWebsiteDeletion, name='submitWebsiteDeletion'),
url(r'^submitWebsiteListing', views.getFurtherAccounts, name='submitWebsiteListing'),
url(r'^submitWebsiteModification', views.deleteWebsite, name='submitWebsiteModification'),
url(r'^submitWebsiteStatus', views.submitWebsiteStatus, name='submitWebsiteStatus'),
url(r'^submitWebsiteCreation$', views.submitWebsiteCreation, name='submitWebsiteCreation'),
url(r'^submitWebsiteDeletion$', views.submitWebsiteDeletion, name='submitWebsiteDeletion'),
url(r'^submitWebsiteListing$', views.getFurtherAccounts, name='submitWebsiteListing'),
url(r'^submitWebsiteModification$', views.deleteWebsite, name='submitWebsiteModification'),
url(r'^submitWebsiteStatus$', views.submitWebsiteStatus, name='submitWebsiteStatus'),
url(r'^getWebsiteDetails', views.submitWebsiteModify, name='getWebsiteDetails'),
url(r'^getWebsiteDetails$', views.submitWebsiteModify, name='getWebsiteDetails'),
url(r'^saveWebsiteChanges', views.saveWebsiteChanges, name='saveWebsiteChanges'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/(?P<childDomain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)$', views.launchChild, name='launchChild'),
url(r'^(?P<domain>([\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'),
url(r'^getDataFromLogFile$', views.getDataFromLogFile, name='getDataFromLogFile'),
url(r'^fetchErrorLogs$', views.fetchErrorLogs, name='fetchErrorLogs'),
url(r'^getDataFromConfigFile', views.getDataFromConfigFile, name='getDataFromConfigFile'),
url(r'^getDataFromConfigFile$', views.getDataFromConfigFile, name='getDataFromConfigFile'),
url(r'^saveConfigsToFile', views.saveConfigsToFile, name='saveConfigsToFile'),
url(r'^saveConfigsToFile$', views.saveConfigsToFile, name='saveConfigsToFile'),
url(r'^getRewriteRules', views.getRewriteRules, name='getRewriteRules'),
url(r'^getRewriteRules$', views.getRewriteRules, name='getRewriteRules'),
url(r'^saveRewriteRules', views.saveRewriteRules, name='saveRewriteRules'),
url(r'^saveRewriteRules$', views.saveRewriteRules, name='saveRewriteRules'),
url(r'^saveSSL', views.saveSSL, name='saveSSL'),
url(r'^saveSSL$', views.saveSSL, name='saveSSL'),
## sub/add/park domains
url(r'^submitDomainCreation', views.submitDomainCreation, name='submitDomainCreation'),
url(r'^submitDomainCreation$', views.submitDomainCreation, name='submitDomainCreation'),
## fetch domains
url(r'^fetchDomains', views.fetchDomains, name='submitDomainCreation'),
url(r'^changePHP', views.changePHP, name='changePHP'),
url(r'^submitDomainDeletion', views.submitDomainDeletion, name='submitDomainDeletion'),
url(r'^fetchDomains$', views.fetchDomains, name='submitDomainCreation'),
url(r'^changePHP$', views.changePHP, name='changePHP'),
url(r'^submitDomainDeletion$', views.submitDomainDeletion, name='submitDomainDeletion'),
# crons
url(r'^listCron',views.listCron,name="listCron"),
url(r'^getWebsiteCron',views.getWebsiteCron,name="getWebsiteCron"),
url(r'^getCronbyLine',views.getCronbyLine,name="getCronbyLine"),
url(r'^remCronbyLine',views.remCronbyLine,name="remCronbyLine"),
url(r'^saveCronChanges',views.saveCronChanges,name="saveCronChanges"),
url(r'^addNewCron',views.addNewCron,name="addNewCron"),
url(r'^listCron$',views.listCron,name="listCron"),
url(r'^getWebsiteCron$',views.getWebsiteCron,name="getWebsiteCron"),
url(r'^getCronbyLine$',views.getCronbyLine,name="getCronbyLine"),
url(r'^remCronbyLine$',views.remCronbyLine,name="remCronbyLine"),
url(r'^saveCronChanges$',views.saveCronChanges,name="saveCronChanges"),
url(r'^addNewCron$',views.addNewCron,name="addNewCron"),
## Domain Alias
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/domainAlias$', views.domainAlias, name='domainAlias'),
url(r'^submitAliasCreation',views.submitAliasCreation,name="submitAliasCreation"),
url(r'^issueAliasSSL',views.issueAliasSSL,name="issueAliasSSL"),
url(r'^delateAlias',views.delateAlias,name="delateAlias"),
url(r'^(?P<domain>(.*))/domainAlias$', views.domainAlias, name='domainAlias'),
url(r'^submitAliasCreation$',views.submitAliasCreation,name="submitAliasCreation"),
url(r'^issueAliasSSL$',views.issueAliasSSL,name="issueAliasSSL"),
url(r'^delateAlias$',views.delateAlias,name="delateAlias"),
## Openbasedir
@@ -73,7 +71,7 @@ urlpatterns = [
## WP Install
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/wordpressInstall$', views.wordpressInstall, name='wordpressInstall'),
url(r'^(?P<domain>(.*))/wordpressInstall$', views.wordpressInstall, name='wordpressInstall'),
url(r'^installWordpressStatus$',views.installWordpressStatus,name="installWordpressStatus"),
url(r'^installWordpress$', views.installWordpress, name='installWordpress'),
@@ -81,21 +79,23 @@ urlpatterns = [
## Joomla Install
url(r'^installJoomla$', views.installJoomla, name='installJoomla'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/joomlaInstall$', views.joomlaInstall, name='joomlaInstall'),
url(r'^(?P<domain>(.*))/joomlaInstall$', views.joomlaInstall, name='joomlaInstall'),
## PrestaShop Install
url(r'^prestaShopInstall$', views.prestaShopInstall, name='prestaShopInstall'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/installPrestaShop$', views.installPrestaShop, name='installPrestaShop'),
url(r'^(?P<domain>(.*))/installPrestaShop$', views.installPrestaShop, name='installPrestaShop'),
## Git
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/setupGit$', views.setupGit, name='setupGit'),
url(r'^(?P<domain>(.*))/setupGit$', views.setupGit, name='setupGit'),
url(r'^setupGitRepo$', views.setupGitRepo, name='setupGitRepo'),
url(r'^(?P<domain>([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?)/gitNotify$', views.gitNotify, name='gitNotify'),
url(r'^(?P<domain>(.*))/gitNotify$', views.gitNotify, name='gitNotify'),
url(r'^detachRepo$', views.detachRepo, name='detachRepo'),
url(r'^changeBranch$', views.changeBranch, name='changeBranch'),
## Catch all for domains
url(r'^(?P<domain>(.*))/(?P<childDomain>(.*))$', views.launchChild, name='launchChild'),
url(r'^(?P<domain>(.*))$', views.domain, name='domain'),
]