mirror of
https://github.com/jakejarvis/mastodon-utils.git
synced 2025-04-26 03:25:22 -04:00
4.7 KiB
4.7 KiB
🦣 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
# back up Postgres, Redis, and secrets:
./scripts/backup.sh
# pull latest Mastodon (vanilla or glitch-soc) and apply patches from this repo:
./scripts/upgrade.sh
# cherry-pick everything else below...
Scripts
init.sh
: A small helper that runs at the very beginning of each script below to initializerbenv
and set consistent environment variables.- Optional: To make your life easier, you can also source this script from the
.bashrc
of themastodon
user and/or whichever user you regularly SSH in as:
- Optional: To make your life easier, you can also source this script from the
if [ -f /home/mastodon/utils/init.sh ]; then
. /home/mastodon/utils/init.sh
fi
apply_patches.sh
: Dangerously applies every patch listed below, and automatically detects ifglitch-soc
patches should also be appliedbackup.sh
: Backs up Postgres, Redis, and.env.production
secrets to a.tar.gz
file in/home/mastodon/backups
— useful for a periodic cronjobsetup_nginx.sh
: Sets up symlinks from/etc/nginx
to nginx confs in this repoupgrade.sh
: Upgrades Mastodon server (latest version if vanilla Mastodon, latest commit ifglitch-soc
) and re-applies patches listed belowversion.sh
: Testsinit.sh
by printing Mastodon, Ruby, and rbenv versions.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
Patches
Vanilla and glitch-soc
:
robots.patch
: Disallow search engines for all of Mastodonincrease-sidekiq-timeout.patch
: Small bump in Sidekiq's timeout before it decides a remote instance isn't available. Use this one very carefully!favicons.patch
: Use custom icon images instead of Mastodon logosystem-font.patch
: Use the system's default sans-serif font stack instead of Robotohide-contact-email.patch
: Hides themailto:
link on the About pagehide-rules.patch
: Applies just to homepage, meant only for single-user instanceshide-signup.patch
: Hide the "create account" button (for aesthetics, not security!)
glitch-soc
only:
custom-glitch-defaults.patch
: Sets default Glitch appearance settings for logged-out usersremove-glitch-cruft.patch
: Removes a bunch of junk no longer used byglitch-soc
sidebar-logo.patch
: Restore Mastodon logo in logged-out sidebar
License
MIT