about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-04-19 21:18:50 +0900
committerEugen <eugen@zeonfederated.com>2017-04-19 14:18:50 +0200
commit8b8e140c7155a94efd2b72d43d18c478a10f3582 (patch)
tree894112f553717e28ec2908da5be80b425065a8ea
parent8bac0350d16cb8e2770c089c91d71f8038404de5 (diff)
Change to switch signature version for Amazon S3 (#2124)
-rw-r--r--.env.production.sample1
-rw-r--r--config/initializers/paperclip.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/.env.production.sample b/.env.production.sample
index 28afee246..16ffd0803 100644
--- a/.env.production.sample
+++ b/.env.production.sample
@@ -74,6 +74,7 @@ SMTP_FROM_ADDRESS=notifications@example.com
 # S3_PROTOCOL=https
 # S3_HOSTNAME=
 # S3_ENDPOINT=
+# S3_SIGNATURE_VERSION=
 
 # Optional alias for S3 if you want to use Cloudfront or Cloudflare in front
 # S3_CLOUDFRONT_HOST=
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index ffaa2566e..af65ca818 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -28,6 +28,7 @@ if ENV['S3_ENABLED'] == 'true'
   unless ENV['S3_ENDPOINT'].blank?
     Paperclip::Attachment.default_options[:s3_options] = {
       endpoint: ENV['S3_ENDPOINT'],
+      signature_version: ENV['S3_SIGNATURE_VERSION'] || 'v4',
       force_path_style: true,
     }