Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a Rails 6.1.6.1 app that is using Active Storage to upload images to Digital Ocean Spaces. All images are uploaded with public permissions. This has worked fine for over 2 years. I’ve now been adding video uploads as well, but using the exact same set up, all videos are uploaded as private instead, no matter what I do. Setting the video to public manually through the DO dashboard sets the permissions as expected.
My storage.yml file is set up as follows:
digitalocean:
service: S3
access_key_id: <%= ENV["DIGITALOCEAN_SPACES_KEY"] %>
secret_access_key: <%= ENV["DIGITALOCEAN_SPACES_SECRET"] %>
region: <%= ENV["DIGITALOCEAN_SPACES_REGION"] %>
bucket: <%= ENV["DIGITALOCEAN_SPACES_BUCKET"] %>
endpoint: <%= ENV["DIGITALOCEAN_SPACES_ENDPOINT"] %>
public: true
upload:
cache_control: "public, max-age=31536000"
Where public: true takes care of the permissions correctly for images.
Both images are videos are uploaded using Direct Upload through the same method.
When I upload an image it is send using the following url (with some bits redacted): https://[bucket].fra1.digitaloceanspaces.com/[file-id]?x-amz-acl=public-read&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[key]%2F20230922%2Ffra1%2Fs3%2Faws4_request&X-Amz-Date=20230922T164911Z&X-Amz-Expires=300&X-Amz-SignedHeaders=content-length%3Bcontent-md5%3Bcontent-type%3Bhost&X-Amz-Signature=[signature]. The important bit (I’m assuming) being x-amz-acl=public-read
When I upload a video the url is similar: https://[bucket].fra1.digitaloceanspaces.com/[file-id]?x-amz-acl=public-read&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[key]%2F20230922%2Ffra1%2Fs3%2Faws4_request&X-Amz-Date=20230922T165148Z&X-Amz-Expires=300&X-Amz-SignedHeaders=content-length%3Bcontent-md5%3Bcontent-type%3Bhost&X-Amz-Signature=[signature]. The same x-amz-acl=public-read is present, yet it is private.
I’ve tried adding the x-amz-acl header to the accepted headers in the DO Spaces settings. I’ve tried adding public: acl: "public-read" to the storage.yml. I’ve tried manually sending the header with every request. But at this point I feel like I’m fighting against something that should have just worked, in theory.
The images are all png or jpeg, the video is always an mp4. The images are limited to 2MB, but videos can of course be much larger (the smallest I’ve tried is 10MB), could it be related to file size somehow?
Any help would be much appreciated!
SarkariResultht
KFSys
Arne van Hoorn
alexdo
4287c71658bd4ea39bef277d491b1c
4287c71658bd4ea39bef277d491b1c
Demanix
Demanix
devjk1
Jordan
LC Labs Sp. z o.o.
a0cd9be01b14447384f79073fc121f