Skip to content

Commit 94ceac9

Browse files
Ken LippoldKen Lippold
authored andcommitted
Fixed bucket ACL settings
1 parent 227879e commit 94ceac9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

hydroserver/settings.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,42 +225,44 @@
225225

226226
if DEPLOYMENT_BACKEND == "aws":
227227
AWS_S3_CUSTOM_DOMAIN = urlparse(PROXY_BASE_URL).hostname
228-
AWS_DEFAULT_ACL = "private"
229228
AWS_CLOUDFRONT_KEY = config("AWS_CLOUDFRONT_KEY", default="").encode("ascii")
230229
AWS_CLOUDFRONT_KEY_ID = config("AWS_CLOUDFRONT_KEY_ID", default=None)
231230
STORAGES = {
232231
"default": {
233232
"BACKEND": "storages.backends.s3.S3Storage",
234233
"OPTIONS": {
235234
"bucket_name": config("MEDIA_BUCKET_NAME", default=None),
236-
"location": "media"
235+
"location": "media",
236+
"default_acl": "private"
237237
},
238238
},
239239
"staticfiles": {
240240
"BACKEND": "storages.backends.s3boto3.S3StaticStorage",
241241
"OPTIONS": {
242242
"bucket_name": config("STATIC_BUCKET_NAME", default=None),
243-
"location": "static"
243+
"location": "static",
244+
"default_acl": "public-read"
244245
},
245246
}
246247
}
247248
elif DEPLOYMENT_BACKEND == "gcp":
248249
GS_PROJECT_ID = config("GS_PROJECT_ID", default=None)
249250
GS_CUSTOM_ENDPOINT = PROXY_BASE_URL
250-
GS_DEFAULT_ACL = "authenticatedRead"
251251
STORAGES = {
252252
"default": {
253253
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
254254
"OPTIONS": {
255255
"bucket_name": config("MEDIA_BUCKET_NAME", default=None),
256-
"location": "media"
256+
"location": "media",
257+
"default_acl": "authenticatedRead"
257258
},
258259
},
259260
"staticfiles": {
260261
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
261262
"OPTIONS": {
262263
"bucket_name": config("STATIC_BUCKET_NAME", default=None),
263-
"location": "static"
264+
"location": "static",
265+
"default_acl": "publicRead"
264266
},
265267
}
266268
}

0 commit comments

Comments
 (0)