django-icekit icon indicating copy to clipboard operation
django-icekit copied to clipboard

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

Open jmurty opened this issue 8 years ago • 2 comments

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:

  • upgrade to whichever version of django-storages supports version 4 signing
  • adjust GLAMkit's settings to use, and work properly with, the new version 4 signing support. Probably by setting AWS_S3_SIGNATURE_VERSION='s3v4' and the AWS_S3_HOST setting as documented in http://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

jmurty avatar Jun 23 '17 04:06 jmurty

django-storages is pegged to < 1.6 in commit bdacba6c

jmurty avatar Jun 23 '17 04:06 jmurty

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.

mrmachine avatar Jun 23 '17 07:06 mrmachine