From 5509bce3d70de6443a128931c38bfb5451ddc6e1 Mon Sep 17 00:00:00 2001 From: Jens L Date: Thu, 4 May 2023 02:16:48 +0300 Subject: [PATCH] blueprints: ignore hidden files in discovery (#5472) blueprints: ignore hidden files Signed-off-by: Jens Langhammer --- authentik/blueprints/v1/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/authentik/blueprints/v1/tasks.py b/authentik/blueprints/v1/tasks.py index 41733b0b9..3a278ef3c 100644 --- a/authentik/blueprints/v1/tasks.py +++ b/authentik/blueprints/v1/tasks.py @@ -101,7 +101,10 @@ def blueprints_find(): """Find blueprints and return valid ones""" blueprints = [] root = Path(CONFIG.y("blueprints_dir")) - for path in root.glob("**/*.yaml"): + for path in root.rglob("**/*.yaml"): + # Check if any part in the path starts with a dot and assume a hidden file + if any(part for part in path.parts if part.startswith(".")): + continue LOGGER.debug("found blueprint", path=str(path)) with open(path, "r", encoding="utf-8") as blueprint_file: try: