Support webfinger / alias domains
Closed this issue · 2 comments
Currently debirdify seems to build links to profiles by just taking @A@B
as https://B/@A
. This doesn't work when the tag domain is different from the web interface domain, which is the case for my @marcan@treehouse.systems account.
The correct way to handle this seems to be webfinger, making a query like this:
https://treehouse.systems/.well-known/webfinger?resource=acct:marcan@treehouse.systems
This will return JSON with the correct profile URI, which can then be used to return the correct link.
This is tricky. I cannot afford to do a webfinger request for every single account found. Those can be hundreds or even thousands, and most Fediverse servers are horribly slow (some take over 5 seconds to respond).
Best I could do is try to cache this on a per-server basis. But it doesn't seem like there is a way to ask the server what the general pattern for these URLs is, just what the URL for a specific user is. Of course, what I could do there is try to look at e.g. what kind of URL it returns in .well-known/nodeinfo
and assume that that one also works for the user profile. Works in your case, at least.
I know use the local_domain
as provided by Fedifinder for this and it seems to work.