1
mirror of https://github.com/jakejarvis/mastodon-utils.git synced 2025-04-25 22:45:22 -04:00

🦣 Mastodon utilities

Random opinionated helper scripts & front-end customizations for my personal Mastodon instance (running on glitch-soc). You definitely don't want to use any of this as-is — check out my more general purpose mastodon-installer scripts instead.

Notes

The wiki of this repo and the /etc folder are simply my way of not forgetting how I did something, which I do quite a bit. Refer there for random notes on PgBouncer, Grafana, etc. but DO NOT BLINDLY COPY & PASTE anything there without doing your own research!

Usage

AGAIN, DEFINITELY DO NOT JUST RUN THIS IF YOU'RE NOT ME!!! 😊

This sets up the bare minimum customizations after Mastodon is installed:

git clone https://github.com/jakejarvis/mastodon-utils.git /home/mastodon/utils && cd /home/mastodon/utils

# setup nginx using conf files from this repo:
./scripts/setup_nginx.sh

# apply vanilla (and glitch-soc) patches from this repo:
./scripts/apply_patches.sh

# cherry-pick everything else below...

Patches

Vanilla and glitch-soc:

glitch-soc only:

Scripts

  • apply_patches.sh: Dangerously applies every patch listed above, and automatically detects if glitch-soc patches should also be applied
  • backup.sh: Backs up Postgres, Redis, and .env.production secrets to a .tar.gz file in /home/mastodon/backups — useful for a periodic cronjob
  • setup_nginx.sh: Sets up symlinks from /etc/nginx to nginx confs in this repo
  • tootctl_shim.sh: Small shell shim to run tootctl in /home/mastodon/live as the mastodon user by anyone & from anywhere
    • Add this line to the .bash_profile of the user you normally login as:
      • . /home/mastodon/utils/scripts/tootctl_shim.sh
  • upgrade.sh: Upgrades Mastodon server (latest version if vanilla Mastodon, latest commit if glitch-soc) and re-applies patches listed above
  • version.sh: Tests tootctl_shim.sh by printing Mastodon version (tootctl version)
  • weekly_cleanup.sh: Runs Mastodon's built-in cleanup commands, designed for a weekly cronjob
    • Keeps 7 days of media (in object storage)
    • Keeps 90 days of generated preview cards

License

MIT

Description
🦣 Small opinionated helper scripts, patches, and configs for Mastodon
https://fediverse.jarv.is/about Readme MIT 4.5 MiB
Languages
Shell 100%