Allow admin to configure bucket ACL settings #600
No reviewers
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#600
Loading…
Reference in a new issue
No description provided.
Delete branch "darkkirb/akkoma:add-s3-acl-option"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To upload to Backblaze B2, the ACL needs to match bucket settings, and
if you have a CDN in front of your media server you may want to restrict
public access to the bucket to avoid expensive non-cdn transfers and
bucket enumeration.
90db8cca7c
toe159a03b43
this looks ok apart from the obvious, but any chance you could add a test for it? over at https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/test/pleroma/uploaders/s3_test.exs#L56 - assert_called will be your best friend here
ideally before raising a PR you'd run the tests (mix test), which would have flagged up your typo 🥴
@ -576,6 +576,7 @@ the source code is here: [kocaptcha](https://github.com/koto-bank/kocaptcha). Th
Don't forget to configure [Ex AWS S3](#ex-aws-s3-settings)
* `acl`: The ACL the uploaded media will have. By default media will be `:public`, and thus directly accessible from the bucket. Set this to `:private` if you have a CDN in front of your media server which sends authenticated requests to your S3 provider. On some providers, like Backblaze B2, this needs to match bucket settings!
can you also document the old standard value of
public_read
?used if you point media directly at the bucket
@ -25,6 +25,7 @@ defmodule Pleroma.Uploaders.S3 do
config = Config.get([__MODULE__])
bucket = Keyword.get(config, :bucket)
streaming = Keyword.get(config, :streaming_enabled)
acl = Keyboard.get(config, :acl)
keyboard
keyboard
muscle memory fun
e159a03b43
to9571f9729d
9571f9729d
tod877856527
oh oops noticed that :public was in fact the wrong value. Added tests for the default value and the new value now, and corrected the two mistakes
once again this does not pass tests
PLEASE make sure you run tests locally before requesting review
@ -68,2 +68,3 @@
test "save file", %{file_upload: file_upload} do
with_mock ExAws, request: fn _ -> {:ok, :ok} end do
with_mock ExAws, request: (fn _ ->
assert op.opts[:acl] == :public_read
op is not defined
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.