mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-14 20:01:28 +03:00
We're now using gosu to switch our user down :)
This commit is contained in:
@@ -47,6 +47,7 @@ RUN apt-get update && apt-get -y install \
|
|||||||
npm \
|
npm \
|
||||||
python2 \
|
python2 \
|
||||||
python3 \
|
python3 \
|
||||||
|
gosu &\
|
||||||
atomicparsley && \
|
atomicparsley && \
|
||||||
apt-get install -f && \
|
apt-get install -f && \
|
||||||
apt-get autoremove --purge && \
|
apt-get autoremove --purge && \
|
||||||
|
|||||||
@@ -3,10 +3,15 @@ set -eu
|
|||||||
|
|
||||||
CMD="pm2-runtime pm2.config.js"
|
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
|
# chown current working directory to current user
|
||||||
if [ "$*" = "$CMD" ] && [ "$(id -u)" = "0" ]; then
|
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."
|
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."
|
||||||
su -c "$0" "$(id -un $UID)" "$@"
|
exec gosu "$UID:$GID" "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user