Update web ui settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
name: "MeshMonitor"
|
name: "MeshMonitor"
|
||||||
description: "Web tool for monitoring a Meshtastic Node Deployment"
|
description: "Web tool for monitoring a Meshtastic Node Deployment"
|
||||||
version: "3.9.5.1"
|
version: "3.9.5.2"
|
||||||
slug: "meshmonitor"
|
slug: "meshmonitor"
|
||||||
init: false
|
init: false
|
||||||
arch:
|
arch:
|
||||||
@@ -18,6 +18,14 @@ map:
|
|||||||
options:
|
options:
|
||||||
meshtastic_node_ip: "192.168.1.xxx"
|
meshtastic_node_ip: "192.168.1.xxx"
|
||||||
meshtastic_tcp_port: 4403
|
meshtastic_tcp_port: 4403
|
||||||
|
admin_password: "changeme"
|
||||||
|
session_secret: "generate_a_random_string_here"
|
||||||
|
disable_anonymous: true
|
||||||
|
debug_level: "info"
|
||||||
schema:
|
schema:
|
||||||
meshtastic_node_ip: "str"
|
meshtastic_node_ip: "str"
|
||||||
meshtastic_tcp_port: "int"
|
meshtastic_tcp_port: "int"
|
||||||
|
admin_password: "str"
|
||||||
|
session_secret: "str"
|
||||||
|
disable_anonymous: "bool"
|
||||||
|
debug_level: "list(error|warn|info|debug)"
|
||||||
@@ -2,30 +2,33 @@
|
|||||||
|
|
||||||
CONFIG_PATH=/data/options.json
|
CONFIG_PATH=/data/options.json
|
||||||
|
|
||||||
# Extract options
|
# --- Mapping HA Options to MeshMonitor Env Vars ---
|
||||||
export MESHTASTIC_NODE_IP=$(jq --raw-output '.meshtastic_node_ip' $CONFIG_PATH)
|
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)
|
export MESHTASTIC_TCP_PORT=$(jq --raw-output '.meshtastic_tcp_port // 4403' $CONFIG_PATH)
|
||||||
|
export ADMIN_PASSWORD=$(jq --raw-output '.admin_password // "changeme"' $CONFIG_PATH)
|
||||||
|
export SESSION_SECRET=$(jq --raw-output '.session_secret // "default_secret"' $CONFIG_PATH)
|
||||||
|
export DISABLE_ANONYMOUS=$(jq --raw-output '.disable_anonymous // true' $CONFIG_PATH)
|
||||||
|
export DEBUG_LEVEL=$(jq --raw-output '.debug_level // "info"' $CONFIG_PATH)
|
||||||
|
|
||||||
# Standard MeshMonitor variables
|
# --- Fixed Add-on Environment Settings ---
|
||||||
export PORT=3001
|
export PORT=3001
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
|
export DATABASE_PATH="/data/meshmonitor.db"
|
||||||
# --- INGRESS SPECIFIC FIXES ---
|
export TRUST_PROXY=true
|
||||||
# 1. Force the app to use relative paths for all assets
|
export ALLOWED_ORIGINS="*"
|
||||||
|
export COOKIE_SECURE=false
|
||||||
export BASE_URL="./"
|
export BASE_URL="./"
|
||||||
|
|
||||||
# 2. Tell the Express server to trust the HA Proxy headers
|
# --- Ingress Path Resolution Patch ---
|
||||||
export TRUST_PROXY=true
|
# This ensures that the frontend assets (JS/CSS) are requested relative
|
||||||
|
# to the Home Assistant Ingress sub-path instead of the root IP.
|
||||||
|
echo "Applying Ingress path patches..."
|
||||||
|
find /app/dist/client -type f -name "*.html" -exec sed -i 's/src="\//src=".\//g' {} +
|
||||||
|
find /app/dist/client -type f -name "*.html" -exec sed -i 's/href="\//href=".\//g' {} +
|
||||||
|
find /app/dist/client -type f -name "*.js" -exec sed -i 's/\"\/assets\//\".\/assets\//g' {} +
|
||||||
|
|
||||||
# 3. Disable Secure Cookies (Ingress often fails if this is 'true' without valid SSL on the local IP)
|
echo "Starting MeshMonitor on port $PORT..."
|
||||||
export COOKIE_SECURE=false
|
echo "Database located at $DATABASE_PATH"
|
||||||
|
|
||||||
# 4. MeshMonitor specific: Allow the HA Ingress origin
|
|
||||||
export ALLOWED_ORIGINS="*"
|
|
||||||
# ------------------------------
|
|
||||||
|
|
||||||
echo "Starting MeshMonitor on port 3001 via Ingress..."
|
|
||||||
|
|
||||||
cd /app
|
cd /app
|
||||||
# Start the server using the compiled distribution
|
|
||||||
exec node dist/server/server.js
|
exec node dist/server/server.js
|
||||||
Reference in New Issue
Block a user