about summary refs log tree commit diff
path: root/config/initializers/paperclip.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/paperclip.rb')
-rw-r--r--config/initializers/paperclip.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index a2285427c..bd37f6709 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -90,6 +90,12 @@ if ENV['S3_ENABLED'] == 'true'
     )
   end
 
+  if ENV.has_key?('S3_STORAGE_CLASS')
+    Paperclip::Attachment.default_options[:s3_headers].merge!(
+      'X-Amz-Storage-Class' => ENV['S3_STORAGE_CLASS']
+    )
+  end
+
   # Some S3-compatible providers might not actually be compatible with some APIs
   # used by kt-paperclip, see https://github.com/mastodon/mastodon/issues/16822
   if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true'
@@ -124,6 +130,7 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
       openstack_domain_name: ENV.fetch('SWIFT_DOMAIN_NAME') { 'default' },
       openstack_region: ENV['SWIFT_REGION'],
       openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
+      openstack_temp_url_key: ENV['SWIFT_TEMP_URL_KEY'],
     },
     
     fog_file: { 'Cache-Control' => 'public, max-age=315576000, immutable' },