LAN stack gives out its LAN address: dev-lan sets FRONTEND_HOST to the published port on the host's default-route address, so the Panels dialog links a screen somewhere it can reach instead of app.localhost

This commit is contained in:
Melvin Strobl
2026-10-15 22:22:58 +02:00
parent 244a43ac8c
commit 4ce50b5c3a
3 changed files with 15 additions and 3 deletions
+4
View File
@@ -81,8 +81,12 @@ dev-local: ## Start the local stack at http://app.localhost (also run by the ro
DOMAIN=$${DOMAIN:-localhost} ENVIRONMENT=$${ENVIRONMENT:-local} \ DOMAIN=$${DOMAIN:-localhost} ENVIRONMENT=$${ENVIRONMENT:-local} \
$(COMPOSE_LOCAL) up --build -d proxy backend frontend docs mailcatcher $(COMPOSE_LOCAL) up --build -d proxy backend frontend docs mailcatcher
# The host's LAN address is the source of its default route. Without `ip`
# (macOS) it stays empty and the instance keeps calling itself app.$(DOMAIN).
dev-lan: ## Same, plus the app on http://<host-ip>:$(APP_PORT) (no DNS needed) dev-lan: ## Same, plus the app on http://<host-ip>:$(APP_PORT) (no DNS needed)
@ip=$$(ip route get 1.1.1.1 2>/dev/null | sed -n 's/.* src \([0-9.]*\).*/\1/p'); \
DOMAIN=$${DOMAIN:-localhost} ENVIRONMENT=$${ENVIRONMENT:-local} APP_PORT=$(APP_PORT) \ DOMAIN=$${DOMAIN:-localhost} ENVIRONMENT=$${ENVIRONMENT:-local} APP_PORT=$(APP_PORT) \
LAN_URL=$${ip:+http://$$ip:$(APP_PORT)} \
$(COMPOSE_LAN) up --build -d proxy backend frontend mailcatcher $(COMPOSE_LAN) up --build -d proxy backend frontend mailcatcher
# The frontend is an nginx image, so a UI change needs a rebuild. Both the # The frontend is an nginx image, so a UI change needs a rebuild. Both the
+7
View File
@@ -7,6 +7,13 @@
# whole app. # whole app.
services: services:
backend:
environment:
# The address the instance gives out: the link the Panels dialog shows a
# screen and the one its emails carry. app.${DOMAIN} resolves on this host
# only, so `make dev-lan` passes the published port on the LAN address.
- FRONTEND_HOST=${LAN_URL:-http://app.${DOMAIN:-localhost}}
frontend: frontend:
ports: !override ports: !override
- "${APP_PORT:-8080}:80" - "${APP_PORT:-8080}:80"
+4 -3
View File
@@ -409,8 +409,8 @@ access.
The openpanel firmware, kept in its own repository, draws dashboards as native The openpanel firmware, kept in its own repository, draws dashboards as native
widgets on an ESP32-P4 wall panel (Waveshare ESP32-P4-WIFI6-Touch-LCD-7B, widgets on an ESP32-P4 wall panel (Waveshare ESP32-P4-WIFI6-Touch-LCD-7B,
1024×600). Once its config page points it at this instance, it shows the 1024×600). Once its config page points it at this instance (the dialog's link
pairing code itself; enter it as in step 4. It reads the same published works too, the device keeps only its address), it shows the pairing code itself; enter it as in step 4. It reads the same published
dashboards and live values and draws every widget type with two exceptions, dashboards and live values and draws every widget type with two exceptions,
both shown as a placeholder: a website tile that embeds a page (image tiles both shown as a placeholder: a website tile that embeds a page (image tiles
work), and a chart of runs, which a panel credential may not read. Media tiles work), and a chart of runs, which a panel credential may not read. Media tiles
@@ -446,7 +446,8 @@ by the nodes that produce it.
!!! note "If the local link is wrong" !!! note "If the local link is wrong"
Pairing links use `FRONTEND_HOST`. Set it to the app address reachable Pairing links use `FRONTEND_HOST`. Set it to the app address reachable
from the screen's network. from the screen's network. `make dev-lan` sets it to the published port on
the host's LAN address.
### A screen somewhere you cannot reach ### A screen somewhere you cannot reach