Merge pull request #91 from DarkKirb/make-uploads-private

make uploads private
This commit is contained in:
Charlotte 🦝 Delenk 2023-03-19 07:31:29 +01:00 committed by GitHub
commit cc12a0e15c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -26,6 +26,7 @@
./block-invalid-datetime-mrf.patch ./block-invalid-datetime-mrf.patch
./require-image-description.patch ./require-image-description.patch
./change-twitter-preview.patch ./change-twitter-preview.patch
./make-uploads-private.patch
]; ];
}; };
in in

View file

@ -0,0 +1,21 @@
diff --git a/lib/pleroma/uploaders/s3.ex b/lib/pleroma/uploaders/s3.ex
index 481153fe8..cae92cf2c 100644
--- a/lib/pleroma/uploaders/s3.ex
+++ b/lib/pleroma/uploaders/s3.ex
@@ -33,14 +33,14 @@ def put_file(%Pleroma.Upload{} = upload) do
upload.tempfile
|> ExAws.S3.Upload.stream_file()
|> ExAws.S3.upload(bucket, s3_name, [
- {:acl, :public_read},
+ {:acl, :private},
{:content_type, upload.content_type}
])
else
{:ok, file_data} = File.read(upload.tempfile)
ExAws.S3.put_object(bucket, s3_name, file_data, [
- {:acl, :public_read},
+ {:acl, :private},
{:content_type, upload.content_type}
])
end