From b9235fb07f8becd2b4170e3b9738d2c212089e60 Mon Sep 17 00:00:00 2001 From: Yuping Zuo Date: Sun, 18 May 2025 23:31:25 +0800 Subject: [PATCH] fix: setfacl operation not supported --- frankenphp/docker-entrypoint.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frankenphp/docker-entrypoint.sh b/frankenphp/docker-entrypoint.sh index 82cb1ff5..444bdfe5 100755 --- a/frankenphp/docker-entrypoint.sh +++ b/frankenphp/docker-entrypoint.sh @@ -57,8 +57,17 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then fi fi - setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var - setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var + SETFACL_STATUS=0 + SETFACL_ERROR=$(setfacl -m u:www-data:rwX -m u:"$(whoami)":rwX var 2>&1 1>/dev/null) || SETFACL_STATUS=$? + if [ $SETFACL_STATUS -eq 0 ]; then + setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var + setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var + elif echo "$SETFACL_ERROR" | grep -q "Operation not supported"; then + # https://github.com/maelgangloff/domain-watchdog/issues/74 + chown -R "$(whoami)":www-data var + else + echo "$SETFACL_ERROR" >&2 + fi echo 'PHP app ready!' fi