ic-labs / django-icekit

GLAMkit is a next-generation Python CMS by the Interaction Consortium, designed especially for the cultural sector.
http://glamkit.com
MIT License
47 stars 11 forks source link

Upgrade and fix django-storages to work with S3's version 4 request signing #257

Open jmurty opened 7 years ago

jmurty commented 7 years ago

We have pinned django-storages to < 1.6 for now because recent updates in versions 1.6 (up to and including 1.6.2 at least) generate incorrect S3 URL formats which break our assets lookups.

The issue is reported upstream in https://github.com/jschneier/django-storages/issues/343 In that ticket, it sounds like an upcoming 1.6.3 version will fix our immediate issue.

However, deeper down, the problem has been triggered by Amazon's update to "version 4" signatures for S3, which is very different from the legacy signing approach. Version 4 request signing is the only kind that works for new(er) S3 regions, since the legacy version is deprecated.

So ultimately we should:

jmurty commented 7 years ago

django-storages is pegged to < 1.6 in commit bdacba6c

mrmachine commented 7 years ago

They have released 1.6.3 which reverts the change to default value, but 1.7 will make the change again. The docs aren't clear which additional setting we need to provide to specify the correct endpoint, but I guess it might be AWS_S3_REGION_NAME. So now we might need bucket name, access key ID, secret key, and region name settings.