Skip to content

Commit

Permalink
fix cg internal endpoint setting (#2613)
Browse files Browse the repository at this point in the history
  • Loading branch information
timoballard authored Oct 25, 2023
1 parent d480d30 commit cc7f6f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/audit/file_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def file_exists(filename):
region_name=settings.AWS_S3_PRIVATE_REGION_NAME,
aws_access_key_id=settings.AWS_PRIVATE_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_PRIVATE_SECRET_ACCESS_KEY,
endpoint_url=settings.AWS_S3_PRIVATE_ENDPOINT,
endpoint_url=settings.AWS_S3_PRIVATE_INTERNAL_ENDPOINT,
config=Config(signature_version="s3v4"),
)

Expand Down
6 changes: 6 additions & 0 deletions backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@
)

AWS_S3_ENDPOINT_URL = AWS_S3_PRIVATE_ENDPOINT

# when running locally, the internal endpoint (docker network) is different from the external endpoint (host network)
AWS_S3_PRIVATE_INTERNAL_ENDPOINT = AWS_S3_ENDPOINT_URL
AWS_S3_PRIVATE_EXTERNAL_ENDPOINT = "http://localhost:9001"

DISABLE_AUTH = env.bool("DISABLE_AUTH", default=False)
Expand Down Expand Up @@ -309,6 +312,9 @@

AWS_S3_PRIVATE_ENDPOINT = s3_creds["endpoint"]
AWS_S3_ENDPOINT_URL = f"https://{AWS_S3_PRIVATE_ENDPOINT}"

# in deployed environments, the internal & external endpoint URLs are the same
AWS_S3_PRIVATE_INTERNAL_ENDPOINT = AWS_S3_ENDPOINT_URL
AWS_S3_PRIVATE_EXTERNAL_ENDPOINT = AWS_S3_ENDPOINT_URL

AWS_PRIVATE_LOCATION = "static"
Expand Down

0 comments on commit cc7f6f2

Please sign in to comment.