From 2e1e061f24d1d9cf186a5048f08448c0e028b7ce Mon Sep 17 00:00:00 2001 From: tmyt Date: Wed, 19 Apr 2017 21:20:36 +0900 Subject: [PATCH] Make configuarable s3_permissions for paperclip (#2139) --- config/initializers/paperclip.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index af65ca8188..9e2996faa0 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -16,7 +16,7 @@ if ENV['S3_ENABLED'] == 'true' 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' Paperclip::Attachment.default_options[:s3_headers] = { 'Cache-Control' => 'max-age=315576000' } - Paperclip::Attachment.default_options[:s3_permissions] = 'public-read' + Paperclip::Attachment.default_options[:s3_permissions] = ENV.fetch('S3_PERMISSION') { 'public-read' } Paperclip::Attachment.default_options[:s3_region] = ENV.fetch('S3_REGION') { 'us-east-1' } Paperclip::Attachment.default_options[:s3_credentials] = {