Shrine: Disable S3 signature

Created on 2 Feb 2018  路  1Comment  路  Source: shrinerb/shrine

I have a lot of public files and I want to be able to get them without signature.
How? Why there is always signature there.

I can't cache those files.

Most helpful comment

AWS S3 by default gives uploaded objects private access, which means these objects can only be retrieved with URLs that have signature. If you wish to make the objects public, you can set the public-read ACL on upload:

Shrine::Storage::S3.new(upload_options: {acl: "public-read"}, **other_options)

And then objects will be accessible without signature, so you can generate URLs with public: true option:

photo.image.url(public: true)

You can also make public: true option the default:

Shrine.plugin :default_url_options, store: {public: true}

Note that as per contribution guidelines questions should be asked on the Shrine google group, GitHub issues should only be used for bug reports.

>All comments

AWS S3 by default gives uploaded objects private access, which means these objects can only be retrieved with URLs that have signature. If you wish to make the objects public, you can set the public-read ACL on upload:

Shrine::Storage::S3.new(upload_options: {acl: "public-read"}, **other_options)

And then objects will be accessible without signature, so you can generate URLs with public: true option:

photo.image.url(public: true)

You can also make public: true option the default:

Shrine.plugin :default_url_options, store: {public: true}

Note that as per contribution guidelines questions should be asked on the Shrine google group, GitHub issues should only be used for bug reports.

Was this page helpful?
0 / 5 - 0 ratings