wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Add "passthrough" to a mastodon instance on webfinger

Open mindlesstux opened this issue 3 years ago • 2 comments
trafficstars

I am just starting to play with mastodon and I might have done something very bad but could be interesting. I read and executed having my mastodon instance at mastodon.mindlesstux.com with wordpress at mindlesstux.com. I wanted to have my mastodon users be @mindlesstux.com instead of @mastodon.mindlesstux.com. I found a couple of settings in mastodon and set the settings to allow this per: https://github.com/felx/mastodon-documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md

I also redirected webfinger to mastodon for a while. This worked till I found your plugin.

I ended up with the plugin installed breaking people being able to find my mastodon user, and without it cant find the blog user in mastodon. Sure I could have gone with some other plugin but this one just "works" from what I can tell compared to the others.

I did a little poking around the code and a bit of reading mastodon docs to find out webfinger requests can be 301/302 redirected. From there it was about a 2hr hack job to come up with the attached diff of the 0.13.3 release code.

add_fallthrough_url.diff.txt

This is by no means good code, I have not done php code in years so there may be better ways to do things. It adds a single setting for ActivityPub for a "fall through" url. (I set mine to https://mastodon.mindlesstux.com ) Then in the 3 error conditions I have the webfinger kick a 302 redirect to the mastodon instance instead of your error message/code if the setting has anything in it.

Testing used my "old"/unused fosstodon account and was able to cleanly search for both user accounts.

The only two gotchas I can spot right now:

  • Anyone in my mastodon server cant find the wordpress user, which is something I can live with.
  • The wordpress users take priority over the mastodon users, basically cant have both users be mindlesstux

mindlesstux avatar Jan 28 '22 05:01 mindlesstux

Appologies for the diff file, its been to long and it is kind of late for me to figure out git pull requests.

mindlesstux avatar Jan 28 '22 05:01 mindlesstux

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 28 '22 06:05 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 27 '22 13:09 stale[bot]