From 507c8f5fdc16718f2fee136762a27bd31b4627b6 Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 3 Dec 2026 09:59:37 +0000 Subject: [PATCH 1/2] Add helper for major version DB migrations --- readme-vars.yml | 7 +++++++ root/migrate | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100755 root/migrate diff --git a/readme-vars.yml b/readme-vars.yml index 07a433a..6dffdd3 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -97,6 +97,12 @@ app_setup_block: | For more information check out the [mastodon documentation](https://docs.joinmastodon.org/). + ### Upgrade from 4.7 to 5.0 + + * Stop your running 4.7 container and pull the new image, make sure the DB and Redis are still running + * Run `docker compose run --rm -e SKIP_POST_DEPLOYMENT_MIGRATIONS=true --entrypoint /bin/bash mastodon migrate` + * Once the migrations are complete, start the Mastodon container as normal + ### Running separate sidekiq instances It is currently only supported to run a single queue per container instance *or* all queues in a single container instance. @@ -174,6 +180,7 @@ init_diagram: | "mastodon:glitch" <- Base Images # changelog changelogs: + - {date: "03.12.26:", desc: "Add migration helper for major version upgrades."} - {date: "29.11.26:", desc: "Fetch Ruby from library image to match the version required by upstream."} - {date: "05.07.26:", desc: "Rebase to Alpine 3.24."} - {date: "21.10.25:", desc: "Add prometheus exporter support."} diff --git a/root/migrate b/root/migrate new file mode 100755 index 0000000..385b35d --- /dev/null +++ b/root/migrate @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +cd /app/www || exit 1 + +bundle exec rails db:migrate From 0d575f48d317bdd3e1ce3b7dec4f63e898c6dda5 Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 3 Dec 2026 10:01:19 +0000 Subject: [PATCH 2/2] Sync readme --- readme-vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme-vars.yml b/readme-vars.yml index 6dffdd3..61672d9 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -79,11 +79,11 @@ app_setup_block_enabled: true app_setup_block: | We provide aliases for the common commands that execute in the correct context so that environment variables from secrets are available to them: - * To generate keys for `SECRET_KEY_BASE` & `OTP_SECRET` run `docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon:glitch generate-secret` once for each. + * To generate keys for `SECRET_KEY_BASE` & `OTP_SECRET` run `docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon:{{ release_tag }} generate-secret` once for each. - * To generate keys for `VAPID_PRIVATE_KEY` & `VAPID_PUBLIC_KEY` run `docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon:glitch generate-vapid` + * To generate keys for `VAPID_PRIVATE_KEY` & `VAPID_PUBLIC_KEY` run `docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon:{{ release_tag }} generate-vapid` - * To generate keys for `ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY`, `ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT`, & `ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY` run `docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon:glitch generate-active-record` + * To generate keys for `ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY`, `ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT`, & `ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY` run `docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon:{{ release_tag }} generate-active-record` Both of the secret generation aliases above can be run without any other setup having been carried out.