[extensions-web] settings: added ability to configure email settings using URL.
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] settings: added ability to configure email settings using URL.
- Date: Mon, 17 Dec 2018 15:23:23 +0000 (UTC)
commit 7f6be6e890a81146b8132f2483fba74c860788af
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Mon Dec 17 19:23:03 2018 +0400
settings: added ability to configure email settings using URL.
Added openshift and docker environment variables.
openshift/docker/docker-compose.yml | 1 +
openshift/templates/extensions-web-nginx.json | 34 +++++++++++++++++++++++++++
requirements.txt | 1 +
sweettooth/settings.py | 3 +++
4 files changed, 39 insertions(+)
---
diff --git a/openshift/docker/docker-compose.yml b/openshift/docker/docker-compose.yml
index 0e7e4ff..43abc29 100644
--- a/openshift/docker/docker-compose.yml
+++ b/openshift/docker/docker-compose.yml
@@ -24,6 +24,7 @@ services:
EGO_ADMINISTRATOR_EMAIL: ykonotopov gnome org
EGO_ALLOWED_HOST:
EGO_DATABASE_URL:
+ EGO_EMAIL_URL:
EGO_SECRET_KEY:
EGO_XAPIAN_DB:
EGO_MEDIA_ROOT: /extensions-web/www/uploaded-files
diff --git a/openshift/templates/extensions-web-nginx.json b/openshift/templates/extensions-web-nginx.json
index d41cd43..7be7d52 100644
--- a/openshift/templates/extensions-web-nginx.json
+++ b/openshift/templates/extensions-web-nginx.json
@@ -44,6 +44,7 @@
},
"stringData": {
"database-url": "${EGO_DATABASE_URL}",
+ "email-url": "${EGO_EMAIL_URL}",
"secret-key": "${EGO_SECRET_KEY}"
}
},
@@ -402,6 +403,15 @@
}
}
},
+ {
+ "name": "EGO_EMAIL_URL",
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "email-url"
+ }
+ }
+ },
{
"name": "EGO_SECRET_KEY",
"valueFrom": {
@@ -555,6 +565,15 @@
}
}
},
+ {
+ "name": "EGO_EMAIL_URL",
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "email-url"
+ }
+ }
+ },
{
"name": "EGO_SECRET_KEY",
"valueFrom": {
@@ -663,6 +682,15 @@
}
}
},
+ {
+ "name": "EGO_EMAIL_URL",
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "email-url"
+ }
+ }
+ },
{
"name": "EGO_SECRET_KEY",
"valueFrom": {
@@ -807,6 +835,12 @@
"description": "Database URL in format suitable for dj-database-url",
"value": ""
},
+ {
+ "name": "EGO_EMAIL_URL",
+ "displayName": "Email URL",
+ "description": "Email URL in format suitable for dj-email-url",
+ "value": ""
+ },
{
"name": "EGO_NODE_ADDRESS",
"displayName": "Address of extensions-web container",
diff --git a/requirements.txt b/requirements.txt
index 7c12cdf..d3da3fe 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,3 +6,4 @@ Pygments >= 1.4
pillow >= 2.0.0
chardet >= 2.2.1
dj-database-url
+dj-email-url
diff --git a/sweettooth/settings.py b/sweettooth/settings.py
index f96db6b..322cf4f 100644
--- a/sweettooth/settings.py
+++ b/sweettooth/settings.py
@@ -196,6 +196,9 @@ LOGGING = {
}
DEFAULT_FROM_EMAIL = "noreply gnome org"
+if os.getenv('EGO_EMAIL_URL'):
+ import dj_email_url
+ vars().update(dj_email_url.parse(os.getenv('EGO_EMAIL_URL')))
NO_SECURE_SETTINGS = False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]