Files
addons/meshmonitor/run.sh
2026-03-22 15:15:36 +01:00

31 lines
898 B
Bash

#!/bin/sh
CONFIG_PATH=/data/options.json
# Extract options
export MESHTASTIC_NODE_IP=$(jq --raw-output '.meshtastic_node_ip' $CONFIG_PATH)
export MESHTASTIC_TCP_PORT=$(jq --raw-output '.meshtastic_tcp_port // 4403' $CONFIG_PATH)
# Standard MeshMonitor variables
export PORT=3001
export NODE_ENV=production
# --- INGRESS SPECIFIC FIXES ---
# 1. Force the app to use relative paths for all assets
export BASE_URL="./"
# 2. Tell the Express server to trust the HA Proxy headers
export TRUST_PROXY=true
# 3. Disable Secure Cookies (Ingress often fails if this is 'true' without valid SSL on the local IP)
export COOKIE_SECURE=false
# 4. MeshMonitor specific: Allow the HA Ingress origin
export ALLOWED_ORIGINS="*"
# ------------------------------
echo "Starting MeshMonitor on port 3001 via Ingress..."
cd /app
# Start the server using the compiled distribution
exec node dist/server/server.js