Code Monkey home page Code Monkey logo

mastodon-utils's Introduction

🦣 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

# override default environment variables if necessary:
cp .env.example .env

# 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 initialize nvm/rbenv and set consistent environment variables.
    • Optional: The default values of each config variable can be seen in .env.example. Create a new file named .env in the root of this repository (probably at /home/mastodon/utils/.env) to override any or all of them.
    • Optional: To make your life easier, you can also source this script from the .bashrc of the mastodon user and/or whichever user you regularly SSH in as:
[ -s /home/mastodon/utils/init.sh ] && \. /home/mastodon/utils/init.sh >/dev/null 2>&1
  • version.sh: A quick and easy way to test init.sh and .env by printing the version numbers of Mastodon, rbenv, nvm, Ruby, Node, and Yarn.

Periodic tasks

  • backup.sh: Backs up Postgres, Redis, and .env.production secrets to a .tar.gz file in $MASTODON_ROOT/backups. Useful for a daily cronjob.
    • Keeps archives for the last 5 days, last 4 weeks, and every month
    • Optionally uploads to S3 with s3cmd
  • purge.sh: Runs Mastodon's built-in cleanup commands, designed for a weekly cronjob.
    • Keeps 14 days of media
    • Keeps 90 days of profile avatars, headers, and link 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.

Patches

Vanilla only:

Vanilla and glitch-soc:

glitch-soc only:

  • mastodon-logo.patch: Restore the Mastodon logo in the non-advanced sidebar
  • settings-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?!?

License

MIT

mastodon-utils's People

Contributors

jakejarvis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.