aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-01-03 17:39:41 +0300
committerAlexander_Kabui2024-01-03 17:39:41 +0300
commitf69cf8d0ac4b2bf910ca2767676b327592b8448a (patch)
tree1cf9c28a7fa5985f7f4924c883ea99a63b35b1ab
parent6bb4a5f05c1a2c96b7da1780ae4a1d70c7cc4afb (diff)
downloadgenenetwork3-f69cf8d0ac4b2bf910ca2767676b327592b8448a.tar.gz
load gn3 secret file
-rw-r--r--gn3/app.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gn3/app.py b/gn3/app.py
index b20b450..cd78d34 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -9,7 +9,7 @@ from typing import Dict
from typing import Union
from flask import Flask
-from flask_cors import CORS # type: ignore
+from flask_cors import CORS # type: ignore
from gn3.loggers import setup_app_handlers
from gn3.api.gemma import gemma
@@ -48,6 +48,12 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
elif config.endswith(".py"):
app.config.from_pyfile(config)
+ # BEGIN: SECRETS -- Should be the last of the settings to load
+ secrets_file = os.environ.get("GN3_SECRETS")
+ if secrets_file and Path(secrets_file).exists():
+ app.config.from_envvar("GN3_SECRETS")
+ # END: SECRETS
+
setup_app_handlers(app)
# DO NOT log anything before this point
logging.info("Guix Profile: '%s'.", os.environ.get("GUIX_PROFILE"))