From 25ae307950495ff834da9a85b0d42b8114943426 Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Tue, 6 May 2025 11:44:02 +0200 Subject: [PATCH 1/2] Rename CLOSED_ACCOUNT_EXPIRATION -> ACCOUNT_EXPIRATION --- deployment/community/.env.template | 4 ++-- deployment/enterprise/.env.template | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/community/.env.template b/deployment/community/.env.template index 741e0e9c..c063d68e 100644 --- a/deployment/community/.env.template +++ b/deployment/community/.env.template @@ -166,8 +166,8 @@ CELERY_RESULT_BACKEND=redis://merginmaps-redis:6379/0 # various life times -#CLOSED_ACCOUNT_EXPIRATION=5 # time in days after user closed his account to all projects and files are permanently deleted -CLOSED_ACCOUNT_EXPIRATION=1 +#ACCOUNT_EXPIRATION=5 # time in days after user closed his account to all projects and files are permanently deleted +ACCOUNT_EXPIRATION=1 #DELETED_PROJECT_EXPIRATION=7 # lifetime of deleted project, expired project are removed permanently without restore possibility, in days diff --git a/deployment/enterprise/.env.template b/deployment/enterprise/.env.template index f6bda021..e2e2adc7 100644 --- a/deployment/enterprise/.env.template +++ b/deployment/enterprise/.env.template @@ -150,8 +150,8 @@ CELERYD_PREFETCH_MULTIPLIER=4 # various life times -#CLOSED_ACCOUNT_EXPIRATION=5 # time in days after user closed his account to all projects and files are permanently deleted -CLOSED_ACCOUNT_EXPIRATION=1 +#ACCOUNT_EXPIRATION=5 # time in days after user closed his account to all projects and files are permanently deleted +ACCOUNT_EXPIRATION=1 #DELETED_PROJECT_EXPIRATION=7 # lifetime of deleted project, expired project are removed permanently without restore possibility, in days From ec51ac654f26c6e258dc686ba0c1ee27b902db88 Mon Sep 17 00:00:00 2001 From: Martin Varga Date: Tue, 13 May 2025 08:13:19 +0200 Subject: [PATCH 2/2] Fix get_x_accel uri for absolute paths --- server/mergin/sync/utils.py | 1 + server/mergin/tests/test_utils.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/server/mergin/sync/utils.py b/server/mergin/sync/utils.py index 48fab72a..c4d5fa16 100644 --- a/server/mergin/sync/utils.py +++ b/server/mergin/sync/utils.py @@ -575,5 +575,6 @@ def get_x_accel_uri(*url_parts): # if the path parts_join starts with local_projects, remove it if url.startswith(local_projects): url = os.path.relpath(url, local_projects) + url = url.lstrip(os.path.sep) result = os.path.join(download_accell_uri, url) return result diff --git a/server/mergin/tests/test_utils.py b/server/mergin/tests/test_utils.py index f3249daa..3859f0bf 100644 --- a/server/mergin/tests/test_utils.py +++ b/server/mergin/tests/test_utils.py @@ -270,3 +270,9 @@ def test_get_x_accell_uri(client): url_parts = () assert get_x_accel_uri(*url_parts) == "/download" + + url_parts = ("/archive", "cc900b78-a8b2-4e80-b546-74c96584bd10-v4.zip") + assert ( + get_x_accel_uri(*url_parts) + == "/download/archive/cc900b78-a8b2-4e80-b546-74c96584bd10-v4.zip" + )