about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-12-12 15:40:06 +0100
committerThibaut Girka <thib@sitedethib.com>2019-12-12 15:40:06 +0100
commitbe4849c08306cce930ea27e1f8097ffb774f75c6 (patch)
tree7eb7528245c671cdf908e07c3d630e7639d575bb /config
parent246addd5b33a172600342af3fb6fb5e4c80ad95e (diff)
parentd08a4979462352f83b1deddaa6209f7b6078ed26 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/controllers/application_controller.rb
  Minor conflict due to glitch-soc's theming system
Diffstat (limited to 'config')
-rw-r--r--config/initializers/paperclip.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index 96607b7ce..5109baff7 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -52,7 +52,7 @@ if ENV['S3_ENABLED'] == 'true'
   if ENV.has_key?('S3_ENDPOINT')
     Paperclip::Attachment.default_options[:s3_options].merge!(
       endpoint: ENV['S3_ENDPOINT'],
-      force_path_style: true
+      force_path_style: ENV['S3_OVERRIDE_PATH_STYLE'] != 'true',
     )
 
     Paperclip::Attachment.default_options[:url] = ':s3_path_url'
@@ -89,7 +89,7 @@ else
   Paperclip::Attachment.default_options.merge!(
     storage: :filesystem,
     use_timestamp: true,
-    path: ENV.fetch('PAPERCLIP_ROOT_PATH', ':rails_root/public/system') + '/:class/:attachment/:id_partition/:style/:filename',
+    path: File.join(ENV.fetch('PAPERCLIP_ROOT_PATH', File.join(':rails_root', 'public', 'system')), ':class', ':attachment', ':id_partition', ':style', ':filename'),
     url: ENV.fetch('PAPERCLIP_ROOT_URL', '/system') + '/:class/:attachment/:id_partition/:style/:filename',
   )
 end