Mastodon to Pleroma — 3 — Shutting Down Mastodon

Written By: Jake Bauer | Posted: 2020-07-25 | Last Updated: 2020-07-25

Now that I’ve settled into Pleroma, I’m going to decommission my Mastodon instance. I was originally planning to do it on 2020-08-08, but now that a majority of my followers have followed the new account, I figure it’s time to take Mastodon off of life support and shut down the instance.

To make sure that everyone has been notified about the account switch and nobody will be left wondering where I went, I have decided to turn my old account (@jbauer@social.paritybit.ca) into a bot which will post an announcement every 30 minutes until the death of the server.

A screenshot of one of the
    announcements on my Mastodon instance. Announcing that the instance is
    shutting down and that followers should follow me on Pleroma instead.

I tried to tweak the script I’m using to post a friendlier link to my profile (in the form of @jbauer@pleroma.paritybit.ca) which would have been better for mobile users, but for some reason unknown to me, Mastodon refuses to federate with instances using LAN addresses and this caused it to give me an HTTP error 422 when trying to link to my Pleroma instance. I really don’t know why but this behaviour annoyed me a lot.

Anyways, I got the idea to do the automated posting from a post by Alex Gleason on the Fediverse and this is the script that I wrote to make the posts:

#!/bin/sh

TTD=$(cat /tmp/ttd)

printf "ANNOUNCEMENT: I have moved accounts from Mastodon to Pleroma.

Followers will NOT auto-migrate. You must manually follow my new account at
https://pleroma.paritybit.ca/jbauer (@jbauer @pleroma.paritybit.ca) and you
should unfollow this account. (Sorry mobile users, I can't generate an @link to
the new profile.)

social.paritybit.ca will be shutting down in >> $TTD hours\n

This account is now a bot. This status will repeat every 30 minutes until the
instance is destroyed." > /tmp/status.txt

accessToken="haha no"
resp="$(curl -s -S -i -X POST \
    -H "Authorization: Bearer $accessToken" \
    -F status="$(cat /tmp/status.txt)" \
    -F visibility=public \
    https://social.paritybit.ca/api/v1/statuses)"
httpCode="$(echo "$resp" | grep HTTP/ | awk '{print $2}')"

if [ "$httpCode" = "200" ]; then
    echo "Successfully posted status update"
else
    echo "ERROR: Failed to post status update"
    echo "$resp"
fi

echo "$TTD-0.5" | bc -ql > /tmp/ttd

The script is run with the following cron job:

*/30 * * * * /home/jbauer/masto-last-hours.sh

I calculated the number of hours from the time I started the script to 2020-07-27 at noon using this time calculator and put the value in /tmp/ttd. As the script runs, it will keep decrementing this value until the instance is terminated. Using the at command, I have scheduled a shutdown so that, once the time hits 12:00 on 2020-07-27, my Mastodon instance will go offline for the final time.

Friendship ended with Mastodon, now Pleroma is my best friend (meme reference).

This is my eighty-first post for the #100DaysToOffload challenge. You can learn more about this challenge over at https://100daystooffload.com.