Skip to content

Instantly share code, notes, and snippets.

@akshaymohite
Created July 19, 2017 11:45
Show Gist options
  • Save akshaymohite/287a04a1f4eb31e3f468e71163caec68 to your computer and use it in GitHub Desktop.
Save akshaymohite/287a04a1f4eb31e3f468e71163caec68 to your computer and use it in GitHub Desktop.
ActiveStorage: storage_services.yml
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
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
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 ]
@benkoshy
Copy link

Cheers for this Akshay, but I have a question: when deploying for production, how will it access the gcs.keyfile (unless you check it into version control)? persumably we do not want to check our gcs secrets into version control? advice much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment