Browse Source

More tweaks to ee stack install

bugfixes
gau1991 10 years ago
parent
commit
3802ef87f4
  1. 11
      ee/cli/plugins/stack.py
  2. 11
      ee/cli/templates/auth-sql-conf.mustache
  3. 12
      ee/cli/templates/dovecot-sql-conf.mustache
  4. 12
      ee/core/variables.py

11
ee/cli/plugins/stack.py

@ -182,6 +182,17 @@ class EEStackController(CementBaseController):
with open('/etc/mysql/my.cnf', 'w') as configfile:
config.write(configfile)
if set(EEVariables.ee_dovecot).issubset(set(apt_packages)):
EEShellExec.cmd_exec("adduser --uid 5000 --home /var/vmail"
"--disabled-password --gecos '' vmail")
EEShellExec.cmd_exec("openssl req -new -x509 -days 3650 -nodes"
"-subj /commonName={HOSTNAME}/emailAddres"
"s={EMAIL} -out /etc/ssl/certs/dovecot."
"pem -keyout /etc/ssl/private/dovecot.pem"
.format(HOSTNAME=EEVariables.ee_fqdn,
EMAIL=EEVariables.ee_email))
EEShellExec.cmd_exec("chmod 0600 /etc/ssl/private/dovecot.pem")
if len(packages):
if any('/usr/bin/wp' == x[1] for x in packages):
EEShellExec.cmd_exec("chmod +x /usr/bin/wp")

11
ee/cli/templates/auth-sql-conf.mustache

@ -0,0 +1,11 @@
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
userdb {
driver = prefetch
}
userdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}

12
ee/cli/templates/dovecot-sql-conf.mustache

@ -0,0 +1,12 @@
driver = mysql
connect = host=localhost user=vimbadmin password={{password}} dbname=vimbadmin
default_pass_scheme = MD5
password_query = SELECT username as user, password as password, \
homedir AS home, maildir AS mail, \
concat('*:bytes=', quota) as quota_rule, uid, gid \
FROM mailbox \
WHERE username = '%Lu' AND active = '1' \
AND ( access_restriction = 'ALL' OR LOCATE( access_restriction, '%Us' ) > 0 )
user_query = SELECT homedir AS home, maildir AS mail, \
concat('*:bytes=', quota) as quota_rule, uid, gid \
FROM mailbox WHERE username = '%u'

12
ee/core/variables.py

@ -1,15 +1,27 @@
"""EasyEngine core variable module"""
import platform
import socket
import confiparser
import os
class EEVariables():
"""Intialization of core variables"""
config = configparser.ConfigParser()
config.read(os.path.expanduser("~")+'/.gitconfig')
# EasyEngine core variables
ee_platform_distro = platform.linux_distribution()[0]
ee_platform_version = platform.linux_distribution()[1]
ee_platform_codename = platform.linux_distribution()[2]
# Get FQDN of system
ee_fqdn = socket.getfqdn()
# Get git user name and EMail
ee_user = config['user']['name']
ee_email = config['user']['email']
# EasyEngine stack installation varibales
# Nginx repo and packages
if ee_platform_distro == 'Ubuntu':

Loading…
Cancel
Save