mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-26 06:00:22 +00:00
share PUID and PGID with child procs from entrypoint
This commit is contained in:
parent
e0e34e6377
commit
16796a63fd
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue