add help message to permissions error output

This commit is contained in:
Nick Sweeting 2023-10-30 15:39:12 -07:00 committed by GitHub
parent e2bcb19603
commit e7795550fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,9 +22,9 @@ if [[ -d "$DATA_DIR/archive" ]]; then
rm "$DATA_DIR/archive/.permissions_test_safe_to_delete" rm "$DATA_DIR/archive/.permissions_test_safe_to_delete"
# echo "[√] Permissions are correct" # echo "[√] Permissions are correct"
else else
echo "[X] Permissions Error: ArchiveBox is not able to write to your data dir. You need to fix the data dir ownership and retry:" >2 echo "[X] Error: ArchiveBox (uid=$PUID) is not able to write to your ./data dir. Fix the permissions and retry:" >2
echo " chown -R $PUID:$PGID data" >2 echo " \$ chown -R $PUID:$PGID data" >2
echo " https://docs.linuxserver.io/general/understanding-puid-and-pgid" >2 echo " You may need to pass PUID & PGID to the Docker container: https://docs.linuxserver.io/general/understanding-puid-and-pgid" >2
exit 1 exit 1
fi fi
else else
@ -34,7 +34,7 @@ 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" == "bash" || "$1" == "sh" || "$1" == "echo" || "$1" == "archivebox" ]]; then
# arg 1 is a binary, execute it verbatim # arg 1 is a binary, execute it verbatim
# e.g. "archivebox init" # e.g. "archivebox init"
# "/bin/bash" # "/bin/bash"