diff --git a/lifecycle/bootstrap.sh b/lifecycle/bootstrap.sh index b002dbe55..23a9e4c97 100755 --- a/lifecycle/bootstrap.sh +++ b/lifecycle/bootstrap.sh @@ -9,16 +9,18 @@ function check_if_root { return fi SOCKET="/var/run/docker.sock" + GROUP="authentik" if [[ -e "$SOCKET" ]]; then # Get group ID of the docker socket, so we can create a matching group and # add ourselves to it DOCKER_GID=$(stat -c '%g' $SOCKET) getent group $DOCKER_GID || groupadd -f -g $DOCKER_GID docker usermod -a -G $DOCKER_GID authentik + GROUP="authentik:docker" fi # Fix permissions of backups and media chown -R authentik:authentik /media /backups - chpst -u authentik:authentik:docker env HOME=/authentik $1 + chpst -u authentik:$GROUP env HOME=/authentik $1 } if [[ "$1" == "server" ]]; then