fix: include yaml for server & docker build

This commit is contained in:
2024-11-03 14:11:12 +01:00
parent cdb4a8aeb9
commit 2305bc9789
3 changed files with 6 additions and 2 deletions

View File

@@ -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) # precreate database directory for mount (will otherwise be created at before_first_request)
COPY ./ . COPY ./ .
RUN mkdir /app/instance/ RUN mkdir -p /app/instance/
EXPOSE 5000/tcp EXPOSE 5000/tcp

View File

@@ -7,6 +7,7 @@ import subprocess
import os import os
import datetime import datetime
import secrets import secrets
import yaml
import ldaptools import ldaptools
import messagetools import messagetools
@@ -421,12 +422,14 @@ def create_app():
app.config["SETTINGS_ACCESS_TOKEN"] = os.environ["SETTINGS_ACCESS_TOKEN"] app.config["SETTINGS_ACCESS_TOKEN"] = os.environ["SETTINGS_ACCESS_TOKEN"]
app.config["DISPATCH_ACCESS_TOKEN"] = os.environ["DISPATCH_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"] = {} app.config["SUBSTITUTIONS"] = {}
if os.path.isfile(substitution_config_file): if os.path.isfile(substitution_config_file):
with open(substitution_config_file) as f: with open(substitution_config_file) as f:
app.config["SUBSTITUTIONS"] = yaml.safe_load(f) app.config["SUBSTITUTIONS"] = yaml.safe_load(f)
print("Loaded subs:", substitution_config_file, app.config["SUBSTITUTIONS"], file=sys.stderr)
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -1,4 +1,5 @@
python-ldap python-ldap
pyyaml
flask flask
flask-sqlalchemy flask-sqlalchemy
sqlalchemy sqlalchemy