Enhancement: Use S3 for active storage (#398)
This commit is contained in:
@@ -25,6 +25,7 @@ SMTP_ENABLE_STARTTLS_AUTO=
|
|||||||
|
|
||||||
#misc
|
#misc
|
||||||
FRONTEND_URL=http://0.0.0.0:3000
|
FRONTEND_URL=http://0.0.0.0:3000
|
||||||
|
ACTIVE_STORAGE_SERVICE=local
|
||||||
|
|
||||||
#s3
|
#s3
|
||||||
S3_BUCKET_NAME=
|
S3_BUCKET_NAME=
|
||||||
|
|||||||
@@ -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 = ENV.fetch('ACTIVE_STORAGE_SERVICE', 'local').to_sym
|
||||||
|
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
# config.force_ssl = true
|
# config.force_ssl = true
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ local:
|
|||||||
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)
|
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
||||||
# amazon:
|
amazon:
|
||||||
# service: S3
|
service: S3
|
||||||
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
access_key_id: <%= ENV.fetch('AWS_ACCESS_KEY_ID', '') %>
|
||||||
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
secret_access_key: <%= ENV.fetch('AWS_SECRET_ACCESS_KEY', '') %>
|
||||||
# region: us-east-1
|
region: <%= ENV.fetch('AWS_REGION', '') %>
|
||||||
# bucket: your_own_bucket
|
bucket: <%= ENV.fetch('S3_BUCKET_NAME', '') %>
|
||||||
|
|
||||||
# Remember not to checkin your GCS keyfile to a repository
|
# Remember not to checkin your GCS keyfile to a repository
|
||||||
# google:
|
# google:
|
||||||
|
|||||||
Reference in New Issue
Block a user