I often work on connecting things that don’t automatically connect but should, like Bridgy for IndieWeb and social networks. Federated social networks like GNU Social and Mastodon have been hot recently, so I’m thinking about them too.
OStatus is the most widely used standard for federated social networking. Here’s background and a straw man design for a bridge between OStatus and IndieWeb’s Webmention, which would let users on both sides follow, reply, like, RSVP, and otherwise interact with each other’s posts.
First, some links:
- Spec, W3C community wiki with Howto, and component standards:
- Mailing list (inactive, spammy)
- IWS 2017 session writeup
- List of implementations. Notable:
- The Federation (focused on Diaspora, not OStatus)
First, some simplifying assumptions and non-goals:
- Don’t translate AS2 to microformats2 HTML. Most of the big existing projects already include mf2 in their HTML: Mastodon, GNU Social, pump.io, and Friendica (but not Diaspora). We’ll just use that in place.
(This may not hold for non-text interactions, e.g. likes, so we may need to revisit those. Also, it may only works well for public data, so…)
- Only public posts and interactions. I’m not sure any project has truly robust, mature support for private or semi-private interactions right now, so they’re not a high priority.
- Require IW sites to serve Atom and PuSH themselves. There’s fairly widespread support for both in major CMSes and external like Superfeedr and FeedBurner.
- No user registration. The bridge is mostly stateless, modulo discovery caching and Salmon keypairs, and we don’t need to do an OAuth-style user approval dance on either end…so let’s not!
Next, a major design decision. Choose one of:
- Proxy all domains. Say the bridge’s domain is
bridge.example. If IW user
alice.exampleand OS user
@firstname.lastname@example.org to interact, they’d do so via wrapped identifiers like
bob.ap.example.bridge.example, respectively. Pro: no changes needed on IW or OS sites. Con: bad UX.
- Require sites to point to bridge. If IW sites support OS content negotiation discovery and redirect to the bridge, and OS sites add a
<link rel="webmention'>that points to the bridge, the normal
@email@example.com will work automatically. Pro: Good UX. Con: depends on support in each individual project.
Proxying is a non-trivial amount of work, and we can always add it later, so we’ll start without it.
granary already has a first pass at translating between microformats2 and ActivityStreams 1, but it hasn’t been tested against an OStatus implementation. We’ll need to do that and fix any holes. At minimum, I think the PoCo extensions are missing.
For OS to discover IW users, IW sites will need to redirect WebFinger and XRD URLs to the bridge, which will fetch their homepage, find its representative h-card, and generate WebFinger data for it. Also, if it’s the first time we’ve seen this user, a Salmon magic key is generated and stored.
For IW to discover OS users, OS projects will need to advertize the bridge’s webmention endpoint in their HTML, e.g.
<link rel="webmention' href="https://bridge.example/webmention>. As an example, I’ve already asked Mastodon for this in an issue.
To convert a webmention to OS:
- Accept incoming webmention.
- Fetch source page. Translate it to AS1.
- Fetch target page. Determine author user.
- Discover user’s Salmon endpoint via WebFinger/XRD.
- Send the AS1 interaction in a Salmon slap.
To convert an OS interaction to webmention:
- Accept incoming Salmon slap.
- Parse AS1 object in body, determine target URL (reply to, like of, etc). Reject if no target is found.
- Fetch target URL, discover webmention endpoint.
- Send webmention with OS source and IW target.