about summary refs log tree commit diff
diff options
context:
space:
mode:
authorY.Yamashiro <shukukei@mojizuri.jp>2020-09-02 07:17:58 +0900
committerGitHub <noreply@github.com>2020-09-02 00:17:58 +0200
commitabc91e5fa6a0c9d621e798ae3e2de7377696dfc0 (patch)
tree5afb2048b86d5f531cff8d067ec51763adb044b8
parent79305428a7c2bda311bc9d367a84acc28f569522 (diff)
Change S3 ACL in "tootctl media remove-orphans --fix-permissions" from fixed value to environment file's value. (#14715)
-rw-r--r--lib/mastodon/media_cli.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb
index 31135f7fc..5f4a414b1 100644
--- a/lib/mastodon/media_cli.rb
+++ b/lib/mastodon/media_cli.rb
@@ -67,6 +67,7 @@ module Mastodon
       when :s3
         paperclip_instance = MediaAttachment.new.file
         s3_interface       = paperclip_instance.s3_interface
+        s3_permissions     = Paperclip::Attachment.default_options[:s3_permissions]
         bucket             = s3_interface.bucket(Paperclip::Attachment.default_options[:s3_credentials][:bucket])
         last_key           = options[:start_after]
 
@@ -87,7 +88,7 @@ module Mastodon
           record_map = preload_records_from_mixed_objects(objects)
 
           objects.each do |object|
-            object.acl.put(acl: 'public-read') if options[:fix_permissions] && !options[:dry_run]
+            object.acl.put(acl: s3_permissions) if options[:fix_permissions] && !options[:dry_run]
 
             path_segments = object.key.split('/')
             path_segments.delete('cache')