Skip to content

Commit

Permalink
fix: HASHID envs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed Jul 3, 2024
1 parent ac4d4dd commit 2b20c21
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/backend/.env.shared
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions packages/backend/.test.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=

Expand Down
2 changes: 0 additions & 2 deletions packages/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions packages/backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/utils/hashid.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 2b20c21

Please sign in to comment.