aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"))