From 2305bc97890beb24fce608d4320a32a06f826840 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Sun, 3 Nov 2024 14:11:12 +0100 Subject: [PATCH] fix: include yaml for server & docker build --- server/Dockerfile | 2 +- server/interface.py | 5 ++++- server/req.txt | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 53baf46..d914d52 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -14,7 +14,7 @@ RUN python3 -m pip install --no-cache-dir --break-system-packages -r req.txt # precreate database directory for mount (will otherwise be created at before_first_request) COPY ./ . -RUN mkdir /app/instance/ +RUN mkdir -p /app/instance/ EXPOSE 5000/tcp diff --git a/server/interface.py b/server/interface.py index 702d769..b4e5c28 100755 --- a/server/interface.py +++ b/server/interface.py @@ -7,6 +7,7 @@ import subprocess import os import datetime import secrets +import yaml import ldaptools import messagetools @@ -421,12 +422,14 @@ def create_app(): app.config["SETTINGS_ACCESS_TOKEN"] = os.environ["SETTINGS_ACCESS_TOKEN"] app.config["DISPATCH_ACCESS_TOKEN"] = os.environ["DISPATCH_ACCESS_TOKEN"] - substitution_config_file = app.config.get("SUBSTITUTION_MAP") or "substitutions.yaml" + substitution_config_file = os.environ.get("SUBSTITUTION_MAP") or "substitutions.yaml" app.config["SUBSTITUTIONS"] = {} if os.path.isfile(substitution_config_file): with open(substitution_config_file) as f: app.config["SUBSTITUTIONS"] = yaml.safe_load(f) + print("Loaded subs:", substitution_config_file, app.config["SUBSTITUTIONS"], file=sys.stderr) + if __name__ == "__main__": diff --git a/server/req.txt b/server/req.txt index cb0d652..c79d862 100644 --- a/server/req.txt +++ b/server/req.txt @@ -1,4 +1,5 @@ python-ldap +pyyaml flask flask-sqlalchemy sqlalchemy