From 172f31d7c54acf9001b01477fd70ce5a3faa0e8d Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 4 Oct 2026 19:55:30 -0400 Subject: [PATCH] drb-update: trust INSTALL_DIR for git so a user-owned checkout can update radio-box (INSTALL_DIR=/home/pi/node-26, owned by pi) failed every update: root's git refused the repo as 'dubious ownership', so origin read as '' and the origin check refused. Scope safe.directory to INSTALL_DIR via GIT_CONFIG_* env (command-line scope) for the updater process only. Co-Authored-By: Claude Opus 5.5 --- scripts/drb-update.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/drb-update.sh b/scripts/drb-update.sh index 6237339..0d9219d 100644 --- a/scripts/drb-update.sh +++ b/scripts/drb-update.sh @@ -51,6 +51,12 @@ main() { flock -n 9 || { log "another update is already running"; return 0; } cd "$INSTALL_DIR" + # This runs as root, but a pre-install.sh checkout (e.g. /home/pi/node-26) + # is owned by the login user, and git >= 2.35.2 then refuses every command + # with "dubious ownership" — which surfaced as origin '' != REPO_URL. Trust + # exactly the configured INSTALL_DIR, for this process only (env config is + # command-line scope, which safe.directory honours; no global config change). + export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.directory GIT_CONFIG_VALUE_0="$INSTALL_DIR" envget() { grep -E "^$1=" .env 2>/dev/null | head -1 | cut -d= -f2- | tr -d '"' || true; } local NODE_ID C2_URL NODE_ID="$(envget NODE_ID)"; C2_URL="$(envget C2_URL)"; C2_URL="${C2_URL%/}" -- 2.54.0