Skip to content

Commit

Permalink
PB-617 Fix the local setup for the bucket access
Browse files Browse the repository at this point in the history
It's impossible to reproduce the service-account situation for minio,
hence we access it the legacy way with access key
  • Loading branch information
schtibe committed Jul 9, 2024
1 parent a47ba19 commit 60cc43c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/config/settings_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@
MANAGED_BUCKET_COLLECTION_PATTERNS = env.list(
'MANAGED_BUCKET_COLLECTION_PATTERNS', default=[r"^ch\.meteoschweiz\.ogd-*"]
)

# Since it's impossible to recreate the service-account situation with minio
# we inject some configuration in here to access the second bucket
# in the same way as first bucket, via access/secrets
# Like this we can leave the base (prod) configuration clean, while fixing
# the local setup
AWS_SETTINGS['managed']['access_type'] = "key"
AWS_SETTINGS['managed']['ACCESS_KEY_ID'] = env("LEGACY_AWS_ACCESS_KEY_ID")
AWS_SETTINGS['managed']['SECRET_ACCESS_KEY'] = env("LEGACY_AWS_SECRET_ACCESS_KEY")
1 change: 1 addition & 0 deletions app/config/settings_prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
},
'managed': {
# The managed configuration will be passed directly via env
# The access to the managed bucket is done via service account
"access_type": "service_account",
"S3_BUCKET_NAME": env("AWS_S3_BUCKET_NAME"),
"S3_REGION_NAME": env('AWS_S3_REGION_NAME', default='eu-central-1'),
Expand Down

0 comments on commit 60cc43c

Please sign in to comment.