mesh: carry gateway_domain so peers can launch remote apps

The mesh payload didn't include a node's acme domain, so a peer had no way
to build launch URLs for another machine's exposed apps. Publish
gateway_domain in the MQTT registry payload and surface it per-deployment on
/mesh/deployments as `domain`. The dashboard palette and System Map now build
`https://<subdomain>.<domain>` for remote http-exposed apps (references use
their base_url), making primer's apps launchable from civil.
This commit is contained in:
2026-07-06 21:07:10 -07:00
parent 25bc8a8ab1
commit b28645f2f4
5 changed files with 49 additions and 6 deletions

View File

@@ -78,12 +78,20 @@ function PaletteBody({ onClose }: { onClose: () => void }) {
})
}
for (const md of mesh?.deployments ?? []) {
// A remote app is launchable at <subdomain>.<node-domain> when the node has an
// acme domain and the app is http-exposed (subdomain set); references carry base_url.
const remoteLaunch =
md.kind === "reference"
? (md.base_url ?? undefined)
: md.subdomain && md.domain
? `https://${md.subdomain}.${md.domain}`
: undefined
out.push({
id: `${md.node}/${md.name}`,
name: md.name,
kind: md.kind,
machine: md.node,
launchUrl: undefined, // remote launch URL isn't in the mesh payload yet
launchUrl: remoteLaunch,
detailPath: `/node/${md.node}`,
mapNodeId: `__remote_${md.node}_${md.name}__`,
})