diff --git a/lifecycle/bootstrap.sh b/lifecycle/bootstrap.sh index fa0fe2be5..bfda8dba7 100755 --- a/lifecycle/bootstrap.sh +++ b/lifecycle/bootstrap.sh @@ -5,6 +5,7 @@ printf '{"event": "Bootstrap completed", "level": "info", "logger": "bootstrap", function check_if_root { if [[ $EUID -ne 0 ]]; then printf '{"event": "Not running as root, disabling permission fixes", "level": "info", "logger": "bootstrap", "command": "%s"}\n' "$@" > /dev/stderr + $1 return fi SOCKET="/var/run/docker.sock" @@ -16,14 +17,14 @@ function check_if_root { fi # Fix permissions of backups and media chown -R authentik:authentik /media /backups + chpst -u authentik env HOME=/authentik $1 } if [[ "$1" == "server" ]]; then python -m lifecycle.migrate /authentik-proxy elif [[ "$1" == "worker" ]]; then - check_if_root - chpst -u authentik env HOME=/authentik celery -A authentik.root.celery worker --autoscale 3,1 -E -B -s /tmp/celerybeat-schedule -Q authentik,authentik_scheduled,authentik_events + check_if_root "celery -A authentik.root.celery worker --autoscale 3,1 -E -B -s /tmp/celerybeat-schedule -Q authentik,authentik_scheduled,authentik_events" elif [[ "$1" == "backup" ]]; then python -m manage dbbackup --clean elif [[ "$1" == "restore" ]]; then