From 75d8ed3fec4ffc0d7dd91969efbb3eaf794576d3 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 11 Jan 2024 20:07:04 -0800 Subject: [PATCH] dont attempt to chown /browsers/.links if it doesnt exist --- bin/docker_entrypoint.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/docker_entrypoint.sh b/bin/docker_entrypoint.sh index 123cabca..23ab419c 100755 --- a/bin/docker_entrypoint.sh +++ b/bin/docker_entrypoint.sh @@ -91,14 +91,16 @@ if ! chown $PUID:$PGID "$DATA_DIR"/* > /dev/null 2>&1; then fi -# also chown BROWSERS_DIR because otherwise 'archivebox setup' wont be able to install chrome at runtime +# also chown BROWSERS_DIR because otherwise 'archivebox setup' wont be able to 'playwright install chromium' at runtime export PLAYWRIGHT_BROWSERS_PATH="${PLAYWRIGHT_BROWSERS_PATH:-/browsers}" mkdir -p "$PLAYWRIGHT_BROWSERS_PATH/permissions_test_safe_to_delete" -chown $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH" -chown $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH"/* -chown $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH"/.* -chown -h $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH"/.links/* rm -Rf "$PLAYWRIGHT_BROWSERS_PATH/permissions_test_safe_to_delete" +chown $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH" +if [[ -d "$PLAYWRIGHT_BROWSERS_PATH/.links" ]]; then + chown $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH"/* + chown $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH"/.* + chown -h $PUID:$PGID "$PLAYWRIGHT_BROWSERS_PATH"/.links/* +fi # (this check is written in blood in 2023, QEMU silently breaks things in ways that are not obvious)