diff --git a/deployment/community/.env.template b/deployment/community/.env.template index ce910efd..4c8aa6aa 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 762bdd14..f3ea9473 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 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 514928ea..a9670a2f 100644 --- a/server/mergin/tests/test_utils.py +++ b/server/mergin/tests/test_utils.py @@ -245,6 +245,12 @@ 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" + ) + def test_save_diagnostic_log_file(client, app): """Test save diagnostic log file"""