fix: config comes from repo clone, fix step numbering

This commit is contained in:
Claus Lohmar 2026-08-06 14:27:58 +01:00
parent d867e3b976
commit 49b1b8a5ff

View file

@ -182,7 +182,7 @@ export GOPATH="$HOME/go"
export GOCACHE="$HOME/.cache/go-build" export GOCACHE="$HOME/.cache/go-build"
# ── 3. Clone or update repository ── # ── 3. Clone or update repository ──
log "Step 4/6: Fetching NextNVR source..." log "Step 3/6: Fetching NextNVR source..."
if [ -d "${DEPLOY_DIR}/.git" ]; then if [ -d "${DEPLOY_DIR}/.git" ]; then
info "Repository exists, pulling latest..." info "Repository exists, pulling latest..."
@ -199,7 +199,7 @@ fi
cd "${DEPLOY_DIR}" cd "${DEPLOY_DIR}"
# ── 4. Build ── # ── 4. Build ──
log "Step 5/6: Building NextNVR binary..." log "Step 4/6: Building NextNVR binary..."
go mod tidy go mod tidy
@ -214,17 +214,16 @@ chmod +x nextnvr
log "Binary built: nextnvr v${VERSION} ($(du -h nextnvr | cut -f1))" log "Binary built: nextnvr v${VERSION} ($(du -h nextnvr | cut -f1))"
# ── 5. Configuration & directories ── # ── 5. Configuration & directories ──
log "Step 6/6: Configuration..." log "Step 5/6: Configuration..."
# Repo includes a default config.yaml. Only warn if it's missing.
if [ ! -f "${DEPLOY_DIR}/config.yaml" ]; then if [ ! -f "${DEPLOY_DIR}/config.yaml" ]; then
cp config.yaml "${DEPLOY_DIR}/config.yaml" err "config.yaml not found in repository — deployment may fail."
log "Default config.yaml created. Use the web UI to configure cameras and storage."
else
log "config.yaml already exists — preserved."
fi fi
log "Using config: ${DEPLOY_DIR}/config.yaml"
# ── 6. Install service ── # ── 6. Install service ──
log "Step 7/6: Service installation..." log "Step 6/6: Service installation..."
RUN_USER="$(whoami)" RUN_USER="$(whoami)"
SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service" SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"