Commit 48a60965 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis
Browse files

deploy: Modify dir for filebased email_backend

Allow user to modify the directory that will
be used for the filebased email backend by Django.

Also move the EMAIL_BACKEND option from astakos to
common.
parent d30bbab7
......@@ -25,6 +25,8 @@ dns = /var/lib/snf-deploy/dnsmasq
lib = /usr/lib/snf-deploy
# dir to store executed commands (to enforce sequential execution)
cmd = /var/run/snf-deploy/cmd
# dir to be used by Django for file-based mail backend
mail_dir = /var/log/gunicorn/synnefo-mails
[keys]
# whether to create new keys
......
......@@ -25,6 +25,8 @@ dns = /var/lib/snf-deploy/dnsmasq
lib = /usr/lib/snf-deploy
# dir to store executed commands (to enforce sequential execution)
cmd = /var/run/snf-deploy/cmd
# dir to be used by Django for file-based mail backend
mail_dir = /var/log/gunicorn/synnefo-mails
[keys]
# whether to create new keys
......
......@@ -25,6 +25,8 @@ dns = /var/lib/snf-deploy/dnsmasq
lib = /usr/lib/snf-deploy
# dir to store executed commands (to enforce sequential execution)
cmd = /var/run/snf-deploy/cmd
# dir to be used by Django for file-based mail backend
mail_dir = /var/log/gunicorn/synnefo-mails
[keys]
# whether to create new keys
......
......@@ -518,9 +518,11 @@ def setup_common():
"EMAIL_SUBJECT_PREFIX": env.host,
"domain": env.env.domain,
"HOST": host_info.fqdn,
"MAIL_DIR": env.env.mail_dir,
}
custom = customize_settings_from_tmpl(tmpl, replace)
put(custom, tmpl, mode=0644)
try_run("mkdir -p {0}; chown root:www-data {0}; chmod 775 {0}".format(env.env.mail_dir))
try_run("/etc/init.d/gunicorn restart")
@roles("accounts")
......
......@@ -34,9 +34,6 @@ ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s' % ASTAKOS_SITENAME
ASTAKOS_COOKIE_DOMAIN = '%DOMAIN%'
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/var/log/gunicorn/synnefo-mails'
ASTAKOS_SERVICES = {
'cyclades': {
'url': 'https://%CYCLADES%/ui/',
......
......@@ -7,3 +7,5 @@ DEFAULT_FROM_EMAIL = "feedback@%DOMAIN%"
SERVER_EMAIL = "root@%HOST%"
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = "%MAIL_DIR%"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment