Configure activestorage for production
access keys and region are configured using environment variables
This commit is contained in:
parent
c1b9f8e701
commit
829f534afd
1
Gemfile
1
Gemfile
@ -23,6 +23,7 @@ gem 'bootsnap', '>= 1.4.2', require: false
|
|||||||
|
|
||||||
gem 'lockbox'
|
gem 'lockbox'
|
||||||
|
|
||||||
|
gem 'aws-sdk-s3', require: false
|
||||||
# gem 'airrecord'
|
# gem 'airrecord'
|
||||||
gem 'google-api-client'
|
gem 'google-api-client'
|
||||||
gem 'rack-cors'
|
gem 'rack-cors'
|
||||||
|
18
Gemfile.lock
18
Gemfile.lock
@ -58,6 +58,22 @@ GEM
|
|||||||
zeitwerk (~> 2.2)
|
zeitwerk (~> 2.2)
|
||||||
addressable (2.7.0)
|
addressable (2.7.0)
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
|
aws-eventstream (1.0.3)
|
||||||
|
aws-partitions (1.263.0)
|
||||||
|
aws-sdk-core (3.89.1)
|
||||||
|
aws-eventstream (~> 1.0, >= 1.0.2)
|
||||||
|
aws-partitions (~> 1, >= 1.239.0)
|
||||||
|
aws-sigv4 (~> 1.1)
|
||||||
|
jmespath (~> 1.0)
|
||||||
|
aws-sdk-kms (1.27.0)
|
||||||
|
aws-sdk-core (~> 3, >= 3.71.0)
|
||||||
|
aws-sigv4 (~> 1.1)
|
||||||
|
aws-sdk-s3 (1.60.1)
|
||||||
|
aws-sdk-core (~> 3, >= 3.83.0)
|
||||||
|
aws-sdk-kms (~> 1)
|
||||||
|
aws-sigv4 (~> 1.1)
|
||||||
|
aws-sigv4 (1.1.0)
|
||||||
|
aws-eventstream (~> 1.0, >= 1.0.2)
|
||||||
bootsnap (1.4.6)
|
bootsnap (1.4.6)
|
||||||
msgpack (~> 1.0)
|
msgpack (~> 1.0)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
@ -96,6 +112,7 @@ GEM
|
|||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jbuilder (2.10.0)
|
jbuilder (2.10.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
|
jmespath (1.4.0)
|
||||||
jwt (2.2.1)
|
jwt (2.2.1)
|
||||||
listen (3.2.1)
|
listen (3.2.1)
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
@ -219,6 +236,7 @@ PLATFORMS
|
|||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
aws-sdk-s3
|
||||||
bootsnap (>= 1.4.2)
|
bootsnap (>= 1.4.2)
|
||||||
byebug
|
byebug
|
||||||
dotenv-rails
|
dotenv-rails
|
||||||
|
@ -36,7 +36,7 @@ Rails.application.configure do
|
|||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :amazon
|
||||||
|
|
||||||
# Mount Action Cable outside main process or domain.
|
# Mount Action Cable outside main process or domain.
|
||||||
# config.action_cable.mount_path = nil
|
# config.action_cable.mount_path = nil
|
||||||
|
@ -6,13 +6,13 @@ local:
|
|||||||
service: Disk
|
service: Disk
|
||||||
root: <%= Rails.root.join("storage") %>
|
root: <%= Rails.root.join("storage") %>
|
||||||
|
|
||||||
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
# access keys and region are configured using environment variables
|
||||||
# amazon:
|
amazon:
|
||||||
# service: S3
|
service: S3
|
||||||
|
bucket: ENV['AWS_S3_BUCKET']
|
||||||
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
||||||
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
||||||
# region: us-east-1
|
# region: ENV['AWS_REGION']
|
||||||
# bucket: your_own_bucket
|
|
||||||
|
|
||||||
# Remember not to checkin your GCS keyfile to a repository
|
# Remember not to checkin your GCS keyfile to a repository
|
||||||
# google:
|
# google:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user