ActivityPub

The ActivityStreams module for Hugo should work with image attachments too. This is a test post to see how they are displayed on Mastodon. But I want to take the opportunity to introduce my readers to Unsplash, where you can find many nice photos for free use. Like this picture from NASA.

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 promised and people already asked, so here is the first part of the documentation about how I enabled ActivityPub support on my Hugo-based blog: The first step to enable ActivityPub support, was to get Hugo to generate ActivityStreams representations for posts and the ActivityPub actor. I did this by adding a custom output format and published the code as a Hugo module on Codeberg. See the README file there to learn about how to use it.

I think I finally got ActivityPub support for this blog working. On Mastodon, you can search for @en@jlelse.blog and @de@jlelse.blog 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.

What I still have to think about though, is how I’m going to connect it with the rest of the system. And what’s also still missing: The media endpoint and update support for MicroPub (I should do this first).

Or should I just cancel my plans with ActivityPub and wait until Fediverse software supports IndieWeb technologies? 🤔

I just noticed the following: Search on Twitter for IndieWeb and ActivityPub or take a look at the Google Trends for ActivityPub. It seems that @jack’s tweet about a new “decentralized standard for social media” created some awareness of already existing standards and project that have the goal to decentralize the web. People on the internet, especially people on Twitter, now talk about these standards and projects and I guess a lot of people will also take a closer look at them and actually try them out.
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. I still need to think about whether or not to ignore inbox queries and if yes, how to handle them?
I started my fediverse journey with Mastodon, the most popular fediverse / ActivityPub software out there. First I joined a public instance, then I temporarily hosted my own instance, forgot about the fediverse, joined again on a public instance some months later and eventually settled with my own Pleroma instance, which is now running for almost a year. But why shouldn’t I take a look at other options too? Some months ago, I briefly tried Microblog.
Jan-Lukas Else
20 years old student who writes about everything he cares about.