Merge branch 'opt-init.d-migrations' into 'develop'

OpenRC: Automatically run migrations before starting pleroma

See merge request pleroma/pleroma!4303
This commit is contained in:
Haelwenn 2025-04-12 23:52:43 +00:00
commit 1f3e4433e8
3 changed files with 19 additions and 2 deletions

View file

@ -0,0 +1 @@
- OpenRC: Automatically run migrations before starting pleroma

View file

@ -37,6 +37,12 @@ depend() {
need nginx postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c '/usr/bin/mix ecto.migrate' -l "${command_user}"
eend "$?"
}
healthcheck() {
# put pleroma_health=YES in /etc/conf.d/pleroma if you want healthchecking
# and make sure you have curl installed

View file

@ -16,7 +16,17 @@ retry="SIGTERM/30/SIGKILL/5"
pidfile="/var/run/pleroma.pid"
# Needs OpenRC >= 0.42
respawn_max=200
respawn_period=86400 # 1*day
depend() {
want nginx
need postgresql
want nginx
need postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c '/opt/pleroma/bin/pleroma_ctl migrate' -l "${command_user}"
eend "$?"
}