make uploads private

This commit is contained in:
Charlotte 🦝 Delenk 2023-03-19 07:27:00 +01:00
parent 85b77674b3
commit 7ce18b8ed6
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
2 changed files with 22 additions and 0 deletions

View file

@ -26,6 +26,7 @@
./block-invalid-datetime-mrf.patch
./require-image-description.patch
./change-twitter-preview.patch
./make-uploads-private.patch
];
};
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