Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
config.cache_store = :memory_store

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
config.active_storage.service = :digitalocean
Rails.application.routes.default_url_options[:host] ||= "http://localhost:3000"

# Don't care if the mailer can't send.
Expand Down
1 change: 1 addition & 0 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

# Override production settings here
Rails.application.configure do
config.active_storage.service = :digitalocean
end
10 changes: 10 additions & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ local:
service: Disk
root: <%= Rails.root.join("storage") %>

digitalocean:
service: S3
access_key_id: <%= ENV['DO_SPACES_KEY'] %>
secret_access_key: <%= ENV['DO_SPACES_SECRET'] %>
region: <%= ENV['DO_SPACES_REGION'] %> # e.g., 'nyc3', 'sfo2', 'sgp1'
bucket: <%= ENV['DO_SPACES_BUCKET'] %>
endpoint: <%= "https://#{ENV['DO_SPACES_REGION']}.digitaloceanspaces.com" %>
force_path_style: false
http_open_timeout: 15
http_read_timeout: 30
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
Expand Down