Skip to content

Commit

Permalink
Use S3 for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
ambethia committed Sep 27, 2018
1 parent 9948f68 commit 7181948
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
COKUzaf5GIGYQHIAtDTaxuRu2HhJ20x9vuM3bUhdYEyfklEBBxWjoMV+relsRF3FcZd6bqo+zcLBtYwbYsDnlrQ0SRSdPPtvgg9fOaY2958FXEXV5VlFaVJ+GYFw8XFW/6E0qY3M91BL26gEdjbXBNczSDkYoB3y/dEmFEtVmXfZ4t+6bM/WAM9n/vuOg/xuieHK7L+uD31bgxrOfx7AG6i6NT+hdRRAmhEhtAr9chYLgvD49M4gPjvGv5EtK/UVCmphN9SFKkC1A76x0QdopJRuP07OcJWAOAXxsi+Xo/WoZlHJ2LFvXu7zMjPt1KDocc2cvsgw+JLbpSCa+hR9LeHVTPP8OGjWEwX6RK3UofZsy1ge0ejzCLPZeX5z5OTKuqaRD/VZuuxuQRnJRg3pkQXKDEx8Kd+JPgRjmheNtsdqOYBkGk1LmvAbnjCQSJeRKxKtURSAn1/c394QzQUn1NiXi0IDTP+TKEO5nNBDrmjqiavPlAXCDCPXsBuBEcaiDbmGJExtvlXDUmHrQ2UxQ4ALXQy1B3kRIPBVMg==--5IQqMBbftwW+5Ubt--+Il22TCWDZ+fKbC69W2OtQ==
Ners6lgwOQ/ajI0cLPFIToKGeT4NF5+zb+ttQjZ/mFusqxEGhrjfXZNiqx4xlNVDWZjg6AEBRHSWZYTrSthJtfxorgFTAvuprzZW6bzPQw592Shaw+ZtgGNzvMHyCnZx2uRhnPH5oM6aHba5Tpwpg3qqP28uU+/I//tXsnUu4V/Ag6KKfCcGmkyyeHJX8dRFgsEsb5nL1f8dZD94t3V0FD3FYydv96Wt+TlOUFiI/diYI8w19AX3A7IAUw5kEO6wlMdrM3AZW9OUwBTmc9dFtCCLrPMGdlOLWJYxtL0+wV0Hdt1Y2XVyd6dZbA4z7TxbBhdqU8Ba6DURS3x4/8GFdy3wNjaxpbHVSw2PEPtQTkbtThjfcaZn8qWISQwD2n02QdntA15t6390a0o+9fRGic6UgIATOlrEFeYqlB6mWYIiojoca/s68UVv32loUZCtg9NtGzm1t8u1MpufQywKrlO9F7g+aIAk--puo4kDly7vuHReKT--Q8XEMUOaBKA5aMwiAnQOkw==
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# 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

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/authentication.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Rails.application.config.middleware.use OmniAuth::Builder do
provider :developer unless Rails.env.production?
provider :github,
Rails.application.credentials.github_client_id,
Rails.application.credentials.github_client_secret,
Rails.application.credentials.dig(:github, :client_id),
Rails.application.credentials.dig(:github, :client_secret),
scope: "user"
end
32 changes: 6 additions & 26 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,9 @@ local:
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

# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket

# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name

# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]
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: gifs.suncoast.io

0 comments on commit 7181948

Please sign in to comment.