aboutsummaryrefslogtreecommitdiff
path: root/gn2
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-03-05 06:45:19 +0300
committerFrederick Muriuki Muriithi2024-03-05 07:05:06 +0300
commitabe3c8b1b01d2b9fe6a33503ea54580753ae65f3 (patch)
tree8c768a0cfe4771843fbc8d354997044e0d8463c0 /gn2
parenta0b8e0a2d0c35542a47f906192d08d39bff290ff (diff)
downloadgenenetwork2-abe3c8b1b01d2b9fe6a33503ea54580753ae65f3.tar.gz
Pick secrets from config file.
Diffstat (limited to 'gn2')
-rw-r--r--gn2/wqflask/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn2/wqflask/__init__.py b/gn2/wqflask/__init__.py
index 8cc2904c..8e96228d 100644
--- a/gn2/wqflask/__init__.py
+++ b/gn2/wqflask/__init__.py
@@ -70,9 +70,9 @@ app.jinja_env.globals.update(
app.config["SESSION_REDIS"] = redis.from_url(app.config["REDIS_URL"])
## BEGIN: SECRETS -- Should be the last of the settings to load
-secrets_file = os.environ.get("GN2_SECRETS")
-if secrets_file and Path(secrets_file).exists():
- app.config.from_envvar("GN2_SECRETS")
+secrets_file = Path(app.config.get("GN2_SECRETS", "")).absolute()
+if secrets_file.exists() and secrets_file.is_file():
+ app.config.from_pyfile(str(secrets_file))
## END: SECRETS