Posty: This is How You Take Your Posts With You

@oliphant@writer.oliphant.social

Mastodon gives you this funny export option, including this funny little phrase about how it's in ActivityPub format, and “readable by any compliant software.” An early question I had was “What compliant software, exactly?” The Mastodon Export archive option says: "You can request an export of your posts and uploaded media. The data will be in ActivityPub format, readable by any compliant software." “Readable by any compliant software?” Hey, it's talking about Posty!

There are a few tools that will more or less let you view archives, or create static sites out of them, but I had a few very specific ideas about what I wanted such an app to do, and it was a good learning experience, after all, reading through a bunch of ActivityPub json data, so Posty was born.

Posty Principles and Features

I knew basically what I wanted it to do off the bat.

  1. Generates a static HTML/CSS site that can be cheaply hosted anywhere, or simply browsed from your local computer.
  2. Posty provides static site generation, along with a zip download of all generated assets, followed by the option of a complete purge of all data, uploaded, generated, or otherwise, from the service.
  3. Uses a simple CSS framework, semantic, responsive, and easily-customized after export by updating a single (small) CSS file. main.css
  4. Stays light on javascript in the generated site, and loaded only where necessary. The site should still be able to function without javascript support.
  5. Keep hashtag links internal and link to 'hashtag index pages' that display all posts by hashtag, along with a main hashtag cloud.
  6. Be responsible about data. Uploaded data includes private mentions and other personal details. Not only should those be ignored, but that data is thrown away as soon as the static site is generated and access to post data is no longer necessary.
  7. Run the Posty app locally or as a hosted service. If hosted, allow it to act as a public archiving service.
  8. If used as a public archiving service, optionally allow it to replace a retired Mastodon instance with a static HTML archive of only posts from members of that instance.
  9. Support custom routes for static HTML pages, so that pages can support their old status references. Here's an example
Host your Static HTML Site...

There are a few ways to run the HTML once generated, use whatever works for you.

...On Your Local Computer

Extract the downloaded .zip file from Posty, and then drag the index.html from that folder directly into your web browser. Boom. There's your entire archive, audience of one.

...On A Potato

It's a static site, you can run it on a very underpowered instance, on Github Pages, or any of a number of other free HTML hosting options.

...On Posty

Once you review the archive, if you like what you see and your Posty instance is already public and taking requests (such as at https://posty.1sland.social) then you may choose to leave the archive there, calling that your public hosting location for your archive.

Here's an example of just such an archive:

https://posty.1sland.social/%40kaleb@social.coop/

It's still recommended you download and keep a backup for yourself somewhere safe after generating the site, however.

Hosting the Archive Service Yourself

You're best off reviewing the README for details if you want to host this service for others.

Note that Posty is intended for any uploaded archive, but there's the option for a “Dedicated” hosted archive, which means the archive uploads are limited to archives for a single domain.

In that mode, archives will be saved on generation with shortened handles (ie., user rather than user@server.social) and SES urls will be defaulted. This is the mode intended for a Mastodon instance that wants to allow those leaving their instance a place to permanently host their old statuses from their retiring instance, as it preserves the status URLs.

Posty itself can convert from an uploader and static site generator to a simple HTML host via configuration once you're done collecting archives, at which point you should be able to downscale the instance it's running on significantly.

If you have any questions about Posty, or find any bugs, be sure to hit the Issues on codeberg, or drop me a line @oliphant.

Note you can now import your Pixelfed archives, too, which provided several unique challenges.

— @oli 🐘