Format sigur pentru /etc/deriox-guard/agent.env pe mini PC. Toate funcțiile reale rămân dezactivate în M9.3.
M9.3 defines the safe local configuration format for the real mini PC gateway agent. It creates a disabled-by-default agent.env template. Heartbeat, pairing, camera discovery, stream, media and production remain disabled until later phases.
#!/bin/bash set -e echo "==================================================" echo "DERIOX GUARD - AGENT CONFIG SETUP M9.3" echo "==================================================" echo "This script writes a disabled-by-default local config." echo "It does NOT start an agent, does NOT send heartbeat," echo "does NOT pair, does NOT scan cameras and does NOT store camera passwords." echo "" if [ "$(id -u)" -ne 0 ]; then echo "EROARE: rulează cu sudo sau ca root pe mini PC." exit 1 fi CONF_DIR="/etc/deriox-guard" CONF_FILE="$CONF_DIR/agent.env" BACKUP_DIR="/var/lib/deriox-guard/config-backups" STAMP="$(date +%Y%m%d_%H%M%S)" mkdir -p "$CONF_DIR" "$BACKUP_DIR" chmod 700 "$CONF_DIR" "$BACKUP_DIR" if [ -f "$CONF_FILE" ]; then cp -f "$CONF_FILE" "$BACKUP_DIR/agent.env.$STAMP.bak" chmod 600 "$BACKUP_DIR/agent.env.$STAMP.bak" echo "Backup config existent: $BACKUP_DIR/agent.env.$STAMP.bak" fi cat > "$CONF_FILE" <<'EOF' # Deriox Guard Agent config - M9.3 safe local format # Path on mini PC: /etc/deriox-guard/agent.env # # Safety rules: # - no camera passwords here # - no stream links here # - no media paths here # - heartbeat/pairing/camera discovery/stream/media remain disabled in M9.3 DERIOX_GUARD_URL=https://guard.deriox.ro DERIOX_AGENT_MODE=preparation DERIOX_AGENT_NAME=mini-pc-pilot-01 # Assigned later, not active in M9.3: DERIOX_GATEWAY_UUID= DERIOX_PAIRING_CODE= # M9.3 disabled-by-default feature flags: DERIOX_ENABLE_HEARTBEAT=0 DERIOX_ENABLE_PAIRING=0 DERIOX_ENABLE_CAMERA_DISCOVERY=0 DERIOX_ENABLE_STREAM=0 DERIOX_ENABLE_MEDIA=0 # Local paths: DERIOX_QUEUE_DIR=/var/lib/deriox-guard/queue DERIOX_STATE_DIR=/var/lib/deriox-guard/state DERIOX_LOG_FILE=/var/log/deriox-guard/agent.log DERIOX_LOG_LEVEL=info EOF chmod 600 "$CONF_FILE" echo "" echo "Config creat: $CONF_FILE" echo "" echo "Verific flag-uri dezactivate:" grep -E "DERIOX_ENABLE_(HEARTBEAT|PAIRING|CAMERA_DISCOVERY|STREAM|MEDIA)=0" "$CONF_FILE" echo "" echo "M9.3 config setup complete." echo "No service was started." echo "Next phase: M9.4 real heartbeat endpoint and mini PC heartbeat script."