Browse Source

Fix insecure S3 URLs

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
b835f4aa1c
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      config/initializers/paperclip.rb

+ 4
- 4
config/initializers/paperclip.rb View File

@ -1,5 +1,8 @@
if ENV['S3_ENABLED'] == 'true'
Paperclip::Attachment.default_options[:storage] = :s3
Paperclip::Attachment.default_options[:storage] = :s3
Paperclip::Attachment.default_options[:s3_protocol] = 'https'
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
Paperclip::Attachment.default_options[:s3_credentials] = {
bucket: ENV.fetch('S3_BUCKET'),
@ -7,7 +10,4 @@ if ENV['S3_ENABLED'] == 'true'
secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
s3_region: ENV.fetch('S3_REGION')
}
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
end

Loading…
Cancel
Save