Skip to content

Commit

Permalink
fix(cors): changed bucket name
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeannesson committed Mar 12, 2024
1 parent d1b3e5d commit 62be4bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions backend/config/settings/db_essentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ def sync_master_key_s3(sender, **kwargs):
if "AWS_ACCESS_KEY_ID" not in env or "AWS_SECRET_ACCESS_KEY" not in env or "AWS_S3_BUCKET_URI" not in env:
print("AWS credentials not found. Skipping sync_master_key_s3")
return

bucket_name = env("AWS_S3_BUCKET_URI").split("s3://")[1].split("/")[0]
if needs_to_sync():
with suppress(ClientError):
pull_file_from_s3(napse_settings.NAPSE_SECRETS_FILE_PATH, "napse-eb-bucket", "napse-secrets.json")
pull_file_from_s3(
napse_settings.NAPSE_SECRETS_FILE_PATH,
bucket_name,
"napse-secrets.json",
)

master_key_created = False
counter = 0
Expand All @@ -53,4 +57,4 @@ def sync_master_key_s3(sender, **kwargs):
raise ValueError(error_msg)

if needs_to_sync():
sync_file_with_s3(napse_settings.NAPSE_SECRETS_FILE_PATH, "napse-eb-bucket", "napse-secrets.json")
sync_file_with_s3(napse_settings.NAPSE_SECRETS_FILE_PATH, bucket_name, "napse-secrets.json")
1 change: 0 additions & 1 deletion backend/config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
ALLOWED_HOSTS = ["django", env("NAPSE_API_DOMAIN"), "localhost"]
print("ALLOWED_HOSTS", ALLOWED_HOSTS)


@receiver(connection_created)
Expand Down

0 comments on commit 62be4bb

Please sign in to comment.