From ab8ff04852098cafc2f95281fb6e6fe882f50a6d Mon Sep 17 00:00:00 2001 From: Alexander GITTINGS Date: Thu, 14 May 2020 15:09:25 +0000 Subject: [PATCH 1/2] #293 --- configuration/configuration.py | 4 ++++ env/netbox.env | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/configuration/configuration.py b/configuration/configuration.py index af121d9..c07e4dc 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -119,6 +119,10 @@ EMAIL = { 'PASSWORD': os.environ.get('EMAIL_PASSWORD', read_secret('email_password')), 'TIMEOUT': int(os.environ.get('EMAIL_TIMEOUT', 10)), # seconds 'FROM_EMAIL': os.environ.get('EMAIL_FROM', ''), + 'USE_SSL': os.environ.get('EMAIL_USE_SSL', 'False'), + 'USE_TLS': os.environ.get('EMAIL_USE_TLS', 'False'), + 'SSL_CERTFILE': os.environ.get('EMAIL_SSL_CERTFILE', '') + 'SSL_KEYFILE': os.environ.get('EMAIL_SSL_KEYFILE', '') } # Enforcement of unique IP space can be toggled on a per-VRF basis. diff --git a/env/netbox.env b/env/netbox.env index aaa7482..84184e3 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -9,6 +9,10 @@ EMAIL_USERNAME=netbox EMAIL_PASSWORD= EMAIL_TIMEOUT=5 EMAIL_FROM=netbox@bar.com +EMAIL_USE_SSL=false +EMAIL_USE_TLS=false +EMAIL_SSL_CERTFILE= +EMAIL_SSL_KEYFILE= MEDIA_ROOT=/opt/netbox/netbox/media NAPALM_USERNAME= NAPALM_PASSWORD= From efec435ba0f33a3c26a1ee63c05457bb2f0bb969 Mon Sep 17 00:00:00 2001 From: Alexander GITTINGS Date: Thu, 14 May 2020 15:37:47 +0000 Subject: [PATCH 2/2] fix some issues --- configuration/configuration.py | 8 ++++---- env/netbox.env | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configuration/configuration.py b/configuration/configuration.py index c07e4dc..8c8e3d9 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -119,10 +119,10 @@ EMAIL = { 'PASSWORD': os.environ.get('EMAIL_PASSWORD', read_secret('email_password')), 'TIMEOUT': int(os.environ.get('EMAIL_TIMEOUT', 10)), # seconds 'FROM_EMAIL': os.environ.get('EMAIL_FROM', ''), - 'USE_SSL': os.environ.get('EMAIL_USE_SSL', 'False'), - 'USE_TLS': os.environ.get('EMAIL_USE_TLS', 'False'), - 'SSL_CERTFILE': os.environ.get('EMAIL_SSL_CERTFILE', '') - 'SSL_KEYFILE': os.environ.get('EMAIL_SSL_KEYFILE', '') + 'USE_SSL': os.environ.get('EMAIL_USE_SSL', 'False').lower() == 'true', + 'USE_TLS': os.environ.get('EMAIL_USE_TLS', 'False').lower() == 'true', + 'SSL_CERTFILE': os.environ.get('EMAIL_SSL_CERTFILE', ''), + 'SSL_KEYFILE': os.environ.get('EMAIL_SSL_KEYFILE', ''), } # Enforcement of unique IP space can be toggled on a per-VRF basis. diff --git a/env/netbox.env b/env/netbox.env index 84184e3..9555f93 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -9,6 +9,7 @@ EMAIL_USERNAME=netbox EMAIL_PASSWORD= EMAIL_TIMEOUT=5 EMAIL_FROM=netbox@bar.com +# EMAIL_USE_SSL and EMAIL_USE_TLS are mutually exclusive, i.e. they can't both be `true`! EMAIL_USE_SSL=false EMAIL_USE_TLS=false EMAIL_SSL_CERTFILE=