about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-14 08:35:55 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-11-14 08:35:55 +0100
commit32c70d2f09e27c474b7e20ef3e3b34f5a7f50121 (patch)
tree117e952f835329eadc0095e809427f7af5be9631 /config/initializers
parent81b1d32d5b618daa4003b8de8292ae4dd3e656f6 (diff)
parentb59ce0a60ff4f90bb16a8c3338ad37218af052b8 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/views/admin/announcements/edit.html.haml`:
  Upstream change too close to theming-related glitch-soc change.
  Ported upstream changes.
- `app/views/admin/announcements/new.html.haml`
  Upstream change too close to theming-related glitch-soc change.
  Ported upstream changes.
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/paperclip.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index 26b0a2f7c..a2285427c 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -67,6 +67,12 @@ if ENV['S3_ENABLED'] == 'true'
       retry_limit: 0,
     }
   )
+  
+  if ENV['S3_PERMISSION'] == ''
+    Paperclip::Attachment.default_options.merge!(
+      s3_permissions: ->(*) { nil }
+    )
+  end
 
   if ENV.has_key?('S3_ENDPOINT')
     Paperclip::Attachment.default_options[:s3_options].merge!(
@@ -119,6 +125,8 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
       openstack_region: ENV['SWIFT_REGION'],
       openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
     },
+    
+    fog_file: { 'Cache-Control' => 'public, max-age=315576000, immutable' },
 
     fog_directory: ENV['SWIFT_CONTAINER'],
     fog_host: ENV['SWIFT_OBJECT_URL'],