[bug] Media Proxy attempts to proxy ActivityPub embedded images #859
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#859
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Your setup
From source
Extra details
Debian Linux
Version
develop
294de939
PostgreSQL version
15
What were you trying to do?
Look at a post that has an embedded base64 png.
What did you expect to happen?
The frontend loads the embedded image and does not proxy to the backend.
What actually happened?
The frontend is forced to proxy to the backend as the media is encoded into a media proxy url.
Logs
Severity
I can manage
Have you searched for this issue?
I've made the following modifications, but I'm not sure this will accurately cover all use cases as I'm still very new to the Akkoma / Pleroma code base. I just switched over to source (Elixir 0.14.0 and OTP 25) so I can start to fix issues I've encountered on my instance and attempt to contribute them back.
Thanks for your report and initial patch!
The diff looks generally good to me. I’m wondering why
preview_url
doesn't (already) useurl_proxiable?
but this is a pre-existing thing and I’m not too familiar with media proxy details.To avoid mistakenly matching e.g. local, relative URLs, the
embed?
check should probably test fordata:
with colon at the end. Perhaps it might also make more sense to check against an allowed set of fetchable protocols instead (onlyhttp
andhttps
atm iinm).You can run
mix format
to automatically adjust code style and run the testsuite withmix test || mix test --failed
(the second rerun is to deal with a few flaky tests). If this doesn't reveal any problems either, it’s probably good and you can open a PR.I'll setup my local environment so I can avoid mixing the "production" setup with a few of your branches I've mixed in to avoid federation issues with IceShrimp.NET and then make a PR.