|
@@ -3,6 +3,7 @@
|
|
|
DATA_DIR="${DATA_DIR:-/data}"
|
|
DATA_DIR="${DATA_DIR:-/data}"
|
|
|
ARCHIVEBOX_USER="${ARCHIVEBOX_USER:-archivebox}"
|
|
ARCHIVEBOX_USER="${ARCHIVEBOX_USER:-archivebox}"
|
|
|
|
|
|
|
|
|
|
+
|
|
|
# Set the archivebox user UID & GID
|
|
# Set the archivebox user UID & GID
|
|
|
if [[ -n "$PUID" && "$PUID" != 0 ]]; then
|
|
if [[ -n "$PUID" && "$PUID" != 0 ]]; then
|
|
|
usermod -u "$PUID" "$ARCHIVEBOX_USER" > /dev/null 2>&1
|
|
usermod -u "$PUID" "$ARCHIVEBOX_USER" > /dev/null 2>&1
|
|
@@ -11,6 +12,7 @@ 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
|
|
|
|
|
|
|
|
|
|
+
|
|
|
# Set the permissions of the data dir to match the archivebox user
|
|
# Set the permissions of the data dir to match the archivebox user
|
|
|
if [[ -d "$DATA_DIR/archive" ]]; then
|
|
if [[ -d "$DATA_DIR/archive" ]]; then
|
|
|
# check data directory permissions
|
|
# check data directory permissions
|
|
@@ -33,11 +35,11 @@ if [[ "$1" == /* || "$1" == "echo" || "$1" == "archivebox" ]]; then
|
|
|
# e.g. "archivebox init"
|
|
# e.g. "archivebox init"
|
|
|
# "/bin/bash"
|
|
# "/bin/bash"
|
|
|
# "echo"
|
|
# "echo"
|
|
|
- gosu "$ARCHIVEBOX_USER" bash -c "$*"
|
|
|
|
|
|
|
+ exec gosu "$ARCHIVEBOX_USER" bash -c "$*"
|
|
|
else
|
|
else
|
|
|
# no command given, assume args were meant to be passed to archivebox cmd
|
|
# no command given, assume args were meant to be passed to archivebox cmd
|
|
|
# e.g. "add https://example.com"
|
|
# e.g. "add https://example.com"
|
|
|
# "manage createsupseruser"
|
|
# "manage createsupseruser"
|
|
|
# "server 0.0.0.0:8000"
|
|
# "server 0.0.0.0:8000"
|
|
|
- gosu "$ARCHIVEBOX_USER" bash -c "archivebox $*"
|
|
|
|
|
|
|
+ exec gosu "$ARCHIVEBOX_USER" bash -c "archivebox $*"
|
|
|
fi
|
|
fi
|