ActivityPub
This article is a stub. You can help the IndieWeb wiki by expanding it.
ActivityPub is a decentralized social networking protocol (W3C Recommendation) developed in the Social Web Working Group based on pump.io and ActivityStreams. Conceptually they were all preceded by OStatus. It was briefly known as ActivityPump before being renamed to ActivityPub.
- Latest published version: https://www.w3.org/TR/activitypub/
- Latest draft: https://w3c.github.io/activitypub/
IndieWeb Examples
Matthias Pfefferle
Matthias Pfefferle has built the WordPress ActivityPub and NodeInfo plugins which allows his WordPress sites to (at least partially) support the ActivityPub protocol so sites like Mastodon and other parts of the Fediverse view his sites as a federated member. Other sites using this method can be seen at https://the-federation.info/wordpress.
Aaron Parecki
Aaron Parecki added initial support for ActivityPub to his website around 2018-07-04 in order to be able to receive likes & comments, reply to Mastodon users, and so that it can be followed from people using compatible software
As of 2018-07-23, Aaron Parecki has about 64 followers from various ActivityPub profiles, and has a few posts that have received a mix of replies from Mastodon and other ActivityPub users.
Nautilus:
- turned knowledge of implementing ActivityPub into a separate service that can be used to add ActivityPub to any website, the code is available as Nautilus on GitHub.
Greg McVerry
Greg McVerry uses:
- native ActivityPub support in Micro.blog which can be viewed @jgmac1106@stream.jgregorymcverry.com he can then send posts from his blog to his ActivityPub instance through Micro.blog
Previously used (quickthoughts.jgregorymcverry.com unresponsive as of 2023-05-25):
- Mastodon Plugin for Known which enables syndication:
Jan-Lukas Else
Jan-Lukas Else uses GoBlog, which has native ActivityPub support.
Hammy Havoc
Hammy Havoc added ActivityPub support on the Hammy Havoc blog on 2023-01-01 via the ActivityPub WordPress plugin.
Ryan Barrett
Ryan Barrett uses Bridgy Fed to backfeed ActivityPub interactions from Mastodon etc to his site, eg the interactions on this page and the followers list at the bottom of this page.
Lots more Bridgy Fed users
Since 2019, many more folks have added ActivityPub support to their personal sites via Bridgy Fed.
- ...
- Tantek Çelik
- ...
Bridging
Bridgy Fed
Bridgy Fed is a comprehensive service that translates ActivityPub feeds and interactions to/from IndieWeb sites and protocols.
ActivityPub Notifications to Webmention
Since Mastodon and other ActivityPub implementations often include Microformats on their permalinks, a shortcut for receiving comments from ActivityPub servers is to treat them as webmentions instead of doing the full Inbox processing normally required by ActivityPub.
When your ActivityPub inbox receives a notification:
- If
type
isCreate
- and if
object.InReplyTo
is present and is a URL on your domain- then save
object.id
as "source" - save
object.InReplyTo
as "target" - send a webmention to your webmention endpoint with the source and target
- then save
- and if
Then your site's existing webmention handling will fetch and verify the ActivityPub source URL, and if there are Microformats on the page, will even look like a reply.
Example:
- Post permalink: https://aaronparecki.com/2018/07/01/9/
- Mastodon reply URL: https://mastodon.social/@aaronpk/100302258872089825
Sending an ActivityPub notification from an IndieWeb website
As more people and services in the IndieWeb build in support for ActivityPub, it's important to remember that competing communication options could happen. Here is a general top-level breakdown of sending an ActivityPub notification for a reply or like.
The u-in-reply-to or u-like-of url will be referred to as the "targetUrl" below, and your post is referred to as the sourceUrl.
- Fetch the targetUrl via text/html, check for a webmention endpoint.
- If webmention endpoint exists, abort ActivityPub and send a webmention for sourceUrl to targetUrl
- If webmention endpoint does not exist, attempt to fetch the targetUrl as
application/activity+json
- If targetUrl doesn't return JSON, targetUrl doesn't accept ActivityPub, abort.
- If targetUrl returns JSON, check for a top-level
@context
attribute. This can be an array or a string, check if it contains "https://www.w3.org/ns/activitystreams
".- If targetUrl's JSON response does not return the right details, abort.
- If targetUrl's JSON response returns the correct info, check the
attributedTo
attribute for the author's ActivityPub profile.- Fetch the author's ActivityPub profile url as
application/activity+json
and check top-levelinbox
attribute for the author's ActivityPub inbox endpoint. - Send an ActivityPub notification to the author's ActivityPub inbox endpoint.
- Fetch the author's ActivityPub profile url as
Tips & Tricks for Sending ActivityPub notifications
- Mastodon requires that you include a "Mention" in the tags array, but you also need to include the person's
preferredUsername
in the post text to show it as a notification. - Technically
attributedTo
can be an object, but this hasn't been seen in the wild yet.
How To
(this section is a stub, please add links to How To articles for ActivityPub)
- Developer primer (in progress) on W3C wiki: https://www.w3.org/wiki/ActivityPub/Primer
- Funkwhale’s federation documentation contains very clear examples of activities to be send around.
- How to Implement a Basic ActivityPub Server
Software
Open source software that supports ActivityPub:
- Mastodon
- PixelFed
- Pleroma and forks such as Akkoma
- WordPress ActivityPub plugin
- Drupal ActivityPub plugin
- WriteFreely
- microblog.pub
- OwnCast
- GoToSocial
- Lemmy
- Misskey and forks such as Calckey
- BookWyrm
- Takahē
- https://git.thebackupbox.net/actpub/
Services
Services that support ActivityPub:
IndieWebCamp Sessions
(pretty sure there's been more sessions, e.g. re: Bridging that was brainstormed and developed at 2017 or 2018)
Criticism
(this section needs organizing into discrete rational criticisms, even better if they can be filed as issues on the specs and moved to an "Issues" section instead)
- 2018-02-01 : ActivityPub - one protocol to rule them all? (archived)
- Response: 2019-01-09 : ActivityPub? Well, it’s not that bad (archived)
- 2019-01-13 : ActivityPub - Final thoughts, one year later (archived)
- 2018-07-30 ActivityPub hot take
This isn’t creating a distributed network, this is creating a whole bunch of massive points of failure. And these failures grow exponentially as more failures happen. Its very nature also makes it so that it’s much more difficult for this data to be migrated; look at what happened when witches.town went down, or when scifi.fyi’s certificate expired [Ed.: for ~ a day https://scifi.fyi/@BrokenBiscuit/100426278316164570], and the effects this had on all other instances regardless of the users of those instances. And spinning up an instance is expensive, and that cost rises with the number of instances out there.
- 2018-08-07 Thread from author of litepub draft specification, provides background frustration and motivations for a variant protocol: https://pleroma.site/notice/2962026
- "activitypub is a crummy protocol, largely designed by committee, largely intended to make W3C brass happy by cargoculting even more of their crummy technology into it.
we need to fork this shit today and purge W3C from activitypub. it's the only conclusion i keep coming to after trying to read their specs." @kaniini August 7, 2018
- "activitypub is a crummy protocol, largely designed by committee, largely intended to make W3C brass happy by cargoculting even more of their crummy technology into it.
See Also
- https://activitypub.com/ which apparently redirects to https://activitypub.rocks/
- https://github.com/go-fed/presentations/tree/master/2018/go-activitypub-journey
- https://blog.joinmastodon.org/2018/07/how-to-make-friends-and-verify-requests/
- https://octodon.social/web/statuses/100527636732474823
- Bridgy Fed
- ActivityPub plugin for WordPress from Matthias Pfefferle
- CommonsPub
- https://twitter.com/tinysubversions/status/1204494753066209280
- "I just released a small ActivityPub debugging tool. It's hosted on @glitch and the idea is that an AP developer can simply remix the project and instantly have their own tiny AP server from which they can send arbitrary test messages.
https://tinysubversions.com/notes/activitypub-tool/" @tinysubversions December 10, 2019
- "I just released a small ActivityPub debugging tool. It's hosted on @glitch and the idea is that an AP developer can simply remix the project and instantly have their own tiny AP server from which they can send arbitrary test messages.
- MoodleNet: What is a federated social network?
- WriteFreely
- PixelFed
- https://socialhub.activitypub.rocks/c/software/14
- a repository of libraries and projects
- Sample Express implementation
- microblog.pub
- Goldfish, a federated service similar to TikTok or Vine
- Limitation: upon "following" someone, you don’t see their recent/past posts, unlike the UX of feed readers, Podcast apps, literally every other UX where you follow someone and immediately see a list of the recent posts / episodes / published content. https://twitter.com/stevehunt4hiop/status/1589913026832236545 see related issue: https://github.com/mastodon/mastodon/issues/1547
- "Here is another surprise. If you follow someone on another instance, you will not get access to their previous posts, unless it so happens that they were already being federated to your instance. Your instance will start to collect their new activity but will never go back..." @stevehunt4hiop November 8, 2022
- https://github.com/mwt/apfollow/ Code and buttons for creating ActivityPub Follow me interface
- ^ apfollow sample service didn’t work with a fediverse address (user & instance) that uses Bridgy Fed ( Tantek Çelik just got an error from it by trying e.g. https://apfollow.mwt.me/?user=tantek.com&instance=tantek.com which returned a plain text error page of “Couldn't find user”)
- https://github.com/davecheney/pub
- Why NOT to add AP support to your site: 2023-01-03 Does a Blog Need to Integrate?
Without a lot of work, a website won’t have the level of functionality a Mastodon account has.
So if the “integration” at this point is simply a way to auto-post to Mastodon (or any ActivityPub service) where’s the value over something like Zapier, or IFTTT? I don’t see it. - Why avoid JSON-LD in your ActivityPub implementations: 2018-11-12 Pleroma, LitePub, ActivityPub and JSON-LD
… it is a critical obligation of federated social networking service developers to ensure that handling of data is done in the most secure way possible, built on proven fundamentals. I view the inclusion of JSON-LD in the ActivityPub and ActivityStreams 2.0 standards to be harmful toward that obligation.
- Criticism: https://ruby.social/@benubois/111267597245152198
- "@manton I gave up on even consuming ActivityPub. It’s an ambitious idea, but wow is it ever complex, verbose, abstract and under defined. It also feels like the wrong abstraction for micropost-like things. JSON Feed and Micropub are much more ergonomic." @benubois October 20, 2023
- Criticism of RDFisms in AP: https://hachyderm.io/@hrefna/111634273843633052
- "I am not working with AP from a graph database.I am not working against a RDF data modelI am not dealing with RDF projectionsI am not an academic who is working with ontologies From a standards perspective: Every single time weirdness from RDF leaks into JSON, it adds complexity to downstream implementations. If your spec is entirely based on RDF that's one thing. But if your spec disclaims being based on RDF and says "only for extensions," then you can't have your cake and eat it too." @hrefna December 24, 2023
- A guide to implement ActivityPub in a static site (or any website)