From fb735b9addfa66f91a05a23d53965b3a223bd6b1 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 29 Dec 2023 08:11:05 +0100 Subject: [PATCH] move static files somewhere else if possible --- frontend.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend.py b/frontend.py index f1f6710..82c37da 100644 --- a/frontend.py +++ b/frontend.py @@ -35,7 +35,10 @@ from redis_session import RedisSessionStore from voc_mqtt import send_message -app = Flask(__name__) +app = Flask( + __name__, + static_folder=CONFIG.get('STATIC_PATH', 'static'), +) app.wsgi_app = ProxyFix(app.wsgi_app) for copy_key in ( @@ -61,7 +64,7 @@ def cached_asset_name(asset): asset_id, "jpg" if asset["filetype"] == "image" else "mp4", ) - cache_name = f"static/{filename}" + cache_name = os.path.join(CONFIG.get('STATIC_PATH', 'static'), filename) if not os.path.exists(cache_name): app.logger.info(f"fetching {asset_id} to {cache_name}")