Issues with Federation on Custom Domain

Hello,

I am attempting to set up a blog at a custom subdomain (https://musicrecs.ladys.computer/) and have managed to do so (test post). I have set up federation in the settings so that the blog is supposed to be federating at @lady@musicrecs.ladys.computer. However, federation does not seem to be working properly.

Digging into it, it appears that this is an issue of a faulty redirect. A webfinger request to https://musicrecs.ladys.computer/.well-known/webfinger?resource=acct:lady@musicrecs.ladys.computer returns a JSON which looks right:

{"subject":"acct:lady@musicrecs.ladys.computer"
,"aliases":
  ["https://musicrecs.ladys.computer/"
  ,"https://musicrecs.ladys.computer/api/collections/lady"]
,"links":
  [ {"href":"https://musicrecs.ladys.computer/"
    ,"type":"text/html"
    ,"rel":"https://webfinger.net/rel/profile-page"}
  , {"href":"https://musicrecs.ladys.computer/api/collections/lady"
    ,"type":"application/activity+json"
    ,"rel":"self"}]}

However, when I follow the link https://musicrecs.ladys.computer/api/collections/lady, it redirects to https://write.as/lady/. This is not the correct URL for the blog and returns a 404.

Hi there, thanks for digging into this. What problems exactly are you having with federation? I.e., what other platforms are you trying to follow from, what happens, etc.?

The redirect to the wrong URL does seem to be a bug specifically on custom domains – I’ll make sure we fix that.

However just as a heads up, the redirecting behavior here in general is correct, as it only happens for readers in the browser. If you instead request these resources with the Accept: application/activity+json header, you should see the correct data (also visible with a tool like browser.pub).

Most fediverse platforms should be doing this, and shouldn’t have any problem (I was able to view and follow your blog on Mastodon). So just need some more information about how exactly federation is failing.

When I originally made this post, I wasn’t able to see the account searching for it from mastodon.social. But I see the account there now, so I’m willing to believe that maybe I was just impatient? In any case, that issue appears to be resolved.

As for the Webfinger stuff, when I saw that the federation wasn’t working, I decided to just follow the account fetch process manually and see how far I got. I wasn’t able to actually get a JSON response for any account (I tried changing the Accept header, but wasn’t able to get it to work, so either I did it wrong or there are other requrements, like HTTP signatures)—I wasn’t too worried about this, but the redirect being wrong seemed weird, so I figured I would mention it. Apologies if it turned out to be a red herring.

Anyway, thanks for the quick response and I think things are working now!

No worries! It is possible some responses were cached, or fresh information wasn’t being fetched by Mastodon. But glad it’s working for you now!