snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
703 stars 52 forks source link

Mastodon: support "split domain" instances #1638

Open TankieTanuki opened 6 months ago

TankieTanuki commented 6 months ago

Background

I'm configuring a single-user Mastodon instance with a split local domain (toot.tankietanuki.com) and web domain (tankietanuki.com).

Goal

I would like to implement Bridgy Fed (the cross-post to a Mastodon account variety) and connect the above-mentioned Mastodon account/instance to my personal website under development at tankietanuki.com.

Problem

Entering my web domain on the signup page fails with tankietanuki.com doesn't look like a Mastodon instance.

If I enter the local domain instead, I am able to OAuth into my Mastodon account, but the subsequent page shows this:

Signed in as: @TankieTanuki@TankieTanuki.com

Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.

Diagnosis

I think the problem is related to this issue mentioned in the Mastodon docs:

As with LOCAL_DOMAIN, WEB_DOMAIN cannot be safely changed once set, as this will confuse remote servers that know of your previous settings and may break communication with them or make it unreliable. As the issues lie with remote servers’ understanding of your accounts, re-installing Mastodon from scratch will not fix the issue.

because I entered something weeks ago under a different configuration. It's the only server that I've ever tried to federate with in any way.

It would break my heart if have truly ruined my dream forever. Is there any hope? 🥺

snarfed commented 6 months ago

Interesting! I don't know if Bridgy has handled a Mastodon user with split domain yet, so this will be good to look at. Bridgy classic (non Fed) uses the Mastodon API, not ActivityPub, so split domain may not actually affect it much.

It sounds like Bridgy's OAuth client on your server got wiped at some point, maybe related to your changed settings. Similar to https://github.com/snarfed/bridgy/issues/1602 / https://github.com/mastodon/mastodon/issues/27740 .

I've wiped out your Bridgy user and auth. Feel free to try again!

TankieTanuki commented 6 months ago

Thank you so much for manually altering your database on my behalf! I really appreciate it. 😃

That worked! Well, half worked. Now I can successfully login with toot.tankietanuki.com and reach this page:

Mastodon @TankieTanuki@toot.tankietanuki.com What's your web site? http://... Bridgy uses your web site(s) for post discovery and, if you choose, publishing.

However, I'd like to login as my web domain, tankietanuki.com, and when I try that I get the same error as before.

How should I troubleshoot from here?

I think (but haven't confirmed) that I have the Mastodon domains configured correctly, because browser requests to tankietanuki.com/.well-known/webfinger/ get forwarded to toot.tankietanuki.com/.well-known/webfinger/.

Edit: On the other hand, maybe logging into Bridgy with the toot domain won't be a problem, if people can still publicly find me by the web domain IDK.

snarfed commented 6 months ago

Great! Looking at https://brid.gy/mastodon/@tankietanuki@toot.tankietanuki.com , your Mastodon account seems to be working fine so far.

Bridgy doesn't affect how people find or follow you in the fediverse. All it does is backfeed (copy) replies, likes, reposts, etc from Mastodon to your web site, and optionally also lets you cross post from your web site to Mastodon. Those should be unaffected by the fediverse handle shown on https://brid.gy/mastodon/@tankietanuki@toot.tankietanuki.com .

Having said that, I can definitely take this as a feature request to support split domains like this!