Skip to content

Commit

Permalink
Merge 7394bf9 into 54d90e7
Browse files Browse the repository at this point in the history
  • Loading branch information
anitagraham committed Oct 21, 2019
2 parents 54d90e7 + 7394bf9 commit 73d9049
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ Refinery::Dragonfly.configure do |config|
# config.response_header = <%= Refinery::Dragonfly.response_header.inspect %>


# Set the S3 options using means other than securely by environment variables.
# If you have to.
# config.s3_bucket_name = ENV['S3_BUCKET']
# config.s3_region = ENV['S3_REGION']
# config.s3_access_key_id = ENV['S3_KEY']
# config.s3_secret_access_key = ENV['S3_SECRET']
# Set the S3 access keys in the encrypted credentials file
# aws:
# access_key_id: 123
# secret_access_key: 345
#
# config.s3_bucket_name = Rails.application.credentials.aws[:bucket_name]
# config.s3_region = Rails.application.credentials.aws[:region]
# config.s3_access_key_id = Rails.application.credentials.aws[:access_key_id]
# config.s3_secret_access_key = Rails.application.credentials.aws[:secret_access_key]

# When true will use Amazon's Simple Storage Service instead of the default file system for storing resources and images
config.s3_datastore = config.s3_access_key_id.present? || config.s3_secret_access_key.present?
Expand Down
11 changes: 6 additions & 5 deletions dragonfly/lib/refinery/dragonfly/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ module Dragonfly
# s3 Data Store Config
# When using s3 as data store, make sure to add the dragonfly-s3_data_store gem to your project
self.s3_datastore = false
self.s3_bucket_name = ENV['S3_BUCKET']
self.s3_access_key_id = ENV['S3_KEY']
self.s3_secret_access_key = ENV['S3_SECRET']
self.s3_region = ENV['S3_REGION'] # default 'us-east-1' see Dragonfly S3DataStore :s3_REGIONS for options
self.s3_url_scheme = nil # defaults to "http"
self.s3_bucket_name = Rails.application.credentials[:s3_bucket_name]
self.s3_access_key_id = Rails.application.credentials[:s3_access_key_id]
self.s3_secret_access_key = Rails.application.credentials[:s3_secret_access_key]
self.s3_region = Rails.application.credentials[:s3_region]
# default 'us-east-1' see Dragonfly S3DataStore :s3_REGIONS for options
self.s3_url_scheme = 'https' # defaults to "http"
self.s3_url_host = nil # defaults to "<bucket-name>.s3.amazonaws.com" or "s3.amazonaws.com/<bucket-name>" if not a valid subdomain
self.s3_use_iam_profile = nil # boolean - if true no need for access_key_id or secret_access_key
self.s3_root_path = nil # store all content under a subdirectory - uids will be relative to this - defaults to nil
Expand Down

0 comments on commit 73d9049

Please sign in to comment.