There’s a land rush of ActivityPub implementations going on right now, and I’m in it.

ActivityPub And Me, Part 2

983 wc

ActivityPub And Me, Part 2

There’s a land rush of ActivityPub implementations going on right now, and I’m in it.

Belghast (who I can’t credit because his account is private now) popped back onto Twitter to report that Tumblr is working on ActivityPub support, which reassured me that I might be onto something here with a blog-centric ActivityPub server.

I think writefreely is also essentially an ActivityPub-based blog platform, except you need ssh access and technical expertise to install it. (Which, to be fair, you will also need for mine.)

In any case, I don’t want to start over with my blog timeline and/or figure out how to import my (extremely not-importable) Markdown file content somewhere else, so Tumblr or writefreely aren’t viable options for me. Whatever I use has to work with my existing blog, more-or-less as-is.

So, what I want to do is make an ActivityPub server implementation that works seamlessly with an existing (possibly static) blog that already has an established footprint (like, say, mine). It’s the best compromise I can think of. And, it’s uncomplicated enough for one person to write it in their spare time.

I’ve come across some projects out there that already do what I’m doing for a blog, so I might be able to wire up something from spare parts lying around the Internet. Fed.brid.gy is one such project to turn your blog into an ActivityPub actor, but it’s a service you sign up for, not something you install on your own server. This WordPress plugin is another, but obviously WordPress is dead to me.

I’ve been anonymously following the #activitypub hashtag over on Mastodon for a little while now (something I can’t seem do with Pleroma, annoyingly). There are quite a few people in the world thinking exactly what I’m thinking right now: Let’s add ActivityPub to this and that and the other thing so we can access it from inside the fediverse! It’s a good idea, just like RSS functionality was and still is a good idea.

As a side note, young developers are trying to push everyone to use JSON feeds instead of RSS feeds because the youth of today is relatively anti-XML, even though every worthwhile development platform can read and write both XML and JSON equally well. Even Golang has native XML support out of the box. But I might add a JSON feed to my site to extend a hand across the generation gap and make the kids happy. It’s pretty easy to do with Hugo.

During this journey of self-hosted-blog-discovery, I’ve also learned that there is something called WebMentions, another product of IndieWeb.org*, that I might consider supporting as a stretch goal. (Yet another thing that doesn’t work with a static blog, though.) It’s essentially identical to WordPress’s pingbacks, except it doesn’t use XML-RPC. I’m always happy to poke another stick in the eye of the WordPress Industrial Complex. XML-RPC is a pain to implement anyway.

Progress Report

I’ve setup two temporary VPSs (virtual private servers) for testing in the cloud on two different providers. One of them is running an instance of Pleroma, and the other is (going to be) running my ActivityPub server behind an nginx reverse proxy. In the end, though, I want this thing to be small and efficient enough to run on something like, say, a Raspberry Pi hanging off of your home network. You definitely can’t do that with Mastodon.

I’m working on it in stages. As of this post, I have the bit that polls an RSS feed periodically and stores new entries as ActivityPub objects. I decided to use sqlite as a database backend because it’s super lightweight and self-contained and doesn’t require installing anything on Linux, and I happened to know how to use it. (If this ever needs to scale to support millions of followers, though, it will definitely need to be replaced. But, I mean, the fediverse itself isn’t designed to scale to support millions of followers, so I’m not too worried about that in the short term.)

It looks something like this crude drawing:

I’ve gotten both Pleroma and Mastodon to see the server and its account, so I have working .well-known discovery endpoints, and an outbox. It turns out an outbox full of content doesn’t really do anything in the fediverse, though, because both Pleroma and Mastodon ignore any old content in your outbox prior to following. So, next I’ll probably be implementing the inbox enough to receive follow requests, and after that, implement pushing notes to remote servers.

I imagine I’ll have to work out signatures, too. I don’t know this for sure, but you’d like to think Mastodon and Pleroma and everyone else won’t just let anyone do an unsigned POST and inject things into every server’s public timeline like a gold spammer in an MMORPG. (Not that signatures would in way way prevent spam like that. A decentralized and federated fediverse leaves a wide open door to spammers, by its very design. Signatures just prevent spammers from making the spam look like it came from you instead of them. )

I also need to work out a better logging strategy now before I get too far into it. Always get your logging and telemetry and continuous integration testing strategies worked out early in the project, that’s my advice to the young developers out there. You’ll regret it if you don’t, if the project ends up growing significantly over time.

* As an organization, IndieWeb.org is a bit too fanciful and idealistic for my tastes, and they seem to be on a mission to reinvent all the wheels that have already been invented, but I like the core ideal of encouraging people to own and operate their own sites, even if I don’t think their organization is strictly necessary. My Internet usage pre-dates social media walled gardens, so the IndieWeb revolution is just “normal Internet usage” to me.

Note: Comments are hosted on a private server uvtek.hopto.org so you may need to whitelist it for comments to work. Currently Google or Twitter sign-in is required to leave a comment. If there's nothing below here, it means the comment server is down for some reason and I need to figure out why.

I don't know why, but sometimes you have to refresh the page to display the Remark42 comment box above correctly.