Merge pull request #91 from DarkKirb/make-uploads-private
make uploads private
This commit is contained in:
commit
cc12a0e15c
2 changed files with 22 additions and 0 deletions
|
@ -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
|
||||||
|
|
21
akkoma/make-uploads-private.patch
Normal file
21
akkoma/make-uploads-private.patch
Normal 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
|
Reference in a new issue