From 3f1468c6735dab5d5d7fc817cc6622f01343de78 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 29 Apr 2020 04:46:01 +0500 Subject: [PATCH 001/121] bug fix: add incremental destination --- IncBackups/views.py | 8 +++++++- cyberpanel_upgrade.sh | 1 + plogical/backupSchedule.py | 3 +++ plogical/backupUtilities.py | 1 - static/backup/backup.js | 3 ++- static/filemanager/js/fileManager.js | 1 - 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/IncBackups/views.py b/IncBackups/views.py index 9ba6b1afc..4739c04cb 100644 --- a/IncBackups/views.py +++ b/IncBackups/views.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utaddDestinationf-8 -*- from django.shortcuts import render from plogical.acl import ACLManager @@ -102,8 +102,14 @@ def addDestination(request): execPath = execPath + " submitDestinationCreation --ipAddress " + ipAddress + " --password " \ + password + " --port " + port + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(execPath) + output = ProcessUtilities.outputExecutioner(execPath) + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(output) + if output.find('1,') > -1: content = '%s\n%s' % (ipAddress, port) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index d833ba5f6..4348c73f2 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -159,6 +159,7 @@ check_root echo -e "\nChecking OS..." OUTPUT=$(cat /etc/*release) + if echo $OUTPUT | grep -q "CentOS Linux 7" ; then echo -e "\nDetecting CentOS 7.X...\n" SERVER_OS="CentOS7" diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index 0a87c8e04..eba989f92 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -196,6 +196,9 @@ class backupSchedule: command = "sudo scp -o StrictHostKeyChecking=no -P "+port+" -i /root/.ssh/cyberpanel " + backupPath + " " + user + "@" + IPAddress+":~/backup/" + ipAddressLocal + "/" + time.strftime("%a-%b") + "/" subprocess.call(shlex.split(command), stdout=writeToFile) + if os.path.exists(ProcessUtilities.debugPath): + logging.CyberCPLogFileWriter.writeToFile(command) + ## Remove backups already sent to remote destinations os.remove(backupPath) diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index 59f62b16f..882e32dfb 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -493,7 +493,6 @@ class backupUtilities: items.status = 1 items.size = totalSize items.save() - logging.CyberCPLogFileWriter.writeToFile(' again size: %s' % (totalSize)) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile('%s. [backupRoot:499]' % str(msg)) for items in backupObs: diff --git a/static/backup/backup.js b/static/backup/backup.js index 9c158422b..a41fffb41 100644 --- a/static/backup/backup.js +++ b/static/backup/backup.js @@ -416,7 +416,7 @@ app.controller('restoreWebsiteControl', function ($scope, $http, $timeout) { }); -//*** Resotre site ends here ***/// +//*** Restore site ends here ***/// ///** Backup Destination ***// @@ -448,6 +448,7 @@ app.controller('backupDestinations', function ($scope, $http, $timeout) { var data = { IPAddress: $scope.IPAddress, password: $scope.password, + user: $scope.user, backupSSHPort: $scope.backupSSHPort, }; diff --git a/static/filemanager/js/fileManager.js b/static/filemanager/js/fileManager.js index 725224dbb..19e175118 100644 --- a/static/filemanager/js/fileManager.js +++ b/static/filemanager/js/fileManager.js @@ -1479,7 +1479,6 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader, // Download files $scope.downloadFile = function () { - url = "/filemanager/downloadFile"; var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0]; window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL; From f54b8fb43a11ea3d8141195311e79657b7474427 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 29 Apr 2020 04:55:33 +0500 Subject: [PATCH 002/121] restore encoding --- IncBackups/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IncBackups/views.py b/IncBackups/views.py index 4739c04cb..fe229f0c9 100644 --- a/IncBackups/views.py +++ b/IncBackups/views.py @@ -1,4 +1,4 @@ -# -*- coding: utaddDestinationf-8 -*- +# -*- coding: utf-8 -*- from django.shortcuts import render from plogical.acl import ACLManager @@ -100,7 +100,7 @@ def addDestination(request): execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py" execPath = execPath + " submitDestinationCreation --ipAddress " + ipAddress + " --password " \ - + password + " --port " + port + + password + " --port " + port + ' --user %s' % ('root') if os.path.exists(ProcessUtilities.debugPath): logging.writeToFile(execPath) From 43ab382e03108b776562bcd785f5da5010b428a9 Mon Sep 17 00:00:00 2001 From: Istiak Ferdous <30789544+istiak101@users.noreply.github.com> Date: Wed, 29 Apr 2020 16:21:18 +0600 Subject: [PATCH 003/121] Show language alphabetically in login Show language alphabetically in login for easy to find. English is default --- loginSystem/templates/loginSystem/login.html | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/loginSystem/templates/loginSystem/login.html b/loginSystem/templates/loginSystem/login.html index e6252a88d..17b3ced2f 100755 --- a/loginSystem/templates/loginSystem/login.html +++ b/loginSystem/templates/loginSystem/login.html @@ -197,20 +197,20 @@ @@ -234,4 +234,4 @@ - \ No newline at end of file + From 63c4227405bccacc657847521e740ce9a05d1140 Mon Sep 17 00:00:00 2001 From: Istiak Ferdous <30789544+istiak101@users.noreply.github.com> Date: Wed, 29 Apr 2020 17:42:22 +0600 Subject: [PATCH 004/121] generate 16 digit strong password for email --- mailServer/static/mailServer/mailServer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mailServer/static/mailServer/mailServer.js b/mailServer/static/mailServer/mailServer.js index f50b36a45..3bf1db1c3 100755 --- a/mailServer/static/mailServer/mailServer.js +++ b/mailServer/static/mailServer/mailServer.js @@ -110,7 +110,7 @@ app.controller('createEmailAccount', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.emailPassword = randomPassword(12); + $scope.emailPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -465,7 +465,7 @@ app.controller('changeEmailPassword', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.emailPassword = randomPassword(12); + $scope.emailPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -1291,4 +1291,4 @@ app.controller('listEmails', function ($scope, $http) { }); -/* Java script code for List Emails Ends here */ \ No newline at end of file +/* Java script code for List Emails Ends here */ From 98ca7950435f20c995fcf87099c4b0e28a312e53 Mon Sep 17 00:00:00 2001 From: Istiak Ferdous <30789544+istiak101@users.noreply.github.com> Date: Wed, 29 Apr 2020 17:44:34 +0600 Subject: [PATCH 005/121] generate 16 digit strong password for database --- databases/static/databases/databases.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/databases/static/databases/databases.js b/databases/static/databases/databases.js index e13d25977..d1e91175b 100755 --- a/databases/static/databases/databases.js +++ b/databases/static/databases/databases.js @@ -106,7 +106,7 @@ app.controller('createDatabase', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.dbPassword = randomPassword(12); + $scope.dbPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -447,7 +447,7 @@ app.controller('listDBs', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.dbPassword = randomPassword(12); + $scope.dbPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -493,4 +493,4 @@ app.controller('phpMyAdmin', function ($scope, $http, $window) { } setupPHPMYAdminSession(); -}); \ No newline at end of file +}); From ede66be2d32b290a628c056301fc04cb3c74f3b2 Mon Sep 17 00:00:00 2001 From: Istiak Ferdous <30789544+istiak101@users.noreply.github.com> Date: Wed, 29 Apr 2020 17:46:00 +0600 Subject: [PATCH 006/121] generate 16 digit strong password for user --- userManagment/static/userManagment/userManagment.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/userManagment/static/userManagment/userManagment.js b/userManagment/static/userManagment/userManagment.js index 39cbf5d6d..73eaed9a5 100755 --- a/userManagment/static/userManagment/userManagment.js +++ b/userManagment/static/userManagment/userManagment.js @@ -113,7 +113,7 @@ app.controller('createUserCtr', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.password = randomPassword(12); + $scope.password = randomPassword(16); }; $scope.usePassword = function () { @@ -342,7 +342,7 @@ app.controller('modifyUser', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.password = randomPassword(12); + $scope.password = randomPassword(16); }; $scope.usePassword = function () { @@ -1744,4 +1744,4 @@ app.controller('listTableUsers', function ($scope, $http) { }); -/* Java script code to list table users */ \ No newline at end of file +/* Java script code to list table users */ From 7797e641d5ff7e9bbd90acd053155e803a0649aa Mon Sep 17 00:00:00 2001 From: Istiak Ferdous <30789544+istiak101@users.noreply.github.com> Date: Wed, 29 Apr 2020 17:46:58 +0600 Subject: [PATCH 007/121] generate 16 digit strong password for ftp --- ftp/static/ftp/ftp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ftp/static/ftp/ftp.js b/ftp/static/ftp/ftp.js index 679a8b5f7..a80377e6b 100755 --- a/ftp/static/ftp/ftp.js +++ b/ftp/static/ftp/ftp.js @@ -113,7 +113,7 @@ app.controller('createFTPAccount', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.ftpPassword = randomPassword(12); + $scope.ftpPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -451,11 +451,11 @@ app.controller('listFTPAccounts', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.ftpPassword = randomPassword(12); + $scope.ftpPassword = randomPassword(16); }; $scope.usePassword = function () { $scope.generatedPasswordView = true; }; -}); \ No newline at end of file +}); From 1e7ffe679bfa200fdcf1998d264845f49ba9e301 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 29 Apr 2020 20:08:08 +0500 Subject: [PATCH 008/121] birth of package manager --- .../templates/baseTemplate/index.html | 3 + .../serverStatus/packageManager.html | 81 +++++++++++++++++++ serverStatus/urls.py | 1 + serverStatus/views.py | 22 ++++- 4 files changed, 104 insertions(+), 3 deletions(-) create mode 100755 serverStatus/templates/serverStatus/packageManager.html diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index 789de56ea..7b1c21a37 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -765,6 +765,9 @@
  • {% trans "Services Status" %}
  • +
  • {% trans "Package Manager" %} +
  • diff --git a/serverStatus/templates/serverStatus/packageManager.html b/serverStatus/templates/serverStatus/packageManager.html new file mode 100755 index 000000000..021cf834e --- /dev/null +++ b/serverStatus/templates/serverStatus/packageManager.html @@ -0,0 +1,81 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Package Manager - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + + + +
    + +
    +

    {% trans "Package Manager" %}

    +

    {% trans "On this page you can manage your system packages. On backend system available package manager is used (apt/yum)." %}

    +
    + +
    +
    +
    +
    + +
    + +
    +
    +

    I'm in Section 1.

    +
    +
    +

    Howdy, I'm in Section 2.

    +
    +
    +

    Howdy, I'm in Section 3.

    +
    +
    +

    Howdy, I'm in Section 4.

    +
    +
    +

    Howdy, I'm in Section 5.

    +
    +
    +

    Howdy, I'm in Section 6.

    +
    +
    +

    Howdy, I'm in Section 7.

    +
    +
    +

    Howdy, I'm in Section 8.

    +
    +
    +

    Howdy, I'm in Section 9.

    +
    +
    +
    +
    +
    +
    +
    +
    + + +{% endblock %} diff --git a/serverStatus/urls.py b/serverStatus/urls.py index cdd1224e0..43ffa605b 100755 --- a/serverStatus/urls.py +++ b/serverStatus/urls.py @@ -18,5 +18,6 @@ urlpatterns = [ url(r'^topProcesses$', views.topProcesses, name='topProcesses'), url(r'^topProcessesStatus$', views.topProcessesStatus, name='topProcessesStatus'), url(r'^killProcess$', views.killProcess, name='killProcess'), + url(r'^packageManager$', views.packageManager, name='packageManager'), ] \ No newline at end of file diff --git a/serverStatus/views.py b/serverStatus/views.py index dae87051e..b0fe234b1 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -505,7 +505,6 @@ def topProcesses(request): logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[litespeedStatus]") return redirect(loadLoginPage) - def topProcessesStatus(request): try: userID = request.session['userID'] @@ -628,7 +627,6 @@ def topProcessesStatus(request): json_data = json.dumps(data_ret) return HttpResponse(json_data) - def killProcess(request): try: userID = request.session['userID'] @@ -656,4 +654,22 @@ def killProcess(request): except KeyError as msg: final_dic = {'status': 0, 'erroMessage': str(msg)} final_json = json.dumps(final_dic) - return HttpResponse(final_json) \ No newline at end of file + return HttpResponse(final_json) + +def packageManager(request): + try: + userID = request.session['userID'] + currentACL = ACLManager.loadedACL(userID) + + if currentACL['admin'] == 1: + pass + else: + return ACLManager.loadError() + + templateName = "serverStatus/packageManager.html" + proc = httpProc(request, templateName) + return proc.renderPre() + + except KeyError as msg: + logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[packageManager]") + return redirect(loadLoginPage) \ No newline at end of file From 2eadbd393f5eb906f12955afa475acbc12eaeeaf Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 30 Apr 2020 18:18:48 +0500 Subject: [PATCH 009/121] show packs on packages manager --- .../static/serverStatus/serverStatus.js | 152 ++++++++++++++---- .../serverStatus/packageManager.html | 100 +++++++----- serverStatus/urls.py | 1 + serverStatus/views.py | 65 +++++++- websiteFunctions/website.py | 1 - 5 files changed, 246 insertions(+), 73 deletions(-) diff --git a/serverStatus/static/serverStatus/serverStatus.js b/serverStatus/static/serverStatus/serverStatus.js index db70955a0..476cde44d 100755 --- a/serverStatus/static/serverStatus/serverStatus.js +++ b/serverStatus/static/serverStatus/serverStatus.js @@ -3,7 +3,6 @@ */ - /* Java script code to start/stop litespeed */ app.controller('litespeedStatus', function ($scope, $http) { @@ -49,8 +48,7 @@ app.controller('litespeedStatus', function ($scope, $http) { $scope.actionResultBad = true; $scope.serverStatusCouldNotConnect = true; - } - else { + } else { $scope.restartorStopLoading = true; $scope.actionResult = true; @@ -109,8 +107,7 @@ app.controller('litespeedStatus', function ($scope, $http) { $scope.actionResultBad = true; $scope.serverStatusCouldNotConnect = true; - } - else { + } else { $scope.restartorStopLoading = true; $scope.actionResult = true; @@ -174,8 +171,7 @@ app.controller('litespeedStatus', function ($scope, $http) { }); $scope.lsSerial = response.data.lsSerial; $scope.lsexpiration = response.data.lsexpiration; - } - else { + } else { $scope.cpLoading = true; new PNotify({ title: 'Operation Failed!', @@ -229,8 +225,7 @@ app.controller('litespeedStatus', function ($scope, $http) { text: 'License successfully Updated', type: 'success' }); - } - else { + } else { $scope.cpLoading = true; new PNotify({ title: 'Operation Failed!', @@ -292,8 +287,7 @@ app.controller('readCyberCPLogFile', function ($scope, $http) { $scope.logsData = response.data.logsdata; - } - else { + } else { $scope.logFileLoading = true; $scope.logsFeteched = true; @@ -347,8 +341,7 @@ app.controller('readCyberCPLogFile', function ($scope, $http) { $scope.logsData = response.data.logsdata; - } - else { + } else { $scope.logFileLoading = true; $scope.logsFeteched = true; @@ -409,8 +402,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.olsStart = false; $scope.olsStop = true; $scope.olsMem = Math.round(parseInt(response.data.memUsage.litespeed) / 1048576) + " MB"; - } - else { + } else { $scope.olsStatus = "Stopped"; $scope.olsStats = false; $scope.olsStart = true; @@ -421,8 +413,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.dockerStatus = "Running"; $scope.dockerStart = false; $scope.dockerStop = true; - } - else { + } else { $scope.dockerStatus = "Stopped"; $scope.dockerStart = true; $scope.dockerStop = false; @@ -435,8 +426,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.sqlStart = false; $scope.sqlStop = true; $scope.sqlMem = Math.round(parseInt(response.data.memUsage.mysql) / 1048576) + " MB"; - } - else { + } else { $scope.sqlStatus = "Stopped"; $scope.sqlStats = false; $scope.sqlStart = true; @@ -451,8 +441,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.dnsStart = false; $scope.dnsStop = true; $scope.dnsMem = Math.round(parseInt(response.data.memUsage.powerdns) / 1048576) + " MB"; - } - else { + } else { $scope.dnsStatus = "Stopped"; $scope.dnsStats = false; $scope.dnsStart = true; @@ -467,8 +456,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.ftpStart = false; $scope.ftpStop = true; $scope.ftpMem = Math.round(parseInt(response.data.memUsage.pureftp) / 1048576) + " MB"; - } - else { + } else { $scope.ftpStatus = "Stopped"; $scope.ftpStats = false; $scope.ftpStart = true; @@ -487,6 +475,7 @@ app.controller('servicesManager', function ($scope, $http) { } } + getServiceStatus(); $scope.serviceAction = function (serviceName, action) { @@ -524,8 +513,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.actionLoader = false; $scope.btnDisable = false; }, 3000); - } - else { + } else { setTimeout(function () { getServiceStatus(); $scope.ActionSuccessfull = false; @@ -583,8 +571,7 @@ app.controller('lswsSwitch', function ($scope, $http, $timeout, $window) { if (response.data.status === 1) { $scope.installBoxGen = false; getRequestStatus(); - } - else { + } else { new PNotify({ title: 'Operation Failed!', text: response.data.error_message, @@ -626,8 +613,7 @@ app.controller('lswsSwitch', function ($scope, $http, $timeout, $window) { if (response.data.abort === 0) { $scope.requestData = response.data.requestStatus; $timeout(getRequestStatus, 1000); - } - else { + } else { // Notifications $scope.cyberPanelLoading = true; $timeout.cancel(); @@ -720,8 +706,7 @@ app.controller('topProcesses', function ($scope, $http, $timeout) { $scope.zombieProcesses = response.data.zombieProcesses; $timeout($scope.topProcessesStatus, 3000); - } - else { + } else { new PNotify({ title: 'Operation Failed!', text: response.data.error_message, @@ -771,8 +756,111 @@ app.controller('topProcesses', function ($scope, $http, $timeout) { text: 'Process successfully killed.', type: 'success' }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); } - else { + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + }; + +}); + +/// + + +app.controller('listOSPackages', function ($scope, $http, $timeout) { + + $scope.cyberpanelLoading = true; + + $scope.currentPage = 1; + $scope.recordsToShow = 10; + + $scope.fetchPackages = function () { + $scope.cyberpanelLoading = false; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + page: $scope.currentPage, + recordsToShow: $scope.recordsToShow + }; + + dataurl = "/serverstatus/fetchPackages"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + $scope.allPackages = JSON.parse(response.data.packages); + $scope.pagination = response.data.pagination; + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + $scope.killProcess = function (pid) { + + $scope.cyberPanelLoading = false; + + url = "/serverstatus/killProcess"; + + var data = { + pid: pid + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + if (response.data.status === 1) { + new PNotify({ + title: 'Success', + text: 'Process successfully killed.', + type: 'success' + }); + } else { new PNotify({ title: 'Operation Failed!', text: response.data.error_message, diff --git a/serverStatus/templates/serverStatus/packageManager.html b/serverStatus/templates/serverStatus/packageManager.html index 021cf834e..a91ac5373 100755 --- a/serverStatus/templates/serverStatus/packageManager.html +++ b/serverStatus/templates/serverStatus/packageManager.html @@ -8,7 +8,7 @@ -
    +

    {% trans "Package Manager" %}

    @@ -22,53 +22,77 @@
    -
    -

    I'm in Section 1.

    -
    -
    -

    Howdy, I'm in Section 2.

    -
    -
    -

    Howdy, I'm in Section 3.

    -

    Howdy, I'm in Section 4.

    -
    -

    Howdy, I'm in Section 5.

    -
    -

    Howdy, I'm in Section 6.

    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    {% trans "Package" %}{% trans "Description" %}{% trans "Status" %}{% trans "Version" %}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Howdy, I'm in Section 7.

    -
    -

    Howdy, I'm in Section 8.

    -
    -
    -

    Howdy, I'm in Section 9.

    -
    diff --git a/serverStatus/urls.py b/serverStatus/urls.py index 43ffa605b..65c60b533 100755 --- a/serverStatus/urls.py +++ b/serverStatus/urls.py @@ -19,5 +19,6 @@ urlpatterns = [ url(r'^topProcessesStatus$', views.topProcessesStatus, name='topProcessesStatus'), url(r'^killProcess$', views.killProcess, name='killProcess'), url(r'^packageManager$', views.packageManager, name='packageManager'), + url(r'^fetchPackages$', views.fetchPackages, name='fetchPackages'), ] \ No newline at end of file diff --git a/serverStatus/views.py b/serverStatus/views.py index b0fe234b1..08c7b376e 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -6,7 +6,7 @@ from django.http import HttpResponse import plogical.CyberCPLogFileWriter as logging from loginSystem.views import loadLoginPage import json -import subprocess +import subprocess, shlex import psutil import socket from plogical.acl import ACLManager @@ -672,4 +672,65 @@ def packageManager(request): except KeyError as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[packageManager]") - return redirect(loadLoginPage) \ No newline at end of file + return redirect(loadLoginPage) + +def fetchPackages(request): + try: + + userID = request.session['userID'] + currentACL = ACLManager.loadedACL(userID) + + if currentACL['admin'] == 1: + pass + else: + return ACLManager.loadError() + + data = json.loads(request.body) + page = int(data['page']) + recordsToShow = int(data['recordsToShow']) + + packageInformation = '/home/cyberpanel/OSPackages' + f = open(packageInformation, "w") + + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + command = 'dpkg-query -f \'{"status":"${db:Status-Abbrev}","package":"${binary:Package}","version":"${Version}","description":"${binary:Summary}"}\n\' -W' + subprocess.call(shlex.split(command), stdout=f) + + packages = ProcessUtilities.outputExecutioner('cat %s' % (packageInformation)).split('\n') + + if os.path.exists(ProcessUtilities.debugPath): + logging.CyberCPLogFileWriter.writeToFile('All packages: %s' % (str(packages))) + + from s3Backups.s3Backups import S3Backups + + pagination = S3Backups.getPagination(len(packages), recordsToShow) + endPageNumber, finalPageNumber = S3Backups.recordsPointer(page, recordsToShow) + finalPackages = packages[finalPageNumber:endPageNumber] + + json_data = "[" + checker = 0 + + if os.path.exists(ProcessUtilities.debugPath): + logging.CyberCPLogFileWriter.writeToFile('Final packages: %s' % (str(finalPackages))) + + for items in finalPackages: + logging.CyberCPLogFileWriter.writeToFile(items) + try: + if checker == 0: + json_data = json_data + items + checker = 1 + else: + json_data = json_data + ',' + items + except: + logging.CyberCPLogFileWriter.writeToFile(items) + + json_data = json_data + ']' + + data_ret = {'status': 1, 'packages': json_data, 'pagination': pagination} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + except BaseException as msg: + data_ret = {'status': 0, 'error_message': str(msg)} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) \ No newline at end of file diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 68763d5df..996b9f48d 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -3613,7 +3613,6 @@ StrictHostKeyChecking no else: return ACLManager.loadErrorJson() - logging.CyberCPLogFileWriter.writeToFile('hello world 2') ## Security check From 874720fbfe44d28d11d6d2b7413933ef4f7d5f19 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 1 May 2020 23:05:04 +0500 Subject: [PATCH 010/121] bug fix: fetch packages --- serverStatus/views.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/serverStatus/views.py b/serverStatus/views.py index 08c7b376e..2fe1c11a2 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -686,7 +686,7 @@ def fetchPackages(request): return ACLManager.loadError() data = json.loads(request.body) - page = int(data['page']) + page = int(data['page'].rstrip('\n')) recordsToShow = int(data['recordsToShow']) packageInformation = '/home/cyberpanel/OSPackages' @@ -698,23 +698,24 @@ def fetchPackages(request): packages = ProcessUtilities.outputExecutioner('cat %s' % (packageInformation)).split('\n') - if os.path.exists(ProcessUtilities.debugPath): - logging.CyberCPLogFileWriter.writeToFile('All packages: %s' % (str(packages))) + # if os.path.exists(ProcessUtilities.debugPath): + # logging.CyberCPLogFileWriter.writeToFile('All packages: %s' % (str(packages))) from s3Backups.s3Backups import S3Backups pagination = S3Backups.getPagination(len(packages), recordsToShow) + logging.CyberCPLogFileWriter.writeToFile(str(pagination)) endPageNumber, finalPageNumber = S3Backups.recordsPointer(page, recordsToShow) finalPackages = packages[finalPageNumber:endPageNumber] json_data = "[" checker = 0 - if os.path.exists(ProcessUtilities.debugPath): - logging.CyberCPLogFileWriter.writeToFile('Final packages: %s' % (str(finalPackages))) - + # if os.path.exists(ProcessUtilities.debugPath): + # logging.CyberCPLogFileWriter.writeToFile('Final packages: %s' % (str(finalPackages))) + import re for items in finalPackages: - logging.CyberCPLogFileWriter.writeToFile(items) + items = re.sub(r'("[\s\w]*)"([\s\w])*"([\s\w]*)',r"\1\2\3", items) try: if checker == 0: json_data = json_data + items From c1f560001881a4337aee110c2c652604b31eb972 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 2 May 2020 17:51:01 +0500 Subject: [PATCH 011/121] bug fix: topProcessesStatus --- .../static/serverStatus/serverStatus.js | 2 + .../serverStatus/packageManager.html | 7 + serverStatus/views.py | 45 ++++- static/databases/databases.js | 6 +- static/ftp/ftp.js | 6 +- static/mailServer/mailServer.js | 6 +- static/serverStatus/serverStatus.js | 154 ++++++++++++++---- static/userManagment/userManagment.js | 6 +- version.txt | 2 +- 9 files changed, 181 insertions(+), 53 deletions(-) mode change 100755 => 100644 static/databases/databases.js diff --git a/serverStatus/static/serverStatus/serverStatus.js b/serverStatus/static/serverStatus/serverStatus.js index 476cde44d..5dca427db 100755 --- a/serverStatus/static/serverStatus/serverStatus.js +++ b/serverStatus/static/serverStatus/serverStatus.js @@ -812,6 +812,8 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { if (response.data.status === 1) { $scope.allPackages = JSON.parse(response.data.packages); $scope.pagination = response.data.pagination; + $scope.fetchedPackages = response.data.fetchedPackages; + $scope.totalPackages = response.data.totalPackages; } else { new PNotify({ title: 'Error!', diff --git a/serverStatus/templates/serverStatus/packageManager.html b/serverStatus/templates/serverStatus/packageManager.html index a91ac5373..c9d7afe9d 100755 --- a/serverStatus/templates/serverStatus/packageManager.html +++ b/serverStatus/templates/serverStatus/packageManager.html @@ -33,6 +33,12 @@

    Howdy, I'm in Section 4.

    diff --git a/serverStatus/views.py b/serverStatus/views.py index 2fe1c11a2..d7e605c40 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -579,17 +579,45 @@ def topProcessesStatus(request): data['Softirqs'] = loadNow[13] + '%' ## Memory - data['totalMemory'] = str(int(float(memory[3]) / 1024)) + 'MB' - data['freeMemory'] = str(int(float(memory[5]) / 1024)) + 'MB' - data['usedMemory'] = str(int(float(memory[7]) / 1024)) + 'MB' - data['buffCache'] = str(int(float(memory[9]) / 1024)) + 'MB' + + if memory[3].find('+') > -1: + memoryFinal = memory[3].split('+')[0] + else: + memoryFinal = memory[3] + + data['totalMemory'] = str(int(float(memoryFinal) / 1024)) + 'MB' + + ## + + if memory[5].find('free') > -1: + data['freeMemory'] = str(int(float(memory[4]) / 1024)) + 'MB' + else: + data['freeMemory'] = str(int(float(memory[5]) / 1024)) + 'MB' + + ## + + if memory[7].find('used') > -1: + data['usedMemory'] = str(int(float(memory[6]) / 1024)) + 'MB' + else: + data['usedMemory'] = str(int(float(memory[7]) / 1024)) + 'MB' + + if memory[9].find('buff') > -1: + data['buffCache'] = str(int(float(memory[8]) / 1024)) + 'MB' + else: + data['buffCache'] = str(int(float(memory[9]) / 1024)) + 'MB' ## Swap + data['swapTotalMemory'] = str(int(float(swap[2]) / 1024)) + 'MB' data['swapFreeMemory'] = str(int(float(swap[4]) / 1024)) + 'MB' data['swapUsedMemory'] = str(int(float(swap[6]) / 1024)) + 'MB' - data['swapBuffCache'] = str(int(float(swap[8]) / 1024)) + 'MB' + + if swap[8].find('+') > -1: + finalBuffCache = swap[8].split('+')[0] + data['swapBuffCache'] = str(int(float(finalBuffCache) / 1024)) + 'MB' + else: + data['swapBuffCache'] = str(int(float(swap[8]) / 1024)) + 'MB' ## Processes @@ -686,7 +714,7 @@ def fetchPackages(request): return ACLManager.loadError() data = json.loads(request.body) - page = int(data['page'].rstrip('\n')) + page = int(str(data['page']).rstrip('\n')) recordsToShow = int(data['recordsToShow']) packageInformation = '/home/cyberpanel/OSPackages' @@ -704,12 +732,12 @@ def fetchPackages(request): from s3Backups.s3Backups import S3Backups pagination = S3Backups.getPagination(len(packages), recordsToShow) - logging.CyberCPLogFileWriter.writeToFile(str(pagination)) endPageNumber, finalPageNumber = S3Backups.recordsPointer(page, recordsToShow) finalPackages = packages[finalPageNumber:endPageNumber] json_data = "[" checker = 0 + counter = 0 # if os.path.exists(ProcessUtilities.debugPath): # logging.CyberCPLogFileWriter.writeToFile('Final packages: %s' % (str(finalPackages))) @@ -717,6 +745,7 @@ def fetchPackages(request): for items in finalPackages: items = re.sub(r'("[\s\w]*)"([\s\w])*"([\s\w]*)',r"\1\2\3", items) try: + counter = counter + 1 if checker == 0: json_data = json_data + items checker = 1 @@ -727,7 +756,7 @@ def fetchPackages(request): json_data = json_data + ']' - data_ret = {'status': 1, 'packages': json_data, 'pagination': pagination} + data_ret = {'status': 1, 'packages': json_data, 'pagination': pagination, 'fetchedPackages': counter, 'totalPackages': len(packages)} json_data = json.dumps(data_ret) return HttpResponse(json_data) diff --git a/static/databases/databases.js b/static/databases/databases.js old mode 100755 new mode 100644 index e13d25977..d1e91175b --- a/static/databases/databases.js +++ b/static/databases/databases.js @@ -106,7 +106,7 @@ app.controller('createDatabase', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.dbPassword = randomPassword(12); + $scope.dbPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -447,7 +447,7 @@ app.controller('listDBs', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.dbPassword = randomPassword(12); + $scope.dbPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -493,4 +493,4 @@ app.controller('phpMyAdmin', function ($scope, $http, $window) { } setupPHPMYAdminSession(); -}); \ No newline at end of file +}); diff --git a/static/ftp/ftp.js b/static/ftp/ftp.js index 679a8b5f7..a80377e6b 100644 --- a/static/ftp/ftp.js +++ b/static/ftp/ftp.js @@ -113,7 +113,7 @@ app.controller('createFTPAccount', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.ftpPassword = randomPassword(12); + $scope.ftpPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -451,11 +451,11 @@ app.controller('listFTPAccounts', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.ftpPassword = randomPassword(12); + $scope.ftpPassword = randomPassword(16); }; $scope.usePassword = function () { $scope.generatedPasswordView = true; }; -}); \ No newline at end of file +}); diff --git a/static/mailServer/mailServer.js b/static/mailServer/mailServer.js index f50b36a45..3bf1db1c3 100644 --- a/static/mailServer/mailServer.js +++ b/static/mailServer/mailServer.js @@ -110,7 +110,7 @@ app.controller('createEmailAccount', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.emailPassword = randomPassword(12); + $scope.emailPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -465,7 +465,7 @@ app.controller('changeEmailPassword', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.emailPassword = randomPassword(12); + $scope.emailPassword = randomPassword(16); }; $scope.usePassword = function () { @@ -1291,4 +1291,4 @@ app.controller('listEmails', function ($scope, $http) { }); -/* Java script code for List Emails Ends here */ \ No newline at end of file +/* Java script code for List Emails Ends here */ diff --git a/static/serverStatus/serverStatus.js b/static/serverStatus/serverStatus.js index db70955a0..5dca427db 100644 --- a/static/serverStatus/serverStatus.js +++ b/static/serverStatus/serverStatus.js @@ -3,7 +3,6 @@ */ - /* Java script code to start/stop litespeed */ app.controller('litespeedStatus', function ($scope, $http) { @@ -49,8 +48,7 @@ app.controller('litespeedStatus', function ($scope, $http) { $scope.actionResultBad = true; $scope.serverStatusCouldNotConnect = true; - } - else { + } else { $scope.restartorStopLoading = true; $scope.actionResult = true; @@ -109,8 +107,7 @@ app.controller('litespeedStatus', function ($scope, $http) { $scope.actionResultBad = true; $scope.serverStatusCouldNotConnect = true; - } - else { + } else { $scope.restartorStopLoading = true; $scope.actionResult = true; @@ -174,8 +171,7 @@ app.controller('litespeedStatus', function ($scope, $http) { }); $scope.lsSerial = response.data.lsSerial; $scope.lsexpiration = response.data.lsexpiration; - } - else { + } else { $scope.cpLoading = true; new PNotify({ title: 'Operation Failed!', @@ -229,8 +225,7 @@ app.controller('litespeedStatus', function ($scope, $http) { text: 'License successfully Updated', type: 'success' }); - } - else { + } else { $scope.cpLoading = true; new PNotify({ title: 'Operation Failed!', @@ -292,8 +287,7 @@ app.controller('readCyberCPLogFile', function ($scope, $http) { $scope.logsData = response.data.logsdata; - } - else { + } else { $scope.logFileLoading = true; $scope.logsFeteched = true; @@ -347,8 +341,7 @@ app.controller('readCyberCPLogFile', function ($scope, $http) { $scope.logsData = response.data.logsdata; - } - else { + } else { $scope.logFileLoading = true; $scope.logsFeteched = true; @@ -409,8 +402,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.olsStart = false; $scope.olsStop = true; $scope.olsMem = Math.round(parseInt(response.data.memUsage.litespeed) / 1048576) + " MB"; - } - else { + } else { $scope.olsStatus = "Stopped"; $scope.olsStats = false; $scope.olsStart = true; @@ -421,8 +413,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.dockerStatus = "Running"; $scope.dockerStart = false; $scope.dockerStop = true; - } - else { + } else { $scope.dockerStatus = "Stopped"; $scope.dockerStart = true; $scope.dockerStop = false; @@ -435,8 +426,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.sqlStart = false; $scope.sqlStop = true; $scope.sqlMem = Math.round(parseInt(response.data.memUsage.mysql) / 1048576) + " MB"; - } - else { + } else { $scope.sqlStatus = "Stopped"; $scope.sqlStats = false; $scope.sqlStart = true; @@ -451,8 +441,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.dnsStart = false; $scope.dnsStop = true; $scope.dnsMem = Math.round(parseInt(response.data.memUsage.powerdns) / 1048576) + " MB"; - } - else { + } else { $scope.dnsStatus = "Stopped"; $scope.dnsStats = false; $scope.dnsStart = true; @@ -467,8 +456,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.ftpStart = false; $scope.ftpStop = true; $scope.ftpMem = Math.round(parseInt(response.data.memUsage.pureftp) / 1048576) + " MB"; - } - else { + } else { $scope.ftpStatus = "Stopped"; $scope.ftpStats = false; $scope.ftpStart = true; @@ -487,6 +475,7 @@ app.controller('servicesManager', function ($scope, $http) { } } + getServiceStatus(); $scope.serviceAction = function (serviceName, action) { @@ -524,8 +513,7 @@ app.controller('servicesManager', function ($scope, $http) { $scope.actionLoader = false; $scope.btnDisable = false; }, 3000); - } - else { + } else { setTimeout(function () { getServiceStatus(); $scope.ActionSuccessfull = false; @@ -583,8 +571,7 @@ app.controller('lswsSwitch', function ($scope, $http, $timeout, $window) { if (response.data.status === 1) { $scope.installBoxGen = false; getRequestStatus(); - } - else { + } else { new PNotify({ title: 'Operation Failed!', text: response.data.error_message, @@ -626,8 +613,7 @@ app.controller('lswsSwitch', function ($scope, $http, $timeout, $window) { if (response.data.abort === 0) { $scope.requestData = response.data.requestStatus; $timeout(getRequestStatus, 1000); - } - else { + } else { // Notifications $scope.cyberPanelLoading = true; $timeout.cancel(); @@ -720,8 +706,7 @@ app.controller('topProcesses', function ($scope, $http, $timeout) { $scope.zombieProcesses = response.data.zombieProcesses; $timeout($scope.topProcessesStatus, 3000); - } - else { + } else { new PNotify({ title: 'Operation Failed!', text: response.data.error_message, @@ -771,8 +756,113 @@ app.controller('topProcesses', function ($scope, $http, $timeout) { text: 'Process successfully killed.', type: 'success' }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); } - else { + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + }; + +}); + +/// + + +app.controller('listOSPackages', function ($scope, $http, $timeout) { + + $scope.cyberpanelLoading = true; + + $scope.currentPage = 1; + $scope.recordsToShow = 10; + + $scope.fetchPackages = function () { + $scope.cyberpanelLoading = false; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + page: $scope.currentPage, + recordsToShow: $scope.recordsToShow + }; + + dataurl = "/serverstatus/fetchPackages"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + $scope.allPackages = JSON.parse(response.data.packages); + $scope.pagination = response.data.pagination; + $scope.fetchedPackages = response.data.fetchedPackages; + $scope.totalPackages = response.data.totalPackages; + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + $scope.killProcess = function (pid) { + + $scope.cyberPanelLoading = false; + + url = "/serverstatus/killProcess"; + + var data = { + pid: pid + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + if (response.data.status === 1) { + new PNotify({ + title: 'Success', + text: 'Process successfully killed.', + type: 'success' + }); + } else { new PNotify({ title: 'Operation Failed!', text: response.data.error_message, diff --git a/static/userManagment/userManagment.js b/static/userManagment/userManagment.js index 39cbf5d6d..73eaed9a5 100644 --- a/static/userManagment/userManagment.js +++ b/static/userManagment/userManagment.js @@ -113,7 +113,7 @@ app.controller('createUserCtr', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.password = randomPassword(12); + $scope.password = randomPassword(16); }; $scope.usePassword = function () { @@ -342,7 +342,7 @@ app.controller('modifyUser', function ($scope, $http) { $scope.generatePassword = function () { $scope.generatedPasswordView = false; - $scope.password = randomPassword(12); + $scope.password = randomPassword(16); }; $scope.usePassword = function () { @@ -1744,4 +1744,4 @@ app.controller('listTableUsers', function ($scope, $http) { }); -/* Java script code to list table users */ \ No newline at end of file +/* Java script code to list table users */ diff --git a/version.txt b/version.txt index ca1e53142..c085faed0 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -{"version":"2.0","build":0} \ No newline at end of file +{"version":"2.0","build":1} \ No newline at end of file From b20af734dd132cbf4f2c9ab1d6553b7826b08a12 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 3 May 2020 11:59:36 +0500 Subject: [PATCH 012/121] feature: load website preview --- api/views.py | 1 - .../templates/websiteFunctions/listChildDomains.html | 2 +- .../templates/websiteFunctions/listWebsites.html | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/api/views.py b/api/views.py index e80fa5927..771ab5eb4 100755 --- a/api/views.py +++ b/api/views.py @@ -593,7 +593,6 @@ def runAWSBackups(request): except BaseException as msg: logging.writeToFile(str(msg) + ' [API.runAWSBackups]') - @csrf_exempt def submitUserCreation(request): try: diff --git a/websiteFunctions/templates/websiteFunctions/listChildDomains.html b/websiteFunctions/templates/websiteFunctions/listChildDomains.html index 668a9e0e6..518a976e6 100755 --- a/websiteFunctions/templates/websiteFunctions/listChildDomains.html +++ b/websiteFunctions/templates/websiteFunctions/listChildDomains.html @@ -41,7 +41,7 @@ style="padding: 0px; box-shadow: 0px 0px 1px 0px #888888;">
    -
    -
    + class="col-lg-3 col-md-12">
    From ac40a5eaaea24684749d33c4d255ab13e6e00bc3 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 3 May 2020 10:35:06 +0100 Subject: [PATCH 013/121] mailscanner mailwatch installer combined installer for centos 7 and ubuntu 18 --- CLScript/mailscannerinstaller.sh | 182 +++++++++++++++++++++++++++++++ install/cyberpanel.repo | 9 +- 2 files changed, 187 insertions(+), 4 deletions(-) create mode 100644 CLScript/mailscannerinstaller.sh diff --git a/CLScript/mailscannerinstaller.sh b/CLScript/mailscannerinstaller.sh new file mode 100644 index 000000000..852695d55 --- /dev/null +++ b/CLScript/mailscannerinstaller.sh @@ -0,0 +1,182 @@ +#!/bin/bash +systemctl stop firewalld + +MAILSCANNER=/etc/MailScanner + +if [ -d $MAILSCANNER ];then + +echo "MailScanner found. If you wish to reinstall then remove the package and revert" +echo "Postfix back to its original config at /etc/postfix/main.cf and remove" +echo "/etc/MailScanner and /usr/share/MailScanner directories" +exit +fi + +if [ -f /etc/os-release ];then + ./etc/os-release +OS=$NAME +fi + +if [ "$OS" == "CentOS Linux" ];then + +setenforce 0 + +yum install -y yum-utils perl-CPAN gcc cpp perl bzip2 zip make patch automake rpm-build perl-Archive-Zip perl-Filesys-Df perl-OLE-Storage_Lite perl-Sys-Hostname-Long perl-Sys-SigAction perl-Net-CIDR perl-DBI perl-MIME-tools perl-DBD-SQLite binutils glibc-devel perl-Filesys-Df zlib unzip zlib-devel wget mlocate clamav "perl(DBD::mysql)" + +rpm -Uvh https://forensics.cert.org/centos/cert/7/x86_64/unrar-5.4.0-1.el7.x86_64.rpm + +export PERL_MM_USE_DEFAULT=1 +curl -L https://cpanmin.us | perl - App::cpanminus +cpanm Encoding::FixLatin +cpanm Digest::SHA1 +cpanm Geo::IP +cpanm Razor2::Client::Agent +cpanm Net::Patricia + +freshclam -v + +DIR=/etc/mail/spamassassin + +if [ -d "$DIR" ]; then +sa-update + +else + +echo "Please install spamassassin through the CyberPanel interface before proceeding" + +exit +fi + +else + +apt-get install -y libmysqlclient-dev + +apt-get install -y cpanminus gcc perl bzip2 zip make patch automake rpm libarchive-zip-perl libfilesys-df-perl libole-storage-lite-perl libsys-hostname-long-perl libsys-sigaction-perl libregexp-common-net-cidr-perl libmime-tools-perl libdbd-sqlite3-perl binutils build-essential libfilesys-df-perl zlib1g unzip mlocate clamav libdbd-mysql-perl unrar libclamav-dev libclamav-client-perl libclamunrar7 + +cpanm Encoding::FixLatin +cpanm Digest::SHA1 +cpanm Geo::IP +cpanm Razor2::Client::Agent +cpanm Net::Patricia +cpanm Net::CIDR + +sudo systemctl stop clamav-freshclam.service + +freshclam + +sudo systemctl start clamav-freshclam.service + +DIR=/etc/spamassassin +if [ -d "$DIR" ]; then + +apt-get -y install razor pyzor libencode-detect-perl libgeo-ip-perl libnet-patricia-perl +sa-update +else +echo "Please install spamassassin through the CyberPanel interface before proceeding" +exit +fi +fi + + +echo "header_checks = regexp:/etc/postfix/header_checks" >> /etc/postfix/main.cf +echo "/^Received:/ HOLD" >> /etc/postfix/header_checks + +systemctl restart postfix + +wget https://github.com/MailScanner/v5/archive/master.zip +unzip master.zip + +cd /root/v5-master/builds + +if [ "$OS" == "CentOS Linux" ];then +rpm -Uvh *.rhel.noarch.rpm +else +dpkg -i *.noarch.deb + + +mkdir /var/run/MailScanner +mkdir /var/lock/subsys +mkdir /var/lock/subsys/MailScanner +chown -R postfix:postfix /var/run/MailScanner +chown -R postfix:postfix /var/lock/subsys/MailScanner +chown -R postfix:postfix /var/spool/MailScanner +fi +mkdir /var/spool/MailScanner/spamassassin + +chown postfix.mtagroup /var/spool/MailScanner/spamassassin +chown root.mtagroup /var/spool/MailScanner/incoming/ +chown postfix.mtagroup /var/spool/MailScanner/milterin +chown postfix.mtagroup /var/spool/MailScanner/milterout +chown postfix.mtagroup /var/spool/postfix/hold +chown postfix.mtagroup /var/spool/postfix/incoming +usermod -a -G mtagroup nobody + +chmod g+rx /var/spool/postfix/incoming +chmod g+rx /var/spool/postfix/hold +chmod -R 0775 /var/spool/postfix/incoming +chmod -R 0775 /var/spool/postfix/hold + +sed -i 's/^Run As User =.*/& postfix/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Run As Group =.*/& postfix/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Incoming Queue Dir =.*/Incoming Queue Dir = \/var\/spool\/postfix\/hold/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Outgoing Queue Dir =.*/Outgoing Queue Dir = \/var\/spool\/postfix\/incoming/' /etc/MailScanner/MailScanner.conf +sed -i 's/^MTA =.*/MTA = postfix/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Quarantine User =.*/& postfix/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Quarantine Group =.*/& mtagroup/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Quarantine Permissions =.*/Quarantine Permissions = 640/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Virus Scanners =.*/Virus Scanners = clamav/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Is Definitely Not Spam =.*/Is Definitely Not Spam = \&SQLWhitelist/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Is Definitely Spam =.*/Is Definitely Spam = \&SQLBlacklist/' /etc/MailScanner/MailScanner.conf +sed -i 's/^SpamAssassin User State Dir =.*/& \/var\/spool\/MailScanner\/spamassassin/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Always Looked Up Last =.*/Always Looked Up Last = \&MailWatchLogging/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Quarantine Whole Message =.*/Quarantine Whole Message = yes/' /etc/MailScanner/MailScanner.conf +sed -i 's/^Spam List =.*/Spam List = SBL + XBL/' /etc/MailScanner/MailScanner.conf + +mkdir /usr/local/CyberCP/public/mailwatch + +cd /usr/local/CyberCP/public/mailwatch + +git clone --depth=1 https://github.com/mailwatch/MailWatch.git --branch 1.2 --single-branch + +mv /usr/local/CyberCP/public/mailwatch/MailWatch/* /usr/local/CyberCP/public/mailwatch/ + +PASSWORD=$(cat /etc/cyberpanel/mysqlPassword) +USER=root +DATABASE=mailscanner +ADMINPASS=$(cat /etc/cyberpanel/adminPass) +mysql -u${USER} -p${PASSWORD} < "/usr/local/CyberCP/public/mailwatch/create.sql" +mysql -u${USER} -p${PASSWORD} -e "use mailscanner"; +mysql -u${USER} -D${DATABASE} -p${PASSWORD} -e "GRANT ALL ON mailscanner.* TO root@localhost IDENTIFIED BY '${PASSWORD}';" +mysql -u${USER} -D${DATABASE} -p${PASSWORD} -e "FLUSH PRIVILEGES;" +mysql -u${USER} -D${DATABASE} -p${PASSWORD} -e "INSERT INTO mailscanner.users SET username = 'admin', password = MD5('${ADMINPASS}'), fullname = 'admin', type = 'A';" + +cp /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php.example /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php + +sed -i "s/^define('DB_USER',.*/define('DB_USER','root');/" /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php +sed -i "s/^define('DB_PASS',.*/define('DB_PASS','${PASSWORD}');/" /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php +sed -i "s/^define('MAILWATCH_HOME',.*/define(\'MAILWATCH_HOME\', \'\/usr\/local\/CyberCP\/public\/mailwatch\/mailscanner');/" /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php +sed -i 's/^run_mailscanner=.*/run_mailscanner=1/' /etc/MailScanner/defaults + +cp /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/MailWatchConf.pm /usr/share/MailScanner/perl/custom/ +sed -i 's/^my (\$db_user) = .*/my (\$db_user) = \x27'${USER}'\x27;/' /usr/share/MailScanner/perl/custom/MailWatchConf.pm +sed -i 's/^my (\$db_pass) = .*/my (\$db_pass) = \x27'${PASSWORD}'\x27;/' /usr/share/MailScanner/perl/custom/MailWatchConf.pm +ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/MailWatch.pm /usr/share/MailScanner/perl/custom +ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/SQLBlackWhiteList.pm /usr/share/MailScanner/perl/custom +ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/SQLSpamSettings.pm /usr/share/MailScanner/perl/custom +sed -i "s/^\$pathToFunctions =.*/\$pathToFunctions = '\/usr\/local\/CyberCP\/public\/mailwatch\/mailscanner\/functions.php';/" /usr/local/CyberCP/public/mailwatch/upgrade.php + +php /usr/local/CyberCP/public/mailwatch/upgrade.php +systemctl enable mailscanner +systemctl restart mailscanner + +IPADDRESS=$(cat /etc/cyberpanel/machineIP) + +echo "MailScanner successfully installed. MailWatch successfully installed." +echo "Visit https://${IPADDRESS}:8090/mailwatch/mailscanner" +echo "Username: admin" +echo "Password: ${ADMINPASS}" +echo "If you wish mailscanner/spamassassin to send spam email to a spam folder please follow the tutorial on the Cyberpanel Website" +echo "Firewalld is stopped. Either enable, install CSF or use an alternative!" +echo "Optional cpan/cpanm modules are available for MailScanner. Cronjobs and further postfix tools are available for MailWatch" +echo "See https://www.mailwatch.org and https://docs.mailwatch.org/install/optional-setup.html" +exit + diff --git a/install/cyberpanel.repo b/install/cyberpanel.repo index 7723bb480..4dc23d316 100755 --- a/install/cyberpanel.repo +++ b/install/cyberpanel.repo @@ -1,4 +1,5 @@ -[cyberpanel] -name=Cyber Panel -baseurl=http://repo.cyberpersons.com -gpgcheck=0 \ No newline at end of file +[CyberPanel] +name=CyberPanel +baseurl=https://rep.cyberpanel.net/ +gpgkey=https://rep.cyberpanel.net/RPM-GPG-KEY-cyberpanel +gpgcheck=1 \ No newline at end of file From acafcf2a76e7239aa3997507e5e64ffe2845e523 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 3 May 2020 11:36:29 +0100 Subject: [PATCH 014/121] Update mailscannerinstaller.sh better os check and minor fix. --- CLScript/mailscannerinstaller.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CLScript/mailscannerinstaller.sh b/CLScript/mailscannerinstaller.sh index 852695d55..7f985fa15 100644 --- a/CLScript/mailscannerinstaller.sh +++ b/CLScript/mailscannerinstaller.sh @@ -12,11 +12,10 @@ exit fi if [ -f /etc/os-release ];then - ./etc/os-release -OS=$NAME +OS=$(head -1 /etc/os-release) fi -if [ "$OS" == "CentOS Linux" ];then +if [ "$OS" = "NAME=\"CentOS Linux\"" ];then setenforce 0 @@ -46,7 +45,7 @@ echo "Please install spamassassin through the CyberPanel interface before procee exit fi -else +elif [ "$OS" = "NAME=\"Ubuntu\"" ];then apt-get install -y libmysqlclient-dev @@ -74,8 +73,8 @@ else echo "Please install spamassassin through the CyberPanel interface before proceeding" exit fi -fi +fi echo "header_checks = regexp:/etc/postfix/header_checks" >> /etc/postfix/main.cf echo "/^Received:/ HOLD" >> /etc/postfix/header_checks @@ -87,11 +86,9 @@ unzip master.zip cd /root/v5-master/builds -if [ "$OS" == "CentOS Linux" ];then -rpm -Uvh *.rhel.noarch.rpm -else -dpkg -i *.noarch.deb +if [ "$OS" = "NAME=\"Ubuntu\"" ];then +dpkg -i *.noarch.deb mkdir /var/run/MailScanner mkdir /var/lock/subsys @@ -99,7 +96,13 @@ mkdir /var/lock/subsys/MailScanner chown -R postfix:postfix /var/run/MailScanner chown -R postfix:postfix /var/lock/subsys/MailScanner chown -R postfix:postfix /var/spool/MailScanner + +elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then + +rpm -Uvh *.rhel.noarch.rpm + fi + mkdir /var/spool/MailScanner/spamassassin chown postfix.mtagroup /var/spool/MailScanner/spamassassin From d297bbb43befd468f657abf08d2bc83422a9e957 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 3 May 2020 22:02:44 +0500 Subject: [PATCH 015/121] bug fix top processes --- serverStatus/views.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/serverStatus/views.py b/serverStatus/views.py index d7e605c40..02f868b07 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -580,6 +580,8 @@ def topProcessesStatus(request): ## Memory + logging.CyberCPLogFileWriter.writeToFile(str(memory)) + if memory[3].find('+') > -1: memoryFinal = memory[3].split('+')[0] else: @@ -587,6 +589,7 @@ def topProcessesStatus(request): data['totalMemory'] = str(int(float(memoryFinal) / 1024)) + 'MB' + ## if memory[5].find('free') > -1: @@ -594,6 +597,7 @@ def topProcessesStatus(request): else: data['freeMemory'] = str(int(float(memory[5]) / 1024)) + 'MB' + ## if memory[7].find('used') > -1: @@ -601,13 +605,21 @@ def topProcessesStatus(request): else: data['usedMemory'] = str(int(float(memory[7]) / 1024)) + 'MB' - if memory[9].find('buff') > -1: - data['buffCache'] = str(int(float(memory[8]) / 1024)) + 'MB' - else: - data['buffCache'] = str(int(float(memory[9]) / 1024)) + 'MB' + + try: + if memory[9].find('buff') > -1: + data['buffCache'] = str(int(float(memory[8]) / 1024)) + 'MB' + else: + data['buffCache'] = str(int(float(memory[9]) / 1024)) + 'MB' + except: + logging.CyberCPLogFileWriter.writeToFile(memory[8]) + data['buffCache'] = str(int(float(memory[8].split('+')[0]) / 1024)) + 'MB' + ## Swap + logging.CyberCPLogFileWriter.writeToFile(str(swap)) + data['swapTotalMemory'] = str(int(float(swap[2]) / 1024)) + 'MB' data['swapFreeMemory'] = str(int(float(swap[4]) / 1024)) + 'MB' From 61dc3654d0881c3adfab745108100f371b9aa7ff Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 3 May 2020 18:03:50 +0100 Subject: [PATCH 016/121] Update mailscannerinstaller.sh update php path --- CLScript/mailscannerinstaller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLScript/mailscannerinstaller.sh b/CLScript/mailscannerinstaller.sh index 7f985fa15..4fa8da4b9 100644 --- a/CLScript/mailscannerinstaller.sh +++ b/CLScript/mailscannerinstaller.sh @@ -167,7 +167,7 @@ ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/SQLBlackWhite ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/SQLSpamSettings.pm /usr/share/MailScanner/perl/custom sed -i "s/^\$pathToFunctions =.*/\$pathToFunctions = '\/usr\/local\/CyberCP\/public\/mailwatch\/mailscanner\/functions.php';/" /usr/local/CyberCP/public/mailwatch/upgrade.php -php /usr/local/CyberCP/public/mailwatch/upgrade.php +/usr/bin/php /usr/local/CyberCP/public/mailwatch/upgrade.php systemctl enable mailscanner systemctl restart mailscanner From 765c5e0dd23577f2a8ce550ebb09ea751ef91dfb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 3 May 2020 22:06:32 +0500 Subject: [PATCH 017/121] add full php path to mail scanner --- {CLScript => CPScripts}/mailscannerinstaller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {CLScript => CPScripts}/mailscannerinstaller.sh (99%) diff --git a/CLScript/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh similarity index 99% rename from CLScript/mailscannerinstaller.sh rename to CPScripts/mailscannerinstaller.sh index 4fa8da4b9..05951f7c6 100644 --- a/CLScript/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -167,7 +167,7 @@ ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/SQLBlackWhite ln -s /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/SQLSpamSettings.pm /usr/share/MailScanner/perl/custom sed -i "s/^\$pathToFunctions =.*/\$pathToFunctions = '\/usr\/local\/CyberCP\/public\/mailwatch\/mailscanner\/functions.php';/" /usr/local/CyberCP/public/mailwatch/upgrade.php -/usr/bin/php /usr/local/CyberCP/public/mailwatch/upgrade.php +/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/mailwatch/upgrade.php systemctl enable mailscanner systemctl restart mailscanner From 332b9ff5fcf1f0d90438e6e66b5ea9fdc8c894cd Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 3 May 2020 23:18:09 +0500 Subject: [PATCH 018/121] change how packages are fetched on ubuntu; --- .../static/serverStatus/serverStatus.js | 6 +- .../serverStatus/packageManager.html | 80 +++++++++++++++++-- serverStatus/views.py | 47 +++++++---- static/serverStatus/serverStatus.js | 6 +- 4 files changed, 114 insertions(+), 25 deletions(-) diff --git a/serverStatus/static/serverStatus/serverStatus.js b/serverStatus/static/serverStatus/serverStatus.js index 5dca427db..f8b6c11fb 100755 --- a/serverStatus/static/serverStatus/serverStatus.js +++ b/serverStatus/static/serverStatus/serverStatus.js @@ -789,7 +789,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { $scope.currentPage = 1; $scope.recordsToShow = 10; - $scope.fetchPackages = function () { + $scope.fetchPackages = function (type = 'installed') { $scope.cyberpanelLoading = false; var config = { @@ -800,7 +800,8 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { var data = { page: $scope.currentPage, - recordsToShow: $scope.recordsToShow + recordsToShow: $scope.recordsToShow, + type: type }; dataurl = "/serverstatus/fetchPackages"; @@ -833,6 +834,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { }; + $scope.fetchPackages('upgrade'); $scope.killProcess = function (pid) { diff --git a/serverStatus/templates/serverStatus/packageManager.html b/serverStatus/templates/serverStatus/packageManager.html index c9d7afe9d..02dbb64eb 100755 --- a/serverStatus/templates/serverStatus/packageManager.html +++ b/serverStatus/templates/serverStatus/packageManager.html @@ -22,7 +22,7 @@
    @@ -368,7 +368,214 @@
    -

    Howdy, I'm in Section 7.

    + Total Packages: {$ totalPackages $} + Fetched Packages: {$ fetchedPackages $} + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    {% trans "Package" %}{% trans "Version" %}{% trans "Lock" %}{% trans "Actions" %}
    + + + + Details + + Update + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    diff --git a/serverStatus/views.py b/serverStatus/views.py index 14ea17504..fa3598713 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -735,18 +735,24 @@ def fetchPackages(request): command = 'apt-mark showhold' locked = ProcessUtilities.outputExecutioner(command).split('\n') - command = 'apt list --installed' - packages = ProcessUtilities.outputExecutioner(command).split('\n') - packages = packages[4:] + if type == 'CyberPanel': - upgradePackages = [] + command = 'cat /usr/local/CyberCP/AllCPUbuntu.json' + packages = json.loads(ProcessUtilities.outputExecutioner(command)) - if type == 'upgrade': - for pack in packages: - if pack.find('upgradable') > -1: - upgradePackages.append(pack) + else: + command = 'apt list --installed' + packages = ProcessUtilities.outputExecutioner(command).split('\n') + packages = packages[4:] - packages = upgradePackages + upgradePackages = [] + + if type == 'upgrade': + for pack in packages: + if pack.find('upgradable') > -1: + upgradePackages.append(pack) + + packages = upgradePackages #if os.path.exists(ProcessUtilities.debugPath): @@ -768,27 +774,47 @@ def fetchPackages(request): import re for items in finalPackages: try: - nowSplitted = items.split('now') + if type == 'CyberPanel': - upgrade = 'Not Needed' + packageName = items['Package'].split('/')[0] - if nowSplitted[1].split(' ')[3].find('upgradable') > -1: - current = nowSplitted[1].split(' ') - upgrade = '%s %s %s' % (current[3], current[4], current[5]) + if packageName in locked: + lock = 1 + else: + lock = 0 + + dic = {'package': packageName, + 'version': items['Version'], 'lock': lock} + + counter = counter + 1 + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) - if nowSplitted[0].split('/')[0] in locked: - lock = 1 else: - lock = 0 + nowSplitted = items.split('now') - dic = {'package': nowSplitted[0].split('/')[0], 'version': '%s %s' % (nowSplitted[1].split(' ')[1], nowSplitted[1].split(' ')[2]), 'upgrade': upgrade, 'lock': lock} + upgrade = 'Not Needed' - counter = counter + 1 - if checker == 0: - json_data = json_data + json.dumps(dic) - checker = 1 - else: - json_data = json_data + ',' + json.dumps(dic) + if nowSplitted[1].split(' ')[3].find('upgradable') > -1: + current = nowSplitted[1].split(' ') + upgrade = '%s %s %s' % (current[3], current[4], current[5]) + + if nowSplitted[0].split('/')[0] in locked: + lock = 1 + else: + lock = 0 + + dic = {'package': nowSplitted[0].split('/')[0], 'version': '%s %s' % (nowSplitted[1].split(' ')[1], nowSplitted[1].split(' ')[2]), 'upgrade': upgrade, 'lock': lock} + + counter = counter + 1 + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile('[ERROR] %s. [fetchPackages:773]' % (str(msg))) diff --git a/static/firewall/firewall.js b/static/firewall/firewall.js index a0acd1f53..eaa372adb 100644 --- a/static/firewall/firewall.js +++ b/static/firewall/firewall.js @@ -2171,8 +2171,6 @@ app.controller('installImunify', function ($scope, $http, $timeout, $window) { text: 'Could not connect to server, please refresh this page', type: 'error' }); - - } } diff --git a/static/serverStatus/serverStatus.js b/static/serverStatus/serverStatus.js index f8b6c11fb..8a89159d6 100644 --- a/static/serverStatus/serverStatus.js +++ b/static/serverStatus/serverStatus.js @@ -788,10 +788,11 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { $scope.currentPage = 1; $scope.recordsToShow = 10; + var globalType; $scope.fetchPackages = function (type = 'installed') { $scope.cyberpanelLoading = false; - + globalType = type; var config = { headers: { 'X-CSRFToken': getCookie('csrftoken') @@ -836,16 +837,98 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { }; $scope.fetchPackages('upgrade'); - $scope.killProcess = function (pid) { + $scope.fetchPackageDetails = function (packageFetch) { + $scope.cyberpanelLoading = false; + $scope.package = packageFetch; - $scope.cyberPanelLoading = false; - - url = "/serverstatus/killProcess"; + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; var data = { - pid: pid + package: packageFetch }; + dataurl = "/serverstatus/fetchPackageDetails"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + $scope.packageDetails = response.data.packageDetails; + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + $scope.updatePackage = function (packageToUpgrade = 'all') { + $scope.cyberpanelLoading = false; + $scope.package = packageToUpgrade; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + package: packageToUpgrade + }; + + dataurl = "/serverstatus/updatePackage"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + getRequestStatus(); + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + function getRequestStatus() { + + $scope.cyberpanelLoading = false; + + url = "/serverstatus/switchTOLSWSStatus"; + + var data = {}; + var config = { headers: { 'X-CSRFToken': getCookie('csrftoken') @@ -857,25 +940,19 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { function ListInitialDatas(response) { - $scope.cyberPanelLoading = true; - if (response.data.status === 1) { - new PNotify({ - title: 'Success', - text: 'Process successfully killed.', - type: 'success' - }); + if (response.data.abort === 0) { + $scope.requestData = response.data.requestStatus; + $timeout(getRequestStatus, 1000); } else { - new PNotify({ - title: 'Operation Failed!', - text: response.data.error_message, - type: 'error' - }); + // Notifications + $timeout.cancel(); + $scope.cyberpanelLoading = true; + $scope.requestData = response.data.requestStatus; } - } function cantLoadInitialDatas(response) { - $scope.cyberPanelLoading = true; + $scope.cyberpanelLoading = true; new PNotify({ title: 'Operation Failed!', text: 'Could not connect to server, please refresh this page', @@ -883,6 +960,53 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) { }); } + } + + $scope.lockStatus = function (lockPackage, type) { + $scope.cyberpanelLoading = false; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + package: lockPackage, + type: type, + }; + + dataurl = "/serverstatus/lockStatus"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + new PNotify({ + title: 'Success!', + text: 'Status updated.', + type: 'success' + }); + $scope.fetchPackages(globalType); + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + }; }); \ No newline at end of file From 1cfb65bdd99de4516da9c6f5e282a08216d07930 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 5 May 2020 22:40:09 +0500 Subject: [PATCH 024/121] fix fetch cp packages --- serverStatus/templates/serverStatus/packageManager.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverStatus/templates/serverStatus/packageManager.html b/serverStatus/templates/serverStatus/packageManager.html index adb189cbd..8f20c01b9 100755 --- a/serverStatus/templates/serverStatus/packageManager.html +++ b/serverStatus/templates/serverStatus/packageManager.html @@ -427,7 +427,7 @@
    - + ng-change="fetchPackages('CyberPanel')"> From e5d784b75fd33fc28c2afda4ac88d8a735be700d Mon Sep 17 00:00:00 2001 From: Guilherme Lima <30418786+guilhermelim@users.noreply.github.com> Date: Tue, 5 May 2020 15:21:22 -0300 Subject: [PATCH 025/121] Translation into Portuguese of Portugal and Brazil Translates placeholder message from the form Install WordPress. Item change: Path Text Box. --- locale/pt-BR/LC_MESSAGES/django.po | 6 +++++- locale/pt/LC_MESSAGES/django.po | 6 +++++- .../templates/websiteFunctions/installWordPress.html | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/locale/pt-BR/LC_MESSAGES/django.po b/locale/pt-BR/LC_MESSAGES/django.po index 12e174b3d..3cb6f2ebc 100644 --- a/locale/pt-BR/LC_MESSAGES/django.po +++ b/locale/pt-BR/LC_MESSAGES/django.po @@ -6189,7 +6189,11 @@ msgstr "Instale o WordPress com LSCache." #: websiteFunctions/templates/websiteFunctions/installWordPress.html:28 msgid "Blog Title" -msgstr "" +msgstr "Título do Blog" + +#: websiteFunctions/templates/websiteFunctions/installWordPress.html:58 +msgid "Leave empty to install in website home directory. (Without preceding slash)" +msgstr "Deixe em branco para instalar no diretório inicial do site. (Sem barra anterior)" #: websiteFunctions/templates/websiteFunctions/launchChild.html:29 msgid "Copy/Sync to Master" diff --git a/locale/pt/LC_MESSAGES/django.po b/locale/pt/LC_MESSAGES/django.po index fdf3601b3..153f62d0f 100755 --- a/locale/pt/LC_MESSAGES/django.po +++ b/locale/pt/LC_MESSAGES/django.po @@ -6724,7 +6724,11 @@ msgstr "Instale o WordPress com LSCache." #: websiteFunctions/templates/websiteFunctions/installWordPress.html:28 msgid "Blog Title" -msgstr "" +msgstr "Título do Blog" + +#: websiteFunctions/templates/websiteFunctions/installWordPress.html:58 +msgid "Leave empty to install in website home directory. (Without preceding slash)" +msgstr "Deixe em branco para instalar no diretório inicial do site. (Sem barra anterior)" #: websiteFunctions/templates/websiteFunctions/launchChild.html:32 msgid "Copy/Sync to Master" diff --git a/websiteFunctions/templates/websiteFunctions/installWordPress.html b/websiteFunctions/templates/websiteFunctions/installWordPress.html index 2800f2628..da2efa079 100755 --- a/websiteFunctions/templates/websiteFunctions/installWordPress.html +++ b/websiteFunctions/templates/websiteFunctions/installWordPress.html @@ -55,7 +55,7 @@
    - +
    From 8c7bc46678e41017cfda34aa5136110210de7b83 Mon Sep 17 00:00:00 2001 From: Guilherme Lima <30418786+guilhermelim@users.noreply.github.com> Date: Tue, 5 May 2020 15:26:57 -0300 Subject: [PATCH 026/121] Revert "Translation into Portuguese of Portugal and Brazil" This reverts commit e5d784b75fd33fc28c2afda4ac88d8a735be700d. --- locale/pt-BR/LC_MESSAGES/django.po | 6 +----- locale/pt/LC_MESSAGES/django.po | 6 +----- .../templates/websiteFunctions/installWordPress.html | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/locale/pt-BR/LC_MESSAGES/django.po b/locale/pt-BR/LC_MESSAGES/django.po index 3cb6f2ebc..12e174b3d 100644 --- a/locale/pt-BR/LC_MESSAGES/django.po +++ b/locale/pt-BR/LC_MESSAGES/django.po @@ -6189,11 +6189,7 @@ msgstr "Instale o WordPress com LSCache." #: websiteFunctions/templates/websiteFunctions/installWordPress.html:28 msgid "Blog Title" -msgstr "Título do Blog" - -#: websiteFunctions/templates/websiteFunctions/installWordPress.html:58 -msgid "Leave empty to install in website home directory. (Without preceding slash)" -msgstr "Deixe em branco para instalar no diretório inicial do site. (Sem barra anterior)" +msgstr "" #: websiteFunctions/templates/websiteFunctions/launchChild.html:29 msgid "Copy/Sync to Master" diff --git a/locale/pt/LC_MESSAGES/django.po b/locale/pt/LC_MESSAGES/django.po index 153f62d0f..fdf3601b3 100755 --- a/locale/pt/LC_MESSAGES/django.po +++ b/locale/pt/LC_MESSAGES/django.po @@ -6724,11 +6724,7 @@ msgstr "Instale o WordPress com LSCache." #: websiteFunctions/templates/websiteFunctions/installWordPress.html:28 msgid "Blog Title" -msgstr "Título do Blog" - -#: websiteFunctions/templates/websiteFunctions/installWordPress.html:58 -msgid "Leave empty to install in website home directory. (Without preceding slash)" -msgstr "Deixe em branco para instalar no diretório inicial do site. (Sem barra anterior)" +msgstr "" #: websiteFunctions/templates/websiteFunctions/launchChild.html:32 msgid "Copy/Sync to Master" diff --git a/websiteFunctions/templates/websiteFunctions/installWordPress.html b/websiteFunctions/templates/websiteFunctions/installWordPress.html index da2efa079..2800f2628 100755 --- a/websiteFunctions/templates/websiteFunctions/installWordPress.html +++ b/websiteFunctions/templates/websiteFunctions/installWordPress.html @@ -55,7 +55,7 @@
    - +
    From cf217c10615f719e2b3784fbda32718b0c866814 Mon Sep 17 00:00:00 2001 From: Guilherme Lima <30418786+guilhermelim@users.noreply.github.com> Date: Tue, 5 May 2020 16:22:23 -0300 Subject: [PATCH 027/121] Translation into Portuguese of Portugal and Brazil Translates placeholder message from the form Install WordPress. Item change: Path Text Box. --- locale/pt-BR/LC_MESSAGES/django.po | 6 +++++- locale/pt/LC_MESSAGES/django.po | 6 +++++- .../templates/websiteFunctions/installWordPress.html | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/locale/pt-BR/LC_MESSAGES/django.po b/locale/pt-BR/LC_MESSAGES/django.po index 12e174b3d..3cb6f2ebc 100644 --- a/locale/pt-BR/LC_MESSAGES/django.po +++ b/locale/pt-BR/LC_MESSAGES/django.po @@ -6189,7 +6189,11 @@ msgstr "Instale o WordPress com LSCache." #: websiteFunctions/templates/websiteFunctions/installWordPress.html:28 msgid "Blog Title" -msgstr "" +msgstr "Título do Blog" + +#: websiteFunctions/templates/websiteFunctions/installWordPress.html:58 +msgid "Leave empty to install in website home directory. (Without preceding slash)" +msgstr "Deixe em branco para instalar no diretório inicial do site. (Sem barra anterior)" #: websiteFunctions/templates/websiteFunctions/launchChild.html:29 msgid "Copy/Sync to Master" diff --git a/locale/pt/LC_MESSAGES/django.po b/locale/pt/LC_MESSAGES/django.po index fdf3601b3..153f62d0f 100755 --- a/locale/pt/LC_MESSAGES/django.po +++ b/locale/pt/LC_MESSAGES/django.po @@ -6724,7 +6724,11 @@ msgstr "Instale o WordPress com LSCache." #: websiteFunctions/templates/websiteFunctions/installWordPress.html:28 msgid "Blog Title" -msgstr "" +msgstr "Título do Blog" + +#: websiteFunctions/templates/websiteFunctions/installWordPress.html:58 +msgid "Leave empty to install in website home directory. (Without preceding slash)" +msgstr "Deixe em branco para instalar no diretório inicial do site. (Sem barra anterior)" #: websiteFunctions/templates/websiteFunctions/launchChild.html:32 msgid "Copy/Sync to Master" diff --git a/websiteFunctions/templates/websiteFunctions/installWordPress.html b/websiteFunctions/templates/websiteFunctions/installWordPress.html index 2800f2628..da2efa079 100755 --- a/websiteFunctions/templates/websiteFunctions/installWordPress.html +++ b/websiteFunctions/templates/websiteFunctions/installWordPress.html @@ -55,7 +55,7 @@
    - +
    From 841a42c5ef113e4842401fa3fc094d58ec015a39 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 00:25:46 +0500 Subject: [PATCH 028/121] package manager support for cent7 --- plogical/applicationInstaller.py | 23 +++-- serverStatus/views.py | 151 ++++++++++++++++++++++++------- 2 files changed, 133 insertions(+), 41 deletions(-) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 5063926d3..d46a49396 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -67,16 +67,23 @@ class ApplicationInstaller(multi.Thread): f = open(ServerStatusUtil.lswsInstallStatusPath, 'a') - if package == 'all': - command = 'apt-get update -y' - f.write(ProcessUtilities.outputExecutioner(command)) + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: - f.flush() + if package == 'all': + command = 'apt-get update -y' + f.write(ProcessUtilities.outputExecutioner(command)) - command = 'apt-get upgrade -y' - f.write(ProcessUtilities.outputExecutioner(command)) - else: - command = 'apt-get install --only-upgrade %s -y' % (package) + f.flush() + + command = 'apt-get upgrade -y' + f.write(ProcessUtilities.outputExecutioner(command)) + else: + command = 'apt-get install --only-upgrade %s -y' % (package) + f.write(ProcessUtilities.outputExecutioner(command)) + + f.close() + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + command = 'yum update %s -y' % (package) f.write(ProcessUtilities.outputExecutioner(command)) f.close() diff --git a/serverStatus/views.py b/serverStatus/views.py index fa3598713..9e7737919 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -753,6 +753,59 @@ def fetchPackages(request): upgradePackages.append(pack) packages = upgradePackages + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + + if type == 'installed': + + #### Cater for packages that need updates. + + startForUpdate = 1 + + command = 'yum check-update' + updates = ProcessUtilities.outputExecutioner(command).split('\n') + + for items in updates: + if items == '': + updates = updates[startForUpdate:] + break + else: + startForUpdate = startForUpdate + 1 + + ## make list of packages that need update + + updateNeeded = [] + for items in updates: + updateNeeded.append(items.split(' ')[0]) + + ### + + command = 'yum list installed' + packages = ProcessUtilities.outputExecutioner(command).split('\n') + + startFrom = 1 + + for items in packages: + if items.find('Installed Packages') > -1: + packages = packages[startFrom:] + break + else: + startFrom = startFrom + 1 + elif type == 'upgrade': + #### Cater for packages that need updates. + + startForUpdate = 1 + + command = 'yum check-update' + packages = ProcessUtilities.outputExecutioner(command).split('\n') + + for items in packages: + if items == '': + packages = packages[startForUpdate:-1] + break + else: + startForUpdate = startForUpdate + 1 + + ## make list of packages that need update #if os.path.exists(ProcessUtilities.debugPath): @@ -773,51 +826,80 @@ def fetchPackages(request): import re for items in finalPackages: - try: - if type == 'CyberPanel': + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + try: + if type == 'CyberPanel': - packageName = items['Package'].split('/')[0] + packageName = items['Package'].split('/')[0] + + if packageName in locked: + lock = 1 + else: + lock = 0 + + dic = {'package': packageName, + 'version': items['Version'], 'lock': lock} + + counter = counter + 1 + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) - if packageName in locked: - lock = 1 else: - lock = 0 + nowSplitted = items.split('now') - dic = {'package': packageName, - 'version': items['Version'], 'lock': lock} + upgrade = 'Not Needed' - counter = counter + 1 - if checker == 0: - json_data = json_data + json.dumps(dic) - checker = 1 - else: - json_data = json_data + ',' + json.dumps(dic) + if nowSplitted[1].split(' ')[3].find('upgradable') > -1: + current = nowSplitted[1].split(' ') + upgrade = '%s %s %s' % (current[3], current[4], current[5]) - else: - nowSplitted = items.split('now') + if nowSplitted[0].split('/')[0] in locked: + lock = 1 + else: + lock = 0 - upgrade = 'Not Needed' + dic = {'package': nowSplitted[0].split('/')[0], 'version': '%s %s' % (nowSplitted[1].split(' ')[1], nowSplitted[1].split(' ')[2]), 'upgrade': upgrade, 'lock': lock} - if nowSplitted[1].split(' ')[3].find('upgradable') > -1: - current = nowSplitted[1].split(' ') - upgrade = '%s %s %s' % (current[3], current[4], current[5]) + counter = counter + 1 + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) + except BaseException as msg: + logging.CyberCPLogFileWriter.writeToFile('[ERROR] %s. [fetchPackages:773]' % (str(msg))) + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + try: + if type == 'installed' or type == 'upgrade': - if nowSplitted[0].split('/')[0] in locked: - lock = 1 - else: - lock = 0 + details = items.split(' ') + details = [a for a in details if a != ''] - dic = {'package': nowSplitted[0].split('/')[0], 'version': '%s %s' % (nowSplitted[1].split(' ')[1], nowSplitted[1].split(' ')[2]), 'upgrade': upgrade, 'lock': lock} + if type == 'installed': + if details[0] in updateNeeded: + upgrade = 'Upgrade available' + else: + upgrade = 'Not needed.' + else: + upgrade = 'Upgrade available' - counter = counter + 1 - if checker == 0: - json_data = json_data + json.dumps(dic) - checker = 1 - else: - json_data = json_data + ',' + json.dumps(dic) + dic = {'package': details[0], + 'version': details[1], + 'upgrade': upgrade, 'lock': 1} - except BaseException as msg: - logging.CyberCPLogFileWriter.writeToFile('[ERROR] %s. [fetchPackages:773]' % (str(msg))) + counter = counter + 1 + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) + + + except BaseException as msg: + logging.CyberCPLogFileWriter.writeToFile('[ERROR] %s. [fetchPackages:839]' % (str(msg))) json_data = json_data + ']' @@ -847,6 +929,9 @@ def fetchPackageDetails(request): if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: command = 'apt-cache show %s' % (package) packageDetails = ProcessUtilities.outputExecutioner(command) + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + command = 'yum info %s' % (package) + packageDetails = ProcessUtilities.outputExecutioner(command) data_ret = {'status': 1, 'packageDetails': packageDetails} json_data = json.dumps(data_ret) From 81e4668dc9f7624b2a2bec13edd6812b29974213 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 00:28:24 +0500 Subject: [PATCH 029/121] Translation into Portuguese of Portugal and Brazil --- locale/pt-BR/LC_MESSAGES/django.mo | Bin 57143 -> 57392 bytes locale/pt/LC_MESSAGES/django.mo | Bin 57143 -> 57392 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/locale/pt-BR/LC_MESSAGES/django.mo b/locale/pt-BR/LC_MESSAGES/django.mo index 8700c156186bb16cc72764a67308068a9cc718a1..ec8862658761318894ceaf9244b0bb96d6a67169 100644 GIT binary patch delta 16136 zcmZYG2YilK!^iQ9AY>R3D?x6tN34iF5+fC>MywPO1Tlh$5!7w(-J+;cd(S9JQJbn! zHEI{dLtCY)RUPl|f1l&|c;EN>e2(wg`??bPJi8BgZ9C-Uz7>#ZzQc1bqvI6BD)}7e zwwL2HE3aI~Ia$YX{P7g#!7G>-f5QBjsjlM`z(Uq)7(}`i24X+Vjbkwv&PN|yYjit1 zi1?E61**eS=)$|09lh!~P7Vw}O)wNSfqGa8+hHM`f&sV&y>TzH4(Cgof6RIn)!!5J zcHEBhnusRg6=^!kf$AU(vta~!21GW;X@^>IGHSpnm=l*^QQU-D@pmQhve7`8i zDT{f~oAI3}BHG#*)KbE6xkyGB1~)VnV^BNM5=&qg48@696xU%ep26n$2vx6YBgZL? zol)t@sGZn?#qk=dA1B(Ri$=5mst{u{hF~$$OHdULVF|p4CDDi3Y66w9Gqyw3Pseij zolR$HY|>@XMScfVy);z6pP(l6rJG18A`ej&a>kf}B2X*rj4DsVEVu%-b?Z?b9Yme! zUF&ny+mNw|d7E6QBddYl*aWq+t>h(@Bc?cbQZ@@Tl@sG<8##OmEm1; zBn46FhNzXqV-6gMn%EedUW$ICH=}O<=U4>Kp?2mOYDc_UvIBbmLy71^5{4ldiT>CX zeK8r;a0II14AcZSqGtefkv@mIGrwRC^lN1%R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&yvr&roYu0zlWTg7M8_NKg?y*CjnP^K$C=^OHsNwcWC0P~a1*azJujv^kI zS=;;=M%j0n_wDm{*~+E4QHvC3^QwN5_$$&1Tjpt9!M$nJ?M%wL+=%}m)wgxp5l@|dYM{WEran{v^_)}7S3Qmv? z(l+z5b-ZkTvGoS!t_C(!z*>$LFSyYQn^IN-r`QgB$+ssTME)MB3waOnfut9tIphye zK9=;5ygT^}(me8YFqN{bs~}~s_5DAURf2O!TS@PbB4{v^r0XG-eg=Yh8TKIm z194;9t{d^!#L1Mm#;W9V*?a0DuYPd-N%>h5I^SfS|L<+Zf4EVI3dL|79>8es&BJd= zy3Uec$-Ok<=EQ!apNNZ6rt2s!!jG^vX$x@}b@Gv(ljpBJrw#E3#4dM!8GB&TW9>nKK&55J9H-h*X@lukiHPR2RO5DpJT_!G1nyl}C zC_yY~HaB!#rSf0clzexLME#Xi9RId;!c>v#Gn;RO`V&0s%1{0Aq*0WwAWh)L`#2O2 zp{~BT!_BV$Zxno;S!{mv<7PTxC>ErnCZvv}IpjaWnzrsOJWQFc)&}Po`P;;$Y(9|s zx+3uysUNAZZKJ(B5b_!$l%&9iNMtMTCZq>*#yBEH^(ko+ z@p94vVqGVR+mLkCr0jFtMm`^DPi86q`<8fU zT-OKMgK&b16y(DGH2jiyjmn6t+m4bc`~hgg#GLRiX{ZzQjO)NUZZ zm3R@UFY(8ed6KfOAj-1aHi_uEO2t*Am(_sY)aiU6Y&y1gHT#VS!J-%c{)sJo!&*;DNX!QR9Ju*Vm diff --git a/locale/pt/LC_MESSAGES/django.mo b/locale/pt/LC_MESSAGES/django.mo index 8700c156186bb16cc72764a67308068a9cc718a1..ec8862658761318894ceaf9244b0bb96d6a67169 100755 GIT binary patch delta 16136 zcmZYG2YilK!^iQ9AY>R3D?x6tN34iF5+fC>MywPO1Tlh$5!7w(-J+;cd(S9JQJbn! zHEI{dLtCY)RUPl|f1l&|c;EN>e2(wg`??bPJi8BgZ9C-Uz7>#ZzQc1bqvI6BD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AWh)L`#2O2 zp{~BT!_BV$Zxno;S!{mv<7PTxC>ErnCZvv}IpjaWnzrsOJWQFc)&}Po`P;;$Y(9|s zx+3uysUNAZZKJ(B5b_!$l%&9iNMtMTCZq>*#yBEH^(ko+ z@p94vVqGVR+mLkCr0jFtMm`^DPi86q`<8fU zT-OKMgK&b16y(DGH2jiyjmn6t+m4bc`~hgg#GLRiX{ZzQjO)NUZZ zm3R@UFY(8ed6KfOAj-1aHi_uEO2t*Am(_sY)aiU6Y&y1gHT#VS!J-%c{)sJo!&*;DNX!QR9Ju*Vm From 87aeb1c8570b67e5983e170bfdb588e80ccb2c81 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 14:16:40 +0500 Subject: [PATCH 030/121] package lock on centos --- .../serverStatus/packageManager.html | 12 +-- serverStatus/views.py | 73 ++++++++++++++++++- 2 files changed, 78 insertions(+), 7 deletions(-) diff --git a/serverStatus/templates/serverStatus/packageManager.html b/serverStatus/templates/serverStatus/packageManager.html index 8f20c01b9..334f9e915 100755 --- a/serverStatus/templates/serverStatus/packageManager.html +++ b/serverStatus/templates/serverStatus/packageManager.html @@ -124,8 +124,8 @@ - - + + - - + + - - + + -1: + + data = open(yumConf, 'r').readlines() + + for items in data: + if items.find('exclude') > -1: + locked = items.split('=')[1].rstrip('\n').split(' ') + break + if type == 'installed': #### Cater for packages that need updates. @@ -875,6 +894,8 @@ def fetchPackages(request): try: if type == 'installed' or type == 'upgrade': + ### + details = items.split(' ') details = [a for a in details if a != ''] @@ -886,9 +907,15 @@ def fetchPackages(request): else: upgrade = 'Upgrade available' + + if details[0].split('.')[0] in locked: + lock = 1 + else: + lock = 0 + dic = {'package': details[0], 'version': details[1], - 'upgrade': upgrade, 'lock': 1} + 'upgrade': upgrade, 'lock': lock} counter = counter + 1 if checker == 0: @@ -899,6 +926,7 @@ def fetchPackages(request): except BaseException as msg: + print(str(msg)) logging.CyberCPLogFileWriter.writeToFile('[ERROR] %s. [fetchPackages:839]' % (str(msg))) json_data = json_data + ']' @@ -1005,6 +1033,49 @@ def lockStatus(request): command = 'apt-mark hold %s' % (package) ProcessUtilities.executioner(command) + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + + package = package.split('.')[0] + + if os.path.exists('/etc/yum.conf'): + yumConf = '/etc/yum.conf' + elif os.path.exists('/etc/yum/yum.conf'): + yumConf = '/etc/yum/yum.conf' + + yumConfData = open(yumConf, 'r').read() + data = open(yumConf, 'r').readlines() + + + if type == 0: + writeToFile = open(yumConf, 'w') + + for items in data: + if items.find('exclude') > -1: + writeToFile.writelines(items.replace(package, '')) + else: + writeToFile.writelines(items) + + writeToFile.close() + else: + + if yumConfData.find('exclude') == -1: + + writeToFile = open(yumConf, 'a') + writeToFile.writelines('exclude=%s\n' % (package)) + writeToFile.close() + + else: + writeToFile = open(yumConf, 'w') + + for items in data: + if items.find('exclude') > -1: + excludeLine = items.strip('\n') + writeToFile.writelines('%s %s\n' % (excludeLine, package)) + else: + writeToFile.writelines(items) + + writeToFile.close() + data_ret = {'status': 1} json_data = json.dumps(data_ret) return HttpResponse(json_data) From f01678f86484c56e515e1eb0f63fb3b500ef50f1 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 15:18:38 +0500 Subject: [PATCH 031/121] CP Packages on Cent7 --- serverStatus/views.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/serverStatus/views.py b/serverStatus/views.py index e5d6fb1ca..7d584c008 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -753,6 +753,8 @@ def fetchPackages(request): upgradePackages.append(pack) packages = upgradePackages + + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: ### Check Package Lock status @@ -823,6 +825,9 @@ def fetchPackages(request): break else: startForUpdate = startForUpdate + 1 + elif type == 'CyberPanel': + command = 'cat /usr/local/CyberCP/CPCent7repo.json' + packages = json.loads(ProcessUtilities.outputExecutioner(command)) ## make list of packages that need update @@ -923,6 +928,24 @@ def fetchPackages(request): checker = 1 else: json_data = json_data + ',' + json.dumps(dic) + elif type == 'CyberPanel': + + packageName = items['Package'] + + if packageName.split('.')[0] in locked: + lock = 1 + else: + lock = 0 + + dic = {'package': packageName, + 'version': items['Version'], 'lock': lock} + + counter = counter + 1 + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) except BaseException as msg: From 52301bbc796aae78a0a70d0b45ac7cd44ba2716c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 15:30:26 +0500 Subject: [PATCH 032/121] update all for cent7 --- plogical/applicationInstaller.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index d46a49396..811906953 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -83,8 +83,12 @@ class ApplicationInstaller(multi.Thread): f.close() elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: - command = 'yum update %s -y' % (package) - f.write(ProcessUtilities.outputExecutioner(command)) + if package == 'all': + command = 'yum update -y' + f.write(ProcessUtilities.outputExecutioner(command)) + else: + command = 'yum update %s -y' % (package) + f.write(ProcessUtilities.outputExecutioner(command)) f.close() From acaf8e80d250b969e189dc342a286950c1b78f88 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 6 May 2020 15:51:11 +0500 Subject: [PATCH 033/121] bug fix: inc backups --- plogical/processUtilities.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 1bfe9b31b..9ff4437e4 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -190,10 +190,15 @@ class ProcessUtilities(multi.Thread): sock = ret[0] if user == None: - if command.find('sudo') == -1: + + if command.find('export') > -1: + pass + elif command.find('sudo') == -1: command = 'sudo %s' % (command) + if os.path.exists(ProcessUtilities.debugPath): logging.writeToFile(ProcessUtilities.token + command) + sock.sendall((ProcessUtilities.token + command).encode('utf-8')) else: command = '%s-u %s %s' % (ProcessUtilities.token, user, command) From 5f589d0569116f8937c88f047b3cc2c27f1cacad Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 7 May 2020 13:36:32 +0500 Subject: [PATCH 034/121] feature: https://github.com/usmannasir/cyberpanel/issues/328 --- manageSSL/views.py | 12 ++++++++---- plogical/acl.py | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/manageSSL/views.py b/manageSSL/views.py index 05ec7e988..0dfdb16c5 100755 --- a/manageSSL/views.py +++ b/manageSSL/views.py @@ -126,7 +126,7 @@ def sslForHostName(request): else: return ACLManager.loadError() - websitesName = ACLManager.findAllSites(currentACL, userID) + websitesName = ACLManager.findAllSites(currentACL, userID, 1) return render(request, 'manageSSL/sslForHostName.html', {'websiteList': websitesName}) except KeyError: @@ -151,11 +151,15 @@ def obtainHostNameSSL(request): data = json.loads(request.body) virtualHost = data['virtualHost'] - path = "/home/" + virtualHost + "/public_html" + try: + website = Websites.objects.get(domain=virtualHost) + path = "/home/" + virtualHost + "/public_html" + except: + website = ChildDomains.objects.get(domain=virtualHost) + path = website.path - data = json.loads(request.body) - virtualHost = data['virtualHost'] admin = Administrator.objects.get(pk=userID) + if ACLManager.checkOwnership(virtualHost, admin, currentACL) == 1: pass else: diff --git a/plogical/acl.py b/plogical/acl.py index a79139059..e3ae1f63f 100755 --- a/plogical/acl.py +++ b/plogical/acl.py @@ -405,13 +405,19 @@ class ACLManager: return admin.package_set.all() @staticmethod - def findAllSites(currentACL, userID): + def findAllSites(currentACL, userID, fetchChilds = 0): websiteNames = [] if currentACL['admin'] == 1: allWebsites = Websites.objects.all() + for items in allWebsites: websiteNames.append(items.domain) + + if fetchChilds: + for child in items.childdomains_set.all(): + websiteNames.append(child.domain) + else: admin = Administrator.objects.get(pk=userID) @@ -421,11 +427,19 @@ class ACLManager: for items in websites: websiteNames.append(items.domain) + if fetchChilds: + for child in items.childdomains_set.all(): + websiteNames.append(child.domain) + for items in admins: webs = items.websites_set.all() for web in webs: websiteNames.append(web.domain) + if fetchChilds: + for child in web.childdomains_set.all(): + websiteNames.append(child.domain) + return websiteNames From 97ae6eca2887655dbe44d2c9864d341a449e59a9 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 7 May 2020 17:15:31 +0500 Subject: [PATCH 035/121] fix : https://github.com/usmannasir/cyberpanel/issues/329 --- backup/backupManager.py | 41 +++++++++++++++------------------- backup/static/backup/backup.js | 1 + static/backup/backup.js | 1 + 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/backup/backupManager.py b/backup/backupManager.py index f7181f4ca..6e298d26b 100755 --- a/backup/backupManager.py +++ b/backup/backupManager.py @@ -1115,32 +1115,27 @@ class BackupManager: time.sleep(3) - if os.path.isfile(backupLogPath): - command = "sudo cat " + backupLogPath - status = ProcessUtilities.outputExecutioner(command) + command = "sudo cat " + backupLogPath + status = ProcessUtilities.outputExecutioner(command) - if status.find("completed[success]") > -1: - command = "rm -rf " + removalPath - ProcessUtilities.executioner(command) - data_ret = {'remoteTransferStatus': 1, 'error_message': "None", "status": status, "complete": 1} - json_data = json.dumps(data_ret) - return HttpResponse(json_data) - elif status.find("[5010]") > -1: - command = "sudo rm -rf " + removalPath - ProcessUtilities.executioner(command) - data = {'remoteTransferStatus': 0, 'error_message': status, - "status": "None", "complete": 0} - json_data = json.dumps(data) - return HttpResponse(json_data) - else: - data_ret = {'remoteTransferStatus': 1, 'error_message': "None", "status": status, "complete": 0} - json_data = json.dumps(data_ret) - return HttpResponse(json_data) - else: - data_ret = {'remoteTransferStatus': 0, 'error_message': "No such log found", "status": "None", - "complete": 0} + if status.find("completed[success]") > -1: + command = "rm -rf " + removalPath + ProcessUtilities.executioner(command) + data_ret = {'remoteTransferStatus': 1, 'error_message': "None", "status": status, "complete": 1} json_data = json.dumps(data_ret) return HttpResponse(json_data) + elif status.find("[5010]") > -1: + command = "sudo rm -rf " + removalPath + ProcessUtilities.executioner(command) + data = {'remoteTransferStatus': 0, 'error_message': status, + "status": "None", "complete": 0} + json_data = json.dumps(data) + return HttpResponse(json_data) + else: + data_ret = {'remoteTransferStatus': 1, 'error_message': "None", "status": status, "complete": 0} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + except BaseException as msg: data = {'remoteTransferStatus': 0, 'error_message': str(msg), "status": "None", "complete": 0} json_data = json.dumps(data) diff --git a/backup/static/backup/backup.js b/backup/static/backup/backup.js index a41fffb41..cbe74d8ef 100755 --- a/backup/static/backup/backup.js +++ b/backup/static/backup/backup.js @@ -1347,6 +1347,7 @@ app.controller('remoteBackupControl', function ($scope, $http, $timeout) { $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); function ListInitialDatas(response) { + $scope.backupProcessStarted = true; if (response.data.remoteTransferStatus === 1) { diff --git a/static/backup/backup.js b/static/backup/backup.js index a41fffb41..cbe74d8ef 100644 --- a/static/backup/backup.js +++ b/static/backup/backup.js @@ -1347,6 +1347,7 @@ app.controller('remoteBackupControl', function ($scope, $http, $timeout) { $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); function ListInitialDatas(response) { + $scope.backupProcessStarted = true; if (response.data.remoteTransferStatus === 1) { From 157da73ae22fc9bb1ea24d21e13c2e3f50d8e275 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 9 May 2020 00:07:56 +0500 Subject: [PATCH 036/121] bug fix: https://forums.cyberpanel.net/discussion/comment/9482/#Comment_9482 --- static/websiteFunctions/websiteFunctions.js | 29 +++++++++++++++++-- .../websiteFunctions/websiteFunctions.js | 29 +++++++++++++++++-- .../templates/websiteFunctions/manageGIT.html | 8 ++--- 3 files changed, 55 insertions(+), 11 deletions(-) diff --git a/static/websiteFunctions/websiteFunctions.js b/static/websiteFunctions/websiteFunctions.js index 58c302260..42cffc8b9 100644 --- a/static/websiteFunctions/websiteFunctions.js +++ b/static/websiteFunctions/websiteFunctions.js @@ -5836,7 +5836,7 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { $scope.autoCommitCurrent = response.data.autoCommitCurrent; $scope.autoPushCurrent = response.data.autoPushCurrent; $scope.emailLogsCurrent = response.data.emailLogsCurrent; - $scope.currentCommands = response.data.commands; + document.getElementById("currentCommands").value = response.data.commands; $scope.webhookCommandCurrent = response.data.webhookCommandCurrent; } else { $scope.gitTracking = false; @@ -6677,17 +6677,40 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { url = "/websites/saveGitConfigurations"; - var data = { domain: $("#domain").text(), folder: $scope.folder, autoCommit: $scope.autoCommit, autoPush: $scope.autoPush, emailLogs: $scope.emailLogs, - commands: $scope.commands, + commands: document.getElementById("currentCommands").value, webhookCommand: $scope.webhookCommand }; + if ($scope.autoCommit === undefined){ + $scope.autoCommitCurrent = 'Never'; + }else{ + $scope.autoCommitCurrent = $scope.autoCommit; + } + + if ($scope.autoPush === undefined){ + $scope.autoPushCurrent = 'Never'; + }else{ + $scope.autoPushCurrent = $scope.autoPush; + } + + if ($scope.emailLogs === undefined){ + $scope.emailLogsCurrent = false; + }else{ + $scope.emailLogsCurrent = $scope.emailLogs; + } + + if ($scope.webhookCommand === undefined){ + $scope.webhookCommandCurrent = false; + }else{ + $scope.webhookCommandCurrent = $scope.webhookCommand; + } + var config = { headers: { 'X-CSRFToken': getCookie('csrftoken') diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 58c302260..42cffc8b9 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -5836,7 +5836,7 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { $scope.autoCommitCurrent = response.data.autoCommitCurrent; $scope.autoPushCurrent = response.data.autoPushCurrent; $scope.emailLogsCurrent = response.data.emailLogsCurrent; - $scope.currentCommands = response.data.commands; + document.getElementById("currentCommands").value = response.data.commands; $scope.webhookCommandCurrent = response.data.webhookCommandCurrent; } else { $scope.gitTracking = false; @@ -6677,17 +6677,40 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { url = "/websites/saveGitConfigurations"; - var data = { domain: $("#domain").text(), folder: $scope.folder, autoCommit: $scope.autoCommit, autoPush: $scope.autoPush, emailLogs: $scope.emailLogs, - commands: $scope.commands, + commands: document.getElementById("currentCommands").value, webhookCommand: $scope.webhookCommand }; + if ($scope.autoCommit === undefined){ + $scope.autoCommitCurrent = 'Never'; + }else{ + $scope.autoCommitCurrent = $scope.autoCommit; + } + + if ($scope.autoPush === undefined){ + $scope.autoPushCurrent = 'Never'; + }else{ + $scope.autoPushCurrent = $scope.autoPush; + } + + if ($scope.emailLogs === undefined){ + $scope.emailLogsCurrent = false; + }else{ + $scope.emailLogsCurrent = $scope.emailLogs; + } + + if ($scope.webhookCommand === undefined){ + $scope.webhookCommandCurrent = false; + }else{ + $scope.webhookCommandCurrent = $scope.webhookCommand; + } + var config = { headers: { 'X-CSRFToken': getCookie('csrftoken') diff --git a/websiteFunctions/templates/websiteFunctions/manageGIT.html b/websiteFunctions/templates/websiteFunctions/manageGIT.html index 27ba5e006..d8558cc46 100755 --- a/websiteFunctions/templates/websiteFunctions/manageGIT.html +++ b/websiteFunctions/templates/websiteFunctions/manageGIT.html @@ -189,8 +189,7 @@
    -
    Currently: {$ autoCommitCurrent - $} +
    Currently: {$ autoCommitCurrent $}
    @@ -234,10 +233,9 @@
    - + class="form-control">
    From 56c87428db520caa99c216221256a37a1c5a5a55 Mon Sep 17 00:00:00 2001 From: WhatTheServer Date: Sat, 9 May 2020 08:41:50 -0400 Subject: [PATCH 037/121] Update mailscannerinstaller.sh initial work to enable defaulting all detected spam to the INBOX.Junk E-mail for cyberpanel --- CPScripts/mailscannerinstaller.sh | 120 +++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/CPScripts/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh index 05951f7c6..875e6c791 100644 --- a/CPScripts/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -1,6 +1,20 @@ #!/bin/bash +#systemctl stop firewalld + +echo 'backup configs'; +cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf-bak_$(date '+%Y-%m-%d_%H_%M:%S'); +cp /etc/postfix/master.cf /etc/postfix/master.cf-bak_$(date '+%Y-%m-%d_%H_%M:%S'); +cp /etc/postfix/main.cf /etc/postfix/main.cf-bak_$(date '+%Y-%m-%d_%H_%M:%S'); +cp /etc/dovecot/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext-bak_$(date '+%Y-%m-%d_%H_%M:%S') + + +ZONE=$(firewall-cmd --get-default-zone) +firewall-cmd --zone=$ZONE --add-port=4190/tcp --permanent systemctl stop firewalld +echo 'Stop CSF' +csf -x + MAILSCANNER=/etc/MailScanner if [ -d $MAILSCANNER ];then @@ -173,13 +187,115 @@ systemctl restart mailscanner IPADDRESS=$(cat /etc/cyberpanel/machineIP) + +echo 'Setting up spamassassin and sieve to deliver spam to Junk folder by default' +#echo "If you wish mailscanner/spamassassin to send spam email to a spam folder please follow the tutorial on the Cyberpanel Website" +echo 'Fix protocols' +sed -i 's/^protocols =.*/protocols = imap pop3 sieve/g' /etc/dovecot/dovecot.conf + + +sed -i "s|^user_query.*|user_query = SELECT '5000' as uid, '5000' as gid, '/home/vmail/%d/%n' as home,mail FROM e_users WHERE email='%u';|g" /etc/dovecot/dovecot-sql.conf.ext + +if [ "$OS" = "NAME=\"Ubuntu\"" ];then + + apt-get install -y dovecot-managesieved dovecot-sieve net-tools pflogsumm + +elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then + + yum install -y nano net-tools dovecot-pigeonhole postfix-perl-scripts + +fi + + +# Create Sieve files +mkdir -p /etc/dovecot/sieve/global +touch /var/log/{dovecot-lda-errors.log,dovecot-lda.log} +touch /var/log/{dovecot-sieve-errors.log,dovecot-sieve.log} +touch /var/log/{dovecot-lmtp-errors.log,dovecot-lmtp.log} +touch /etc/dovecot/sieve/default.sieve +chown vmail: -R /etc/dovecot/sieve +chown vmail:mail /var/log/dovecot-* + +echo 'Create Sieve Default spam to Junk rule' +cat >> /etc/dovecot/sieve/default.sieve <> /etc/dovecot/dovecot.conf < Date: Sun, 10 May 2020 02:20:10 +0500 Subject: [PATCH 038/121] add dkim keys to dns records during fetch --- .../templates/WebTerminal/WebTerminal.html | 9 +++---- mailServer/mailserverManager.py | 2 ++ plogical/dnsUtilities.py | 26 ++++++++++++------- .../websiteFunctions/websiteFunctions.js | 1 + 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/WebTerminal/templates/WebTerminal/WebTerminal.html b/WebTerminal/templates/WebTerminal/WebTerminal.html index 81d21e451..75bea2190 100755 --- a/WebTerminal/templates/WebTerminal/WebTerminal.html +++ b/WebTerminal/templates/WebTerminal/WebTerminal.html @@ -7,15 +7,13 @@ {% get_current_language as LANGUAGE_CODE %} - - -

    {% trans "Terminal" %} - {% trans "Web Terminal Docs" %}

    + style="height: 23px;line-height: 21px;" + class="btn btn-border btn-alt border-red btn-link font-red" + title="">{% trans "Web Terminal Docs" %}

    {% trans "Execute your terminal commands." %}

    @@ -50,5 +48,4 @@
    - {% endblock %} diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index 2463bb94f..b5e387627 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -617,6 +617,8 @@ class MailServerManager: command = "sudo cat " + path privateKey = ProcessUtilities.outputExecutioner(command, 'opendkim') + DNS.createDKIMRecords(domainName) + data_ret = {'status': 1, 'fetchStatus': 1, 'keysAvailable': 1, 'publicKey': output[leftIndex:rightIndex], 'privateKey': privateKey, 'dkimSuccessMessage': 'Keys successfully fetched!', 'error_message': "None"} diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index 51fb3f8b2..cc2d3b2b2 100755 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -474,16 +474,22 @@ class DNS: leftIndex = output.index('(') + 2 rightIndex = output.rindex(')') - 1 - record = Records(domainOwner=zone, - domain_id=zone.id, - name="default._domainkey." + topLevelDomain, - type="TXT", - content=output[leftIndex:rightIndex], - ttl=3600, - prio=0, - disabled=0, - auth=1) - record.save() + if Records.objects.filter(domainOwner=zone, name="default._domainkey." + topLevelDomain).count() == 0: + + record = Records(domainOwner=zone, + domain_id=zone.id, + name="default._domainkey." + topLevelDomain, + type="TXT", + content=output[leftIndex:rightIndex], + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + command = ' systemctl restart pdns' + ProcessUtilities.executioner(command) if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: command = ' systemctl restart pdns' diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 42cffc8b9..f39798297 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -6805,4 +6805,5 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) { }; }); + /* Java script code to git tracking ends here */ From 6bc60d7c9eb12433887b1c198ffaab7fae5ad218 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 10 May 2020 03:15:33 +0500 Subject: [PATCH 039/121] setup autodiscover at later stage --- mailServer/mailserverManager.py | 47 +++++++- mailServer/static/mailServer/mailServer.js | 52 ++++++++ .../templates/mailServer/listEmails.html | 12 +- mailServer/urls.py | 1 + mailServer/views.py | 12 ++ plogical/virtualHostUtilities.py | 113 ++++++++++-------- static/mailServer/mailServer.js | 52 ++++++++ static/websiteFunctions/websiteFunctions.js | 1 + 8 files changed, 237 insertions(+), 53 deletions(-) diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index b5e387627..187fbbe74 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -226,6 +226,38 @@ class MailServerManager: json_data = json.dumps(data_ret) return HttpResponse(json_data) + def fixMailSSL(self): + try: + + userID = self.request.session['userID'] + currentACL = ACLManager.loadedACL(userID) + + data = json.loads(self.request.body) + selectedDomain = data['selectedDomain'] + + admin = Administrator.objects.get(pk=userID) + + if ACLManager.checkOwnership(selectedDomain, admin, currentACL) == 1: + pass + else: + return ACLManager.loadErrorJson('status', 0) + + website = Websites.objects.get(domain=selectedDomain) + + execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py" + execPath = '%s setupAutoDiscover --virtualHostName %s --websiteOwner %s' % (execPath, selectedDomain, website.admin.userName) + + ProcessUtilities.executioner(execPath) + + data_ret = {'status': 1, 'error_message': "None"} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + except BaseException as msg: + data_ret = {'status': 0, 'error_message': str(msg)} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + def emailForwarding(self): try: userID = self.request.session['userID'] @@ -476,6 +508,19 @@ class MailServerManager: except: raise BaseException('No emails exist for this domain.') + postfixMapPath = '/etc/postfix/vmail_ssl.map' + + if os.path.exists(postfixMapPath): + + postfixMapData = open(postfixMapPath, 'r').read() + + if postfixMapData.find(selectedDomain) == -1: + mailConfigured = 0 + else: + mailConfigured = 1 + else: + mailConfigured = 0 + records = emailDomain.eusers_set.all() json_data = "[" @@ -492,7 +537,7 @@ class MailServerManager: json_data = json_data + ',' + json.dumps(dic) json_data = json_data + ']' - final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data}) + final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'mailConfigured': mailConfigured, 'error_message': "None", "data": json_data}) return HttpResponse(final_json) except BaseException as msg: diff --git a/mailServer/static/mailServer/mailServer.js b/mailServer/static/mailServer/mailServer.js index 3bf1db1c3..c33087815 100755 --- a/mailServer/static/mailServer/mailServer.js +++ b/mailServer/static/mailServer/mailServer.js @@ -1124,6 +1124,7 @@ app.controller('listEmails', function ($scope, $http) { $scope.cyberpanelLoading = true; $scope.emailsAccounts = true; + $scope.mailConfigured = 1; $scope.populateCurrentRecords = function () { $scope.cyberpanelLoading = false; @@ -1151,6 +1152,8 @@ app.controller('listEmails', function ($scope, $http) { if (response.data.status === 1) { $scope.emailsAccounts = false; $scope.records = JSON.parse(response.data.data); + $scope.mailConfigured = response.data.mailConfigured; + new PNotify({ title: 'Success!', text: 'Emails Successfully Fetched.', @@ -1229,6 +1232,55 @@ app.controller('listEmails', function ($scope, $http) { } + }; + + $scope.fixMailSSL = function (email) { + + $scope.cyberpanelLoading = false; + + var url = "/email/fixMailSSL"; + + var data = { + selectedDomain: $scope.selectedDomain, + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + function ListInitialDatas(response) { + if (response.data.status === 1) { + $scope.populateCurrentRecords(); + new PNotify({ + title: 'Success!', + text: 'Configurations applied successfully.', + type: 'success' + }); + + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + new PNotify({ + title: 'Error!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + } + + }; $scope.changePasswordInitial = function (email) { diff --git a/mailServer/templates/mailServer/listEmails.html b/mailServer/templates/mailServer/listEmails.html index 955cdf4f8..4ed7781ff 100755 --- a/mailServer/templates/mailServer/listEmails.html +++ b/mailServer/templates/mailServer/listEmails.html @@ -56,6 +56,15 @@
    +
    +
    +

    {% trans "SSL for email is not configured properly, you may get Self-Signed error on mail clients such as Outlook and Thunderbird. More details " %}here.

    +
    + + + +
    +
    @@ -74,7 +83,8 @@ class="btn btn-border btn-alt border-purple btn-link font-purple" href="#" title="">{% trans 'Change Password' %} - {% trans 'Delete' %} diff --git a/mailServer/urls.py b/mailServer/urls.py index 74d902484..a974c6b64 100755 --- a/mailServer/urls.py +++ b/mailServer/urls.py @@ -20,6 +20,7 @@ urlpatterns = [ url(r'^deleteEmailAccount', views.deleteEmailAccount, name='deleteEmailAccount'), url(r'^getEmailsForDomain$', views.getEmailsForDomain, name='getEmailsForDomain'), url(r'^submitEmailDeletion', views.submitEmailDeletion, name='submitEmailDeletion'), + url(r'^fixMailSSL', views.fixMailSSL, name='fixMailSSL'), ## Change email password diff --git a/mailServer/views.py b/mailServer/views.py index 337567c07..12ce04a91 100755 --- a/mailServer/views.py +++ b/mailServer/views.py @@ -91,6 +91,18 @@ def submitEmailDeletion(request): json_data = json.dumps(data_ret) return HttpResponse(json_data) +def fixMailSSL(request): + try: + + msM = MailServerManager(request) + coreResult = msM.fixMailSSL() + + return coreResult + except KeyError as msg: + data_ret = {'deleteEmailStatus': 0, 'error_message': str(msg)} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + def emailForwarding(request): try: msM = MailServerManager(request) diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index 7bbfcb306..7fae5acb6 100755 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -55,6 +55,64 @@ class virtualHostUtilities: cyberPanel = "/usr/local/CyberCP" redisConf = '/usr/local/lsws/conf/dvhost_redis.conf' + @staticmethod + def setupAutoDiscover(mailDomain, tempStatusPath, virtualHostName, admin): + + if mailDomain: + + logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Creating mail child domain..,80') + childDomain = 'mail.%s' % (virtualHostName) + childPath = '/home/%s/public_html/%s' % (virtualHostName, childDomain) + + virtualHostUtilities.createDomain(virtualHostName, childDomain, 'PHP 7.2', childPath, 1, 0, 0, + admin.userName, 0, "/home/cyberpanel/" + str(randint(1000, 9999))) + + ## update dovecot conf to enable auto-discover + + dovecotPath = '/etc/dovecot/dovecot.conf' + + if os.path.exists(dovecotPath): + dovecotContent = open(dovecotPath, 'r').read() + + if dovecotContent.find(childDomain) == -1: + content = """\nlocal_name %s { + ssl_cert = Date: Sun, 10 May 2020 23:38:59 +0500 Subject: [PATCH 040/121] display mail client details --- mailServer/mailserverManager.py | 2 +- mailServer/static/mailServer/mailServer.js | 1 + .../templates/mailServer/listEmails.html | 76 ++++++++++++++++++- static/mailServer/mailServer.js | 1 + 4 files changed, 78 insertions(+), 2 deletions(-) diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index 187fbbe74..a171cc68e 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -537,7 +537,7 @@ class MailServerManager: json_data = json_data + ',' + json.dumps(dic) json_data = json_data + ']' - final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'mailConfigured': mailConfigured, 'error_message': "None", "data": json_data}) + final_json = json.dumps({'status': 1, 'fetchStatus': 1,'serverHostname': 'mail.%s' % (selectedDomain), 'mailConfigured': mailConfigured, 'error_message': "None", "data": json_data}) return HttpResponse(final_json) except BaseException as msg: diff --git a/mailServer/static/mailServer/mailServer.js b/mailServer/static/mailServer/mailServer.js index c33087815..f46bb4d4a 100755 --- a/mailServer/static/mailServer/mailServer.js +++ b/mailServer/static/mailServer/mailServer.js @@ -1153,6 +1153,7 @@ app.controller('listEmails', function ($scope, $http) { $scope.emailsAccounts = false; $scope.records = JSON.parse(response.data.data); $scope.mailConfigured = response.data.mailConfigured; + $scope.serverHostname = response.data.serverHostname; new PNotify({ title: 'Success!', diff --git a/mailServer/templates/mailServer/listEmails.html b/mailServer/templates/mailServer/listEmails.html index 4ed7781ff..00abe9f6b 100755 --- a/mailServer/templates/mailServer/listEmails.html +++ b/mailServer/templates/mailServer/listEmails.html @@ -65,7 +65,81 @@ -
    +
    + +

    {% trans "Details To Configure Mail Clients" %}

    + +
    + + + + + + + + + + + + + + + + + + + + +
    {% trans "POP3" %}{% trans "Details" %}
    {% trans "Server Hostname" %}{$ serverHostname $}
    {% trans "Port" %}110
    {% trans "SSL" %}STARTTLS
    + + + + + + + + + + + + + + + + + + + + + + +
    {% trans "IMAP" %}{% trans "Details" %}
    {% trans "Server Hostname" %}{$ serverHostname $}
    {% trans "Port" %}143
    {% trans "SSL" %}STARTTLS
    + + + + + + + + + + + + + + + + + + + + + + +
    {% trans "SMTP" %}{% trans "Details" %}
    {% trans "Server Hostname" %}{$ serverHostname $}
    {% trans "Port" %}587
    {% trans "SSL" %}STARTTLS
    +
    + +
    diff --git a/static/mailServer/mailServer.js b/static/mailServer/mailServer.js index c33087815..f46bb4d4a 100644 --- a/static/mailServer/mailServer.js +++ b/static/mailServer/mailServer.js @@ -1153,6 +1153,7 @@ app.controller('listEmails', function ($scope, $http) { $scope.emailsAccounts = false; $scope.records = JSON.parse(response.data.data); $scope.mailConfigured = response.data.mailConfigured; + $scope.serverHostname = response.data.serverHostname; new PNotify({ title: 'Success!', From 561cac2b3f5d7095500e9045c902ceabe048a5bf Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 10 May 2020 23:41:09 +0500 Subject: [PATCH 041/121] display mail client details --- plogical/virtualHostUtilities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index 7fae5acb6..a490db652 100755 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -107,7 +107,11 @@ class virtualHostUtilities: writeToFile.write(mapContent) writeToFile.close() - command = 'postmap -F hash:/etc/postfix/vmail_ssl.map' + if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + command = 'postmap -F hash:/etc/postfix/vmail_ssl.map' + else: + command = 'postmap -f hash:/etc/postfix/vmail_ssl.map' + ProcessUtilities.executioner(command) command = 'systemctl restart postfix' From c2d0e3075ebfaa179e49a75361227cf193c038e9 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 00:56:38 +0500 Subject: [PATCH 042/121] display mail client details --- plogical/virtualHostUtilities.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index a490db652..93dd2a1cc 100755 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -107,10 +107,7 @@ class virtualHostUtilities: writeToFile.write(mapContent) writeToFile.close() - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - command = 'postmap -F hash:/etc/postfix/vmail_ssl.map' - else: - command = 'postmap -f hash:/etc/postfix/vmail_ssl.map' + command = 'postmap -F hash:/etc/postfix/vmail_ssl.map' ProcessUtilities.executioner(command) From 7e26f3a58102b07595470d332870ff2bb0a0cfd1 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 00:59:21 +0500 Subject: [PATCH 043/121] ubuntu 20 --- cyberpanel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 993cc279d..492668dcd 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -554,7 +554,7 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then echo -e "\nDetecting CentOS 8.X...\n" SERVER_OS="CentOS" CENTOS_8="True" -elif echo $OUTPUT | grep -q "Ubuntu 18.04" ; then +elif echo $OUTPUT | grep -q "Ubuntu" ; then if uname -m | grep -q 64 ; then echo -e "\nDetecting Ubuntu 18.04...\n" SERVER_OS="Ubuntu" From 7488d79868387565e6ba84180c4ad4a056ede7af Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 01:03:51 +0500 Subject: [PATCH 044/121] ubuntu 20 --- cyberpanel.sh | 10 +++++++++- install/installCyberPanel.py | 37 ++++++++++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 492668dcd..9ca9bbe12 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -554,7 +554,7 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then echo -e "\nDetecting CentOS 8.X...\n" SERVER_OS="CentOS" CENTOS_8="True" -elif echo $OUTPUT | grep -q "Ubuntu" ; then +elif echo $OUTPUT | grep -q "Ubuntu 18.04" ; then if uname -m | grep -q 64 ; then echo -e "\nDetecting Ubuntu 18.04...\n" SERVER_OS="Ubuntu" @@ -562,6 +562,14 @@ elif echo $OUTPUT | grep -q "Ubuntu" ; then echo -e "\nUbuntu 18.04 x32 detected...ths only works on x64 system." exit fi +elif echo $OUTPUT | grep -q "Ubuntu 20" ; then + if uname -m | grep -q 64 ; then + echo -e "\nDetecting Ubuntu 20...\n" + SERVER_OS="Ubuntu" + else + echo -e "\nUbuntu 20 x32 detected...ths only works on x64 system." + exit + fi else cat /etc/*release echo -e "\nUnable to detect your OS...\n" diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index bba011f20..80019cbd1 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -7,12 +7,32 @@ import randomPassword import errno import MySQLdb as mariadb import install +from os.path import exists #distros centos=0 ubuntu=1 cent8=2 +def get_Ubuntu_release(): + release = -1 + if exists("/etc/lsb-release"): + distro_file = "/etc/lsb-release" + with open(distro_file) as f: + for line in f: + if line[:16] == "DISTRIB_RELEASE=": + release = float(line[16:]) + + if release == -1: + print("Can't find distro release name in " + distro_file + " - fatal error") + + else: + logging.InstallLog.writeToFile("Can't find linux release file - fatal error") + print("Can't find linux release file - fatal error") + os._exit(os.EX_UNAVAILABLE) + + return release + class InstallCyberPanel: mysql_Root_password = "" @@ -333,17 +353,18 @@ class InstallCyberPanel: command = 'DEBIAN_FRONTEND=noninteractive apt install pure-ftpd-mysql -y' os.system(command) - command = 'wget https://rep.cyberpanel.net/pure-ftpd-common_1.0.47-3_all.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + if get_Ubuntu_release() == 18.10: + command = 'wget https://rep.cyberpanel.net/pure-ftpd-common_1.0.47-3_all.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'wget https://rep.cyberpanel.net/pure-ftpd-mysql_1.0.47-3_amd64.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = 'wget https://rep.cyberpanel.net/pure-ftpd-mysql_1.0.47-3_amd64.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) elif self.distro == centos: command = "yum install -y pure-ftpd" From b4663a55663ac36fdb80fc136a8a109540029b9c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 01:09:28 +0500 Subject: [PATCH 045/121] ubuntu 20 --- cyberpanel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 9ca9bbe12..e0dbfdffc 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -410,7 +410,7 @@ if [[ $SERVER_OS == "CentOS" ]] ; then if [[ $SERVER_OS == "Ubuntu" ]] ; then apt update -y DEBIAN_FRONTEND=noninteractive apt upgrade -y - DEBIAN_FRONTEND=noninteracitve apt install -y htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim + DEBIAN_FRONTEND=noninteracitve apt install -y htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip check_return DEBIAN_FRONTEND=noninteractive apt install -y python3-pip From 67944ab90b5e11052847c521402a842d15645a71 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 13:43:04 +0500 Subject: [PATCH 046/121] some fixes for ubuntu 20 --- cyberpanel.sh | 52 +++++++++++++++++++++++++++++++++++-------------- requirments.txt | 2 -- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index e0dbfdffc..0cda48a26 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1,6 +1,6 @@ #!/bin/bash -#CyberPanel installer script for CentOS 7.X, CentOS 8.X, CloudLinux 7.X and Ubuntu 18.04 +#CyberPanel installer script for CentOS 7.X, CentOS 8.X, CloudLinux 7.X, Ubuntu 18.04 and Ubuntu 20.04 SUDO_TEST=$(set) @@ -23,6 +23,7 @@ MEMCACHED="ON" REDIS="ON" TOTAL_RAM=$(free -m | awk '/Mem\:/ { print $2 }') CENTOS_8="False" +UBUNTU_20="False" WATCHDOG="OFF" BRANCH_NAME="v${TEMP:12:3}.${TEMP:25:1}" VIRT_TYPE="" @@ -562,10 +563,11 @@ elif echo $OUTPUT | grep -q "Ubuntu 18.04" ; then echo -e "\nUbuntu 18.04 x32 detected...ths only works on x64 system." exit fi -elif echo $OUTPUT | grep -q "Ubuntu 20" ; then +elif echo $OUTPUT | grep -q "Ubuntu 20.04" ; then if uname -m | grep -q 64 ; then - echo -e "\nDetecting Ubuntu 20...\n" + echo -e "\nDetecting Ubuntu 20.04 ...\n" SERVER_OS="Ubuntu" + UBUNTU_20="True" else echo -e "\nUbuntu 20 x32 detected...ths only works on x64 system." exit @@ -573,7 +575,7 @@ elif echo $OUTPUT | grep -q "Ubuntu 20" ; then else cat /etc/*release echo -e "\nUnable to detect your OS...\n" - echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, CentOS 7.x, CentOS 8.x and CloudLinux 7.x...\n" + echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, CentOS 7.x, CentOS 8.x and CloudLinux 7.x...\n" exit 1 fi } @@ -994,7 +996,14 @@ if [[ $debug == "0" ]] ; then fi if [[ $debug == "1" ]] ; then - /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* + if [[ $UBUNTU_20 == "False" ]] ; then + /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* + check_return +else + wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt + /usr/local/CyberPanel/bin/pip3 install --ignore-installed -r requirments.txt + check_return +fi if [[ $REDIS_HOSTING == "Yes" ]] ; then /usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --redis enable @@ -1034,15 +1043,20 @@ if [[ $DEV == "ON" ]] ; then #install dev branch #wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt cd /usr/local/ - virtualenv -p /usr/bin/python3 CyberPanel + virtualenv -p /usr/bin/python3 CyberPanel source /usr/local/CyberPanel/bin/activate - wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip - check_return - unzip /usr/local/cyberpanel-pip.zip -d /usr/local - check_return - pip3.6 install --ignore-installed /usr/local/pip-packs/* - check_return - cd - + if [[ $UBUNTU_20 == "False" ]] ; then + wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip + check_return + unzip /usr/local/cyberpanel-pip.zip -d /usr/local + check_return + pip3.6 install --ignore-installed /usr/local/pip-packs/* + check_return + cd - + else + wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt + pip3.6 install --ignore-installed -r requirments.txt + fi fi if [ -f requirements.txt ] && [ -d cyberpanel ] ; then @@ -1132,8 +1146,16 @@ EOF virtualenv -p /usr/bin/python3 /usr/local/CyberCP source /usr/local/CyberCP/bin/activate -pip3.6 install --ignore-installed /usr/local/pip-packs/* -check_return + +if [[ $UBUNTU_20 == "False" ]] ; then + pip3.6 install --ignore-installed /usr/local/pip-packs/* + check_return +else + wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt + pip3.6 install --ignore-installed -r requirments.txt + check_return +fi + systemctl restart lscpd fi diff --git a/requirments.txt b/requirments.txt index 42c87b102..154583392 100755 --- a/requirments.txt +++ b/requirments.txt @@ -6,9 +6,7 @@ backports.ssl-match-hostname==3.5.0.1 bcrypt==3.1.7 boto3==1.9.64 botocore==1.12.64 -certbot==0.21.1 certifi==2018.4.16 -cffi==1.11.5 chardet==3.0.4 cloudflare==2.6.1 ConfigArgParse==0.15.2 From 48ee0a777f2e2616a77b5f2069a705f8f236eceb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 13:56:51 +0500 Subject: [PATCH 047/121] bug fix in fixMariaDB --- install/installCyberPanel.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 80019cbd1..7fca30c94 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -328,8 +328,11 @@ class InstallCyberPanel: conn = mariadb.connect(user='root', passwd=self.mysql_Root_password) cursor = conn.cursor() cursor.execute('set global innodb_file_per_table = on;') - cursor.execute('set global innodb_file_format = Barracuda;') - cursor.execute('set global innodb_large_prefix = on;') + try: + cursor.execute('set global innodb_file_format = Barracuda;') + cursor.execute('set global innodb_large_prefix = on;') + except BaseException as msg: + self.stdOut('%s. [ERROR:335]' % (str(msg))) cursor.close() conn.close() From 209026ed368c8c4adb81a74e5387d3b49f2bc03a Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 14:28:31 +0500 Subject: [PATCH 048/121] bug fix in fixMariaDB --- dns/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/models.py b/dns/models.py index c926566db..ad666cff2 100755 --- a/dns/models.py +++ b/dns/models.py @@ -41,7 +41,7 @@ class Comments(models.Model): type = models.CharField(max_length=10) modified_at = models.IntegerField() account = models.CharField(max_length=40) - comment = models.CharField(max_length=64000) + comment = models.TextField() class Meta: db_table = 'comments' From 1fbc276709f47e334850e9c767b94696b649a919 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 14:48:37 +0500 Subject: [PATCH 049/121] bug fix in fixMariaDB --- dns/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/models.py b/dns/models.py index ad666cff2..c42b663ad 100755 --- a/dns/models.py +++ b/dns/models.py @@ -23,7 +23,7 @@ class Records(models.Model): domain_id = models.IntegerField(blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True) type = models.CharField(max_length=10, blank=True, null=True) - content = models.CharField(max_length=64000, blank=True, null=True) + content = models.CharField(max_length=1000, blank=True, null=True) ttl = models.IntegerField(blank=True, null=True) prio = models.IntegerField(blank=True, null=True) change_date = models.IntegerField(blank=True, null=True) From 1d0ad177432575b82be2241d2371620acff86665 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 22:27:13 +0500 Subject: [PATCH 050/121] fix lswsgi for python 3.8 --- cyberpanel_upgrade.sh | 10 +++++++--- install/install.py | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 4348c73f2..768b3b92a 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -305,11 +305,15 @@ fi ## +rm -f wsgi-lsapi-1.4.tgz rm -f wsgi-lsapi-1.5.tgz +rm -f wsgi-lsapi-1.6.tgz rm -rf wsgi-lsapi-1.4 -wget http://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-1.5.tgz -tar xf wsgi-lsapi-1.5.tgz -cd wsgi-lsapi-1.5 +rm -rf wsgi-lsapi-1.5 +rm -rf wsgi-lsapi-1.6 +wget http://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-1.6.tgz +tar xf wsgi-lsapi-1.6.tgz +cd wsgi-lsapi-1.6 /usr/local/CyberPanel/bin/python ./configure.py make diff --git a/install/install.py b/install/install.py index 411534b69..4fdd694de 100755 --- a/install/install.py +++ b/install/install.py @@ -1494,13 +1494,13 @@ imap_folder_list_limit = 0 def setupPythonWSGI(self): try: - command = "wget http://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-1.4.tgz" + command = "wget http://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-1.6.tgz" preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - command = "tar xf wsgi-lsapi-1.4.tgz" + command = "tar xf wsgi-lsapi-1.6.tgz" preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - os.chdir("wsgi-lsapi-1.4") + os.chdir("wsgi-lsapi-1.6") command = "/usr/local/CyberPanel/bin/python ./configure.py" preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) From 2db5c93a233ff916cf0b9b1e3ed95bc0d6c6dc03 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 02:22:08 +0500 Subject: [PATCH 051/121] some debugging --- cyberpanel.sh | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 0cda48a26..a69a2fe20 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -30,6 +30,19 @@ VIRT_TYPE="" GIT_URL="github.com/usmannasir/cyberpanel" GIT_CONTENT_URL="raw.githubusercontent.com/usmannasir/cyberpanel" +disable_repos() { + +if [[ $SERVER_OS == "CentOS" ]] ; then + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo +fi + +} check_return() { #check previous command result , 0 = ok , non-0 = something wrong. @@ -46,7 +59,6 @@ if [[ ! -f /usr/bin/cyberpanel_utility ]] ; then wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh chmod 700 /usr/bin/cyberpanel_utility fi - } watchdog_setup() { @@ -545,6 +557,7 @@ fi check_OS() { echo -e "\nChecking OS..." OUTPUT=$(cat /etc/*release) + if echo $OUTPUT | grep -q "CentOS Linux 7" ; then echo -e "\nDetecting CentOS 7.X...\n" SERVER_OS="CentOS" @@ -578,6 +591,8 @@ else echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, CentOS 7.x, CentOS 8.x and CloudLinux 7.x...\n" exit 1 fi + + } check_root() { @@ -1042,8 +1057,7 @@ export LC_ALL=en_US.UTF-8 if [[ $DEV == "ON" ]] ; then #install dev branch #wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - cd /usr/local/ - virtualenv -p /usr/bin/python3 CyberPanel + virtualenv -p /usr/bin/python3 /usr/local/CyberPanel source /usr/local/CyberPanel/bin/activate if [[ $UBUNTU_20 == "False" ]] ; then wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip @@ -1052,7 +1066,6 @@ if [[ $DEV == "ON" ]] ; then check_return pip3.6 install --ignore-installed /usr/local/pip-packs/* check_return - cd - else wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt pip3.6 install --ignore-installed -r requirments.txt @@ -1064,6 +1077,10 @@ if [ -f requirements.txt ] && [ -d cyberpanel ] ; then rm -f requirements.txt fi +echo $PWD + +sleep 20 + git clone https://${GIT_URL} cd cyberpanel git checkout $BRANCH_NAME @@ -1072,6 +1089,9 @@ cd - cp -r cyberpanel /usr/local/cyberpanel cd cyberpanel/install +echo $PWD + +sleep 20 curl https://cyberpanel.sh/?version } @@ -1412,6 +1432,8 @@ else fi } +##START + if [ $# -eq 0 ] ; then echo -e "\nInitializing...\n" else @@ -1510,6 +1532,8 @@ else DOWNLOAD_SERVER="cdn.cyberpanel.sh" fi +##END + check_OS check_virtualization check_root @@ -1518,9 +1542,6 @@ check_process check_provider - - - if [[ $SILENT = "ON" ]] ; then argument_mode else @@ -1541,18 +1562,4 @@ main_install ### Disable Centos Default Repos -disable_repos() { - -if [[ $SERVER_OS == "CentOS" ]] ; then - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo - sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo -fi - -} - disable_repos \ No newline at end of file From 16458a5243d4c59a84636486485d7d01a7de3ff9 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 02:22:47 +0500 Subject: [PATCH 052/121] update awk for ubuntu20 --- cyberpanel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index a69a2fe20..6510f3cdc 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -21,7 +21,7 @@ KEY_SIZE="" ADMIN_PASS="1234567" MEMCACHED="ON" REDIS="ON" -TOTAL_RAM=$(free -m | awk '/Mem\:/ { print $2 }') +TOTAL_RAM=$(free -m | awk '/Mem:/ { print $2 }') CENTOS_8="False" UBUNTU_20="False" WATCHDOG="OFF" From 333ef741e11a9a5314ff9e46ee43b901af812a0b Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 02:24:31 +0500 Subject: [PATCH 053/121] some debugging --- install/install.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/install.py b/install/install.py index 4fdd694de..45dec46de 100755 --- a/install/install.py +++ b/install/install.py @@ -2217,4 +2217,6 @@ def main(): if __name__ == "__main__": + print(os.getcwd()) + time.sleep(20) main() From 536d3da622c2be41877991e3c54bb6703e5bd97d Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 02:49:45 +0500 Subject: [PATCH 054/121] some more debugging --- cyberpanel.sh | 4 ++++ install/install.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cyberpanel.sh b/cyberpanel.sh index 6510f3cdc..8bc1b726f 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1015,6 +1015,7 @@ if [[ $debug == "1" ]] ; then /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* check_return else + . /usr/local/CyberCP/bin/activate wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt /usr/local/CyberPanel/bin/pip3 install --ignore-installed -r requirments.txt check_return @@ -1073,6 +1074,8 @@ if [[ $DEV == "ON" ]] ; then fi if [ -f requirements.txt ] && [ -d cyberpanel ] ; then + echo $PWD + sleep 20 rm -rf cyberpanel rm -f requirements.txt fi @@ -1171,6 +1174,7 @@ if [[ $UBUNTU_20 == "False" ]] ; then pip3.6 install --ignore-installed /usr/local/pip-packs/* check_return else + . /usr/local/CyberCP/bin/activate wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt pip3.6 install --ignore-installed -r requirments.txt check_return diff --git a/install/install.py b/install/install.py index 45dec46de..ed7f9aecf 100755 --- a/install/install.py +++ b/install/install.py @@ -1312,6 +1312,10 @@ imap_folder_list_limit = 0 logging.InstallLog.writeToFile("Starting LSCPD installation..") + print(os.getcwd()) + + time.sleep(30) + os.chdir(self.cwd) if self.distro == ubuntu: From 2a90ec2dfdcb5a40ac75551cd0511f84e863267a Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 03:05:07 +0500 Subject: [PATCH 055/121] add missing virtualenv --- cyberpanel.sh | 1 + install/install.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cyberpanel.sh b/cyberpanel.sh index 8bc1b726f..c5d9011c2 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1010,6 +1010,7 @@ if [[ $debug == "0" ]] ; then exit fi +virtualenv -p /usr/bin/python3 /usr/local/CyberCP if [[ $debug == "1" ]] ; then if [[ $UBUNTU_20 == "False" ]] ; then /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* diff --git a/install/install.py b/install/install.py index ed7f9aecf..a746e4f1c 100755 --- a/install/install.py +++ b/install/install.py @@ -1318,6 +1318,10 @@ imap_folder_list_limit = 0 os.chdir(self.cwd) + print(os.getcwd()) + + time.sleep(30) + if self.distro == ubuntu: command = "apt-get -y install gcc g++ make autoconf rcs" else: From 0d34c1e3a6def59020b925bac559ab85d1272e64 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 03:59:40 +0500 Subject: [PATCH 056/121] remove duplicate venv --- cyberpanel.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index c5d9011c2..39071afd0 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1010,18 +1010,8 @@ if [[ $debug == "0" ]] ; then exit fi -virtualenv -p /usr/bin/python3 /usr/local/CyberCP -if [[ $debug == "1" ]] ; then - if [[ $UBUNTU_20 == "False" ]] ; then - /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* - check_return -else - . /usr/local/CyberCP/bin/activate - wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - /usr/local/CyberPanel/bin/pip3 install --ignore-installed -r requirments.txt - check_return -fi +if [[ $debug == "1" ]] ; then if [[ $REDIS_HOSTING == "Yes" ]] ; then /usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --redis enable else @@ -1168,21 +1158,22 @@ trusted-host=pypi.python.org EOF fi +fi + virtualenv -p /usr/bin/python3 /usr/local/CyberCP -source /usr/local/CyberCP/bin/activate if [[ $UBUNTU_20 == "False" ]] ; then - pip3.6 install --ignore-installed /usr/local/pip-packs/* + source /usr/local/CyberCP/bin/activate + /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* check_return else . /usr/local/CyberCP/bin/activate wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - pip3.6 install --ignore-installed -r requirments.txt + /usr/local/CyberPanel/bin/pip3 install --ignore-installed -r requirments.txt check_return fi systemctl restart lscpd -fi for version in $(ls /usr/local/lsws | grep lsphp); do From 772dbf63d8144ae76540862375144e5ed9ea27af Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 04:01:10 +0500 Subject: [PATCH 057/121] remove duplicate venv --- cyberpanel.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 39071afd0..41463e391 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1060,7 +1060,7 @@ if [[ $DEV == "ON" ]] ; then check_return else wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - pip3.6 install --ignore-installed -r requirments.txt + pip3 install --ignore-installed -r requirments.txt fi fi @@ -1169,7 +1169,7 @@ if [[ $UBUNTU_20 == "False" ]] ; then else . /usr/local/CyberCP/bin/activate wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - /usr/local/CyberPanel/bin/pip3 install --ignore-installed -r requirments.txt + pip3 install --ignore-installed -r requirments.txt check_return fi From e7013d31e6183709bcda74c6c964ffad57add887 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 12:48:32 +0500 Subject: [PATCH 058/121] pip packs --- cyberpanel.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 41463e391..823e7dfbc 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1059,8 +1059,12 @@ if [[ $DEV == "ON" ]] ; then pip3.6 install --ignore-installed /usr/local/pip-packs/* check_return else - wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - pip3 install --ignore-installed -r requirments.txt + wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/ubuntu-pip.zip + check_return + unzip /usr/local/cyberpanel-pip.zip -d /usr/local + check_return + pip3 install --ignore-installed /usr/local/packages/* + check_return fi fi @@ -1168,8 +1172,7 @@ if [[ $UBUNTU_20 == "False" ]] ; then check_return else . /usr/local/CyberCP/bin/activate - wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt - pip3 install --ignore-installed -r requirments.txt + pip3 install --ignore-installed /usr/local/packages/* check_return fi From d63ff4c9bfb6f5d4cd038e1af3536c66a9d7b69f Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 12 May 2020 13:33:39 +0500 Subject: [PATCH 059/121] remove debugging info --- cyberpanel.sh | 9 --------- install/install.py | 10 ---------- 2 files changed, 19 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 823e7dfbc..dc5b8d62a 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1069,16 +1069,10 @@ if [[ $DEV == "ON" ]] ; then fi if [ -f requirements.txt ] && [ -d cyberpanel ] ; then - echo $PWD - sleep 20 rm -rf cyberpanel rm -f requirements.txt fi -echo $PWD - -sleep 20 - git clone https://${GIT_URL} cd cyberpanel git checkout $BRANCH_NAME @@ -1087,9 +1081,6 @@ cd - cp -r cyberpanel /usr/local/cyberpanel cd cyberpanel/install -echo $PWD - -sleep 20 curl https://cyberpanel.sh/?version } diff --git a/install/install.py b/install/install.py index a746e4f1c..4fdd694de 100755 --- a/install/install.py +++ b/install/install.py @@ -1312,16 +1312,8 @@ imap_folder_list_limit = 0 logging.InstallLog.writeToFile("Starting LSCPD installation..") - print(os.getcwd()) - - time.sleep(30) - os.chdir(self.cwd) - print(os.getcwd()) - - time.sleep(30) - if self.distro == ubuntu: command = "apt-get -y install gcc g++ make autoconf rcs" else: @@ -2225,6 +2217,4 @@ def main(): if __name__ == "__main__": - print(os.getcwd()) - time.sleep(20) main() From 1b708b3aadcf99f7ba7626279031a2c6ba5f8ee1 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 01:29:29 +0500 Subject: [PATCH 060/121] bug fix: install --- cyberpanel.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index dc5b8d62a..f2d56ebe1 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1050,7 +1050,7 @@ if [[ $DEV == "ON" ]] ; then #install dev branch #wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt virtualenv -p /usr/bin/python3 /usr/local/CyberPanel - source /usr/local/CyberPanel/bin/activate + . /usr/local/CyberPanel/bin/activate if [[ $UBUNTU_20 == "False" ]] ; then wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip check_return @@ -1158,7 +1158,7 @@ fi virtualenv -p /usr/bin/python3 /usr/local/CyberCP if [[ $UBUNTU_20 == "False" ]] ; then - source /usr/local/CyberCP/bin/activate + . /usr/local/CyberCP/bin/activate /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* check_return else From 28f774102b35f714d0f72de1640a0c13f862c26c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 01:32:55 +0500 Subject: [PATCH 061/121] update repo version for cent7 --- install/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install.py b/install/install.py index 4fdd694de..cfb9eee6e 100755 --- a/install/install.py +++ b/install/install.py @@ -323,7 +323,7 @@ class preFlightsChecks: os._exit(os.EX_SOFTWARE) elif self.distro == centos: - command = 'rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm' + command = 'rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.2-1.el7.noarch.rpm' preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) elif self.distro == cent8: command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' From c544fedd137117658c5769d08edc4335a6dadd8d Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 18:08:55 +0500 Subject: [PATCH 062/121] virtualenv to 16.7.9 on ubuntu 20.04 --- cyberpanel.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cyberpanel.sh b/cyberpanel.sh index f2d56ebe1..50207dd53 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -414,6 +414,8 @@ if [[ $SERVER_OS == "CentOS" ]] ; then if [[ $SERVER_OS == "CentOS" ]] ; then pip3.6 install virtualenv==16.7.9 + elif [[ $UBUNTU_20 == "True" ]] ; then + pip3.6 install virtualenv==16.7.9 else pip3.6 install virtualenv fi From ec4be2ea8a5880561d483de0ba19eb9fa9c619d9 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 18:32:36 +0500 Subject: [PATCH 063/121] virtualenv to 16.7.9 on ubuntu 20.04 --- cyberpanel.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 50207dd53..89e0318c2 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -414,15 +414,20 @@ if [[ $SERVER_OS == "CentOS" ]] ; then if [[ $SERVER_OS == "CentOS" ]] ; then pip3.6 install virtualenv==16.7.9 - elif [[ $UBUNTU_20 == "True" ]] ; then - pip3.6 install virtualenv==16.7.9 else pip3.6 install virtualenv fi - check_return - fi + check_return + +fi if [[ $SERVER_OS == "Ubuntu" ]] ; then + + if [[ $UBUNTU_20 == "True" ]] ; then + pip3 install virtualenv==16.7.9 + fi + check_return + apt update -y DEBIAN_FRONTEND=noninteractive apt upgrade -y DEBIAN_FRONTEND=noninteracitve apt install -y htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip From 9ff8c9ee44c10fb0d8902ba0775e519726bbd71d Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 18:35:10 +0500 Subject: [PATCH 064/121] virtualenv to 16.7.9 on ubuntu 20.04 --- cyberpanel.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 89e0318c2..d111d9433 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -423,11 +423,6 @@ fi if [[ $SERVER_OS == "Ubuntu" ]] ; then - if [[ $UBUNTU_20 == "True" ]] ; then - pip3 install virtualenv==16.7.9 - fi - check_return - apt update -y DEBIAN_FRONTEND=noninteractive apt upgrade -y DEBIAN_FRONTEND=noninteracitve apt install -y htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip @@ -441,6 +436,11 @@ if [[ $SERVER_OS == "Ubuntu" ]] ; then DEBIAN_FRONTEND=noninteractive apt install -y python3-venv check_return + if [[ $UBUNTU_20 == "True" ]] ; then + pip3 install virtualenv==16.7.9 + fi + check_return + fi } From 8e356637b68c343e522a860c9517aee31762900c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 20:20:23 +0500 Subject: [PATCH 065/121] update default php path --- cyberpanel.sh | 5 +++++ plogical/applicationInstaller.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index d111d9433..6ad5356fb 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1040,6 +1040,11 @@ if [[ $REDIS == "ON" ]] ; then fi after_install fi + +if [[ $UBUNTU_20 == "True" ]] ; then + cp /usr/local/lsws/lsphp73/bin/php /usr/bin +fi + } pip_virtualenv() { diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 811906953..a2e71dcb9 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -70,7 +70,7 @@ class ApplicationInstaller(multi.Thread): if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: if package == 'all': - command = 'apt-get update -y' + command = 'DEBIAN_FRONTEND=noninteractive apt-get update -y' f.write(ProcessUtilities.outputExecutioner(command)) f.flush() From 524b05c49bb76ce6a42218d877057107ff25cf52 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 20:28:42 +0500 Subject: [PATCH 066/121] upgrade check for ubuntu 20 --- cyberpanel_upgrade.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 768b3b92a..6a1eb9c25 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -12,6 +12,7 @@ GIT_URL="github.com/usmannasir/cyberpanel" GIT_CONTENT_URL="raw.githubusercontent.com/usmannasir/cyberpanel" SERVER_COUNTRY="unknow" SERVER_COUNTRY=$(curl --silent --max-time 5 https://cyberpanel.sh/?country) +UBUNTU_20="False" ### Update and remove not needed repos @@ -190,6 +191,10 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then elif echo $OUTPUT | grep -q "Ubuntu 18.04" ; then echo -e "\nDetecting Ubuntu 18.04...\n" SERVER_OS="Ubuntu" +elif echo $OUTPUT | grep -q "Ubuntu 20.04" ; then + echo -e "\nDetecting Ubuntu 18.04...\n" + SERVER_OS="Ubuntu" + UBUNTU_20="True" else cat /etc/*release echo -e "\nUnable to detect your OS...\n" @@ -237,9 +242,17 @@ else fi rm -f requirments.txt -wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip + +if [[ $UBUNTU_20 == "False" ]] ; then + wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip +else + wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/ubuntu-pip.zip +fi + check_return rm -rf /usr/local/pip-packs/ +rm -rf /usr/local/packages + unzip /usr/local/cyberpanel-pip.zip -d /usr/local check_return . /usr/local/CyberPanel/bin/activate @@ -248,7 +261,11 @@ check_return if [ $SERVER_OS = "Ubuntu" ] ; then . /usr/local/CyberPanel/bin/activate check_return - pip3 install --ignore-installed /usr/local/pip-packs/* + if [[ $UBUNTU_20 == "False" ]] ; then + pip3 install --ignore-installed /usr/local/pip-packs/* + else + pip3 install --ignore-installed /usr/local/packages/* + fi check_return else source /usr/local/CyberPanel/bin/activate @@ -293,7 +310,11 @@ check_return if [ $SERVER_OS = "Ubuntu" ] ; then . /usr/local/CyberCP/bin/activate check_return - pip3 install --ignore-installed /usr/local/pip-packs/* + if [[ $UBUNTU_20 == "False" ]] ; then + pip3 install --ignore-installed /usr/local/pip-packs/* + else + pip3 install --ignore-installed /usr/local/packages/* + fi check_return else source /usr/local/CyberCP/bin/activate From cef81982d9d19a37bdc2f170cb4bcef1c0053e77 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 21:42:16 +0500 Subject: [PATCH 067/121] ftp fix for ubuntu 20 --- cyberpanel_upgrade.sh | 2 +- install/installCyberPanel.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 6a1eb9c25..2f49f7edf 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -192,7 +192,7 @@ elif echo $OUTPUT | grep -q "Ubuntu 18.04" ; then echo -e "\nDetecting Ubuntu 18.04...\n" SERVER_OS="Ubuntu" elif echo $OUTPUT | grep -q "Ubuntu 20.04" ; then - echo -e "\nDetecting Ubuntu 18.04...\n" + echo -e "\nDetecting Ubuntu 20.04...\n" SERVER_OS="Ubuntu" UBUNTU_20="True" else diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 7fca30c94..ec9bd9974 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -409,8 +409,11 @@ class InstallCyberPanel: except: logging.InstallLog.writeToFile("[ERROR] Could not create directory for FTP SSL") + if (self.distro == centos or self.distro == cent8) or (self.distro == ubuntu and get_Ubuntu_release() == 18.14): + 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' + else: + command = 'openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -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' install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) os.chdir(self.cwd) From f09836c38c669187216beb11ef88d4bdb6c868ac Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 22:13:43 +0500 Subject: [PATCH 068/121] fall back for venv --- cyberpanel.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 6ad5356fb..b0f5079d6 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1062,8 +1062,9 @@ if [[ $DEV == "ON" ]] ; then #install dev branch #wget https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt virtualenv -p /usr/bin/python3 /usr/local/CyberPanel - . /usr/local/CyberPanel/bin/activate + if [[ $UBUNTU_20 == "False" ]] ; then + source /usr/local/CyberPanel/bin/activate wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/cyberpanel-pip.zip check_return unzip /usr/local/cyberpanel-pip.zip -d /usr/local @@ -1071,6 +1072,7 @@ if [[ $DEV == "ON" ]] ; then pip3.6 install --ignore-installed /usr/local/pip-packs/* check_return else + . /usr/local/CyberPanel/bin/activate wget -O /usr/local/cyberpanel-pip.zip https://rep.cyberpanel.net/ubuntu-pip.zip check_return unzip /usr/local/cyberpanel-pip.zip -d /usr/local @@ -1170,7 +1172,7 @@ fi virtualenv -p /usr/bin/python3 /usr/local/CyberCP if [[ $UBUNTU_20 == "False" ]] ; then - . /usr/local/CyberCP/bin/activate + source /usr/local/CyberCP/bin/activate /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* check_return else From 3022f3f39ee6607c775a451475fcce9012828220 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 May 2020 23:33:01 +0500 Subject: [PATCH 069/121] change pip path --- cyberpanel.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index b0f5079d6..295d2c0c2 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1019,6 +1019,7 @@ fi if [[ $debug == "1" ]] ; then + pip3.6 install --ignore-installed /usr/local/pip-packs/* if [[ $REDIS_HOSTING == "Yes" ]] ; then /usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --redis enable else @@ -1173,10 +1174,12 @@ virtualenv -p /usr/bin/python3 /usr/local/CyberCP if [[ $UBUNTU_20 == "False" ]] ; then source /usr/local/CyberCP/bin/activate - /usr/local/CyberPanel/bin/pip3 install --ignore-installed /usr/local/pip-packs/* + check_return + pip3.6 install --ignore-installed /usr/local/pip-packs/* check_return else . /usr/local/CyberCP/bin/activate + check_return pip3 install --ignore-installed /usr/local/packages/* check_return fi From ef91568933fe8abb90b4c1647260b73283f56919 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 14 May 2020 00:50:06 +0500 Subject: [PATCH 070/121] minor cosmetic change --- mailServer/templates/mailServer/listEmails.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailServer/templates/mailServer/listEmails.html b/mailServer/templates/mailServer/listEmails.html index 00abe9f6b..f2462bb06 100755 --- a/mailServer/templates/mailServer/listEmails.html +++ b/mailServer/templates/mailServer/listEmails.html @@ -61,7 +61,7 @@

    {% trans "SSL for email is not configured properly, you may get Self-Signed error on mail clients such as Outlook and Thunderbird. More details " %}here.

    - + From a3a77fef2427463821bea99184d727cbfa7e5a25 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 14 May 2020 14:06:26 +0500 Subject: [PATCH 071/121] bug fix incbackups for ubuntu --- IncBackups/IncBackupsControl.py | 3 ++- cyberpanel.sh | 2 +- plogical/processUtilities.py | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/IncBackups/IncBackupsControl.py b/IncBackups/IncBackupsControl.py index b153a5b9e..618c950a4 100644 --- a/IncBackups/IncBackupsControl.py +++ b/IncBackups/IncBackupsControl.py @@ -122,7 +122,8 @@ class IncJobs(multi.Thread): def findRestorePath(self): - if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8 \ + or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: self.restoreTarget = '/' return 1 else: diff --git a/cyberpanel.sh b/cyberpanel.sh index 295d2c0c2..8038886a7 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1175,7 +1175,7 @@ virtualenv -p /usr/bin/python3 /usr/local/CyberCP if [[ $UBUNTU_20 == "False" ]] ; then source /usr/local/CyberCP/bin/activate check_return - pip3.6 install --ignore-installed /usr/local/pip-packs/* + pip3 install --ignore-installed /usr/local/pip-packs/* check_return else . /usr/local/CyberCP/bin/activate diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 336d8cb1b..fdd5e6990 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -16,6 +16,7 @@ class ProcessUtilities(multi.Thread): centos = 1 cent8 = 2 ubuntu = 0 + ubuntu20 = 3 server_address = '/usr/local/lscpd/admin/comm.sock' token = "unset" @@ -139,6 +140,8 @@ class ProcessUtilities(multi.Thread): distroPath = '/etc/lsb-release' if os.path.exists(distroPath): + if open(distroPath, 'r').read().find('20.04') > -1: + return ProcessUtilities.ubuntu20 return ProcessUtilities.ubuntu else: if open('/etc/redhat-release', 'r').read().find('CentOS Linux release 8') > -1: From 52e56c3bdb194cd79a60f692d7bd6e1990c08e2e Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 14 May 2020 14:18:23 +0500 Subject: [PATCH 072/121] set system default php on ubuntu 20.04 --- cyberpanel.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 8038886a7..1f5721acd 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1042,10 +1042,6 @@ fi after_install fi -if [[ $UBUNTU_20 == "True" ]] ; then - cp /usr/local/lsws/lsphp73/bin/php /usr/bin -fi - } pip_virtualenv() { @@ -1308,6 +1304,10 @@ fi fi #fix php.ini & issue +if [[ $UBUNTU_20 == "True" ]] ; then + cp /usr/local/lsws/lsphp73/bin/php /usr/bin +fi + #clear echo "###################################################################" echo " CyberPanel Successfully Installed " From 9d235aa9ad4184f66f7db5bb0bbf3846b70dbe36 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 15 May 2020 01:07:04 +0500 Subject: [PATCH 073/121] fetch ubuntu distro correctly --- baseTemplate/views.py | 2 +- plogical/applicationInstaller.py | 2 +- plogical/cronUtil.py | 4 ++-- plogical/csf.py | 4 ++-- plogical/dnsUtilities.py | 14 +++++++------- plogical/firewallUtilities.py | 2 +- plogical/mailUtilities.py | 2 +- serverStatus/views.py | 8 ++++---- websiteFunctions/website.py | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/baseTemplate/views.py b/baseTemplate/views.py index 60494ba00..2fee1a4d1 100755 --- a/baseTemplate/views.py +++ b/baseTemplate/views.py @@ -59,7 +59,7 @@ def getAdminStatus(request): pdns = PDNSStatus.objects.get(pk=1) currentACL['dnsAsWhole'] = pdns.serverStatus except: - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: pdnsPath = '/etc/powerdns' else: pdnsPath = '/etc/pdns' diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index a2e71dcb9..c4e26a75b 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -67,7 +67,7 @@ class ApplicationInstaller(multi.Thread): f = open(ServerStatusUtil.lswsInstallStatusPath, 'a') - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: if package == 'all': command = 'DEBIAN_FRONTEND=noninteractive apt-get update -y' diff --git a/plogical/cronUtil.py b/plogical/cronUtil.py index a08803833..120f6c06a 100755 --- a/plogical/cronUtil.py +++ b/plogical/cronUtil.py @@ -100,7 +100,7 @@ class CronUtil: commandT = 'chmod 755 %s' % (cronParent) ProcessUtilities.executioner(commandT, 'root') - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'chmod 755 /var/spool/cron/crontabs' ProcessUtilities.outputExecutioner(command) @@ -109,7 +109,7 @@ class CronUtil: commandT = 'chmod 700 %s' % (cronParent) ProcessUtilities.executioner(commandT, 'root') - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'chmod 1730 /var/spool/cron/crontabs' ProcessUtilities.outputExecutioner(command) diff --git a/plogical/csf.py b/plogical/csf.py index ef1999224..7b2bee78e 100755 --- a/plogical/csf.py +++ b/plogical/csf.py @@ -73,7 +73,7 @@ class CSF(multi.Thread): if ProcessUtilities.decideDistro() == ProcessUtilities.centos: command = 'yum install bind-utils net-tools perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph ipset -y' ProcessUtilities.normalExecutioner(command) - elif ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + elif ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'apt-get install dnsutils libwww-perl liblwp-protocol-https-perl libgd-graph-perl net-tools ipset -y' ProcessUtilities.normalExecutioner(command) command = 'ln -s /bin/systemctl /usr/bin/systemctl' @@ -309,7 +309,7 @@ class CSF(multi.Thread): ## # Some Ubuntu initial configurations - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: data = open('/etc/csf/csf.conf', 'r').readlines() writeToConf = open('/etc/csf/csf.conf', 'w') diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index cc2d3b2b2..c553e304d 100755 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -446,7 +446,7 @@ class DNS: DNS.createDNSRecord(zone, cNameValue, "CNAME", actualSubDomain, 0, 3600) - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'sudo systemctl restart pdns' ProcessUtilities.executioner(command) @@ -487,11 +487,11 @@ class DNS: auth=1) record.save() - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = ' systemctl restart pdns' ProcessUtilities.executioner(command) - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = ' systemctl restart pdns' ProcessUtilities.executioner(command) @@ -572,7 +572,7 @@ class DNS: auth=1) record.save() - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'sudo systemctl restart pdns' ProcessUtilities.executioner(command) @@ -591,7 +591,7 @@ class DNS: auth=1) record.save() - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'sudo systemctl restart pdns' ProcessUtilities.executioner(command) return @@ -608,7 +608,7 @@ class DNS: auth=1) record.save() - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'sudo systemctl restart pdns' ProcessUtilities.executioner(command) return @@ -624,7 +624,7 @@ class DNS: disabled=0, auth=1) record.save() - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'sudo systemctl restart pdns' ProcessUtilities.executioner(command) diff --git a/plogical/firewallUtilities.py b/plogical/firewallUtilities.py index d3f07fb63..f47b74205 100755 --- a/plogical/firewallUtilities.py +++ b/plogical/firewallUtilities.py @@ -15,7 +15,7 @@ class FirewallUtilities: @staticmethod def resFailed(res): - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu and res != 0: + if (ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20) and res != 0: return True elif ProcessUtilities.decideDistro() == ProcessUtilities.centos and res == 1: return True diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index 485206df0..0b1bd2ae2 100755 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -502,7 +502,7 @@ milter_default_action = accept def configureSpamAssassin(): try: - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: confFile = "/etc/mail/spamassassin/local.cf" confData = open(confFile).readlines() diff --git a/serverStatus/views.py b/serverStatus/views.py index 7d584c008..33efa23f6 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -730,7 +730,7 @@ def fetchPackages(request): recordsToShow = int(data['recordsToShow']) type = data['type'] - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'apt-mark showhold' locked = ProcessUtilities.outputExecutioner(command).split('\n') @@ -850,7 +850,7 @@ def fetchPackages(request): import re for items in finalPackages: - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: try: if type == 'CyberPanel': @@ -977,7 +977,7 @@ def fetchPackageDetails(request): data = json.loads(request.body) package = data['package'] - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'apt-cache show %s' % (package) packageDetails = ProcessUtilities.outputExecutioner(command) elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: @@ -1047,7 +1047,7 @@ def lockStatus(request): package = data['package'] type = data['type'] - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: if type == 0: command = 'apt-mark unhold %s' % (package) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 996b9f48d..71619e209 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -1605,7 +1605,7 @@ class WebsiteManager: output = ProcessUtilities.outputExecutioner(execPath, website.externalApp) - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu: + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'chmod 600 %s' % (cronPath) ProcessUtilities.executioner(command) From 8743fa9adb80b06260d2a4bf2c0b933c6aa317fb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 15 May 2020 01:47:48 +0500 Subject: [PATCH 074/121] bug fix: fetch access logs --- plogical/virtualHostUtilities.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index 93dd2a1cc..d750f5e3c 100755 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -308,10 +308,7 @@ class virtualHostUtilities: print("0, %s file is symlinked." % (fileName)) return 0 - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' + groupName = 'nobody' numberOfTotalLines = int(ProcessUtilities.outputExecutioner('wc -l %s' % (fileName), groupName).split(" ")[0]) From db7d0f5854237e8756630ffe54545f47ca6915d4 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 16 May 2020 04:15:28 +0500 Subject: [PATCH 075/121] bug fix: wp staging --- websiteFunctions/StagingSetup.py | 71 ++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index dd0351fc0..dbd7fc158 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -36,6 +36,11 @@ class StagingSetup(multi.Thread): website = Websites.objects.get(domain=masterDomain) + masterPath = '/home/%s/public_html' % (masterDomain) + + command = 'chmod 755 %s' % (masterPath) + ProcessUtilities.executioner(command) + ## Creating Child Domain path = "/home/" + masterDomain + "/public_html/" + domain @@ -57,18 +62,37 @@ class StagingSetup(multi.Thread): if data.find('[200]') > -1: pass else: - logging.statusWriter(tempStatusPath, 'Failed to create child-domain for staging enviroment. [404]') + logging.statusWriter(tempStatusPath, 'Failed to create child-domain for staging environment. [404]') return 0 logging.statusWriter(tempStatusPath, 'Domain successfully created..,15') ## Copying Data - masterPath = '/home/%s/public_html' % (masterDomain) + ## Fetch child domain path + + childDomainPaths = [] + + for childs in website.childdomains_set.all(): + childDomainPaths.append(childs.path) + + filesAndFolder = os.listdir(masterPath) + + for items in filesAndFolder: + completePath = '%s/%s' % (masterPath, items) + + if completePath in childDomainPaths: + continue + else: + command = 'cp -r %s %s/' % (completePath, path) + ProcessUtilities.executioner(command, website.externalApp) + + foldersToBeRemoved = ['%s/.git' % (path), '%s/wp-content/backups' % (path), '%s/wp-content/updraft' % (path), '%s/wp-content/cache' % (path), '%s/wp-content/plugins/litespeed-cache' % (path)] + + for rmv in foldersToBeRemoved: + command = 'rm -rf %s' % (rmv) + ProcessUtilities.executioner(command, website.externalApp) - command = 'rsync -avzh --exclude "%s" --exclude ".git" --exclude "wp-content/backups" --exclude "wp-content/updraft" --exclude "wp-content/cache" --exclude "wp-content/plugins/litespeed-cache" %s/ %s' % ( - domain, masterPath, path) - ProcessUtilities.executioner(command, website.externalApp) logging.statusWriter(tempStatusPath, 'Data copied..,50') @@ -82,11 +106,15 @@ class StagingSetup(multi.Thread): configPath = '%s/wp-config.php' % (masterPath) - if not os.path.exists(configPath): + command = 'ls -la %s' % (configPath) + output = ProcessUtilities.outputExecutioner(command) + + if output.find('No such file or') > -1: logging.statusWriter(tempStatusPath, 'WordPress is not detected. [404]') return 0 - data = open(configPath, 'r').readlines() + command = 'cat %s' % (configPath) + data = ProcessUtilities.outputExecutioner(command).split('\n') for items in data: if items.find('DB_NAME') > -1: @@ -105,11 +133,6 @@ class StagingSetup(multi.Thread): databasePath = '%s/%s.sql' % ('/home/cyberpanel', dbName) - command = "sed -i 's/%s/%s/g' %s" % (masterDomain, domain, databasePath) - ProcessUtilities.executioner(command, 'cyberpanel') - command = "sed -i 's/%s/%s/g' %s" % ('https', 'http', databasePath) - ProcessUtilities.executioner(command, 'cyberpanel') - if not mysqlUtilities.restoreDatabaseBackup(dbNameRestore, '/home/cyberpanel', None, 1, dbName): try: os.remove(databasePath) @@ -125,22 +148,31 @@ class StagingSetup(multi.Thread): ## Update final config file pathFinalConfig = '%s/wp-config.php' % (path) - data = open(pathFinalConfig, 'r').readlines() + + command = 'cat %s' % (configPath) + data = ProcessUtilities.outputExecutioner(command).split('\n') tmp = "/tmp/" + str(randint(1000, 9999)) writeToFile = open(tmp, 'w') for items in data: if items.find('DB_NAME') > -1: - writeToFile.write("define( 'DB_NAME', '%s' );\n" % (dbNameRestore)) + writeToFile.write("\ndefine( 'DB_NAME', '%s' );\n" % (dbNameRestore)) elif items.find('DB_USER') > -1: - writeToFile.write("define( 'DB_USER', '%s' );\n" % (dbUser)) + writeToFile.write("\ndefine( 'DB_USER', '%s' );\n" % (dbUser)) elif items.find('DB_PASSWORD') > -1: - writeToFile.write("define( 'DB_PASSWORD', '%s' );\n" % (dbPassword)) + writeToFile.write("\ndefine( 'DB_PASSWORD', '%s' );\n" % (dbPassword)) elif items.find('WP_SITEURL') > -1: continue + elif items.find("That's all, stop editing! Happy publishing.") > -1: + content = """ +define('WP_HOME','http://%s'); +define('WP_SITEURL','http://%s'); +""" % (domain, domain) + writeToFile.write(content) + writeToFile.writelines(items) else: - writeToFile.write(items) + writeToFile.write(items + '\n') writeToFile.close() @@ -157,6 +189,11 @@ class StagingSetup(multi.Thread): except: pass + from filemanager.filemanager import FileManager + + fm = FileManager(None, None) + fm.fixPermissions(masterDomain) + logging.statusWriter(tempStatusPath, 'Data copied..,[200]') return 0 From 47c0e0ef5cb2d3dfec7c7599fe1d546c0ef2b0ef Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 16 May 2020 04:43:02 +0500 Subject: [PATCH 076/121] bug fix: sync to master --- websiteFunctions/StagingSetup.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index dbd7fc158..e6af71bf9 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -46,7 +46,7 @@ class StagingSetup(multi.Thread): path = "/home/" + masterDomain + "/public_html/" + domain logging.statusWriter(tempStatusPath, 'Creating domain for staging environment..,5') - phpSelection = 'PHP 7.1' + phpSelection = 'PHP 7.2' execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py" execPath = execPath + " createDomain --masterDomain " + masterDomain + " --virtualHostName " + domain + \ @@ -194,6 +194,9 @@ define('WP_SITEURL','http://%s'); fm = FileManager(None, None) fm.fixPermissions(masterDomain) + from plogical.installUtilities import installUtilities + installUtilities.reStartLiteSpeed() + logging.statusWriter(tempStatusPath, 'Data copied..,[200]') return 0 @@ -211,7 +214,11 @@ define('WP_SITEURL','http://%s'); child = ChildDomains.objects.get(domain=childDomain) + command = 'chmod 755 /home/%s/public_html' % (child.master.domain) + ProcessUtilities.executioner(command) + configPath = '%s/wp-config.php' % (child.path) + if not os.path.exists(configPath): logging.statusWriter(tempStatusPath, 'WordPress is not detected. [404]') return 0 @@ -234,8 +241,6 @@ define('WP_SITEURL','http://%s'); raise BaseException('Failed to create database backup.') databasePath = '%s/%s.sql' % ('/home/cyberpanel', dbName) - command = "sed -i 's/%s/%s/g' %s" % (child.domain, child.master.domain, databasePath) - ProcessUtilities.executioner(command, 'cyberpanel') ## Restore to master domain @@ -273,6 +278,16 @@ define('WP_SITEURL','http://%s'); command = 'rsync -avzh --exclude "wp-config.php" %s/ %s' % (sourcePath, destinationPath) ProcessUtilities.executioner(command, child.master.externalApp) + from filemanager.filemanager import FileManager + + fm = FileManager(None, None) + fm.fixPermissions(child.master.domain) + + from plogical.installUtilities import installUtilities + installUtilities.reStartLiteSpeed() + + logging.statusWriter(tempStatusPath, 'Data copied..,[200]') + logging.statusWriter(tempStatusPath, 'Data copied..,[200]') return 0 From d4741a6ab79b6bd7b9a78dfdcb5bfc9dc501fae6 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 16 May 2020 14:01:11 +0500 Subject: [PATCH 077/121] remove duplicate log message --- websiteFunctions/StagingSetup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index e6af71bf9..7fd2929ed 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -264,7 +264,6 @@ define('WP_SITEURL','http://%s'); os.remove(databasePath) except: pass - if eraseCheck: sourcePath = child.path destinationPath = '/home/%s/public_html' % (child.master.domain) @@ -288,8 +287,6 @@ define('WP_SITEURL','http://%s'); logging.statusWriter(tempStatusPath, 'Data copied..,[200]') - logging.statusWriter(tempStatusPath, 'Data copied..,[200]') - return 0 except BaseException as msg: mesg = '%s. [404]' % (str(msg)) From 02da28621f63bc4e0e257fc438a4d080ecb56ef0 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 16 May 2020 15:42:15 +0500 Subject: [PATCH 078/121] bug fix: adding remote destinations --- plogical/backupUtilities.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index 882e32dfb..a61b3a186 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -924,6 +924,11 @@ class backupUtilities: expectation.append("Permission denied") expectation.append("100%") + ## Temp changes + + command = 'chmod 600 %s' % ('/root/.ssh/cyberpanel.pub') + ProcessUtilities.executioner(command) + command = "scp -o StrictHostKeyChecking=no -P " + port + " /root/.ssh/cyberpanel.pub " + user + "@" + IPAddress + ":~/.ssh/authorized_keys" setupKeys = pexpect.spawn(command, timeout=3) @@ -949,15 +954,32 @@ class backupUtilities: else: raise BaseException + ## Temp changes + + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel.pub') + ProcessUtilities.executioner(command) + return [1, "None"] except pexpect.TIMEOUT as msg: + + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel') + ProcessUtilities.executioner(command) + logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [sendKey]") return [0, "TIMEOUT [sendKey]"] except pexpect.EOF as msg: + + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel') + ProcessUtilities.executioner(command) + logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [sendKey]") return [0, "EOF [sendKey]"] except BaseException as msg: + + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel') + ProcessUtilities.executioner(command) + logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [sendKey]") return [0, str(msg) + " [sendKey]"] @@ -980,7 +1002,7 @@ class backupUtilities: expectation.append("Permission denied") expectation.append("File exists") - command = "ssh -o StrictHostKeyChecking=no -p " + port + ' ' + user + "@" + IPAddress + ' "mkdir ~/.ssh || rm -f ~/.ssh/temp && rm -f ~/.ssh/authorized_temp && cp ~/.ssh/authorized_keys ~/.ssh/temp"' + command = "ssh -o StrictHostKeyChecking=no -p " + port + ' ' + user + "@" + IPAddress + ' "mkdir ~/.ssh || rm -f ~/.ssh/temp && rm -f ~/.ssh/authorized_temp && cp ~/.ssh/authorized_keys ~/.ssh/temp || chmod 700 ~/.ssh || chmod g-w ~"' setupKeys = pexpect.spawn(command, timeout=3) if os.path.exists(ProcessUtilities.debugPath): @@ -1182,6 +1204,7 @@ class backupUtilities: subprocess.call(shlex.split(command)) + command = "sudo ssh -o StrictHostKeyChecking=no -p " + port + " -i /root/.ssh/cyberpanel " + user + "@" + IPAddress + ' "cat ~/.ssh/authorized_temp > ~/.ssh/authorized_keys"' if os.path.exists(ProcessUtilities.debugPath): From 8a2b2e43e79277d3aa8681cb2c9dabd9d3570589 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 16 May 2020 15:43:16 +0500 Subject: [PATCH 079/121] bug fix: adding remote destinations --- plogical/backupUtilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index a61b3a186..bf6b11b17 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -963,21 +963,21 @@ class backupUtilities: except pexpect.TIMEOUT as msg: - command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel') + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel.pub') ProcessUtilities.executioner(command) logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [sendKey]") return [0, "TIMEOUT [sendKey]"] except pexpect.EOF as msg: - command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel') + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel.pub') ProcessUtilities.executioner(command) logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [sendKey]") return [0, "EOF [sendKey]"] except BaseException as msg: - command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel') + command = 'chmod 644 %s' % ('/root/.ssh/cyberpanel.pub') ProcessUtilities.executioner(command) logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [sendKey]") From 354179d89db20e501200925e1258f501ea657f60 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 16 May 2020 16:48:16 +0500 Subject: [PATCH 080/121] bug fix: wp staging --- websiteFunctions/StagingSetup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index 7fd2929ed..419bd1184 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -117,7 +117,7 @@ class StagingSetup(multi.Thread): data = ProcessUtilities.outputExecutioner(command).split('\n') for items in data: - if items.find('DB_NAME') > -1: + if items.find('DB_NAME') > -1 and items[0] != '/': try: dbName = items.split("'")[3] if mysqlUtilities.createDatabaseBackup(dbName, '/home/cyberpanel'): @@ -164,13 +164,13 @@ class StagingSetup(multi.Thread): writeToFile.write("\ndefine( 'DB_PASSWORD', '%s' );\n" % (dbPassword)) elif items.find('WP_SITEURL') > -1: continue - elif items.find("That's all, stop editing! Happy publishing.") > -1: + elif items.find("table_prefix") > -1: + writeToFile.writelines(items) content = """ define('WP_HOME','http://%s'); define('WP_SITEURL','http://%s'); """ % (domain, domain) writeToFile.write(content) - writeToFile.writelines(items) else: writeToFile.write(items + '\n') @@ -233,7 +233,7 @@ define('WP_SITEURL','http://%s'); data = open(configPath, 'r').readlines() for items in data: - if items.find('DB_NAME') > -1: + if items.find('DB_NAME') > -1 and items[0] != '/': dbName = items.split("'")[3] if mysqlUtilities.createDatabaseBackup(dbName, '/home/cyberpanel'): break From 4d92f10b3076a3e6f2894f7a5067405423183372 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 17 May 2020 13:16:30 +0500 Subject: [PATCH 081/121] bug fix: wp staging --- websiteFunctions/StagingSetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index 419bd1184..df6979ca6 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -251,7 +251,7 @@ define('WP_SITEURL','http://%s'); data = open(configPath, 'r').readlines() for items in data: - if items.find('DB_NAME') > -1: + if items.find('DB_NAME') > -1 and items[0] != '/': dbNameRestore = items.split("'")[3] if not mysqlUtilities.restoreDatabaseBackup(dbNameRestore, '/home/cyberpanel', None, 1, dbName): try: From 860fff09a3b3e97018bb35f40d878d5f9aca20d2 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 19 May 2020 13:29:39 +0500 Subject: [PATCH 082/121] =?UTF-8?q?fix=20dkim:=20Shouldn=E2=80=99t=20be=20?= =?UTF-8?q?different=20for=20domain=20and=20subdomain=20(causes=20issue=20?= =?UTF-8?q?while=20sending=20mail)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mailServer/mailserverManager.py | 6 +++ plogical/dnsUtilities.py | 71 +++++++++++++++++++++++++++++++-- plogical/mailUtilities.py | 50 +++++++++++------------ 3 files changed, 97 insertions(+), 30 deletions(-) diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index a171cc68e..a67006543 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -652,6 +652,12 @@ class MailServerManager: return ACLManager.loadError() try: + + import tldextract + + extractDomain = tldextract.extract(domainName) + domainName = extractDomain.domain + '.' + extractDomain.suffix + path = "/etc/opendkim/keys/" + domainName + "/default.txt" command = "sudo cat " + path output = ProcessUtilities.outputExecutioner(command, 'opendkim') diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index c553e304d..0ef13bd13 100755 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -121,7 +121,6 @@ class DNS: subDomain = extractDomain.subdomain if len(subDomain) == 0: - if Domains.objects.filter(name=topLevelDomain).count() == 0: try: pdns = PDNSStatus.objects.get(pk=1) @@ -440,12 +439,66 @@ class DNS: DNS.createDNSRecord(zone, actualSubDomain, "A", ipAddress, 0, 3600) + ## Mail Record + + DNS.createDNSRecord(zone, 'mail.' + actualSubDomain, "A", ipAddress, 0, 3600) + # CNAME Records. cNameValue = "www." + actualSubDomain DNS.createDNSRecord(zone, cNameValue, "CNAME", actualSubDomain, 0, 3600) + ## MX Records + + mxValue = "mail." + actualSubDomain + + record = Records(domainOwner=zone, + domain_id=zone.id, + name=actualSubDomain, + type="MX", + content=mxValue, + ttl=3600, + prio="10", + disabled=0, + auth=1) + record.save() + + ## TXT Records + + record = Records(domainOwner=zone, + domain_id=zone.id, + name=actualSubDomain, + type="TXT", + content="v=spf1 a mx ip4:" + ipAddress + " ~all", + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + record = Records(domainOwner=zone, + domain_id=zone.id, + name="_dmarc." + actualSubDomain, + type="TXT", + content="v=DMARC1; p=none", + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + record = Records(domainOwner=zone, + domain_id=zone.id, + name="_domainkey." + actualSubDomain, + type="TXT", + content="t=y; o=~;", + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'sudo systemctl restart pdns' ProcessUtilities.executioner(command) @@ -465,6 +518,7 @@ class DNS: extractDomain = tldextract.extract(domain) topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix + subDomain = extractDomain.subdomain zone = Domains.objects.get(name=topLevelDomain) @@ -487,9 +541,18 @@ class DNS: auth=1) record.save() - if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: - command = ' systemctl restart pdns' - ProcessUtilities.executioner(command) + if len(subDomain) > 0: + if Records.objects.filter(domainOwner=zone, name="default._domainkey." + domain).count() == 0: + record = Records(domainOwner=zone, + domain_id=zone.id, + name="default._domainkey." + domain, + type="TXT", + content=output[leftIndex:rightIndex], + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = ' systemctl restart pdns' diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index 0b1bd2ae2..ca17dc3ed 100755 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -214,41 +214,39 @@ class mailUtilities: import tldextract - #extractDomain = tldextract.extract(virtualHostName) - #virtualHostName = extractDomain.domain + '.' + extractDomain.suffix + actualDomain = virtualHostName + extractDomain = tldextract.extract(virtualHostName) + virtualHostName = extractDomain.domain + '.' + extractDomain.suffix - if os.path.exists("/etc/opendkim/keys/" + virtualHostName + "/default.txt"): - return 1, "None" + if not os.path.exists("/etc/opendkim/keys/" + virtualHostName + "/default.txt"): + path = '/etc/opendkim/keys/%s' % (virtualHostName) + command = 'mkdir %s' % (path) + ProcessUtilities.normalExecutioner(command) + ## Generate keys - path = '/etc/opendkim/keys/%s' % (virtualHostName) - command = 'mkdir %s' % (path) - ProcessUtilities.normalExecutioner(command) + if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + command = "/usr/sbin/opendkim-genkey -D /etc/opendkim/keys/%s -d %s -s default" % (virtualHostName, virtualHostName) + else: + command = "opendkim-genkey -D /etc/opendkim/keys/%s -d %s -s default" % ( + virtualHostName, virtualHostName) + ProcessUtilities.normalExecutioner(command) + ## Fix permissions - ## Generate keys + command = "chown -R root:opendkim /etc/opendkim/keys/" + virtualHostName + ProcessUtilities.normalExecutioner(command) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - command = "/usr/sbin/opendkim-genkey -D /etc/opendkim/keys/%s -d %s -s default" % (virtualHostName, virtualHostName) - else: - command = "opendkim-genkey -D /etc/opendkim/keys/%s -d %s -s default" % ( - virtualHostName, virtualHostName) - ProcessUtilities.normalExecutioner(command) - ## Fix permissions + command = "chmod 640 /etc/opendkim/keys/" + virtualHostName + "/default.private" + ProcessUtilities.normalExecutioner(command) - command = "chown -R root:opendkim /etc/opendkim/keys/" + virtualHostName - ProcessUtilities.normalExecutioner(command) - - command = "chmod 640 /etc/opendkim/keys/" + virtualHostName + "/default.private" - ProcessUtilities.normalExecutioner(command) - - command = "chmod 644 /etc/opendkim/keys/" + virtualHostName + "/default.txt" - ProcessUtilities.normalExecutioner(command) + command = "chmod 644 /etc/opendkim/keys/" + virtualHostName + "/default.txt" + ProcessUtilities.normalExecutioner(command) ## Edit key file keyTable = "/etc/opendkim/KeyTable" - configToWrite = "default._domainkey." + virtualHostName + " " + virtualHostName + ":default:/etc/opendkim/keys/" + virtualHostName + "/default.private\n" + configToWrite = "default._domainkey." + actualDomain + " " + actualDomain + ":default:/etc/opendkim/keys/" + virtualHostName + "/default.private\n" writeToFile = open(keyTable, 'a') writeToFile.write(configToWrite) @@ -257,7 +255,7 @@ class mailUtilities: ## Edit signing table signingTable = "/etc/opendkim/SigningTable" - configToWrite = "*@" + virtualHostName + " default._domainkey." + virtualHostName + "\n" + configToWrite = "*@" + actualDomain + " default._domainkey." + actualDomain + "\n" writeToFile = open(signingTable, 'a') writeToFile.write(configToWrite) @@ -266,7 +264,7 @@ class mailUtilities: ## Trusted hosts trustedHosts = "/etc/opendkim/TrustedHosts" - configToWrite = virtualHostName + "\n" + configToWrite = actualDomain + "\n" writeToFile = open(trustedHosts, 'a') writeToFile.write(configToWrite) From d863d32a4ff4e2a8e54d39c0e6dd3a65781ebfd9 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 May 2020 15:48:46 +0500 Subject: [PATCH 083/121] fix: https://github.com/usmannasir/cyberpanel/issues/342 --- websiteFunctions/website.py | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 71619e209..67d26aeb8 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -3222,7 +3222,23 @@ StrictHostKeyChecking no else: return ACLManager.loadErrorJson() - if validators.domain(self.gitHost) and ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame): + if self.gitHost.find(':') > -1: + gitHostDomain = self.gitHost.split(':')[0] + gitHostPort = self.gitHost.split(':')[1] + + if not validators.domain(gitHostDomain): + return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') + + try: + gitHostPort = int(gitHostPort) + except: + return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') + + else: + if not validators.domain(self.gitHost): + return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') + + if ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame): pass else: return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') @@ -3613,10 +3629,25 @@ StrictHostKeyChecking no else: return ACLManager.loadErrorJson() + if self.gitHost.find(':') > -1: + gitHostDomain = self.gitHost.split(':')[0] + gitHostPort = self.gitHost.split(':')[1] + + if not validators.domain(gitHostDomain): + return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') + + try: + gitHostPort = int(gitHostPort) + except: + return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') + else: + if not validators.domain(self.gitHost): + return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') + ## Security check - if validators.domain(self.gitHost) and ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame): + if ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame): pass else: return ACLManager.loadErrorJson('status', 'Invalid characters in your input.') From 6972f868dd518e0137f42762adaa10f91d842dc2 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 May 2020 16:13:45 +0500 Subject: [PATCH 084/121] fix: https://github.com/usmannasir/cyberpanel/issues/342 --- CyberCP/secMiddleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CyberCP/secMiddleware.py b/CyberCP/secMiddleware.py index 322c03bbf..783080e2b 100755 --- a/CyberCP/secMiddleware.py +++ b/CyberCP/secMiddleware.py @@ -73,7 +73,7 @@ class secMiddleware: or 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' or key == 'commands': + or key == 'fileContent' or key == 'commands' or key == 'gitHost': continue 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 \ From 9f8c1ef5f2d0687b7de1376c46374033e7f0d192 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 May 2020 17:03:08 +0500 Subject: [PATCH 085/121] feature: display ssl port during list emails --- .../templates/mailServer/listEmails.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mailServer/templates/mailServer/listEmails.html b/mailServer/templates/mailServer/listEmails.html index f2462bb06..8b86a7786 100755 --- a/mailServer/templates/mailServer/listEmails.html +++ b/mailServer/templates/mailServer/listEmails.html @@ -85,6 +85,10 @@
    + + + + @@ -108,6 +112,10 @@ + + + + @@ -129,7 +137,15 @@ - + + + + + + + + + From f3322cdc9165838e3030647c5bc1e12db4316c12 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 May 2020 22:13:06 +0500 Subject: [PATCH 086/121] table for scheduled backup logs --- plogical/upgrade.py | 27 +++++++++++++++++++++++++++ websiteFunctions/models.py | 12 +++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index f200bd53b..e10c9d5fe 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1233,6 +1233,33 @@ class Upgrade: CONSTRAINT `websiteFunctions_git_owner_id_ce74c7de_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_websites` (`id`) )""" + try: + cursor.execute(query) + except: + pass + + qeury = """CREATE TABLE `websiteFunctions_backupjob` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `logFile` varchar(1000) NOT NULL, + `ipAddress` varchar(50) NOT NULL, + `port` varchar(15) NOT NULL, + PRIMARY KEY (`id`) +)""" + try: + cursor.execute(query) + except: + pass + + + query = """CREATE TABLE `websiteFunctions_backupjoblogs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `message` longtext NOT NULL, + `owner_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` (`owner_id`), + CONSTRAINT `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_backupjob` (`id`) +)""" + try: cursor.execute(query) except: diff --git a/websiteFunctions/models.py b/websiteFunctions/models.py index 93ebc01f1..2207b6b5f 100755 --- a/websiteFunctions/models.py +++ b/websiteFunctions/models.py @@ -8,7 +8,6 @@ from datetime import datetime # Create your models here. - class Websites(models.Model): admin = models.ForeignKey(Administrator, on_delete=models.PROTECT) package = models.ForeignKey(Package, on_delete=models.PROTECT) @@ -26,7 +25,6 @@ class ChildDomains(models.Model): ssl = models.IntegerField() phpSelection = models.CharField(max_length=10,default=None) - class Backups(models.Model): website = models.ForeignKey(Websites,on_delete=models.CASCADE) fileName = models.CharField(max_length=200) @@ -34,16 +32,13 @@ class Backups(models.Model): size = models.CharField(max_length=50) status = models.IntegerField(default=0) - class dest(models.Model): destLoc = models.CharField(unique=True,max_length=18) - class backupSchedules(models.Model): dest = models.ForeignKey(dest, on_delete=models.CASCADE) frequency = models.CharField(max_length=15) - class aliasDomains(models.Model): master = models.ForeignKey(Websites, on_delete=models.CASCADE) aliasDomain = models.CharField(max_length=75) @@ -54,4 +49,11 @@ class GitLogs(models.Model): type = models.CharField(max_length=5) message = models.TextField(max_length=65532) +class BackupJob(models.Model): + logFile = models.CharField(max_length=1000) + ipAddress = models.CharField(max_length=50) + port = models.CharField(max_length=15) +class BackupJobLogs(models.Model): + owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE) + message = models.TextField() \ No newline at end of file From dd8cd6fc2f97f4331316b3066841701753da1f9a Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 May 2020 22:23:21 +0500 Subject: [PATCH 087/121] table for scheduled backup logs --- plogical/backupScheduleLocal.py | 2 +- plogical/upgrade.py | 3 +++ websiteFunctions/models.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index a2c7f5f93..313594ffd 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -17,12 +17,12 @@ from plogical.processUtilities import ProcessUtilities from re import match,I,M import signal from datetime import datetime +from websiteFunctions.models import BackupJob, BackupJobLogs class backupScheduleLocal: localBackupPath = '/home/cyberpanel/localBackupPath' now = datetime.now() - @staticmethod def prepare(): try: diff --git a/plogical/upgrade.py b/plogical/upgrade.py index e10c9d5fe..a22fc9d65 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1243,6 +1243,8 @@ class Upgrade: `logFile` varchar(1000) NOT NULL, `ipAddress` varchar(50) NOT NULL, `port` varchar(15) NOT NULL, + `jobFailedSites` int(11) NOT NULL, + `jobSuccessSites` int(11) NOT NULL, PRIMARY KEY (`id`) )""" try: @@ -1255,6 +1257,7 @@ class Upgrade: `id` int(11) NOT NULL AUTO_INCREMENT, `message` longtext NOT NULL, `owner_id` int(11) NOT NULL, + `status` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` (`owner_id`), CONSTRAINT `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_backupjob` (`id`) diff --git a/websiteFunctions/models.py b/websiteFunctions/models.py index 2207b6b5f..32a05846d 100755 --- a/websiteFunctions/models.py +++ b/websiteFunctions/models.py @@ -53,7 +53,10 @@ class BackupJob(models.Model): logFile = models.CharField(max_length=1000) ipAddress = models.CharField(max_length=50) port = models.CharField(max_length=15) + jobSuccessSites = models.IntegerField() + jobFailedSites = models.IntegerField() class BackupJobLogs(models.Model): owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE) + status = models.IntegerField() message = models.TextField() \ No newline at end of file From 12a5401775f8199aa4c91de64c89a5ccda3a1115 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 May 2020 22:35:54 +0500 Subject: [PATCH 088/121] table for scheduled backup logs --- plogical/upgrade.py | 1 + websiteFunctions/models.py | 1 + 2 files changed, 2 insertions(+) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index a22fc9d65..d88edd44f 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1245,6 +1245,7 @@ class Upgrade: `port` varchar(15) NOT NULL, `jobFailedSites` int(11) NOT NULL, `jobSuccessSites` int(11) NOT NULL, + `location` int(11) NOT NULL, PRIMARY KEY (`id`) )""" try: diff --git a/websiteFunctions/models.py b/websiteFunctions/models.py index 32a05846d..ff4a5aea2 100755 --- a/websiteFunctions/models.py +++ b/websiteFunctions/models.py @@ -55,6 +55,7 @@ class BackupJob(models.Model): port = models.CharField(max_length=15) jobSuccessSites = models.IntegerField() jobFailedSites = models.IntegerField() + location = models.IntegerField() class BackupJobLogs(models.Model): owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE) From 661d866e9958c036f180d37da50228371e44785b Mon Sep 17 00:00:00 2001 From: hennaboy Date: Wed, 20 May 2020 18:45:42 +0100 Subject: [PATCH 089/121] Update mailscannerinstaller.sh Updated for Ubuntu 20 compatibility --- CPScripts/mailscannerinstaller.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CPScripts/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh index 875e6c791..927d0203e 100644 --- a/CPScripts/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -63,7 +63,7 @@ elif [ "$OS" = "NAME=\"Ubuntu\"" ];then apt-get install -y libmysqlclient-dev -apt-get install -y cpanminus gcc perl bzip2 zip make patch automake rpm libarchive-zip-perl libfilesys-df-perl libole-storage-lite-perl libsys-hostname-long-perl libsys-sigaction-perl libregexp-common-net-cidr-perl libmime-tools-perl libdbd-sqlite3-perl binutils build-essential libfilesys-df-perl zlib1g unzip mlocate clamav libdbd-mysql-perl unrar libclamav-dev libclamav-client-perl libclamunrar7 +apt-get install -y cpanminus gcc perl bzip2 zip make patch automake rpm libarchive-zip-perl libfilesys-df-perl libole-storage-lite-perl libsys-hostname-long-perl libsys-sigaction-perl libregexp-common-net-cidr-perl libmime-tools-perl libdbd-sqlite3-perl binutils build-essential libfilesys-df-perl zlib1g unzip mlocate clamav libdbd-mysql-perl unrar libclamav-dev libclamav-client-perl libclamunrar9 cpanm Encoding::FixLatin cpanm Digest::SHA1 @@ -98,7 +98,7 @@ systemctl restart postfix wget https://github.com/MailScanner/v5/archive/master.zip unzip master.zip -cd /root/v5-master/builds +cd /usr/local/CyberCP/CPScripts/v5-master/builds if [ "$OS" = "NAME=\"Ubuntu\"" ];then @@ -171,7 +171,14 @@ cp /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php.example /usr/local/C sed -i "s/^define('DB_USER',.*/define('DB_USER','root');/" /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php sed -i "s/^define('DB_PASS',.*/define('DB_PASS','${PASSWORD}');/" /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php sed -i "s/^define('MAILWATCH_HOME',.*/define(\'MAILWATCH_HOME\', \'\/usr\/local\/CyberCP\/public\/mailwatch\/mailscanner');/" /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php + +MSDEFAULT=/etc/MailScanner/defaults +if [ -f "$MSDEFAULT" ];then sed -i 's/^run_mailscanner=.*/run_mailscanner=1/' /etc/MailScanner/defaults +elif [ ! -f "$MSDEFAULT" ];then +touch /etc/MailScanner/defaults +echo "run_mailscanner=1" >> /etc/MailScanner/defaults +fi cp /usr/local/CyberCP/public/mailwatch/MailScanner_perl_scripts/MailWatchConf.pm /usr/share/MailScanner/perl/custom/ sed -i 's/^my (\$db_user) = .*/my (\$db_user) = \x27'${USER}'\x27;/' /usr/share/MailScanner/perl/custom/MailWatchConf.pm @@ -227,6 +234,7 @@ EOL echo "Adding Sieve to /etc/dovecot/dovecot.conf" cat >> /etc/dovecot/dovecot.conf < Date: Thu, 21 May 2020 23:21:36 +0500 Subject: [PATCH 090/121] add detailed schedule backup logging --- backup/backupManager.py | 95 ++++++++++++++- backup/static/backup/backup.js | 66 ++++++++++- backup/templates/backup/backupLogs.html | 125 ++++++++++++++++++++ backup/templates/backup/backupSchedule.html | 9 +- backup/urls.py | 4 +- backup/views.py | 17 +++ plogical/backupSchedule.py | 21 +++- plogical/backupScheduleLocal.py | 24 +++- serverStatus/views.py | 7 -- static/backup/backup.js | 66 ++++++++++- 10 files changed, 413 insertions(+), 21 deletions(-) create mode 100755 backup/templates/backup/backupLogs.html diff --git a/backup/backupManager.py b/backup/backupManager.py index 6e298d26b..eb9f4fe73 100755 --- a/backup/backupManager.py +++ b/backup/backupManager.py @@ -9,7 +9,7 @@ django.setup() import json from plogical.acl import ACLManager import plogical.CyberCPLogFileWriter as logging -from websiteFunctions.models import Websites, Backups, dest, backupSchedules +from websiteFunctions.models import Websites, Backups, dest, backupSchedules, BackupJob, BackupJobLogs from plogical.virtualHostUtilities import virtualHostUtilities import subprocess import shlex @@ -1186,3 +1186,96 @@ class BackupManager: data = {'cancelStatus': 0, 'error_message': str(msg)} json_data = json.dumps(data) return HttpResponse(json_data) + + def backupLogs(self, request = None, userID = None, data = None): + try: + currentACL = ACLManager.loadedACL(userID) + + if currentACL['admin'] == 1: + pass + else: + return ACLManager.loadError() + + all_files = [] + + logFiles = BackupJob.objects.all().order_by('-id') + + for logFile in logFiles: + all_files.append(logFile.logFile) + + return render(request, 'backup/backupLogs.html', {'backups': all_files}) + + except BaseException as msg: + return HttpResponse(str(msg)) + + def fetchLogs(self, userID = None, data = None): + try: + currentACL = ACLManager.loadedACL(userID) + + if currentACL['admin'] == 1: + pass + else: + return ACLManager.loadError() + + page = int(str(data['page']).rstrip('\n')) + recordsToShow = int(data['recordsToShow']) + logFile = data['logFile'] + + logJob = BackupJob.objects.get(logFile=logFile) + + logs = logJob.backupjoblogs_set.all() + + from s3Backups.s3Backups import S3Backups + from plogical.backupSchedule import backupSchedule + + pagination = S3Backups.getPagination(len(logs), recordsToShow) + endPageNumber, finalPageNumber = S3Backups.recordsPointer(page, recordsToShow) + finalLogs = logs[finalPageNumber:endPageNumber] + + json_data = "[" + checker = 0 + counter = 0 + + for log in finalLogs: + + if log.status == backupSchedule.INFO: + status = 'INFO' + else: + status = 'ERROR' + + dic = { + 'LEVEL': status, "Message": log.message + } + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) + counter = counter + 1 + + json_data = json_data + ']' + + if logJob.location == backupSchedule.LOCAL: + location = 'local' + else: + location = 'remote' + + + data = { + 'status': 1, + 'error_message': 'None', + 'logs': json_data, + 'pagination': pagination, + 'jobSuccessSites': logJob.jobSuccessSites, + 'jobFailedSites': logJob.jobFailedSites, + 'location': location + } + + + json_data = json.dumps(data) + return HttpResponse(json_data) + + except BaseException as msg: + data = {'remoteRestoreStatus': 0, 'error_message': str(msg)} + json_data = json.dumps(data) + return HttpResponse(json_data) diff --git a/backup/static/backup/backup.js b/backup/static/backup/backup.js index cbe74d8ef..59c654f87 100755 --- a/backup/static/backup/backup.js +++ b/backup/static/backup/backup.js @@ -1541,4 +1541,68 @@ app.controller('remoteBackupControl', function ($scope, $http, $timeout) { }); -///** Backup site ends **/// \ No newline at end of file +///** Backup site ends **/// + + +//*** Remote Backup site ****// +app.controller('backupLogsScheduled', function ($scope, $http, $timeout) { + + $scope.cyberpanelLoading = true; + $scope.logDetails = true; + + $scope.currentPage = 1; + $scope.recordsToShow = 10; + + $scope.fetchLogs = function () { + + $scope.cyberpanelLoading = false; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + logFile: $scope.logFile, + recordsToShow: $scope.recordsToShow, + page: $scope.currentPage + }; + + dataurl = "/backup/fetchLogs"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + $scope.logDetails = false; + $scope.logs = JSON.parse(response.data.logs); + $scope.pagination = response.data.pagination; + $scope.jobSuccessSites = response.data.jobSuccessSites; + $scope.jobFailedSites = response.data.jobFailedSites; + $scope.location = response.data.location; + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + +}); + +///** Backup site ends **/// diff --git a/backup/templates/backup/backupLogs.html b/backup/templates/backup/backupLogs.html new file mode 100755 index 000000000..0c7dadf49 --- /dev/null +++ b/backup/templates/backup/backupLogs.html @@ -0,0 +1,125 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Backup Logs - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + + {% get_current_language as LANGUAGE_CODE %} + + + +
    +
    +

    {% trans "Backup Logs" %}

    +

    {% trans "On this page you can view detailed logs of your local and remote scheduled backups." %}

    +
    + +
    +
    +

    + {% trans "Restore Website" %} +

    +
    + +
    + + +
    + +
    + +
    +
    + + + +
    +
    + +
    {% trans "Port" %} 110
    {% trans "Port" %}995 (SSL)
    {% trans "SSL" %} STARTTLS{% trans "Port" %} 143
    {% trans "Port" %}993 (SSL)
    {% trans "SSL" %} STARTTLS
    {% trans "Port" %}58725
    {% trans "Port" %}587 (SSL)
    {% trans "Port" %}465 (SSL)
    {% trans "SSL" %}
    + + + + + + + + + + + + + + +
    {% trans "Successful Sites" %}{% trans "Failed Sites" %}{% trans "Location" %}
    {$ jobSuccessSites $}{$ jobFailedSites $}{$ location $}
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + +
    {% trans "LEVEL" %}{% trans "Message" %}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + + +
    + + +{% endblock %} \ No newline at end of file diff --git a/backup/templates/backup/backupSchedule.html b/backup/templates/backup/backupSchedule.html index 69de37618..6fb11b5b5 100755 --- a/backup/templates/backup/backupSchedule.html +++ b/backup/templates/backup/backupSchedule.html @@ -11,7 +11,7 @@

    {% trans "Schedule Back up" %} - {% trans "Remote Backups" %}

    {% trans "On this page you can schedule Back ups to localhost or remote server (If you have added one)." %}

    @@ -20,8 +20,11 @@

    - {% trans "Schedule Back up" %} + {% trans "Schedule Back up" %} - {% trans "Backup Logs" %}

    diff --git a/backup/urls.py b/backup/urls.py index 0a7164ba2..9d09770a5 100755 --- a/backup/urls.py +++ b/backup/urls.py @@ -48,7 +48,7 @@ urlpatterns = [ url(r'^localInitiate$', views.localInitiate, name='localInitiate'), - - + url(r'^backupLogs$', views.backupLogs, name='backupLogs'), + url(r'^fetchLogs$', views.fetchLogs, name='fetchLogs'), ] \ No newline at end of file diff --git a/backup/views.py b/backup/views.py index ef8842283..bf6512c25 100755 --- a/backup/views.py +++ b/backup/views.py @@ -327,6 +327,23 @@ def cancelRemoteBackup(request): except KeyError: return redirect(loadLoginPage) +def backupLogs(request): + try: + userID = request.session['userID'] + bm = BackupManager() + return bm.backupLogs(request, userID) + except KeyError: + return redirect(loadLoginPage) + +def fetchLogs(request): + try: + userID = request.session['userID'] + + wm = BackupManager() + return wm.fetchLogs(userID, json.loads(request.body)) + + except KeyError: + return redirect(loadLoginPage) @csrf_exempt def localInitiate(request): diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index eba989f92..a6a420e8e 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -12,7 +12,7 @@ import os import time from plogical.backupUtilities import backupUtilities from re import match,I,M -from websiteFunctions.models import Backups +from websiteFunctions.models import Backups, BackupJob, BackupJobLogs from plogical.processUtilities import ProcessUtilities from random import randint import json, requests @@ -22,14 +22,22 @@ import signal class backupSchedule: now = datetime.now() + LOCAL = 0 + REMOTE = 1 + INFO = 0 + ERROR = 1 + backupLog = '' @staticmethod - def remoteBackupLogging(fileName, message): + def remoteBackupLogging(fileName, message, status = 0): try: file = open(fileName,'a') file.writelines("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message + "\n") print(("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message + "\n")) file.close() + + BackupJobLogs(owner=backupSchedule.backupLog, status=status, message="[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message).save() + except IOError as msg: return "Can not write to error file." @@ -120,18 +128,25 @@ class backupSchedule: except: pass - backupSchedule.remoteBackupLogging(backupLogPath, "An error occurred, Error message: " + status) + backupSchedule.remoteBackupLogging(backupLogPath, "Local backup creating failed for %s, Error message: %s" % (virtualHost, status), backupSchedule.ERROR) + try: os.remove(pathToFile) except: pass return 0, tempStoragePath + elif os.path.exists(schedulerPath): + backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed without reporting any error.', + backupSchedule.ERROR) os.remove(schedulerPath) return 0, 'Backup process killed without reporting any error.' except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [119:startBackup]") + backupSchedule.remoteBackupLogging(backupLogPath, + "Local backup creating failed for %s, Error message: %s" % ( + virtualHost, str(msg)), backupSchedule.ERROR) return 0, str(msg) @staticmethod diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 313594ffd..1fcee1aea 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -29,6 +29,12 @@ class backupScheduleLocal: backupRunTime = time.strftime("%m.%d.%Y_%H-%M-%S") backupLogPath = "/usr/local/lscp/logs/local_backup_log." + backupRunTime + jobSuccessSites = 0 + jobFailedSites = 0 + + backupSchedule.backupLog = BackupJob(logFile=backupLogPath, location=backupSchedule.LOCAL, jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites) + backupSchedule.backupLog.save() + writeToFile = open(backupLogPath, "a") backupSchedule.remoteBackupLogging(backupLogPath, "#################################################") @@ -43,6 +49,9 @@ class backupScheduleLocal: try: retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath) + if retValues[0] == 0: + continue + if os.path.exists(backupScheduleLocal.localBackupPath): backupPath = retValues[1] + ".tar.gz" localBackupPath = '%s/%s' % (open(backupScheduleLocal.localBackupPath, 'r').read().rstrip('/'), backupRunTime) @@ -52,10 +61,14 @@ class backupScheduleLocal: command = 'mv %s %s' % (backupPath, localBackupPath) ProcessUtilities.normalExecutioner(command) - except BaseException as msg: - backupSchedule.remoteBackupLogging(backupLogPath, - '[ERROR] Backup failed for %s, error: %s moving on..' % (virtualHost, str(msg))) + jobSuccessSites = jobSuccessSites + 1 + except BaseException as msg: + + jobFailedSites = jobFailedSites + 1 + + backupSchedule.remoteBackupLogging(backupLogPath, + '[ERROR] Backup failed for %s, error: %s moving on..' % (virtualHost, str(msg)), backupSchedule.ERROR) @@ -71,6 +84,11 @@ class backupScheduleLocal: writeToFile.close() + job = BackupJob.objects.get(logFile=backupLogPath) + job.jobFailedSites = jobFailedSites + job.jobSuccessSites = jobSuccessSites + job.save() + except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [214:startBackup]") diff --git a/serverStatus/views.py b/serverStatus/views.py index 33efa23f6..60e7bc850 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -93,7 +93,6 @@ def litespeedStatus(request): logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[litespeedStatus]") return redirect(loadLoginPage) - def stopOrRestartLitespeed(request): try: userID = request.session['userID'] @@ -127,7 +126,6 @@ def stopOrRestartLitespeed(request): logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[stopOrRestartLitespeed]") return HttpResponse("Not Logged in as admin") - def cyberCPMainLogFile(request): try: userID = request.session['userID'] @@ -145,7 +143,6 @@ def cyberCPMainLogFile(request): logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[cyberCPMainLogFile]") return redirect(loadLoginPage) - def getFurtherDataFromLogFile(request): try: userID = request.session['userID'] @@ -196,7 +193,6 @@ def services(request): except KeyError: return redirect(loadLoginPage) - def servicesStatus(request): try: userID = request.session['userID'] @@ -291,7 +287,6 @@ def servicesStatus(request): except KeyError: return redirect(loadLoginPage) - def servicesAction(request): try: userID = request.session['userID'] @@ -344,7 +339,6 @@ def servicesAction(request): final_json = json.dumps(final_dic) return HttpResponse(final_json) - def switchTOLSWS(request): try: userID = request.session['userID'] @@ -378,7 +372,6 @@ def switchTOLSWS(request): json_data = json.dumps(data_ret) return HttpResponse(json_data) - def switchTOLSWSStatus(request): try: diff --git a/static/backup/backup.js b/static/backup/backup.js index cbe74d8ef..59c654f87 100644 --- a/static/backup/backup.js +++ b/static/backup/backup.js @@ -1541,4 +1541,68 @@ app.controller('remoteBackupControl', function ($scope, $http, $timeout) { }); -///** Backup site ends **/// \ No newline at end of file +///** Backup site ends **/// + + +//*** Remote Backup site ****// +app.controller('backupLogsScheduled', function ($scope, $http, $timeout) { + + $scope.cyberpanelLoading = true; + $scope.logDetails = true; + + $scope.currentPage = 1; + $scope.recordsToShow = 10; + + $scope.fetchLogs = function () { + + $scope.cyberpanelLoading = false; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + logFile: $scope.logFile, + recordsToShow: $scope.recordsToShow, + page: $scope.currentPage + }; + + dataurl = "/backup/fetchLogs"; + + $http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberpanelLoading = true; + if (response.data.status === 1) { + $scope.logDetails = false; + $scope.logs = JSON.parse(response.data.logs); + $scope.pagination = response.data.pagination; + $scope.jobSuccessSites = response.data.jobSuccessSites; + $scope.jobFailedSites = response.data.jobFailedSites; + $scope.location = response.data.location; + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + function cantLoadInitialData(response) { + $scope.cyberpanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + +}); + +///** Backup site ends **/// From df4cea0ebb0a10f2f36f373d9bd046a8a155fe7a Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 22 May 2020 16:03:49 +0500 Subject: [PATCH 091/121] prevent local backup from running multiple processes --- plogical/backupSchedule.py | 7 +++++++ plogical/backupScheduleLocal.py | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index a6a420e8e..6c8f85af0 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -228,6 +228,13 @@ class backupSchedule: backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%m.%d.%Y_%H-%M-%S") + jobSuccessSites = 0 + jobFailedSites = 0 + + backupSchedule.backupLog = BackupJob(logFile=backupLogPath, location=backupSchedule.REMOTE, + jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites) + backupSchedule.backupLog.save() + backupSchedule.remoteBackupLogging(backupLogPath,"#################################################") backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S")) backupSchedule.remoteBackupLogging(backupLogPath,"#################################################\n") diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 1fcee1aea..d37b1bb43 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -21,11 +21,22 @@ from websiteFunctions.models import BackupJob, BackupJobLogs class backupScheduleLocal: localBackupPath = '/home/cyberpanel/localBackupPath' + runningPath = '/home/cyberpanel/localBackupPID' now = datetime.now() @staticmethod def prepare(): try: + + if os.path.exists(backupScheduleLocal.runningPath): + pid = open(backupScheduleLocal.runningPath, 'r').read() + print('Local backup is already running with PID: %s. If you want to run againly kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) + return 0 + + writeToFile = open(backupScheduleLocal.runningPath, 'w') + writeToFile.write(str(os.getpid())) + writeToFile.close() + backupRunTime = time.strftime("%m.%d.%Y_%H-%M-%S") backupLogPath = "/usr/local/lscp/logs/local_backup_log." + backupRunTime @@ -70,8 +81,6 @@ class backupScheduleLocal: backupSchedule.remoteBackupLogging(backupLogPath, '[ERROR] Backup failed for %s, error: %s moving on..' % (virtualHost, str(msg)), backupSchedule.ERROR) - - backupSchedule.remoteBackupLogging(backupLogPath, "") backupSchedule.remoteBackupLogging(backupLogPath, "") @@ -89,6 +98,9 @@ class backupScheduleLocal: job.jobSuccessSites = jobSuccessSites job.save() + if os.path.exists(backupScheduleLocal.runningPath): + os.remove(backupScheduleLocal.runningPath) + except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [214:startBackup]") From 79aa5d4c271496f81e35ca459bfd56ef53635b30 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 22 May 2020 16:11:32 +0500 Subject: [PATCH 092/121] add similar logs for remote schedule backups --- plogical/backupSchedule.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index 6c8f85af0..91a5c452e 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -27,6 +27,7 @@ class backupSchedule: INFO = 0 ERROR = 1 backupLog = '' + runningPath = '/home/cyberpanel/remoteBackupPID' @staticmethod def remoteBackupLogging(fileName, message, status = 0): @@ -183,6 +184,8 @@ class backupSchedule: backupSchedule.remoteBackupLogging(backupLogPath, "") else: + backupSchedule.remoteBackupLogging(backupLogPath, 'Remote backup creation failed for %s.' % (virtualHost) ) + backupSchedule.remoteBackupLogging(backupLogPath, "") backupSchedule.remoteBackupLogging(backupLogPath, "") @@ -224,16 +227,21 @@ class backupSchedule: @staticmethod def prepare(): try: + + if os.path.exists(backupSchedule.runningPath): + pid = open(backupSchedule.runningPath, 'r').read() + print('Remote backup is already running with PID: %s. If you want to run againly kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) + return 0 + + writeToFile = open(backupSchedule.runningPath, 'w') + writeToFile.write(str(os.getpid())) + writeToFile.close() + + destinations = backupUtilities.destinationsPath backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%m.%d.%Y_%H-%M-%S") - jobSuccessSites = 0 - jobFailedSites = 0 - - backupSchedule.backupLog = BackupJob(logFile=backupLogPath, location=backupSchedule.REMOTE, - jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites) - backupSchedule.backupLog.save() backupSchedule.remoteBackupLogging(backupLogPath,"#################################################") backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S")) @@ -255,6 +263,13 @@ class backupSchedule: ipAddress = data['ipAddress'] + jobSuccessSites = 0 + jobFailedSites = 0 + + backupSchedule.backupLog = BackupJob(logFile=backupLogPath, location=backupSchedule.REMOTE, + jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites, ipAddress=ipAddress, port=port) + backupSchedule.backupLog.save() + ## IPAddress of local server ipFile = "/etc/cyberpanel/machineIP" @@ -287,7 +302,8 @@ class backupSchedule: backupSchedule.remoteBackupLogging(backupLogPath, "Remote backup job completed.\n") - + if os.path.exists(backupSchedule.runningPath): + os.remove(backupSchedule.runningPath) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [prepare]") From 8dae110a9ce1d02173b7afa5f4c85300a1ba556e Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 22 May 2020 16:57:44 +0500 Subject: [PATCH 093/121] bug fix: schedule backup logs --- plogical/backupSchedule.py | 31 ++++++++++++++++--------------- plogical/backupScheduleLocal.py | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index 91a5c452e..0227aed6d 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -230,26 +230,13 @@ class backupSchedule: if os.path.exists(backupSchedule.runningPath): pid = open(backupSchedule.runningPath, 'r').read() - print('Remote backup is already running with PID: %s. If you want to run againly kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) + print('\n\nRemote backup is already running with PID: %s. If you want to run again kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) return 0 writeToFile = open(backupSchedule.runningPath, 'w') writeToFile.write(str(os.getpid())) writeToFile.close() - - destinations = backupUtilities.destinationsPath - - backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%m.%d.%Y_%H-%M-%S") - - - backupSchedule.remoteBackupLogging(backupLogPath,"#################################################") - backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S")) - backupSchedule.remoteBackupLogging(backupLogPath,"#################################################\n") - - backupSchedule.remoteBackupLogging(backupLogPath, "") - backupSchedule.remoteBackupLogging(backupLogPath, "") - ## IP of Remote server. destinations = backupUtilities.destinationsPath @@ -266,10 +253,24 @@ class backupSchedule: jobSuccessSites = 0 jobFailedSites = 0 + backupLogPath = "/usr/local/lscp/logs/backup_log." + time.strftime("%m.%d.%Y_%H-%M-%S") + backupSchedule.backupLog = BackupJob(logFile=backupLogPath, location=backupSchedule.REMOTE, - jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites, ipAddress=ipAddress, port=port) + jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites, + ipAddress=ipAddress, port=port) backupSchedule.backupLog.save() + + destinations = backupUtilities.destinationsPath + + + backupSchedule.remoteBackupLogging(backupLogPath,"#################################################") + backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S")) + backupSchedule.remoteBackupLogging(backupLogPath,"#################################################\n") + + backupSchedule.remoteBackupLogging(backupLogPath, "") + backupSchedule.remoteBackupLogging(backupLogPath, "") + ## IPAddress of local server ipFile = "/etc/cyberpanel/machineIP" diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index d37b1bb43..3a69f20fa 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -30,7 +30,7 @@ class backupScheduleLocal: if os.path.exists(backupScheduleLocal.runningPath): pid = open(backupScheduleLocal.runningPath, 'r').read() - print('Local backup is already running with PID: %s. If you want to run againly kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) + print('\n\nLocal backup is already running with PID: %s. If you want to run again kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) return 0 writeToFile = open(backupScheduleLocal.runningPath, 'w') From d71b3045bb04211b42d2c01c63958506f8f8ebaa Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 22 May 2020 22:02:40 +0500 Subject: [PATCH 094/121] bug fix: fix text --- backup/templates/backup/backupLogs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/templates/backup/backupLogs.html b/backup/templates/backup/backupLogs.html index 0c7dadf49..2736eddef 100755 --- a/backup/templates/backup/backupLogs.html +++ b/backup/templates/backup/backupLogs.html @@ -18,7 +18,7 @@

    - {% trans "Restore Website" %} + {% trans "Backup Logs" %}

    From ca1d507ac242439afbe4e3930477860bd02abf49 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 23 May 2020 01:41:06 +0500 Subject: [PATCH 095/121] bug fix: https://github.com/usmannasir/cyberpanel/issues/346 --- manageServices/serviceManager.py | 16 ++++++----- .../manageServices/managePowerDNS.html | 18 ++++++------- manageServices/views.py | 27 ++++++++++++++++--- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/manageServices/serviceManager.py b/manageServices/serviceManager.py index c37468a3b..877c30472 100755 --- a/manageServices/serviceManager.py +++ b/manageServices/serviceManager.py @@ -30,8 +30,8 @@ class ServiceManager: ipsString = ipsString.rstrip(' ') ipStringNoSubnet = ipStringNoSubnet.rstrip(' ') - - + tempPath = "/home/cyberpanel/" + str(randint(1000, 9999)) + writeToFile = open(tempPath, 'w') for items in data: if items.find('allow-axfr-ips') > -1: @@ -49,14 +49,14 @@ class ServiceManager: if items.find('slave') > -1: continue + if items.find('master') > -1: + continue + counter = counter + 1 - tempPath = "/home/cyberpanel/" + str(randint(1000, 9999)) - writeToFile = open(tempPath, 'w') - - for items in data: writeToFile.writelines(items + '\n') + writeToFile.writelines('allow-axfr-ips=' + ipsString + '\n') writeToFile.writelines('also-notify=' + ipStringNoSubnet + '\n') writeToFile.writelines('daemon=no\n') @@ -82,6 +82,9 @@ class ServiceManager: if items.find('slave') > -1: continue + if items.find('slave=yes') > 1: + return 0 + counter = counter + 1 tempPath = "/home/cyberpanel/" + str(randint(1000, 9999)) @@ -112,6 +115,5 @@ superslave=yes Supermasters(ip=self.extraArgs['masterServerIP'], nameserver=self.extraArgs['slaveServerNS'], account='').save() command = 'sudo mv ' + tempPath + ' ' + path - #subprocess.call(shlex.split(command)) ProcessUtilities.executioner(command) diff --git a/manageServices/templates/manageServices/managePowerDNS.html b/manageServices/templates/manageServices/managePowerDNS.html index 685f53474..013dd0533 100755 --- a/manageServices/templates/manageServices/managePowerDNS.html +++ b/manageServices/templates/manageServices/managePowerDNS.html @@ -51,57 +51,57 @@
    -
    +
    -
    +
    -
    +
    -
    +
    -
    +
    -
    +
    -
    +
    -
    - +
    +
    diff --git a/manageServices/views.py b/manageServices/views.py index 1facec6a0..b95965ed6 100755 --- a/manageServices/views.py +++ b/manageServices/views.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- - from django.shortcuts import render from django.shortcuts import HttpResponse, redirect import plogical.CyberCPLogFileWriter as logging @@ -14,19 +13,41 @@ from .serviceManager import ServiceManager from plogical.processUtilities import ProcessUtilities # Create your views here. - def managePowerDNS(request): try: userID = request.session['userID'] currentACL = ACLManager.loadedACL(userID) + if currentACL['admin'] == 1: pass else: return ACLManager.loadError() try: - return render(request, 'manageServices/managePowerDNS.html', {"status": 1}) + data = {} + data['status'] = 1 + + pdnsStatus = PDNSStatus.objects.get(pk=1) + + if pdnsStatus.type == 'MASTER': + counter = 1 + + for items in SlaveServers.objects.all(): + + if counter == 1: + data['slaveServer'] = items.slaveServer + data['slaveServerIP'] = items.slaveServerIP + else: + data['slaveServer%s' % (str(counter))] = items.slaveServer + data['slaveServerIP%s' % (str(counter))] = items.slaveServerIP + + counter = counter + 1 + else: + data['slaveServerNS'] = pdnsStatus.masterServer + data['masterServerIP'] = pdnsStatus.masterIP + + return render(request, 'manageServices/managePowerDNS.html', data) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg)) return HttpResponse("See CyberCP main log file.") From bb63e366030b2f8b5053cb7d0e4502888b25a2c7 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 23 May 2020 01:57:30 +0500 Subject: [PATCH 096/121] bug fix: https://github.com/usmannasir/cyberpanel/issues/346 --- manageServices/serviceManager.py | 73 +++++++++++++++++--------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/manageServices/serviceManager.py b/manageServices/serviceManager.py index 877c30472..27917605a 100755 --- a/manageServices/serviceManager.py +++ b/manageServices/serviceManager.py @@ -6,6 +6,8 @@ from manageServices.models import SlaveServers class ServiceManager: + slaveConfPath = '/home/cyberpanel/slaveConf' + def __init__(self, extraArgs): self.extraArgs = extraArgs @@ -64,50 +66,55 @@ class ServiceManager: writeToFile.writelines('master=yes\n') writeToFile.close() else: - counter = 0 + import os - for items in data: - if items.find('allow-axfr-ips') > -1: - continue + if not os.path.exists(ServiceManager.slaveConfPath): - if items.find('also-notify') > -1: - continue + writeToFile = open(ServiceManager.slaveConfPath, 'w') + writeToFile.write('configured') + writeToFile.close() - if items.find('daemon=') > -1: - continue + counter = 0 - if items.find('disable-axfr') > -1: - continue + for items in data: + if items.find('allow-axfr-ips') > -1: + continue - if items.find('slave') > -1: - continue + if items.find('also-notify') > -1: + continue - if items.find('slave=yes') > 1: - return 0 + if items.find('daemon=') > -1: + continue - counter = counter + 1 + if items.find('disable-axfr') > -1: + continue - tempPath = "/home/cyberpanel/" + str(randint(1000, 9999)) - writeToFile = open(tempPath, 'w') + if items.find('slave') > -1: + continue - for items in data: - writeToFile.writelines(items + '\n') + counter = counter + 1 - slaveData = """slave=yes -daemon=yes -disable-axfr=yes -guardian=yes -local-address=0.0.0.0 -local-port=53 -master=no -slave-cycle-interval=60 -setgid=pdns -setuid=pdns -superslave=yes -""" + tempPath = "/home/cyberpanel/" + str(randint(1000, 9999)) + writeToFile = open(tempPath, 'w') - writeToFile.writelines(slaveData) - writeToFile.close() + for items in data: + writeToFile.writelines(items + '\n') + + slaveData = """slave=yes + daemon=yes + disable-axfr=yes + guardian=yes + local-address=0.0.0.0 + local-port=53 + master=no + slave-cycle-interval=60 + setgid=pdns + setuid=pdns + superslave=yes + """ + + writeToFile.writelines(slaveData) + writeToFile.close() for items in Supermasters.objects.all(): items.delete() From 6a6d3261836f7c59481571e55c7823415ebfd6d7 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 23 May 2020 02:04:02 +0500 Subject: [PATCH 097/121] bug fix: https://github.com/usmannasir/cyberpanel/issues/346 --- manageServices/serviceManager.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/manageServices/serviceManager.py b/manageServices/serviceManager.py index 27917605a..4823be81d 100755 --- a/manageServices/serviceManager.py +++ b/manageServices/serviceManager.py @@ -100,27 +100,28 @@ class ServiceManager: for items in data: writeToFile.writelines(items + '\n') - slaveData = """slave=yes - daemon=yes - disable-axfr=yes - guardian=yes - local-address=0.0.0.0 - local-port=53 - master=no - slave-cycle-interval=60 - setgid=pdns - setuid=pdns - superslave=yes - """ + slaveData = """ +slave=yes +daemon=yes +disable-axfr=yes +guardian=yes +local-address=0.0.0.0 +local-port=53 +master=no +slave-cycle-interval=60 +setgid=pdns +setuid=pdns +superslave=yes +""" writeToFile.writelines(slaveData) writeToFile.close() + command = 'sudo mv ' + tempPath + ' ' + path + ProcessUtilities.executioner(command) + for items in Supermasters.objects.all(): items.delete() Supermasters(ip=self.extraArgs['masterServerIP'], nameserver=self.extraArgs['slaveServerNS'], account='').save() - command = 'sudo mv ' + tempPath + ' ' + path - ProcessUtilities.executioner(command) - From 00bfaa1bb391815cf18e807d8742380bcd56370d Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 23 May 2020 18:17:55 +0500 Subject: [PATCH 098/121] bug fix: https://github.com/usmannasir/cyberpanel/issues/347 --- manageServices/serviceManager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manageServices/serviceManager.py b/manageServices/serviceManager.py index 4823be81d..05ef80e92 100755 --- a/manageServices/serviceManager.py +++ b/manageServices/serviceManager.py @@ -26,11 +26,11 @@ class ServiceManager: ipStringNoSubnet = '' for items in SlaveServers.objects.all(): - ipsString = ipsString + '%s/32 ' % (items.slaveServerIP) - ipStringNoSubnet = ipStringNoSubnet + '%s ' % (items.slaveServerIP) + ipsString = ipsString + '%s/32, ' % (items.slaveServerIP) + ipStringNoSubnet = ipStringNoSubnet + '%s, ' % (items.slaveServerIP) - ipsString = ipsString.rstrip(' ') - ipStringNoSubnet = ipStringNoSubnet.rstrip(' ') + ipsString = ipsString.rstrip(', ') + ipStringNoSubnet = ipStringNoSubnet.rstrip(', ') tempPath = "/home/cyberpanel/" + str(randint(1000, 9999)) writeToFile = open(tempPath, 'w') From b5aa5b4def12b8d448051a4a41d233204d22e7a9 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sat, 23 May 2020 15:24:56 +0100 Subject: [PATCH 099/121] Update mailscannerinstaller.sh Updated for Ubuntu 20.04 --- CPScripts/mailscannerinstaller.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/CPScripts/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh index 927d0203e..39288c5a1 100644 --- a/CPScripts/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -27,6 +27,7 @@ fi if [ -f /etc/os-release ];then OS=$(head -1 /etc/os-release) +VERSION=$(sed '6q;d' /etc/os-release) fi if [ "$OS" = "NAME=\"CentOS Linux\"" ];then @@ -61,9 +62,9 @@ fi elif [ "$OS" = "NAME=\"Ubuntu\"" ];then -apt-get install -y libmysqlclient-dev + apt-get install -y libmysqlclient-dev -apt-get install -y cpanminus gcc perl bzip2 zip make patch automake rpm libarchive-zip-perl libfilesys-df-perl libole-storage-lite-perl libsys-hostname-long-perl libsys-sigaction-perl libregexp-common-net-cidr-perl libmime-tools-perl libdbd-sqlite3-perl binutils build-essential libfilesys-df-perl zlib1g unzip mlocate clamav libdbd-mysql-perl unrar libclamav-dev libclamav-client-perl libclamunrar9 + apt-get install -y cpanminus gcc perl bzip2 zip make patch automake rpm libarchive-zip-perl libfilesys-df-perl libole-storage-lite-perl libsys-hostname-long-perl libsys-sigaction-perl libregexp-common-net-cidr-perl libmime-tools-perl libdbd-sqlite3-perl binutils build-essential libfilesys-df-perl zlib1g unzip mlocate clamav libdbd-mysql-perl unrar libclamav-dev libclamav-client-perl libclamunrar9 cpanm Encoding::FixLatin cpanm Digest::SHA1 @@ -198,19 +199,23 @@ IPADDRESS=$(cat /etc/cyberpanel/machineIP) echo 'Setting up spamassassin and sieve to deliver spam to Junk folder by default' #echo "If you wish mailscanner/spamassassin to send spam email to a spam folder please follow the tutorial on the Cyberpanel Website" echo 'Fix protocols' -sed -i 's/^protocols =.*/protocols = imap pop3 sieve/g' /etc/dovecot/dovecot.conf +sed -i 's/^protocols =.*/protocols = imap pop3 lmtp sieve/g' /etc/dovecot/dovecot.conf sed -i "s|^user_query.*|user_query = SELECT '5000' as uid, '5000' as gid, '/home/vmail/%d/%n' as home,mail FROM e_users WHERE email='%u';|g" /etc/dovecot/dovecot-sql.conf.ext if [ "$OS" = "NAME=\"Ubuntu\"" ];then - - apt-get install -y dovecot-managesieved dovecot-sieve net-tools pflogsumm +if [ "$VERSION" = "VERSION_ID=\"18.04\"" ];then + apt-get install -y dovecot-managesieved dovecot-sieve dovecot-lmtpd net-tools pflogsumm +elif [ "$VERSION" = "VERSION_ID=\"20.04\"" ];then + apt-get install -y libmysqlclient-dev + sed -e '/deb/ s/^#*/#/' -i /etc/apt/sources.list.d/dovecot.list + apt install -y dovecot-lmtpd dovecot-managesieved dovecot-sieve net-tools pflogsumm +fi elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then - yum install -y nano net-tools dovecot-pigeonhole postfix-perl-scripts - + yum install -y nano net-tools dovecot-pigeonhole postfix-perl-scripts fi @@ -276,6 +281,7 @@ postmaster_address=$(grep postmaster_address /etc/dovecot/dovecot.conf | sed 's sed -i "s|postmaster@example.com|$postmaster_address|g" /etc/dovecot/dovecot.conf sed -i "s|server.example.com|$hostname|g" /etc/dovecot/dovecot.conf +sed -i "s|postmaster@example.com|$postmaster_address|g" /etc/dovecot/dovecot.conf #Sieve the global spam filter sievec /etc/dovecot/sieve/default.sieve From 84beb8eb695cb832563ade62a8254c596014a441 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:17:25 +0100 Subject: [PATCH 100/121] Update dockerInstall.py centos8 --- dockerManager/dockerInstall.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockerManager/dockerInstall.py b/dockerManager/dockerInstall.py index 8b5220169..83589ad27 100755 --- a/dockerManager/dockerInstall.py +++ b/dockerManager/dockerInstall.py @@ -18,7 +18,9 @@ class DockerInstall: logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Starting Docker Installation..\n", 1) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + command = 'sudo dnf install -y docker-ce --nobest' + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: command = 'sudo yum install -y docker' else: command = 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io' From d1301168a2d23d8f3a4cf5cd31f5234043459351 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:20:17 +0100 Subject: [PATCH 101/121] Update applicationInstaller.py centos8 --- plogical/applicationInstaller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index c4e26a75b..6a438fd43 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -82,7 +82,7 @@ class ApplicationInstaller(multi.Thread): f.write(ProcessUtilities.outputExecutioner(command)) f.close() - elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: if package == 'all': command = 'yum update -y' f.write(ProcessUtilities.outputExecutioner(command)) @@ -414,7 +414,7 @@ class ApplicationInstaller(multi.Thread): homeDir = "/home/" + domainName + "/public_html" - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' @@ -590,7 +590,7 @@ class ApplicationInstaller(multi.Thread): homeDir = "/home/" + domainName + "/public_html" - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' @@ -750,7 +750,7 @@ class ApplicationInstaller(multi.Thread): shutil.rmtree(finalPath + "installation") - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' @@ -776,7 +776,7 @@ class ApplicationInstaller(multi.Thread): homeDir = "/home/" + domainName + "/public_html" - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' @@ -964,7 +964,7 @@ class ApplicationInstaller(multi.Thread): homeDir = "/home/" + domainName + "/public_html" - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' From 8e9a723d4282f716cd5fac1d83aebd8b7f853ad9 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:22:37 +0100 Subject: [PATCH 102/121] Update cronUtil.py centos 8 --- plogical/cronUtil.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plogical/cronUtil.py b/plogical/cronUtil.py index 120f6c06a..25f49e12c 100755 --- a/plogical/cronUtil.py +++ b/plogical/cronUtil.py @@ -9,7 +9,7 @@ class CronUtil: def getWebsiteCron(externalApp): try: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: cronPath = "/var/spool/cron/" + externalApp else: cronPath = "/var/spool/cron/crontabs/" + externalApp @@ -29,7 +29,7 @@ class CronUtil: try: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: cronPath = "/var/spool/cron/" + externalApp else: cronPath = "/var/spool/cron/crontabs/" + externalApp @@ -51,7 +51,7 @@ class CronUtil: try: line -= 1 - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: cronPath = "/var/spool/cron/" + externalApp else: cronPath = "/var/spool/cron/crontabs/" + externalApp @@ -81,7 +81,7 @@ class CronUtil: @staticmethod def addNewCron(externalApp, finalCron): try: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: cronPath = "/var/spool/cron/" + externalApp else: cronPath = "/var/spool/cron/crontabs/" + externalApp From f261b1f506d45ae0243aa425e0b70c3c3a419602 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:23:55 +0100 Subject: [PATCH 103/121] Update csf.py centos 8 --- plogical/csf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/csf.py b/plogical/csf.py index 7b2bee78e..cb4a1d9f7 100755 --- a/plogical/csf.py +++ b/plogical/csf.py @@ -70,7 +70,7 @@ class CSF(multi.Thread): ProcessUtilities.normalExecutioner(command) # install required packages for CSF perl and /usr/bin/host - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'yum install bind-utils net-tools perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph ipset -y' ProcessUtilities.normalExecutioner(command) elif ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: From 55ad650db92b581262dfb225dde5606493a0474b Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:26:15 +0100 Subject: [PATCH 104/121] Update firewallUtilities.py centos 8 --- plogical/firewallUtilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/firewallUtilities.py b/plogical/firewallUtilities.py index f47b74205..db945d2f6 100755 --- a/plogical/firewallUtilities.py +++ b/plogical/firewallUtilities.py @@ -17,7 +17,7 @@ class FirewallUtilities: def resFailed(res): if (ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20) and res != 0: return True - elif ProcessUtilities.decideDistro() == ProcessUtilities.centos and res == 1: + elif (ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8) and res == 1: return True return False From fa9e92f4b43875af8aad095ed6cef9ece9fb0808 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:29:22 +0100 Subject: [PATCH 105/121] Update mailUtilities.py centos 8 --- plogical/mailUtilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index ca17dc3ed..812b5317a 100755 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -225,7 +225,7 @@ class mailUtilities: ## Generate keys - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = "/usr/sbin/opendkim-genkey -D /etc/opendkim/keys/%s -d %s -s default" % (virtualHostName, virtualHostName) else: command = "opendkim-genkey -D /etc/opendkim/keys/%s -d %s -s default" % ( @@ -449,7 +449,7 @@ milter_default_action = accept def installSpamAssassin(install, SpamAssassin): try: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo yum install spamassassin -y' else: command = 'sudo apt-get install spamassassin spamc -y' From c60d2370bbbc88fbe22ee0a99a2a8f3c21b90f72 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:31:07 +0100 Subject: [PATCH 106/121] Update modSec.py centos 8 --- plogical/modSec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/modSec.py b/plogical/modSec.py index 6c4e86c6f..e242d4035 100755 --- a/plogical/modSec.py +++ b/plogical/modSec.py @@ -24,7 +24,7 @@ class modSec: mailUtilities.checkHome() - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo yum install ols-modsecurity -y' else: command = 'sudo DEBIAN_FRONTEND=noninteractive apt-get install ols-modsecurity -y' From 0d8b3729b5616d7c2679d648d395281d4276de48 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:32:18 +0100 Subject: [PATCH 107/121] Update mysqlUtilities.py centos 8 --- plogical/mysqlUtilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plogical/mysqlUtilities.py b/plogical/mysqlUtilities.py index fa06f8fac..bb17f36e7 100755 --- a/plogical/mysqlUtilities.py +++ b/plogical/mysqlUtilities.py @@ -413,7 +413,7 @@ password=%s def applyMySQLChanges(data): try: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo mv /etc/my.cnf /etc/my.cnf.bak' else: command = 'sudo mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak' @@ -430,7 +430,7 @@ password=%s writeToFile.close() ## - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo mv ' + tempPath + ' /etc/my.cnf' else: command = 'sudo mv ' + tempPath + ' /etc/mysql/my.cnf' @@ -440,7 +440,7 @@ password=%s return 1, None except BaseException as msg: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo mv /etc/my.cnf.bak /etc/my.cnf' else: command = 'sudo mv /etc/mysql/my.cnf.bak /etc/mysql//my.cnf' From 2625d5f27b9734610f934ba1a4e02ddc2022edb9 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:34:08 +0100 Subject: [PATCH 108/121] Update phpUtilities.py centos 8 --- plogical/phpUtilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index e1518a7d9..8e69569ef 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -20,7 +20,7 @@ class phpUtilities: mailUtilities.checkHome() - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo yum install ' + extension + ' -y' else: command = 'sudo apt-get install ' + extension + ' -y' @@ -54,7 +54,7 @@ class phpUtilities: mailUtilities.checkHome() - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'sudo rpm --nodeps -e ' + extension + ' -v' else: command = 'sudo apt-get remove -y ' + extension @@ -103,7 +103,7 @@ class phpUtilities: command = 'touch %s' % (serverLevelPHPRestart) ProcessUtilities.executioner(command) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini" else: initial = phpVers[3] From 50ee7d825a13f5cc221e23e7f794c13100d547cc Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:38:37 +0100 Subject: [PATCH 109/121] Update vhost.py centos 8 --- plogical/vhost.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plogical/vhost.py b/plogical/vhost.py index 8d8eef190..556dc5960 100755 --- a/plogical/vhost.py +++ b/plogical/vhost.py @@ -91,7 +91,7 @@ class vhost: try: os.makedirs(pathHTML) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities. or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' @@ -112,7 +112,7 @@ class vhost: try: os.makedirs(pathLogs) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' @@ -403,7 +403,7 @@ class vhost: ## - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'userdel -r -f %s' % (externalApp) else: command = 'deluser %s' % (externalApp) @@ -468,7 +468,7 @@ class vhost: ## - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'userdel -r -f %s' % (externalApp) else: command = 'deluser %s' % (externalApp) @@ -848,7 +848,7 @@ class vhost: try: os.makedirs(path) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' From 2034311e155f68a1fa0e5cfb48ab75781c8fb070 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:46:21 +0100 Subject: [PATCH 110/121] Update views.py centos 8 --- managePHP/views.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/managePHP/views.py b/managePHP/views.py index 4ef3a6ecc..887719155 100755 --- a/managePHP/views.py +++ b/managePHP/views.py @@ -1085,7 +1085,7 @@ def installExtensions(request): phpPath = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8 phpPath = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php70.xml') else: phpPath = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp70.xml') @@ -1116,7 +1116,7 @@ def installExtensions(request): phpPath = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: phpPath = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php71.xml') else: phpPath = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp71.xml') @@ -1144,7 +1144,7 @@ def installExtensions(request): php72Path = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: php72Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php72.xml') else: php72Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp72.xml') @@ -1172,7 +1172,7 @@ def installExtensions(request): php73Path = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: php73Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php73.xml') else: php73Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp73.xml') @@ -1200,7 +1200,7 @@ def installExtensions(request): php74Path = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: php74Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php74.xml') else: php74Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp74.xml') @@ -1344,7 +1344,7 @@ def getRequestStatus(request): checkCommand = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: checkCommand = 'yum list installed' checkCommand = shlex.split(checkCommand) else: @@ -1469,7 +1469,7 @@ def getRequestStatusApache(request): checkCommand = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: checkCommand = 'yum list installed' checkCommand = shlex.split(checkCommand) else: @@ -1607,7 +1607,7 @@ def getCurrentPHPConfig(request): phpVers = "php" + PHPManager.getPHPString(phpVers) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini" else: initial = phpVers[3] @@ -1767,7 +1767,7 @@ def getCurrentAdvancedPHPConfig(request): phpVers = "php" + PHPManager.getPHPString(phpVers) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini" else: initial = phpVers[3] @@ -1809,7 +1809,7 @@ def savePHPConfigAdvance(request): phpVers = "php" + PHPManager.getPHPString(phpVers) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini" else: initial = phpVers[3] From 95350179b11773ec1f539132f82335160c48728b Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:51:14 +0100 Subject: [PATCH 111/121] Update cloudManager.py centos 8 --- cloudAPI/cloudManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudAPI/cloudManager.py b/cloudAPI/cloudManager.py index d6c9058de..ffab613c2 100755 --- a/cloudAPI/cloudManager.py +++ b/cloudAPI/cloudManager.py @@ -1080,7 +1080,7 @@ class CloudManager: finalData['ramInGB'] = inGB - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: finalData['conf'] = ProcessUtilities.outputExecutioner('sudo cat /etc/my.cnf') else: finalData['conf'] = ProcessUtilities.outputExecutioner('sudo cat /etc/mysql/my.cnf') From 30b874726077f6a563f62ee4d0ef90c21155e958 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 10:59:01 +0100 Subject: [PATCH 112/121] Update haManager.py centos 8 --- highAvailability/haManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highAvailability/haManager.py b/highAvailability/haManager.py index 077ada262..dcda19b6d 100755 --- a/highAvailability/haManager.py +++ b/highAvailability/haManager.py @@ -36,7 +36,7 @@ class HAManager(multi.Thread): def setupNode(self): try: - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: mesg = 'Clusters are only supported on Ubuntu 18.04. [404]' logging.statusWriter(self.data['tempStatusPath'], mesg) return 0 From 2fa71aef7914e1b9cb5c8ae3e4a7d20c882206df Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 11:02:56 +0100 Subject: [PATCH 113/121] Update pure-ftpd.conf centos 8 --- install/pure-ftpd/pure-ftpd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/pure-ftpd/pure-ftpd.conf b/install/pure-ftpd/pure-ftpd.conf index 1c0af0529..299252b61 100755 --- a/install/pure-ftpd/pure-ftpd.conf +++ b/install/pure-ftpd/pure-ftpd.conf @@ -18,7 +18,7 @@ MaxLoad 4 AntiWarez yes Umask 133:022 MinUID 1000 -UseFtpUsers no +#UseFtpUsers no AllowUserFXP no AllowAnonymousFXP no ProhibitDotFilesWrite no From f6d69e003f6cb20b355dcd46a1309a0386a7d767 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 11:10:01 +0100 Subject: [PATCH 114/121] Update views.py centos 8 --- serverLogs/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverLogs/views.py b/serverLogs/views.py index b2f1a738b..553e1382d 100755 --- a/serverLogs/views.py +++ b/serverLogs/views.py @@ -131,12 +131,12 @@ def getLogsFromFile(request): elif type == "error": fileName = installUtilities.Server_root_path + "/logs/error.log" elif type == "email": - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: fileName = "/var/log/maillog" else: fileName = "/var/log/mail.log" elif type == "ftp": - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: fileName = "/var/log/messages" else: fileName = "/var/log/syslog" From 479152e3776f99f92567ca07a5369635b3bebd8b Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 11:11:55 +0100 Subject: [PATCH 115/121] Update views.py centos 8 --- serverStatus/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serverStatus/views.py b/serverStatus/views.py index 60e7bc850..1ec698044 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -748,7 +748,7 @@ def fetchPackages(request): packages = upgradePackages - elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: ### Check Package Lock status @@ -888,7 +888,7 @@ def fetchPackages(request): json_data = json_data + ',' + json.dumps(dic) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile('[ERROR] %s. [fetchPackages:773]' % (str(msg))) - elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: try: if type == 'installed' or type == 'upgrade': @@ -973,7 +973,7 @@ def fetchPackageDetails(request): if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: command = 'apt-cache show %s' % (package) packageDetails = ProcessUtilities.outputExecutioner(command) - elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: command = 'yum info %s' % (package) packageDetails = ProcessUtilities.outputExecutioner(command) @@ -1049,7 +1049,7 @@ def lockStatus(request): command = 'apt-mark hold %s' % (package) ProcessUtilities.executioner(command) - elif ProcessUtilities.decideDistro() == ProcessUtilities.centos: + elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: package = package.split('.')[0] From fa84f29e9747f6f5da563102432b0d320afa9f5c Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 11:14:35 +0100 Subject: [PATCH 116/121] Update website.py centos 8 --- websiteFunctions/website.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 67d26aeb8..f4ee953e0 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -1367,7 +1367,7 @@ class WebsiteManager: CronUtil.CronPrem(0) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: cronPath = "/var/spool/cron/" + website.externalApp else: cronPath = "/var/spool/cron/crontabs/" + website.externalApp @@ -1586,7 +1586,7 @@ class WebsiteManager: website = Websites.objects.get(domain=self.domain) - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: cronPath = "/var/spool/cron/" + website.externalApp else: cronPath = "/var/spool/cron/crontabs/" + website.externalApp From ae671ec04d25a9ab34eec830a21a752b662e36e5 Mon Sep 17 00:00:00 2001 From: hennaboy Date: Sun, 24 May 2020 13:26:01 +0100 Subject: [PATCH 117/121] Update mailscannerinstaller.sh Centos 8 --- CPScripts/mailscannerinstaller.sh | 55 ++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/CPScripts/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh index 39288c5a1..f91acaa7c 100644 --- a/CPScripts/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -27,17 +27,17 @@ fi if [ -f /etc/os-release ];then OS=$(head -1 /etc/os-release) -VERSION=$(sed '6q;d' /etc/os-release) +UBUNTUVERSION=$(sed '6q;d' /etc/os-release) +CENTOSVERSION=$(sed '5q;d' /etc/os-release) fi -if [ "$OS" = "NAME=\"CentOS Linux\"" ];then +if [ "$CENTOSVERSION" = "VERSION_ID=\"7\"" ];then setenforce 0 - -yum install -y yum-utils perl-CPAN gcc cpp perl bzip2 zip make patch automake rpm-build perl-Archive-Zip perl-Filesys-Df perl-OLE-Storage_Lite perl-Sys-Hostname-Long perl-Sys-SigAction perl-Net-CIDR perl-DBI perl-MIME-tools perl-DBD-SQLite binutils glibc-devel perl-Filesys-Df zlib unzip zlib-devel wget mlocate clamav "perl(DBD::mysql)" +yum install -y perl yum-utils perl-CPAN +yum install -y gcc cpp perl bzip2 zip make patch automake rpm-build perl-Archive-Zip perl-Filesys-Df perl-OLE-Storage_Lite perl-Sys-Hostname-Long perl-Sys-SigAction perl-Net-CIDR perl-DBI perl-MIME-tools perl-DBD-SQLite binutils glibc-devel perl-Filesys-Df zlib unzip zlib-devel wget mlocate clamav "perl(DBD::mysql)" rpm -Uvh https://forensics.cert.org/centos/cert/7/x86_64/unrar-5.4.0-1.el7.x86_64.rpm - export PERL_MM_USE_DEFAULT=1 curl -L https://cpanmin.us | perl - App::cpanminus cpanm Encoding::FixLatin @@ -46,6 +46,37 @@ cpanm Geo::IP cpanm Razor2::Client::Agent cpanm Net::Patricia +freshclam -v +DIR=/etc/mail/spamassassin + +if [ -d "$DIR" ]; then +sa-update + +else + +echo "Please install spamassassin through the CyberPanel interface before proceeding" + +exit +fi + +elif [ "$CENTOSVERSION" = "VERSION_ID=\"8\"" ];then + +setenforce 0 +yum install -y perl yum-utils perl-CPAN +dnf --enablerepo=PowerTools install -y perl-IO-stringy +yum install -y gcc cpp perl bzip2 zip make patch automake rpm-build perl-Archive-Zip perl-Filesys-Df perl-OLE-Storage_Lite perl-Net-CIDR perl-DBI perl-MIME-tools perl-DBD-SQLite binutils glibc-devel perl-Filesys-Df zlib unzip zlib-devel wget mlocate clamav clamav-update "perl(DBD::mysql)" + +rpm -Uvh https://forensics.cert.org/centos/cert/8/x86_64/unrar-5.4.0-1.el8.x86_64.rpm + +export PERL_MM_USE_DEFAULT=1 +curl -L https://cpanmin.us | perl - App::cpanminus +cpanm Encoding::FixLatin +cpanm Digest::SHA1 +cpanm Geo::IP +cpanm Razor2::Client::Agent +cpanm Sys::Hostname::Long +cpanm Sys::SigAction + freshclam -v DIR=/etc/mail/spamassassin @@ -205,17 +236,25 @@ sed -i 's/^protocols =.*/protocols = imap pop3 lmtp sieve/g' /etc/dovecot/doveco sed -i "s|^user_query.*|user_query = SELECT '5000' as uid, '5000' as gid, '/home/vmail/%d/%n' as home,mail FROM e_users WHERE email='%u';|g" /etc/dovecot/dovecot-sql.conf.ext if [ "$OS" = "NAME=\"Ubuntu\"" ];then -if [ "$VERSION" = "VERSION_ID=\"18.04\"" ];then +if [ "$UBUNTUVERSION" = "VERSION_ID=\"18.04\"" ];then apt-get install -y dovecot-managesieved dovecot-sieve dovecot-lmtpd net-tools pflogsumm -elif [ "$VERSION" = "VERSION_ID=\"20.04\"" ];then +elif [ "$UBUNTUVERSION" = "VERSION_ID=\"20.04\"" ];then apt-get install -y libmysqlclient-dev sed -e '/deb/ s/^#*/#/' -i /etc/apt/sources.list.d/dovecot.list apt install -y dovecot-lmtpd dovecot-managesieved dovecot-sieve net-tools pflogsumm fi -elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then +elif [ "$CENTOSVERSION" = "VERSION_ID=\"7\"" ];then yum install -y nano net-tools dovecot-pigeonhole postfix-perl-scripts + +elif [ "$CENTOSVERSION" = "VERSION_ID=\"8\"" ];then + + rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm + dnf --enablerepo=gf-plus upgrade -y dovecot23* + dnf --enablerepo=gf-plus install -y dovecot23-pigeonhole + dnf install -y net-tools postfix-perl-scripts + fi From 183e55bdebe78193049e64c60b8dafaa7c2e0cd5 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 24 May 2020 22:43:58 +0500 Subject: [PATCH 118/121] bug fix: plogical/vhost.py --- plogical/backupSchedule.py | 1 - plogical/vhost.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index 0227aed6d..3093a54fa 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -87,7 +87,6 @@ class backupSchedule: if os.path.exists(status): status = open(status, 'r').read() - print(status) time.sleep(2) if status.find("Completed") > -1: diff --git a/plogical/vhost.py b/plogical/vhost.py index 556dc5960..6e353096d 100755 --- a/plogical/vhost.py +++ b/plogical/vhost.py @@ -91,7 +91,7 @@ class vhost: try: os.makedirs(pathHTML) - if ProcessUtilities.decideDistro() == ProcessUtilities. or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: groupName = 'nobody' else: groupName = 'nogroup' From 74ac832a44e7a35307671b90170991df9fb32e67 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 24 May 2020 22:52:48 +0500 Subject: [PATCH 119/121] bug fix: managePHP/views.py --- managePHP/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/managePHP/views.py b/managePHP/views.py index 887719155..62e9d0f26 100755 --- a/managePHP/views.py +++ b/managePHP/views.py @@ -1085,7 +1085,7 @@ def installExtensions(request): phpPath = '' - if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8 + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: phpPath = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php70.xml') else: phpPath = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp70.xml') From c44e29b159347bee9d03015370dd7a49c6d2a3fb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 24 May 2020 23:35:08 +0500 Subject: [PATCH 120/121] bug fix backupSchedule.py --- plogical/backupSchedule.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index 3093a54fa..a2ebcdf01 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -83,6 +83,13 @@ class backupSchedule: except: fileName = "Fetching.." + ifRunning = ProcessUtilities.outputExecutioner('ps aux') + + if (ifRunning.find('startBackup') > -1 or ifRunning.find('BackupRoot') > -1) and ifRunning.find('/%s/' % (backupDomain)): + pass + else: + return 0, 'Backup process killed without reporting any error.' + ## file name read ends if os.path.exists(status): From bcfd769306f13296cacf02aa9c862789453d422c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 25 May 2020 00:08:05 +0500 Subject: [PATCH 121/121] bug fix backupSchedule.py --- plogical/backupSchedule.py | 30 +++++++++++++++++++++++++++++- plogical/backupScheduleLocal.py | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index a2ebcdf01..46f531eab 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -88,7 +88,35 @@ class backupSchedule: if (ifRunning.find('startBackup') > -1 or ifRunning.find('BackupRoot') > -1) and ifRunning.find('/%s/' % (backupDomain)): pass else: - return 0, 'Backup process killed without reporting any error.' + if os.path.exists(status): + + status = open(status, 'r').read() + time.sleep(2) + + if status.find("Completed") > -1: + + ### Removing Files + + command = 'sudo rm -f ' + status + ProcessUtilities.normalExecutioner(command) + + command = 'sudo rm -f ' + backupFileNamePath + ProcessUtilities.normalExecutioner(command) + + command = 'sudo rm -f ' + pid + ProcessUtilities.normalExecutioner(command) + + backupSchedule.remoteBackupLogging(backupLogPath, "Backup Completed for: " + virtualHost) + try: + os.remove(pathToFile) + except: + pass + return 1, tempStoragePath + else: + return 0, 'Backup process killed without reporting any error.' + else: + + return 0, 'Backup process killed without reporting any error.' ## file name read ends diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 3a69f20fa..6065b9c92 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -61,6 +61,7 @@ class backupScheduleLocal: retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath) if retValues[0] == 0: + backupSchedule.remoteBackupLogging(backupLogPath, '[ERROR] Backup failed for %s, error: %s moving on..' % (virtualHost, retValues[1]), backupSchedule.ERROR) continue if os.path.exists(backupScheduleLocal.localBackupPath):