Skip to content

Commit 7b0959b

Browse files
authored
Merge pull request #148 from linuxserver/glitch-v5
Add helper for major version DB migrations (glitch)
2 parents ea8b1aa + 0d575f4 commit 7b0959b

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎readme-vars.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ app_setup_block_enabled: true
7979
app_setup_block: |
8080
We provide aliases for the common commands that execute in the correct context so that environment variables from secrets are available to them:
8181
82-
* 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.
82+
* 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.
8383
84-
* 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`
84+
* 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`
8585
86-
* 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`
86+
* 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`
8787
8888
Both of the secret generation aliases above can be run without any other setup having been carried out.
8989
@@ -97,6 +97,12 @@ app_setup_block: |
9797
9898
For more information check out the [mastodon documentation](https://docs.joinmastodon.org/).
9999
100+
### Upgrade from 4.7 to 5.0
101+
102+
* Stop your running 4.7 container and pull the new image, make sure the DB and Redis are still running
103+
* Run `docker compose run --rm -e SKIP_POST_DEPLOYMENT_MIGRATIONS=true --entrypoint /bin/bash mastodon migrate`
104+
* Once the migrations are complete, start the Mastodon container as normal
105+
100106
### Running separate sidekiq instances
101107
102108
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: |
174180
"mastodon:glitch" <- Base Images
175181
# changelog
176182
changelogs:
183+
- {date: "03.12.26:", desc: "Add migration helper for major version upgrades."}
177184
- {date: "29.11.26:", desc: "Fetch Ruby from library image to match the version required by upstream."}
178185
- {date: "05.07.26:", desc: "Rebase to Alpine 3.24."}
179186
- {date: "21.10.25:", desc: "Add prometheus exporter support."}

‎root/migrate‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
cd /app/www || exit 1
5+
6+
bundle exec rails db:migrate

0 commit comments

Comments
 (0)