From 96f6aeea60350d1325fd67e995e413133108e5fd Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 28 Apr 2025 17:41:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(backend)=20Allow=20overwriting=20t?= =?UTF-8?q?he=20data=20directory=20(#893)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Purpose Deployments that don't rely on Docker should be given the option to use a different data directory. ## Proposal Allow customization of the `DATA_DIR` through an environment variable of the same name. If the environment variable is not set the behaviour remains the same as before. Signed-off-by: Martin Weinelt --- CHANGELOG.md | 1 + src/backend/impress/settings.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d1aff7f..a4f54fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to - 🚩 add homepage feature flag #861 - ✨(settings) Allow configuring PKCE for the SSO #886 - 🌐(i18n) activate chinese and spanish languages #884 +- 🔧(backend) allow overwriting the data directory #893 ## Changed diff --git a/src/backend/impress/settings.py b/src/backend/impress/settings.py index a01bc002..3fc497b7 100755 --- a/src/backend/impress/settings.py +++ b/src/backend/impress/settings.py @@ -23,7 +23,7 @@ from sentry_sdk.integrations.logging import ignore_logger # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -DATA_DIR = os.path.join("/", "data") +DATA_DIR = os.getenv("DATA_DIR", os.path.join("/", "data")) def get_release():