From 2b20c210c637643631226c7d096a18fdaef56bbc Mon Sep 17 00:00:00 2001 From: Michal Kleszcz Date: Wed, 3 Jul 2024 09:53:42 +0200 Subject: [PATCH] fix: HASHID envs --- packages/backend/.env.shared | 1 - packages/backend/.test.env | 2 -- packages/backend/Dockerfile | 2 -- packages/backend/config/settings.py | 4 +--- packages/backend/utils/hashid.py | 2 +- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/backend/.env.shared b/packages/backend/.env.shared index 15ab32e98..84f4dc315 100644 --- a/packages/backend/.env.shared +++ b/packages/backend/.env.shared @@ -5,7 +5,6 @@ DJANGO_DEFAULT_HOST=localhost DJANGO_SECRET_KEY=X&*az9nsBNykh!hXMczbaeH2oAm%jR6ZalWcXDW0#PUjHn0Xjs HASHID_FIELD_SALT=X&*az9nsBNykh!hXMczbaeH2oAm%jR6ZalWcXDW0#PUjHn0Xjs -HASHID_SALT=X&*az9nsBNykh!hXMczbaeH2oAm%jR6ZalWcXDW0#PUjHn0Xjs ENVIRONMENT_NAME=local diff --git a/packages/backend/.test.env b/packages/backend/.test.env index f2c075f94..e5aaf6aa0 100644 --- a/packages/backend/.test.env +++ b/packages/backend/.test.env @@ -9,7 +9,6 @@ DJANGO_PASSWORD_HASHERS=common.tests.hashers.DangerousMockHasher DJANGO_DEFAULT_FILE_STORAGE=common.tests.storages.MockS3Boto3Storage HASHID_FIELD_SALT=9q#3t$5gs9ob682b@(6^fdv2kg*0ztr(3doa((w&kyq!d8rbt^y -HASHID_SALT=2{N28?.CKenLuj0jp6C% DB_CONNECTION='{"dbname":"backend","username":"backend","password":"backend","host":"db","port":5432}' REDIS_CONNECTION=redis://redis:6379 @@ -27,7 +26,6 @@ STRIPE_LIVE_MODE=False DJSTRIPE_WEBHOOK_SECRET=whsec_12345 AWS_STORAGE_BUCKET_NAME=test-bucket -AWS_EXPORTS_STORAGE_BUCKET_NAME=exports-bucket AWS_S3_CUSTOM_DOMAIN=cdn.example.com AWS_ENDPOINT_URL= diff --git a/packages/backend/Dockerfile b/packages/backend/Dockerfile index 4c004c38c..9275ae439 100644 --- a/packages/backend/Dockerfile +++ b/packages/backend/Dockerfile @@ -41,13 +41,11 @@ RUN chmod +x /app/scripts/runtime/*.sh FROM backend_build AS static_files ENV HASHID_FIELD_SALT='' \ - HASHID_SALT='' \ DJANGO_PARENT_HOST='' \ DJANGO_SECRET_KEY='build' \ DB_CONNECTION='{"dbname":"build","username":"build","password":"build","host":"db","port":5432}' \ REDIS_CONNECTION=redis://redis:6379 \ WORKERS_EVENT_BUS_NAME='' \ - AWS_EXPORTS_STORAGE_BUCKET_NAME='' \ PYTHONPATH=/pkgs/__pypackages__/3.11/lib RUN ./scripts/runtime/build_static.sh diff --git a/packages/backend/config/settings.py b/packages/backend/config/settings.py index 10d1bb21f..d70c1d4c9 100644 --- a/packages/backend/config/settings.py +++ b/packages/backend/config/settings.py @@ -344,10 +344,8 @@ def tenant_request_callback(request): WEB_SOCKET_API_ENDPOINT_URL = env("WEB_SOCKET_API_ENDPOINT_URL", default="") -HASHID_SALT = env('HASHID_SALT', None) - AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME", default=None) -AWS_EXPORTS_STORAGE_BUCKET_NAME = env("AWS_EXPORTS_STORAGE_BUCKET_NAME", None) +AWS_EXPORTS_STORAGE_BUCKET_NAME = env("AWS_EXPORTS_STORAGE_BUCKET_NAME", default=None) AWS_S3_ENDPOINT_URL = AWS_ENDPOINT_URL AWS_S3_CUSTOM_DOMAIN = env("AWS_S3_CUSTOM_DOMAIN", default=None) AWS_QUERYSTRING_EXPIRE = env("AWS_QUERYSTRING_EXPIRE", default=60 * 60 * 24) diff --git a/packages/backend/utils/hashid.py b/packages/backend/utils/hashid.py index 64d186d0e..14ce707be 100644 --- a/packages/backend/utils/hashid.py +++ b/packages/backend/utils/hashid.py @@ -1,7 +1,7 @@ from hashids import Hashids from django.conf import settings -hashids = Hashids(salt=settings.HASHID_SALT, min_length=7) +hashids = Hashids(salt=settings.HASHID_FIELD_SALT, min_length=7) def encode(val):