The roster publishes a route's internal name, never its public one (hq ADR 0191)

NamesServed read a route's public `name` and plan.go then filtered by suffix — telling the mesh's
names from public ones by their spelling, when the mesh composed both itself. It now publishes the
`internal-name` it composed under the serving node (ADR 0151); the suffix filter is gone.
This commit is contained in:
2026-10-03 15:39:05 +02:00
parent f966693583
commit e56f3aa1cb
4 changed files with 37 additions and 58 deletions
+12 -3
View File
@@ -22,8 +22,15 @@ import (
// modules declared. Deterministic: names, requirements and nodes are walked in order, so two
// plans of one mesh yield one region.
// NamesServed is every routed name across the mesh and the node that serves it, from every node's
// resolution and settings. A name several termini claim goes to the first node in name order, so
// **The name published is the one the mesh composed for itself** (novox/hq ADR 0191). A route carries
// two: `name`, composed from the node's public domain, and `internal-name`, composed from the mesh's
// own domain under the serving node (ADR 0151). Only the second is the mesh's to answer. The public
// one is the operator's, answered by public DNS — publishing it here gave every machine's resolver a
// private answer for a public name, and a resolver that also serves a LAN handed it to a phone that
// could not reach it. Which is which is known from where each was composed, not read off its spelling.
//
// NamesServed is every routed internal name across the mesh and the node that serves it, from every
// node's resolution and settings. A name several termini claim goes to the first node in name order, so
// the answer is stable; a name nothing terminal claims is left out.
func NamesServed(plans map[string]Resolution, settings map[string]SettingsBy) (map[string]string, error) {
nodes := make([]string, 0, len(plans))
@@ -56,7 +63,9 @@ func NamesServed(plans map[string]Resolution, settings map[string]SettingsBy) (m
if _, labelled := given.Values["label"]; !labelled {
continue
}
name, _ := given.Values["name"].(string)
// A route that asked for no internal name — its reach is public only — has none to
// publish, and its public name is not the mesh's to answer.
name, _ := given.Values["internal-name"].(string)
if name == "" {
continue
}