share PUID and PGID with child procs from entrypoint

This commit is contained in:
Nick Sweeting 2023-10-20 02:45:54 -07:00
parent e0e34e6377
commit 16796a63fd

View file

@ -12,8 +12,8 @@ if [[ -n "$PGID" && "$PGID" != 0 ]]; then
groupmod -g "$PGID" "$ARCHIVEBOX_USER" > /dev/null 2>&1 groupmod -g "$PGID" "$ARCHIVEBOX_USER" > /dev/null 2>&1
fi fi
PUID="$(id -u archivebox)" export PUID="$(id -u archivebox)"
PGID="$(id -g archivebox)" export PGID="$(id -g archivebox)"
# Check the permissions of the data dir (or create if it doesn't exist) # Check the permissions of the data dir (or create if it doesn't exist)
if [[ -d "$DATA_DIR/archive" ]]; then if [[ -d "$DATA_DIR/archive" ]]; then
@ -33,7 +33,6 @@ else
fi fi
chown $ARCHIVEBOX_USER:$ARCHIVEBOX_USER "$DATA_DIR" "$DATA_DIR"/* chown $ARCHIVEBOX_USER:$ARCHIVEBOX_USER "$DATA_DIR" "$DATA_DIR"/*
# Drop permissions to run commands as the archivebox user # Drop permissions to run commands as the archivebox user
if [[ "$1" == /* || "$1" == "echo" || "$1" == "archivebox" ]]; then if [[ "$1" == /* || "$1" == "echo" || "$1" == "archivebox" ]]; then
# arg 1 is a binary, execute it verbatim # arg 1 is a binary, execute it verbatim