SpamAssassin bug fix for ubuntu

This commit is contained in:
usmannasir
2019-01-12 17:52:45 +05:00
parent f9bfccee60
commit a3933ad5dd
6 changed files with 417 additions and 337 deletions

View File

@@ -57,24 +57,24 @@ class InstallCyberPanel:
except:
pass
command = 'wget https://www.litespeedtech.com/packages/5.0/lsws-5.3.4-ent-x86_64-linux.tar.gz'
command = 'wget https://www.litespeedtech.com/packages/5.0/lsws-5.3.5-ent-x86_64-linux.tar.gz'
install.preFlightsChecks.call(command, self.distro, '[installLiteSpeed]',
'Install LiteSpeed Webserver Enterprise.',
1, 1, os.EX_OSERR)
command = 'tar zxf lsws-5.3.4-ent-x86_64-linux.tar.gz'
command = 'tar zxf lsws-5.3.5-ent-x86_64-linux.tar.gz'
install.preFlightsChecks.call(command, self.distro, '[installLiteSpeed]',
'Install LiteSpeed Webserver Enterprise.',
1, 1, os.EX_OSERR)
writeSerial = open('lsws-5.3.4/serial.no', 'w')
writeSerial = open('lsws-5.3.5/serial.no', 'w')
writeSerial.writelines(self.serial)
writeSerial.close()
shutil.copy('litespeed/install.sh', 'lsws-5.3.4/')
shutil.copy('litespeed/functions.sh', 'lsws-5.3.4/')
shutil.copy('litespeed/install.sh', 'lsws-5.3.5/')
shutil.copy('litespeed/functions.sh', 'lsws-5.3.5/')
os.chdir('lsws-5.3.4')
os.chdir('lsws-5.3.5')
command = 'chmod +x install.sh'
install.preFlightsChecks.call(command, self.distro, '[installLiteSpeed]',

View File

@@ -25,6 +25,7 @@ import requests
from processUtilities import ProcessUtilities
from serverStatus.serverStatusUtil import ServerStatusUtil
import threading as multi
from mailUtilities import mailUtilities
# Use default socket to connect
@@ -64,6 +65,9 @@ class ContainerManager(multi.Thread):
if ACLManager.currentContextPermission(currentACL, 'createContainer') == 0:
return ACLManager.loadError()
mailUtilities.checkHome()
statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
@@ -92,12 +96,14 @@ class ContainerManager(multi.Thread):
command = 'sudo systemctl start docker'
ServerStatusUtil.executioner(command, statusFile)
cm = ContainerManager(self.name, 'restartGunicorn')
cm.start()
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Docker successfully installed.[200]\n", 1)
time.sleep(2)
cm = ContainerManager(self.name, 'restartGunicorn')
cm.start()
except BaseException, msg:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)

View File

@@ -426,6 +426,21 @@ milter_default_action = accept
def configureSpamAssassin():
try:
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
confFile = "/etc/mail/spamassassin/local.cf"
confData = open(confFile).readlines()
conf = open(confFile, 'w')
for items in confData:
if items.find('report_safe') > -1 or items.find('rewrite_header') > -1 or items.find('required_score') > -1 or items.find('required_hits') > -1:
conf.write(items.strip('#').strip(' '))
else:
conf.write(items)
conf.close()
command = "groupadd spamd"
subprocess.call(shlex.split(command))

View File

@@ -547,7 +547,7 @@ class virtualHostUtilities:
writeFile.close()
p = Process(target=mailUtilities.restartServices, args=('restart',))
p = Process(target=mailUtilities.restartServices, args=())
p.start()
print "1,None"

View File

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

View File

