I am totally new to ActivityPub and related protocols (ActivityStream, WebFinger, JSON-LD, etc). I have heard of Mastodon for years and I somehow independently reinvented the idea of federated network back in 2018 (or 2017), but not before 2023-01-13 did I create a Mastodon account or look into the specifications of the underlying protocol.
Also, not until I got scared away by the dependency hell of Mastodon did I really want to learn the protocol in the hope of making my own implementation.
BTW personally I would prefer XML over JSON if I were to design a protocol for similar purposes over some representation layer protocol, but that is another topic…
I am developing ApubNode, a CLI tool for generating static websites which are supposed to partially support ActivityPub — to publish activities in HTML and JSON-LD like other ActivityPub-compatible servers, but interaction features (e.g. reply, comment, like, direct message) are to be omitted. Please forgive the inaccurate impression of favoring Nodejs being implied by the name (although it does involve Nodejs components); ‘Node’ means ‘static website instance’.
An online demo has been deployed on Cloudflare Pages (very reasonable for a static lover), available at
https://mypubnode.pages.dev/u/neruthes/. For debugging purposes, all JSON files are visibly linked from anchors. At the profile page, you may see 3 types of anchors pointing to
.json URLs (Person, Outbox, and Action). I believe that these JSON files should be valid.
With Cloudflare Pages Functions, it can serve the WebFinger lookup endpoint
http://mypubnode.pages.dev/.well-known/webfinger?resource=acct:email@example.com for user profiles. The JSON looks similar to those served by Mastodon, and I think this part should be valid, too.
For what have been implemented, theoretically speaking, a full-feature subscriber (peer server) should be able to find my activities through the chain of short handle → WebFinger lookup → JSON URL for Outbox index → JSON URL for Outbox paged. The paging feature is not yet implemented, serving all Actions at once in one file, and I believe that this is not going to cause problems.
However, I have found no way to see my self-hosted profile in the eyes of any other peer server. Mastodon instances, e.g. mastodon.world (the instance which I first started playing with) cannot load my profile with a simple
firstname.lastname@example.org short handle. This is open for different interpretations. I could imagine that some part of my code was wrong, or Mastodon has hidden mechanisms or features about ‘exotic profiles’ which I was unaware of (e.g. limits with retrieval).
It will be good if there is any server (source code or online instance) that truthfully does the handling and parsing of exotic profile. so that I may know how other people would see my profile from their existing ActivityPub-compatible servers.
At this moment, I cannot tell whether there is any bug with in code or is there a limitation in Mastodon. A testing suite should be good, but the old test suite, whose public deployment was discontinued, is still linked on ActivityPub website homepage. Also, I have gathered that the attempts on developing a new test suite was not really fast or successful. So perhaps some human inspection on my artifacts (JSON, etc) and code will be helpful.
The online demo instance is also available on GitHub; it might be more convenient to read artifacts and code there.