From d867e3b976560b1aff4a854839f9ad7921b58fa6 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Thu, 6 Aug 2026 14:23:56 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20storage=20path=20in=20config.yaml?= =?UTF-8?q?=20only=20=E2=80=94=20deploy=20script=20no=20longer=20prompts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yaml | 2 +- deploy_nvr.sh | 46 ++++++++-------------------------------------- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/config.yaml b/config.yaml index e17ae45..973675b 100644 --- a/config.yaml +++ b/config.yaml @@ -7,7 +7,7 @@ server: viewer_port: ":8090" storage: - recordings_path: "" + recordings_path: "/home/master/nvr_data" retention_days: 7 cleanup_interval_mins: 60 diff --git a/deploy_nvr.sh b/deploy_nvr.sh index 3d35ad8..c6a9478 100755 --- a/deploy_nvr.sh +++ b/deploy_nvr.sh @@ -159,33 +159,8 @@ log "Local time: $(date)" TZ=$(timedatectl show --property=Timezone --value 2>/dev/null || cat /etc/timezone 2>/dev/null || echo "unknown") log "Timezone: ${TZ}" -# ── 1c. Storage path ── -echo "" -log "Step 1c/7: Where should recordings be stored?" -info " This is where video clips and snapshots will be saved." -info " Examples: /mnt/recordings, /home/user/nvr, /media/usb-drive" -info " Or set STORAGE_PATH environment variable to skip the prompt." -echo "" -if [ -n "${STORAGE_PATH}" ]; then - log "Using STORAGE_PATH from environment: ${STORAGE_PATH}" -elif [ -e /dev/tty ]; then - read -p " Storage path [${HOME}/nvr_data]: " STORAGE_PATH /dev/null || mkdir -p "${STORAGE_PATH}" -sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}" 2>/dev/null || true # ── 6. Install service ── -log "Step 7/7: Service installation..." +log "Step 7/6: Service installation..." RUN_USER="$(whoami)" SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service" @@ -319,7 +289,7 @@ echo "============================================" echo "" info " Web UI: http://$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'localhost'):8080" info " Config: ${DEPLOY_DIR}/config.yaml" -info " Storage: /mnt/recordings/" +info " Storage: $(grep recordings_path ${DEPLOY_DIR}/config.yaml 2>/dev/null | awk '{print $2}' | tr -d '"')" echo "" if $HAS_SYSTEMD; then echo " Service:"