Fix WebFinger for split-domain setups #1032
No reviewers
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma!1032
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mkljczk/akkoma:webfinger-actual-fix"
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?
Currently, running a webfinger query like
WebFinger.finger("hswaw@social.hackerspace.pl")fails in thevalidate_webfinger/2function due to a hostname mismatch.As a result, when
update_nickname_on_user_fetchis enabled (which is the default), fetching and updating a user — eg. viaPleroma.Web.ActivityPub.ActivityPub.generate_nickname/1— causes the stored nickname to change to include the domain name from actor's AP url.The issue doesn't happen when resolving addresses of instances having a
/.well-known/host-metaredirect between domains. However, Mastodon documentation doesn't instruct admins to configure such a redirect.My PR resolves this issue, while keeping the existing spoofing prevention working (it worked before a security fix introduced a regression which I only partially fixed).
i'm not seeing much wrong here, just one thing to potentially change up
@ -185,2 +185,4 @@body: File.read!("test/fixtures/tesla_mock/bad.com_host_meta")}}%{url: "https://whitehouse.gov/.well-known/webfinger?resource=acct:trump@whitehouse.gov"} ->this is a very specific gripe but we should probably avoid having outright irl politics in our test strings
Thanks, accidentally merged this from Pleroma, this mock was not even used
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.