From 23557c49a5bcea1d68966fb66af0cc3048f78e62 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 25 Dec 2023 19:40:05 +0100 Subject: [PATCH] move and fix stuff Signed-off-by: Jens Langhammer --- .gitignore | 6 +----- authentik/root/settings.py | 4 +++- scripts/generate_config.py | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 713258ca7..1da68e6a8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,7 @@ *.pot *.pyc __pycache__/ -local_settings.py db.sqlite3 -media # If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/ # in your Git repository. Update and uncomment the following line accordingly. @@ -192,10 +190,8 @@ pyvenv.cfg pip-selfcheck.json # End of https://www.gitignore.io/api/python,django -/static/ -local.env.yml +*.env.yml -media/ *mmdb .idea/ diff --git a/authentik/root/settings.py b/authentik/root/settings.py index cc80e2b7a..5b873f54d 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -17,7 +17,9 @@ from authentik.stages.password import BACKEND_APP_PASSWORD, BACKEND_INBUILT, BAC BASE_DIR = Path(__file__).absolute().parent.parent.parent STATICFILES_DIRS = [BASE_DIR / Path("web")] -MEDIA_ROOT = BASE_DIR / Path("media") +MEDIA_ROOT = Path(CONFIG.get("paths.media")) +if not MEDIA_ROOT.exists(): + MEDIA_ROOT.mkdir(parents=True, exist_ok=True) DEBUG = CONFIG.get_bool("debug") SECRET_KEY = CONFIG.get("secret_key") diff --git a/scripts/generate_config.py b/scripts/generate_config.py index db055488f..b927c855c 100644 --- a/scripts/generate_config.py +++ b/scripts/generate_config.py @@ -15,7 +15,6 @@ with open("local.env.yml", "w", encoding="utf-8") as _config: "outposts": { "container_image_base": "ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s", }, - "paths.blueprints": "./blueprints", "paths": { "cert_discovery": "./data/certs", "media": "./data/media", @@ -23,7 +22,7 @@ with open("local.env.yml", "w", encoding="utf-8") as _config: "blueprints": "./blueprints", }, "events": { - "processors": { + "context_processors": { "geoip": "tests/GeoLite2-City-Test.mmdb", "asn": "tests/GeoLite2-ASN-Test.mmdb", }