Hi, I am trying to use spaces as an active storage provider with ruby on rails.
Rails seems to expect the files to be public with no (obvious) way of setting the permission on upload.
I am trying to set the default permission for a spaces to public, but only find resources showing how to change permission after the upload. What I need is set the default to public.
Is it possible to do? Without it we can’t deploy to digital ocean :-/
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there. The documentation says the API is S3-compatible (https://developers.digitalocean.com/documentation/spaces/#introduction). So I just went and used the s3cmd tool like this:
s3cmd --access-key=xxx --secret-key=yyy --host=<region>.digitaloceanspaces.com --host-bucket=<bucket>.<region>.digitaloceanspaces.com --region=<region> s3://<bucket> --acl-public
Oops, correcting myself. The command should be:
s3cmd --access_key=xxx --secret_key=yyy --host=<region>.digitaloceanspaces.com --host-bucket=<bucket>.<region>.digitaloceanspaces.com --region=<region> setacl s3://<bucket> --acl-public
Managed to make it work by upgrading rails. It works with the presigned url now.
Don’t need it anymore, but can’t figure out how to change default permission.
This seems to imply it is possible: https://developers.digitalocean.com/documentation/spaces/#create-a-bucket
Tried with the ruby aws api, it crash with
Aws::S3::Errors::XAmzContentSHA256Mismatch ()
Then I used the Aws ruby api to generate the sign header that I use directly with curl. Spaces did returned HTTP/1.1 200 OK, but nothing changed. New file are still privates. Though maybe I misunderstood the api and it just set the listing setting to public, but no this one stays private too.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.