mirror of
				https://github.com/jakejarvis/mastodon-utils.git
				synced 2025-11-04 05:50:08 -05:00 
			
		
		
		
	
			
				
					
						
					
					f48a0508a7a8a7f33fe5e6d3bb4dade136c96e4f
				
			
			
		
	🦣 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 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!!! 😊
mkdir -p /home/mastodon
git clone https://github.com/jakejarvis/mastodon-utils.git /home/mastodon/utils
cd /home/mastodon/utils
# install Mastodon on fresh Ubuntu box:
./scripts/install.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
Scripts
init.sh: A small helper that runs at the very beginning of each script below to initializerbenvand set consistent environment variables.- Optional: To make your life easier, you can also source this script from the 
.bashrcof themastodonuser and/or whichever user you regularly SSH in as: 
- Optional: To make your life easier, you can also source this script from the 
 
[ -s /home/mastodon/utils/init.sh ] && \. /home/mastodon/utils/init.sh >/dev/null 2>&1
version.sh: Testsinit.shby printing version of Mastodon, rbenv, nvm, Ruby, Node, and Yarn.
Periodic tasks
backup.sh: Backs up Postgres, Redis, and.env.productionsecrets to a.tar.gzfile in/home/mastodon/backups— useful for a periodic cronjob.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
 
Dangerous
The following scripts are highly opinionated, catastrophically destructive, and very specific to me. Check them out line-by-line instead of running them.
install.sh: Assumes an absolutely clean install of Ubuntu and installs Mastodon with all of the quirks from this repo. ConfigureMASTODON_USERand other paths ininit.shfirst if necessary. Get the far less dangerous version ofinstall.shhere instead.upgrade.sh: Upgrades Mastodon server (latest version if vanilla Mastodon, latest commit ifglitch-soc) and re-applies every patch listed below. Get the far less dangerous version ofupgrade.shhere instead.
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!system-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 userssettings-sidebar-cleanup.patch: Why is the most frequently used admin page listed under a link that takes you to another page to open a submenu in the sidebar to finally be able to click on it to go to the page?!?remove-glitch-cruft.patch: Removes a bunch of junk no longer used byglitch-socsidebar-logo.patch: Restore Mastodon logo in logged-out sidebar
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%