about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-04 17:25:57 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-04-04 17:25:57 +0200
commitd01c5b0b8c330fff7e0d73bcb509129a4311f24e (patch)
tree101066d4ab7edfdd8e1935a11d3525707901ca1d /lib
parent3381a0e6e050438680f38c97ac9332045b8d66f4 (diff)
parent80ded02a4bd2ea6d5b9b69198753063224773f66 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'lib')
-rw-r--r--lib/paperclip/storage_extensions.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/paperclip/storage_extensions.rb b/lib/paperclip/storage_extensions.rb
deleted file mode 100644
index 95c35641e..000000000
--- a/lib/paperclip/storage_extensions.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-# 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_ENABLED'] == 'true' && ENV['S3_FORCE_SINGLE_REQUEST'] == 'true'
-  module Paperclip
-    module Storage
-      module S3Extensions
-        def copy_to_local_file(style, local_dest_path)
-          log("copying #{path(style)} to local file #{local_dest_path}")
-          s3_object(style).download_file(local_dest_path, { mode: 'single_request' })
-        rescue Aws::Errors::ServiceError => e
-          warn("#{e} - cannot copy #{path(style)} to local file #{local_dest_path}")
-          false
-        end
-      end
-    end
-  end
-
-  Paperclip::Storage::S3.prepend(Paperclip::Storage::S3Extensions)
-end