mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-13 16:20:59 +03:00
about gosu behaviour, it looking for local "existed" UID, i found it become blank. That is our issue, so updating our entrypoint to change existed user "youtube" UID and GID to match compose request, will make gosu correctly find use UID:GID as it existed.
20 lines
591 B
Bash
Executable File
20 lines
591 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
CMD="npm start"
|
|
|
|
# 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."
|
|
usermod -u "$UID" "$USER"
|
|
groupmod -g "$GID" "$USER"
|
|
exec gosu "$UID:$GID" "$0" "$@"
|
|
fi
|
|
|
|
exec "$@"
|