@@ -1,8 +1,18 @@
app.controller('installDocker', function($scope,$http) {
app.controller('installDocker', function ($scope, $http, $timeout, $window) {
$scope.installDockerStatus = true;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = false;
$scope.installDocker = function () {
$scope.installDockerStatus = false;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = true;
url = "/docker/installDocker";
var data = {};
var config = {
headers: {
@@ -10,42 +20,91 @@ app.controller('installDocker', function($scope,$http) {
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.installDockerStatus === 1)
{
new PNotify({
title: 'Docker installed',
text: 'Reloading...',
type: 'success'
});
location.reload();
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
$scope.installBoxGen = false;
getRequestStatus();
}
else {
new PNotify({
title: 'Failed to complete request',
text: response.data.error,
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
$scope.installDockerStatus = true;
}
function cantLoadInitialDatas(response) {
$scope.installDockerStatus = true;
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Failed to complete request',
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')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.abort === 0) {
$scope.requestData = response.data.requestStatus;
$timeout(getRequestStatus, 1000);
}
else {
// Notifications
$scope.cyberPanelLoading = true;
$timeout.cancel();
$scope.requestData = response.data.requestStatus;
if (response.data.installed === 1) {
$timeout(function () {
$window.location.reload();
}, 3000);
}
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
}
});
/* Java script code for docker management */
var delayTimer = null;
app.controller('dockerImages', function($scope,$http) {
app.controller('dockerImages', function ($scope) {
$scope.tagList = [];
$scope.imageTag = {};
});
@@ -119,8 +178,7 @@ app.controller('runContainer', function($scope,$http) {
function ListInitialDatas(response) {
if (response.data.createContainerStatus === 1)
{
if (response.data.createContainerStatus === 1) {
$scope.currentStatus = "Successful. Redirecting...";
window.location.href = "/docker/view/" + $scope.name
}
@@ -138,8 +196,8 @@ app.controller('runContainer', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.containerCreationLoading = true;
@@ -175,7 +233,7 @@ app.controller('listContainers', function($scope,$http) {
$scope.assignContainer = function (name) {
$("#assign").modal("show");
$scope.assignActive = name;
}
};
$scope.submitAssignContainer = function () {
url = "/docker/assignContainer";
@@ -199,8 +257,7 @@ app.controller('listContainers', function($scope,$http) {
});
window.location.href = '/docker/listContainers';
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -209,6 +266,7 @@ app.controller('listContainers', function($scope,$http) {
}
$("#assign").modal("hide");
}
function cantLoadInitialData(response) {
console.log("not good");
new PNotify({
@@ -217,7 +275,7 @@ app.controller('listContainers', function($scope,$http) {
});
$("#assign").modal("hide");
}
}
};
$scope.delContainer = function (name, unlisted=false) {
(new PNotify({
@@ -296,18 +354,19 @@ app.controller('listContainers', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
$('#imageLoading').hide();
}
})
}
else
{
else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
$('#imageLoading').hide();
}
@@ -345,8 +404,7 @@ app.controller('listContainers', function($scope,$http) {
if (response.data.containerLogStatus === 1) {
$scope.logs = response.data.containerLog;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -355,6 +413,7 @@ app.controller('listContainers', function($scope,$http) {
}
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -386,13 +445,13 @@ app.controller('listContainers', function($scope,$http) {
console.log($scope.ContainerList);
$("#listFail").hide();
}
else
{
else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialData(response) {
console.log("not good");
}
@@ -421,20 +480,19 @@ app.controller('listContainers', function($scope,$http) {
$scope.ContainerList = finalData;
$("#listFail").hide();
}
else
{
else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
console.log(response.data);
}
}
function cantLoadInitialData(response) {
console.log("not good");
}
};
});
@@ -483,8 +541,7 @@ app.controller('viewContainer', function($scope,$http) {
});
location.reload();
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -494,6 +551,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$('#infoLoading').hide();
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -529,8 +587,7 @@ app.controller('viewContainer', function($scope,$http) {
$scope.topHead = response.data.processes.Titles;
$scope.topProcesses = response.data.processes.Processes;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -540,6 +597,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$scope.loadingTop = false;
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -587,8 +645,7 @@ app.controller('viewContainer', function($scope,$http) {
});
window.location.href = '/docker/listContainers';
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -597,6 +654,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$('#actionLoading').hide();
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -622,8 +680,7 @@ app.controller('viewContainer', function($scope,$http) {
console.log(response.data.status);
$scope.status = response.data.status;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -632,6 +689,7 @@ app.controller('viewContainer', function($scope,$http) {
}
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -678,8 +736,7 @@ app.controller('viewContainer', function($scope,$http) {
});
}
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -690,6 +747,7 @@ app.controller('viewContainer', function($scope,$http) {
$('#containerSettingLoading').hide();
$scope.savingSettings = false;
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -735,8 +793,7 @@ app.controller('viewContainer', function($scope,$http) {
$scope.status = response.data.status;
$scope.refreshStatus()
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -746,6 +803,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$('#actionLoading').hide();
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -778,12 +836,12 @@ app.controller('viewContainer', function($scope,$http) {
if (response.data.containerLogStatus === 1) {
$scope.logs = response.data.containerLog;
}
else
{
else {
$scope.logs = response.data.error_message;
}
}
function cantLoadInitialData(response) {
console.log("not good");
$scope.logs = "Error loading log";
@@ -801,8 +859,7 @@ app.controller('manageImages', function($scope,$http) {
$scope.pullImage = function (image, tag) {
function ListInitialDatas(response) {
if (response.data.installImageStatus === 1)
{
if (response.data.installImageStatus === 1) {
new PNotify({
title: 'Image pulled successfully',
text: 'Reloading...',
@@ -821,6 +878,7 @@ app.controller('manageImages', function($scope,$http) {
$('#imageLoading').hide();
}
function cantLoadInitialDatas(response) {
$('#imageLoading').hide();
new PNotify({
@@ -828,6 +886,7 @@ app.controller('manageImages', function($scope,$http) {
type: 'error'
});
}
if (image && tag) {
$('#imageLoading').show();
@@ -880,8 +939,7 @@ app.controller('manageImages', function($scope,$http) {
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.searchImageStatus === 1)
{
if (response.data.searchImageStatus === 1) {
$scope.images = response.data.matches;
console.log($scope.images)
}
@@ -896,6 +954,7 @@ app.controller('manageImages', function($scope,$http) {
$('#imageLoading').hide();
}
function cantLoadInitialDatas(response) {
$('#imageLoading').hide();
new PNotify({
@@ -932,8 +991,7 @@ app.controller('manageImages', function($scope,$http) {
$scope.tagList[image].push("Load more");
}
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -942,6 +1000,7 @@ app.controller('manageImages', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -1012,8 +1071,7 @@ app.controller('manageImages', function($scope,$http) {
$('#history').modal('show');
$scope.historyList = response.data.history;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -1022,6 +1080,7 @@ app.controller('manageImages', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -1082,8 +1141,7 @@ app.controller('manageImages', function($scope,$http) {
});
window.location.href = "/docker/manageImages";
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -1092,6 +1150,7 @@ app.controller('manageImages', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',