diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index e563fb9..b804e66 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -3,15 +3,10 @@ set -eu CMD="pm2-runtime pm2.config.js" -# if the first arg starts with "-" pass it to program -if [ "${1#-}" != "$1" ]; then - set -- "$CMD" "$@" -fi - # chown current working directory to current user if [ "$*" = "$CMD" ] && [ "$(id -u)" = "0" ]; then find . \! -user "$UID" -exec chown "$UID:$GID" -R '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos." - exec /usr/lib/apache2/suexec-custom "$UID:$GID" "$0" "$@" + su -c "$0" "$(id -un $UID)" "$@" fi exec "$@"