Skip to content

Commit fe61bda

Browse files
Add digitalocean s3-compatible DO Spaces config (#301)
* Add digitalocean s3-compatible DO Spaces config * Add digtalocean config to staging * Add more config * use local storage for development --------- Co-authored-by: Justin Miller <[email protected]>
1 parent 6fc2b21 commit fe61bda

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

config/environments/staging.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
# Override production settings here
44
Rails.application.configure do
5+
config.active_storage.service = :digitalocean
56
end

config/storage.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ local:
66
service: Disk
77
root: <%= Rails.root.join("storage") %>
88

9+
digitalocean:
10+
service: S3
11+
access_key_id: <%= ENV['DO_SPACES_KEY'] %>
12+
secret_access_key: <%= ENV['DO_SPACES_SECRET'] %>
13+
region: <%= ENV['DO_SPACES_REGION'] %> # e.g., 'nyc3', 'sfo2', 'sgp1'
14+
bucket: <%= ENV['DO_SPACES_BUCKET'] %>
15+
endpoint: <%= "https://#{ENV['DO_SPACES_REGION']}.digitaloceanspaces.com" %>
16+
force_path_style: false
17+
http_open_timeout: 15
18+
http_read_timeout: 30
919
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
1020
# amazon:
1121
# service: S3

0 commit comments

Comments
 (0)