Browse Source

Adding environment overrides of config

Kirk Trombley 5 years ago
parent
commit
0d9e9ef774
2 changed files with 2 additions and 2 deletions
  1. 1 1
      server/Dockerfile
  2. 1 1
      server/app.py

+ 1 - 1
server/Dockerfile

@@ -2,7 +2,7 @@ FROM python:3.8
 
 RUN pip install --upgrade pip gunicorn
 
-ENV TS_SECRET_FILE /secret/secret.toml
+ENV TS_SECRET_FILE /data/secret.toml
 
 WORKDIR /var/tss
 

+ 1 - 1
server/app.py

@@ -20,7 +20,7 @@ CORS(app)
 with open(os.environ.get("TS_SECRET_FILE", "secret.toml")) as infile:
     cfg = toml.load(infile)
 for k in ("host", "port", "user", "pass"):
-    app.config[k] = cfg[k]
+    app.config[k] = os.environ.get(f"TS_SERVER_{k.upper()}", cfg[k])
 
 
 def parse_ts_response(response):