Browse Source

Merge branch 'python' of github.com:rtCamp/easyengine into python

bugfixes
harshadyeola 10 years ago
parent
commit
ec97685963
  1. 38
      ee/cli/plugins/stack.py
  2. 27
      ee/cli/templates/15-content_filter_mode.mustache
  3. 17
      ee/cli/templates/50-user.mustache
  4. 5
      ee/core/variables.py
  5. 1
      setup.py

38
ee/cli/plugins/stack.py

@ -280,8 +280,35 @@ class EEStackController(CementBaseController):
EEShellExec.cmd_exec("sievec /var/lib/dovecot/sieve/"
"default.sieve")
if set(EEVariables.ee_mailscanner).issubset(set(apt_packages)):
# Set up Custom amavis configuration
data = dict()
ee_amavis = open('/etc/amavis/conf.d/15-content_filter_mode',
'w')
self.app.render((data), '15-content_filter_mode.mustache',
out=ee_amavis)
ee_amavis.close()
# Amavis postfix configuration
EEShellExec.cmd_exec("postconf -e \"content_filter = "
"smtp-amavis:[127.0.0.1]:10024\"")
EEShellExec.cmd_exec("sed -i \"s/1 pickup/1 pickup"
"\n -o content_filter=\n -o"
" receive_override_options=no_header_body"
"_checks/\" /etc/postfix/master.cf")
# Amavis ClamAV configuration
EEShellExec.cmd_exec("adduser clamav amavis")
EEShellExec.cmd_exec("adduser amavis clamav")
EEShellExec.cmd_exec("chmod -R 775 /var/lib/amavis/tmp")
# Update ClamAV database
EEShellExec.cmd_exec("freshclam")
EEShellExec.cmd_exec("service clamav-daemon restart")
if len(packages):
if any('/usr/bin/wp' == x[1] for x in packages):
EEShellExec.cmd_exec("chmod +x /usr/bin/wp")
if any('/tmp/pma.tar.gz' == x[1]
for x in packages):
@ -436,6 +463,15 @@ class EEStackController(CementBaseController):
out=vm_config)
vm_config.close()
# If Amavis is going to be installed then configure Vimabadmin
# Amvis settings
if set(EEVariables.ee_mailscanner).issubset(set(apt_packages)):
vm_config = open('/etc/amavis/conf.d/50-user',
'w')
self.app.render((data), '50-user.mustache',
out=vm_config)
vm_config.close()
if any('/tmp/roundcube.tar.gz' == x[1] for x in packages):
# Extract RoundCubemail
EEExtract.extract('/tmp/roundcube.tar.gz', '/tmp/')
@ -497,6 +533,8 @@ class EEStackController(CementBaseController):
"1.0.4/roundcubemail-1.0.4.tar.gz",
"/tmp/roundcube.tar.gz"]
]
if EEVariables.ee_ram > 1024:
apt_packages = apt_packages + EEVariables.ee_mailscanner
if self.app.pargs.nginx:
apt_packages = apt_packages + EEVariables.ee_nginx

27
ee/cli/templates/15-content_filter_mode.mustache

@ -0,0 +1,27 @@
use strict;
# You can modify this file to re-enable SPAM checking through spamassassin
# and to re-enable antivirus checking.
#
# Default antivirus checking mode
# Please note, that anti-virus checking is DISABLED by
# default.
# If You wish to enable it, please uncomment the following lines:
@bypass_virus_checks_maps = (
\%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
#
# Default SPAM checking mode
# Please note, that anti-spam checking is DISABLED by
# default.
# If You wish to enable it, please uncomment the following lines:
@bypass_spam_checks_maps = (
\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
1; # ensure a defined return

17
ee/cli/templates/50-user.mustache

@ -0,0 +1,17 @@
use strict;
$sa_spam_subject_tag = undef;
$spam_quarantine_to = undef;
$sa_tag_level_deflt = undef;
# Prevent spams from automatically rejected by mail-server
$final_spam_destiny = D_PASS;
# We need to provide list of domains for which filtering need to be done
@lookup_sql_dsn = (
['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',
'vimbadmin',
'{{password}}']);
$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';
1; # ensure a defined return

5
ee/core/variables.py

@ -4,6 +4,7 @@ import socket
import configparser
import os
import sys
import psutil
class EEVariables():
@ -27,6 +28,10 @@ class EEVariables():
print("Unable to find GIT user name and Email")
sys.exit(1)
# Get System RAM and SWAP details
ee_ram = psutil.virtual_memory().total / (1024 * 1024)
ee_swap = psutil.swap_memory().total / (1024 * 1024)
# EasyEngine stack installation varibales
# Nginx repo and packages
if ee_platform_distro == 'Ubuntu':

1
setup.py

@ -33,6 +33,7 @@ setup(name='ee',
'python-apt',
'pynginxconfig',
'pymysql3',
'psutil',
],
setup_requires=[],
entry_points="""

Loading…
Cancel
Save