I am in the process of building an ActivityPub integration for Mirlo, an open source platform where users can publish their music and also maintain a blog on their artist page.
How I heard of SocialHub was from this Github issue inviting anybody from that community to join this forum to discuss incorporating the ActivityPub standard.
Note: I am a new user so I can only put 2 links in each forum post. The location of my dev instance is goaify[.]me which you can append to the below routes to view the JSON or webpage I am referring to.
So far I have built an Express.js / Node service which dynamically generates the Webfinger goaify.me/.well-known/webfinger?resource=acct:test1234@goaify.me
and actor JSON-LD (goaify.me/activitypub/test1234
when the GET request is sent with Accept: application/activity+json
header) based on the application’s API (e.g. api.goaify.me/v1/artists/test1234
)
This makes the URL, url slug, artist name, artist ID, avatar, banner, bio, and links of the artist discoverable on Mastodon when searching for the ActivityPub user by their account name, in the above example, test1234@goaify.me
. The HTML version of the artist page is located at goaify.me/test1234.
Basic Account Data
On a Mastodon instance, the account appears as shown below. It looks pretty good so far, but I wonder how often Mastodon refreshes its cache when the details change at the remote server?
Followers
At this stage of the implementation at goaify.me/activitypub/test1234/followers
, I have hard-coded two followers for each actor (my personal Mastodon account and the actor itself). The follower count of 2 is detected on Mastodon (on instances which haven’t cached the previous follower count of 1), but the actual follower list is invisible with the message This user has chosen to not make this information available
– why?
In the actor file I have already set discoverable
, indexable
to true and hide_collections
to false.
Posts
The most challenging part is getting the blog posts located at goaify.me/test1234/posts
to populate in Mastodon. I understand that Mastodon does not backfill posts from before an ActivityPub account was first looked up on that Mastodon instance, but I am not seeing it populate new posts either.
The error is Older posts from other servers are not displayed. Browse more on the original profile
.
In the ActivityPub user’s outbox at goaify.me/activitypub/test1234/outbox
, I have the blog posts and their contests listed in JSON format. I believe I read somewhere that Mastodon does not pull posts from the outbox, but rather requires them to be POSTed to an account following the remote user locally on that Mastodon instance.
It looks like I would need to first fix the followers flow so that it is not hard-coded, but actually accepts follow requests from ActivityPub servers and persists the list of followers somewhere (e.g. a database). For that activity I would also need to verify the HTTP signature being sent from the remote server on behalf of the user who is following?
Is it required to make each individual post accessible in JSON format at their own permalink URL in order for Mastodon to ingest it, or is an orderedItems
list similar to what I have done in the outbox sufficient?
At what route should the orderedItems
list of blog posts reside?
Any help from folks who have experience building a custom ActivityPub client, and knowledge of Mastodon’s behavior would be appreciated. I have tried to scour the documentation and forums as much as possible, but the docs seem a bit sparse and each ActivityPub implementation does not 100% conform to the spec.