From 65a67e337abafbf21e3092763d44dfc2cb2946f7 Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 3 Dec 2026 09:59:35 +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 700bbcb..f29bf63 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -95,6 +95,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. @@ -172,6 +178,7 @@ init_diagram: | "mastodon:develop" <- 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: "18.11.26:", desc: "Build Ruby from source to match the version required by upstream."} - {date: "05.07.26:", desc: "Rebase to Alpine 3.24."} 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 18d18541373546e3d1e2881e9de598c38a0e2caf Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 3 Dec 2026 10:01:20 +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 f29bf63..9042979 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -77,11 +77,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:develop 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:develop 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:develop 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.