Digital Ocean Spaces for Storage?
Yep! Just add this to config/storage.yml:
digital_ocean: service: S3 access_key_id: <SPACES_KEY> secret_access_key: <SPACES_SECRET_KEY> region: nyc3 bucket: <SPACES_NAME> endpoint: 'https://nyc3.digitaloceanspaces.com'
Adjust all those values to match your Spaces configuration and you can then change your app to use "digital_ocean".
config.active_storage.service = :digital_ocean
Don't forget:
gem 'aws-sdk-s3'
Also I was easily confused by the 'Endpoint' link at the top of the Spaces name. I mistakenly copied that one for the config.
It should be the one below:
"The endpoint is used to configure 3rd party clients, which may refer to it by other names such as the S3 Endpoint or Server."
I'm having an issue getting Digital Ocean spaces working. It seems that the credentials cant be found in my deployment. I'm a few hours in and can't figure out what the issue is.
Does anyone have any thoughts or see something I'm missing?
Puma log file:
Does anyone have any thoughts or see something I'm missing?
Puma log file:
Unable to load application: Aws::Sigv4::Errors::MissingCredentialsError: missing credentials, provide credentials with one of the following options: Feb 05 03:33:25: - :access_key_id and :secret_access_key Feb 05 03:33:25: - :credentials Feb 05 03:33:25: - :credentials_provider
Gem file
gem 'aws-sdk-s3'
config/storage.yml
digitalocean_spaces: service: S3 access_key_id: <%= Rails.application.credentials.dig(:digitalocean_spaces, :access_key_id) %> secret_access_key: <%= Rails.application.credentials.dig(:digitalocean_spaces, :secret_access_key) %> region: nyc3 endpoint: 'https://nyc3.digitaloceanspaces.com' bucket: foobar-bucket
environments/production.rb
config.active_storage.service = :digitalocean_spaces
credentials.ymc.enc
digitalocean_spaces: access_key_id: foobar secret_access_key: secretfoobar
Notifications
You’re not receiving notifications from this thread.