diff --git a/deploy/install.sh b/deploy/install.sh index cbd3302..ce7be39 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -7,10 +7,13 @@ REPO_URL="${REPO_URL:-https://git.cynfo.net/christian/voice-agent.git}" APP_DIR="/var/www/voice-agent" APP_USER="deploy" +echo "[0/7] Sicherstellen: nicht-interaktive apt" +export DEBIAN_FRONTEND=noninteractive + echo "[1/7] System-Pakete installieren" apt-get update -y apt-get install -y --no-install-recommends \ - git python3 python3-venv python3-pip nginx ca-certificates curl ffmpeg + git python3 python3-venv python3-pip nginx ca-certificates curl ffmpeg sudo echo "[2/7] Deploy-User sicherstellen" id "$APP_USER" >/dev/null 2>&1 || useradd -m -s /bin/bash "$APP_USER" @@ -19,17 +22,17 @@ chown -R "$APP_USER:$APP_USER" "$APP_DIR" echo "[3/7] Repo klonen/aktualisieren" if [ -d "$APP_DIR/.git" ]; then - sudo -u "$APP_USER" git -C "$APP_DIR" fetch --all --prune - sudo -u "$APP_USER" git -C "$APP_DIR" reset --hard origin/main + runuser -u "$APP_USER" -- git -C "$APP_DIR" fetch --all --prune + runuser -u "$APP_USER" -- git -C "$APP_DIR" reset --hard origin/main else - sudo -u "$APP_USER" git clone "$REPO_URL" "$APP_DIR" + runuser -u "$APP_USER" -- git clone "$REPO_URL" "$APP_DIR" fi echo "[4/7] Python-venv + Dependencies" cd "$APP_DIR/lxc-frontend" -sudo -u "$APP_USER" python3 -m venv .venv -sudo -u "$APP_USER" .venv/bin/pip install --upgrade pip -sudo -u "$APP_USER" .venv/bin/pip install -r requirements.txt +runuser -u "$APP_USER" -- python3 -m venv .venv +runuser -u "$APP_USER" -- .venv/bin/pip install --upgrade pip +runuser -u "$APP_USER" -- .venv/bin/pip install -r requirements.txt echo "[5/7] .env anlegen falls fehlt" if [ ! -f "$APP_DIR/lxc-frontend/.env" ]; then