Microblog.pub Fediverse Server
There's been a big increase in people using the Fediverse in recent months, much of it on Mastodon, but I was looking for something simpler and more customisable to host the Irish Left Archive account (@ila@leftarchive.ie).
I came across the Microblog.pub project – a self-hosted, single-user ActivityPub server that fit my use-case perfectly.
Mostly the work of developer Thomas Sileo @tsileo, Microblog.pub is written in Python and uses an SQLite database. In addition to ActivityPub, it also implements IndieWeb features such as Micropub, Microformats and Webmentions. However, with the dominance of ActivityPub, I haven't had interactions to test that side of its functionality.
Setting up
Getting Microblog.pub set up is a simple process: it just requires cloning the repo, building the Docker image, generating an initial config with the provided make
command and then initiating it with the provided docker-compose.yml
. Additional config can be added to the data/profile.toml
file, and is well documented on the documentation site.
A nice feature is the ability to define the domain for the user handle separately from the installed domain and redirect Webfinger requests from one to the other – this meant I could use the cleaner handle of @ila@leftarchive.ie while the instance runs on posts.leftarchive.ie. (This is done by setting a separate webfinger_domain
in profile.toml
and creating a redirect for .well-known/webfinger
on the root domain.)
Theming Microblog.pub
By default, Microblog.pub offers a simple, Javascript-free HTML frontend, and a mechanism to over-ride the colour variables with custom SASS variables. However, it is also very customisable, so I decided to do a complete overhaul of the frontend to align the design with our existing website.
Templates use the Jinja format, which, for anyone not used to the Python ecosystem, will be familiar if you've used Twig in PHP (or Tera, which implements the same syntax for Rust and is used on this website). Template files are read first from the data/
directory, and then from the core templates in the app, so it facilitates anything from minor tweaks to major overhauls by over-riding only the template files needed.
The included SASS compiler, Boussole, uses libsass rather than dart-sass, so some modern SASS features are missing.
To integrate the design with the website, I've bypassed the included SASS and over-ridden most of the templates. I had intended to build the CSS with a selective subset of Bootstrap 3 and Font Awesome, because that is what is still used on the main Irish Left Archive website, but in the end I modified the CORS to allow pulling in the CSS and fonts from the main site to avoid the overlap in maintenance and bypass the need for some Dart SASS features. I then included an additional CSS file for Microblog.pub specific styles which is compiled with Boussole. The result is rather heavier than necessary and has a lot more redundancy, but is easier to maintain. I also integrated the Javascript image viewer from leftarchive.ie for viewing attachments (for interested readers, this is part of the ILA UI Elements set of modules created for the project.)
All of which means our instance isn't entirely in the spirit of the clean, Javascript-free frontend of the original, but it's good to have that design consistency with the main site, despite the accumulation of code from a long-maintained site that that brings in.
The developer has very kindly included our instance in the examples in the README. For anyone curious, the code for our modifications is available in the git repository below.
ila-microblog.pub
Customised Microblog.pub for the Irish Left Archive Fediverse account.
View repositoryMigrating
Microblog.pub also implements a migration process, which simplifies moving from a Mastodon instance to your new account. This made it very easy to bring over our existing followers by redirecting the Mastodon account and adding an alias in profile.toml
, and importing our existing follows with the provided make
task.
From what I've seen, the extent to which migration in and out is implemented in various Fediverse software is quite variable, so it's good to see a simple process provided for this.
So far, Microblog.pub has been a perfect solution for what I was hoping to achieve and is an impressive example of the flexibility provided by the Fediverse protocols. If you have a Fediverse account and are interested in Irish political history, you can follow at @ila@leftarchive.ie.