about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorleopku <leopku@qq.com>2017-03-23 15:44:55 +0800
committerleopku <leopku@qq.com>2017-03-23 15:44:55 +0800
commitc46843c65c0761f97d894f21e361489a0fa1a60a (patch)
tree1502911e9bba9e0d06dfba9b86c51facaa4fa89e /config/initializers
parent08faeedff7838e339488cfcddf02d95241557ffb (diff)
:wrench: S3 protocol from ENV
add support for reading S3 protocol from ENV
also add S3_HOSTNAME in .env.production.sample
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/paperclip.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index 580a3196e..2a2ef8fea 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -11,7 +11,7 @@ if ENV['S3_ENABLED'] == 'true'
   Aws.eager_autoload!(services: %w(S3))
 
   Paperclip::Attachment.default_options[:storage]        = :s3
-  Paperclip::Attachment.default_options[:s3_protocol]    = 'https'
+  Paperclip::Attachment.default_options[:s3_protocol]    = ENV.fetch('S3_PROTOCOL') { 'https' }
   Paperclip::Attachment.default_options[:url]            = ':s3_domain_url'
   Paperclip::Attachment.default_options[:s3_host_name]   = ENV.fetch('S3_HOSTNAME') { "s3-#{ENV.fetch('S3_REGION')}.amazonaws.com" }
   Paperclip::Attachment.default_options[:path]           = '/:class/:attachment/:id_partition/:style/:filename'