fix(pilot): let SENCHO_PUBLIC_URL override the request Host in enrollment (#1122)

The enrollment minter inferred SENCHO_PRIMARY_URL from the request Host
header, which baked loopback or LAN addresses into the compose YAML when
the admin opened Add Node on the central's own machine. Pilots on a
different network (a public cloud VPS, for example) cannot dial that.

SENCHO_PUBLIC_URL on the primary now wins when set and well-formed
(http(s)://, no loopback). Trailing slashes are stripped. Falls back to
the request Host when unset or invalid.
This commit is contained in:
Anso
2026-05-20 03:35:25 -04:00
committed by GitHub
parent b4d92621d4
commit 282ab8d844
4 changed files with 107 additions and 5 deletions
+8
View File
@@ -29,6 +29,14 @@ API_RATE_LIMIT=200
# Increase for environments with many concurrent browser sessions behind shared NAT.
API_POLLING_RATE_LIMIT=300
# Public URL of THIS primary instance, used to bake an externally-reachable
# SENCHO_PRIMARY_URL into pilot enrollment YAML. Set this when the primary
# sits behind a reverse proxy or Cloudflare Tunnel so pilots on a different
# network can dial the public hostname instead of the request Host header
# the admin happens to be on (loopback, LAN, etc.). Must be http(s)://; no
# trailing slash. When unset, enrollment falls back to the request Host.
SENCHO_PUBLIC_URL=
# ─── Pilot agent (remote host only) ──────────────────────────────
# These three vars are required ONLY on a remote host running as a
# pilot-agent reverse-tunnel container. The primary instance does not