Mark the app checkout as a safe.directory for root's git commands

install.sh chowns $APP_DIR to the service user, but its own (and
upgrade.sh's) git fetch/checkout steps run as root per the previous fix —
git refuses that combination by default ("detected dubious ownership"),
which is exactly what happens re-running install.sh after an earlier run
got far enough to chown the checkout. Add the directory to root's
safe.directory list before touching it with git.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ksmithandClaude Sonnet 5 committed 2026-10-31 08:49:37 -06:00
1 parent 8c23cc631c
commit 50d2ba9404
2 files changed
+12

No files matched your search

+7
View File
@@ -26,6 +26,13 @@ VENV_DIR="$EVECTION_HOME/venv"
EVECTION_USER="${EVECTION_USER:-evection}"
PYTHON_BIN="${PYTHON_BIN:-python3}"
# $APP_DIR ends up owned by $EVECTION_USER (see below), but the git steps
# in this script run as root — without this, git refuses to touch a repo
# it doesn't own ("detected dubious ownership"), which is exactly what
# happens re-running this script after a previous run got far enough to
# chown the checkout.
git config --global --add safe.directory "$APP_DIR"
echo "==> Installing Evection"
echo " App directory: $APP_DIR"
echo " Service user: $EVECTION_USER"