From 6943c3d18f4704f3cc6db8f36040f37f4b5962f0 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Wed, 28 Oct 2020 08:34:43 +0100 Subject: [PATCH] Expose more email settings --- README.rst | 11 +++++++++++ docker/.env | 3 +++ docker/docker-compose.yml.m4 | 3 +++ docker/docker-stack.yml.m4 | 3 +++ server/docker/settings.py | 5 ++++- server/openslides/utils/settings.py.tpl | 5 ++++- 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2393b6dae..a9bf44400 100644 --- a/README.rst +++ b/README.rst @@ -55,6 +55,17 @@ Finally, you can start the instance using ``docker-compose``:: $ # ... $ docker-compose down +More settings +------------- + +When generating the ``docker-compose.yml``, more settings can be adjusted in the +``docker/.env`` file. All changes for the backend are passed into djangos ``settings.py``. +You can find more information about most settings `here +`_. To generate +the ``docker-compose.yml`` use this command:: + + $ ( set -a; source .env; m4 docker-stack.yml.m4 ) > docker-stack.yml + Docker Swarm Mode ----------------- diff --git a/docker/.env b/docker/.env index c4dbdfd09..9f0070ba1 100644 --- a/docker/.env +++ b/docker/.env @@ -63,6 +63,9 @@ EMAIL_HOST= EMAIL_HOST_PASSWORD= EMAIL_HOST_USER= EMAIL_PORT= +EMAIL_USE_SSL= +EMAIL_USE_TLS= +EMAIL_TIMEOUT= JITSI_DOMAIN= JITSI_ROOM_PASSWORD= JITSI_ROOM_NAME= diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index d3eece276..f707eb1ec 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -59,6 +59,9 @@ x-osserver-env: &default-osserver-env EMAIL_HOST_PASSWORD: "ifenvelse(`EMAIL_HOST_PASSWORD',)" EMAIL_HOST_USER: "ifenvelse(`EMAIL_HOST_USER',)" EMAIL_PORT: ifenvelse(`EMAIL_PORT', 25) + EMAIL_USE_SSL: "ifenvelse(`EMAIL_USE_SSL',)" + EMAIL_USE_TLS: "ifenvelse(`EMAIL_USE_TLS',)" + EMAIL_TIMEOUT: "ifenvelse(`EMAIL_TIMEOUT',)" ENABLE_ELECTRONIC_VOTING: "ifenvelse(`ENABLE_ELECTRONIC_VOTING', False)" ENABLE_SAML: "ifenvelse(`ENABLE_SAML', False)" INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index 7e55656ca..cfcb372a1 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -58,6 +58,9 @@ x-osserver-env: &default-osserver-env EMAIL_HOST_PASSWORD: "ifenvelse(`EMAIL_HOST_PASSWORD',)" EMAIL_HOST_USER: "ifenvelse(`EMAIL_HOST_USER',)" EMAIL_PORT: ifenvelse(`EMAIL_PORT', 25) + EMAIL_USE_SSL: "ifenvelse(`EMAIL_USE_SSL',)" + EMAIL_USE_TLS: "ifenvelse(`EMAIL_USE_TLS',)" + EMAIL_TIMEOUT: "ifenvelse(`EMAIL_TIMEOUT',)" ENABLE_ELECTRONIC_VOTING: "ifenvelse(`ENABLE_ELECTRONIC_VOTING', False)" ENABLE_SAML: "ifenvelse(`ENABLE_SAML', False)" INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" diff --git a/server/docker/settings.py b/server/docker/settings.py index 722795b14..722982eab 100644 --- a/server/docker/settings.py +++ b/server/docker/settings.py @@ -59,11 +59,14 @@ DEMO_USERS = get_env("DEMO_USERS", default=None) DEMO_USERS = json.loads(DEMO_USERS) if DEMO_USERS else None # Email settings -# For SSL/TLS specific settings see https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend +# For an explaination and more settings values see https://docs.djangoproject.com/en/2.2/topics/email/#smtp-backend EMAIL_HOST = get_env("EMAIL_HOST", "postfix") EMAIL_PORT = get_env("EMAIL_PORT", 25, int) EMAIL_HOST_USER = get_env("EMAIL_HOST_USER", "") EMAIL_HOST_PASSWORD = get_env("EMAIL_HOST_PASSWORD", "") +EMAIL_USE_SSL = get_env("EMAIL_USE_SSL", False, bool) +EMAIL_USE_TLS = get_env("EMAIL_USE_TLS", False, bool) +EMAIL_TIMEOUT = get_env("EMAIL_TIMEOUT", None, int) DEFAULT_FROM_EMAIL = get_env("DEFAULT_FROM_EMAIL", "noreply@example.com") # Increasing Upload size to 100mb (default is 2.5mb) diff --git a/server/openslides/utils/settings.py.tpl b/server/openslides/utils/settings.py.tpl index 30eedeebb..071e67ea7 100644 --- a/server/openslides/utils/settings.py.tpl +++ b/server/openslides/utils/settings.py.tpl @@ -45,12 +45,15 @@ DEBUG = %(debug)s RESET_PASSWORD_VERBOSE_ERRORS = True # Email settings -# For SSL/TLS specific settings see https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend +# For an explaination and more settings values see https://docs.djangoproject.com/en/2.2/topics/email/#smtp-backend EMAIL_HOST = 'localhost' EMAIL_PORT = 587 EMAIL_HOST_USER = '' EMAIL_HOST_PASSWORD = '' +EMAIL_USE_SSL = False +EMAIL_USE_TLS = False +EMAIL_TIMEOUT = None DEFAULT_FROM_EMAIL = 'noreply@example.com' # Increasing Upload size to 100mb (default is 2.5mb)