Add internal reverse proxy
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
FROM ghcr.io/yeraze/meshmonitor:latest
|
||||
|
||||
USER root
|
||||
RUN apk add --no-cache jq curl bash
|
||||
RUN apk add --no-cache jq curl bash nginx
|
||||
|
||||
COPY nginx.conf /etc/nginx/http.d/default.conf
|
||||
|
||||
COPY run.sh /run.sh
|
||||
RUN chmod a+x /run.sh
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
name: "MeshMonitor"
|
||||
description: "Meshtastic Monitoring Dashboard"
|
||||
version: "1.0.5"
|
||||
version: "1.0.6"
|
||||
slug: "meshmonitor"
|
||||
arch:
|
||||
- aarch64
|
||||
- amd64
|
||||
# Remove the ingress keys entirely
|
||||
ports:
|
||||
3001/tcp: 8080
|
||||
ports_description:
|
||||
3001/tcp: "Web Interface"
|
||||
ingress: true
|
||||
ingress_port: 8099
|
||||
panel_icon: mdi:access-point-network
|
||||
panel_title: "MeshMonitor"
|
||||
options:
|
||||
MESHTASTIC_NODE_IP: "192.168.1.100"
|
||||
MESHTASTIC_TCP_PORT: 4403
|
||||
|
||||
16
meshmonitor/nginx.conf
Normal file
16
meshmonitor/nginx.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
server {
|
||||
listen 8099;
|
||||
|
||||
location / {
|
||||
# Reconstruct the full path expected by the app's BASE_URL
|
||||
proxy_pass http://127.0.0.1:3001$http_x_ingress_path$request_uri;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,20 @@ export DISABLE_ANONYMOUS=$(jq --raw-output '.DISABLE_ANONYMOUS' $CONFIG_PATH)
|
||||
|
||||
export DATABASE_PATH="/data/meshmonitor.db"
|
||||
export PORT=3001
|
||||
export TRUST_PROXY=true
|
||||
export ALLOWED_ORIGINS="*"
|
||||
export COOKIE_SECURE=false
|
||||
|
||||
echo "Starting MeshMonitor for node: $MESHTASTIC_NODE_IP..."
|
||||
# Fetch Ingress URL so the Node app knows its subpath
|
||||
if [ -n "$SUPERVISOR_TOKEN" ]; then
|
||||
RAW_URL=$(curl -s -H "Authorization: Bearer ${SUPERVISOR_TOKEN}" http://supervisor/addons/self/info | jq --raw-output '.data.ingress_url')
|
||||
export BASE_URL="${RAW_URL%/}"
|
||||
echo "Configuring MeshMonitor BASE_URL to: $BASE_URL"
|
||||
fi
|
||||
|
||||
# Start Nginx in the background
|
||||
mkdir -p /run/nginx
|
||||
nginx
|
||||
|
||||
echo "Starting MeshMonitor..."
|
||||
exec node dist/server/server.js
|
||||
Reference in New Issue
Block a user