Private
Public Access
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:
1 parent
8c23cc631c
commit
50d2ba9404
2 files changed
+12
No files matched your search
@@ -26,6 +26,13 @@ VENV_DIR="$EVECTION_HOME/venv"
|
|||||||
EVECTION_USER="${EVECTION_USER:-evection}"
|
EVECTION_USER="${EVECTION_USER:-evection}"
|
||||||
PYTHON_BIN="${PYTHON_BIN:-python3}"
|
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 "==> Installing Evection"
|
||||||
echo " App directory: $APP_DIR"
|
echo " App directory: $APP_DIR"
|
||||||
echo " Service user: $EVECTION_USER"
|
echo " Service user: $EVECTION_USER"
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ VENV_DIR="$EVECTION_HOME/venv"
|
|||||||
EVECTION_USER="${EVECTION_USER:-evection}"
|
EVECTION_USER="${EVECTION_USER:-evection}"
|
||||||
SOCKET="/run/evection/gunicorn.sock"
|
SOCKET="/run/evection/gunicorn.sock"
|
||||||
|
|
||||||
|
# $APP_DIR is owned by $EVECTION_USER, but the git steps below run as
|
||||||
|
# root — without this, git refuses to touch a repo it doesn't own
|
||||||
|
# ("detected dubious ownership").
|
||||||
|
git config --global --add safe.directory "$APP_DIR"
|
||||||
|
|
||||||
if ! id -u "$EVECTION_USER" >/dev/null 2>&1; then
|
if ! id -u "$EVECTION_USER" >/dev/null 2>&1; then
|
||||||
echo "System user '$EVECTION_USER' doesn't exist — is Evection installed?" \
|
echo "System user '$EVECTION_USER' doesn't exist — is Evection installed?" \
|
||||||
"Run scripts/install.sh first." >&2
|
"Run scripts/install.sh first." >&2
|
||||||
|
|||||||
Reference in new issue
Block a user