Skip to content

Instantly share code, notes, and snippets.

@mbalc
Last active September 25, 2018 09:22
Show Gist options
  • Save mbalc/4428361c985149fd3e5e7c6ac818d6f4 to your computer and use it in GitHub Desktop.
Save mbalc/4428361c985149fd3e5e7c6ac818d6f4 to your computer and use it in GitHub Desktop.
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
- config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
+ config.public_file_server.enabled = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# 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)
- config.active_storage.service = :local
+ config.active_storage.service = :amazon
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
service: Disk
root: <%= Rails.root.join("storage") %>
-# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
-# amazon:
-# service: S3
-# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
-# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
-# region: us-east-1
-# bucket: your_own_bucket
+# Use rails credentials:edit to set the AWS secrets (as staging:access_key_id|secret_access_key)
+# TODO add support for production/staging based on env
+amazon:
+ service: S3
+ access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
+ secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
+ region: us-east-2
+ bucket: elasticbeanstalk-us-east-2-423917048452
# Remember not to checkin your GCS keyfile to a repository
# google:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment