mirror of https://github.com/rails/rails
Include default storage configuration
This commit is contained in:
parent
9330d01ada
commit
4687c86b91
|
@ -26,6 +26,9 @@ Rails.application.configure do
|
|||
|
||||
config.cache_store = :null_store
|
||||
end
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage_services.yml for options)
|
||||
config.active_storage.service = :local
|
||||
<%- unless options.skip_action_mailer? -%>
|
||||
|
||||
# Don't care if the mailer can't send.
|
||||
|
|
|
@ -45,6 +45,8 @@ Rails.application.configure do
|
|||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage_services.yml for options)
|
||||
config.active_storage.service = :local
|
||||
<%- unless options[:skip_action_cable] -%>
|
||||
# Mount Action Cable outside main process or domain
|
||||
# config.action_cable.mount_path = nil
|
||||
|
|
|
@ -27,6 +27,9 @@ Rails.application.configure do
|
|||
|
||||
# Disable request forgery protection in test environment.
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
# Store uploaded files on the local file system in a temporary directory
|
||||
config.active_storage.service = :test
|
||||
<%- unless options.skip_action_mailer? -%>
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
test:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("tmp/storage") %>
|
||||
|
||||
local:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("storage") %>
|
||||
|
||||
# Use rails secrets:edit to set the AWS secrets (as shared:aws:access_key_id|secret_access_key)
|
||||
# amazon:
|
||||
# service: S3
|
||||
# access_key_id: <%= Rails.application.secrets.dig(:aws, :access_key_id) %>
|
||||
# secret_access_key: <%= Rails.application.secrets.dig(:aws, :secret_access_key) %>
|
||||
# region: us-east-1
|
||||
# bucket: your_own_bucket
|
||||
|
||||
# Remember not to checkin your GCS keyfile to a repository
|
||||
# google:
|
||||
# service: GCS
|
||||
# project: your_project
|
||||
# keyfile: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
||||
# bucket: your_own_bucket
|
||||
|
||||
# mirror:
|
||||
# service: Mirror
|
||||
# primary: local
|
||||
# secondaries: [ amazon, google ]
|
|
@ -64,6 +64,7 @@ DEFAULT_APP_FILES = %w(
|
|||
config/routes.rb
|
||||
config/secrets.yml
|
||||
config/spring.rb
|
||||
config/storage_services.yml
|
||||
db
|
||||
db/seeds.rb
|
||||
lib
|
||||
|
|
Loading…
Reference in New Issue