Because ActivityPub instances can go offline from time to time and it’s general best practice to retry failed requests, I just added a new queueing system for ActivityPub requests to GoBlog using this nice library named “dque”. There’s always a bug or sub-optimal solution I need to fix before I want to release GoBlog (or whatever I will name it in the end) to the wide world. But the frequency of the discovery of improvable things is decreasing, so I hope I will be able to write documentation soon.
Mastodon doesn’t support “Article” posts and only shows the summary from them. But not only that, it doesn’t seem to unescape escaped HTML and that’s why articles from my blog looked so weird on Mastodon, while they worked fine on Pleroma and Microblog.pub. I now fixed the escaping. My Hugo module for ActivityStreams representation is available on Codeberg.
I think I finally got ActivityPub support for this blog working. On Mastodon, you can search for @firstname.lastname@example.org and @email@example.com to follow the English and German blog. You should also be able to search for the URL of any post and reply to it. But remember that it’s only possible for the reply to appear in the “Interactions” if your profile isn’t locked (so your reply is visible to the public). I will write about my implementation later, when I’m sure everything is working correctly.
I wonder if I will even be able to finish my ActivityPub implementation during this holiday. ActivityPub is somehow more complex than expected and unfortunately there are not many implementations to get inspiration from. Meanwhile my idea is to use Hugo to generate ActivityStream JSON files which are then sent to the followers with my own implementation. To do this I have to configure Caddy (the server that delivers my blog) to return the JSON files when an “Accept” HTTP header is received and I have to proxy certain request routes to the implementation. I have to think about it again, work out a plan, implement the whole thing and when this is done, document everything.
I started developing my ActivityPub implementation. It will be a little Go application, which sends out every new item in a JSON Feed to the followers. It will be possible to configure multiple feeds and ActivityPub actors, so that I can use it for my blog with one actor for the English blog and one for the German blog. I’ll probably later add some possibility to use it to follow others too. I started by using the code from activityserve and now rewrite most parts.
I plan to add a bit of ActivityPub to my blog to be able to interact with the fediverse, without the need to use Mastodon, Pleroma or my current microblog. Just my static Hugo blog with it’s dynamic Go-backend. Because I don’t want to implement everything from scratch - I haven’t yet added media support for MicroPub - I am in search for libraries that help implementing ActivityPub, or at least give me a starting point. I discovered the library activityserver, which is used by a tool called pherephone by write.as, maybe that can help me.
I just found this article on how to create a basic ActivityPub server. It let’s me think about adding ActivityPub support to my hugo-micropub project (which then becomes more than just a Micropub endpoint for my Hugo setup). It’s definitely a project I finally want start once I’m done with this semester.