Skip to content

Commit

Permalink
Include default storage configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jul 31, 2017
1 parent 9330d01 commit 4687c86
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
Expand Up @@ -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.
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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

Expand Down
@@ -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 ]
1 change: 1 addition & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -64,6 +64,7 @@
config/routes.rb
config/secrets.yml
config/spring.rb
config/storage_services.yml
db
db/seeds.rb
lib
Expand Down

0 comments on commit 4687c86

Please sign in to comment.