From 6c46759848210dd25e0a12d47e327c48bfa46df5 Mon Sep 17 00:00:00 2001 From: gahusb Date: Mon, 27 Apr 2026 16:55:19 +0900 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20deploy-nas.sh=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EB=9F=B0=ED=83=80=EC=9E=84=20=EB=94=94=EB=A0=89?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=EC=97=90=20chown+chmod=20=EC=9D=BC=EA=B4=84?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서비스별 개별 처리 대신 $DST 전체에 대해 chown -R + chmod -R 755 수행. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/deploy-nas.sh | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/scripts/deploy-nas.sh b/scripts/deploy-nas.sh index 3077098..f186c57 100644 --- a/scripts/deploy-nas.sh +++ b/scripts/deploy-nas.sh @@ -62,28 +62,9 @@ rsync -rl --no-owner --no-group "$SRC/docker-compose.yml" "$DST/docker-compose.y fi } -# 파일 권한 설정 — numeric UID/GID + idempotent (이미 맞으면 skip) + silent -# Synology ACL이 chown을 거부할 수 있어도 파일이 이미 올바른 소유자면 문제없음 -echo "Setting ownership ${DEPLOY_UID}:${DEPLOY_GID} and mode ${DEPLOY_MODE}..." -chown_if_needed() { - local target="$1" - [ -e "$target" ] || return 0 - local cur - cur=$(stat -c '%u:%g' "$target" 2>/dev/null || echo "") - if [ "$cur" = "${DEPLOY_UID}:${DEPLOY_GID}" ]; then - return 0 - fi - chown "${DEPLOY_UID}:${DEPLOY_GID}" "$target" 2>/dev/null || true -} - -for dir in $SERVICES; do - [ -e "$DST/$dir" ] || continue - # 재귀: 디렉토리/파일 각각 idempotent chown (find로 mismatch만 시도) - find "$DST/$dir" \( ! -uid "$DEPLOY_UID" -o ! -gid "$DEPLOY_GID" \) \ - -exec chown "${DEPLOY_UID}:${DEPLOY_GID}" {} + 2>/dev/null || true - chmod -R "$DEPLOY_MODE" "$DST/$dir" 2>/dev/null || true -done -chown_if_needed "$DST/docker-compose.yml" -chmod "$DEPLOY_MODE" "$DST/docker-compose.yml" 2>/dev/null || true +# 파일 권한 설정 — 전체 런타임 디렉토리에 일괄 적용 +echo "Setting ownership ${DEPLOY_UID}:${DEPLOY_GID} and mode ${DEPLOY_MODE} on $DST ..." +chown -R "${DEPLOY_UID}:${DEPLOY_GID}" "$DST" 2>/dev/null || true +chmod -R "$DEPLOY_MODE" "$DST" 2>/dev/null || true echo "SYNC_OK"