diff options
author | Alexander_Kabui | 2024-01-03 17:39:41 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-01-03 17:39:41 +0300 |
commit | f69cf8d0ac4b2bf910ca2767676b327592b8448a (patch) | |
tree | 1cf9c28a7fa5985f7f4924c883ea99a63b35b1ab | |
parent | 6bb4a5f05c1a2c96b7da1780ae4a1d70c7cc4afb (diff) | |
download | genenetwork3-f69cf8d0ac4b2bf910ca2767676b327592b8448a.tar.gz |
load gn3 secret file
-rw-r--r-- | gn3/app.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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")) |