device-add: the community mesh plane ships on both gateway renders — management, signal, relay promoted from the kanidm-netbird spike (ADR 0214 d.1) + verification V1 #961

Closed
opened 2026-08-28 21:49:11 +00:00 by ben · 2 comments
Owner

Parent

Spec #960 (child of device-add spec #13) · ADR 0214 · surfaced by #956 (Ben ruled BUILD). Glossary: mesh plane, setup key (CONTEXT.md).

What to build

After a founding on either carrier (kanidm or IDIP), the gateway runs the mesh plane: Netbird management, signal and coturn relay, declared by the gateway render itself (both renders), with its two secrets as clan vars generated on the gateway. No Netbird dashboard. Before wiring anything on top, prove V1 live on the standing rehearsal-d community: a client-credentials token from the carrier's issuer, presented to the plane's setup-keys API, creates/owns the Netbird account and returns a setup key. Record the finding beside the kanidm-netbird spike findings; if a carrier cannot issue client-credentials tokens, record the fallback (Netbird service user + personal access token held as a clan var) — the later minter ticket only needs a token source behind its adapter.

Promote the spike's content (service settings, generators, firewall), not its file — the spike module is written for a three-node lab inventory and a module not in the render's module list is dead text.

Acceptance criteria

  • Both gateway renders emit services.netbird.server gated on a new GatewayFacts.Mesh flag the founding paths set; management on 8011, signal on 8012, coturn enabled, Caddy keeps 443 (no nginx).
  • Generators netbird-datastore and netbird-coturn are named constants, declared by the render, asserted by name in the gateway assertions, and never referenced when the flag is off (no nix eval error on an ungated dereference).
  • The management Signal setting carries an explicit port; the signal URI is the front-door host with :443 when a front door exists (the spike's ${domain}:443/missing port traps are covered by an assertion).
  • Firewall: 8011/8012 open on the LAN-facing nic and wt0 only; 51820/udp + 3478/udp remain the existing mesh/relay port groups; nothing new on the WAN.
  • Render string tests + the nix eval smoke pass for both renders; go build/vet/golangci-lint clean.
  • V1 verified live on both carriers (or the fallback chosen and recorded) in docs/spike-findings/; the outcome named on this ticket.
  • GOTCHAS gains entries for: signal port collision, datastore encryption key format, coturn secret ownership, LAN-before-wt0 enrolment.
  • docs/architecture gains the mesh-plane view (ADR 0042 derived view); STATUS updated.

Blocked by

  • None — can start immediately (depends on landed slices approve-enroll-land, bootstrap:clan-seam).

Task manifest

task: mesh-plane-render
implements_flow: p3-device-add-app
implements_edge: "P3-S4→P3-S5 — approved on the dashboard — device enrolled in the mesh (the plane that makes it possible)"
wireframe: []
interface: GatewayFacts.Mesh (bool) gates netbirdServer(g) in both gateway renders; generators netbird-datastore, netbird-coturn
seam: internal/clan render string tests + nix eval smoke; live V1 on rehearsal-d
acceptance:
  - given: a founding on the kanidm carrier or the IDIP carrier
    when: the gateway deploys
    then: netbird-management, netbird-signal and coturn are running with clan-var secrets, control ports on LAN nic + wt0 only
  - given: a client-credentials token from the carrier's issuer
    when: POST /api/setup-keys on a fresh plane
    then: HTTP 200 with a setup key (V1), or the PAT fallback is recorded
depends_on: [approve-enroll-land, bootstrap:clan-seam]
out_of_scope: [front-door routes, minting at Approve, gateway self-peer, netbird dashboard, members as netbird users]
needs_human_decision: []
## Parent Spec #960 (child of device-add spec #13) · ADR 0214 · surfaced by #956 (Ben ruled BUILD). Glossary: **mesh plane**, **setup key** (CONTEXT.md). ## What to build After a founding on either carrier (kanidm or IDIP), the gateway runs the **mesh plane**: Netbird management, signal and coturn relay, declared by the gateway render itself (both renders), with its two secrets as clan vars generated on the gateway. No Netbird dashboard. Before wiring anything on top, prove **V1** live on the standing `rehearsal-d` community: a client-credentials token from the carrier's issuer, presented to the plane's setup-keys API, creates/owns the Netbird account and returns a setup key. Record the finding beside the kanidm-netbird spike findings; if a carrier cannot issue client-credentials tokens, record the fallback (Netbird service user + personal access token held as a clan var) — the later minter ticket only needs *a* token source behind its adapter. Promote the spike's **content** (service settings, generators, firewall), not its file — the spike module is written for a three-node lab inventory and a module not in the render's module list is dead text. ## Acceptance criteria - [ ] Both gateway renders emit `services.netbird.server` gated on a new `GatewayFacts.Mesh` flag the founding paths set; management on 8011, signal on 8012, coturn enabled, Caddy keeps 443 (no nginx). - [ ] Generators `netbird-datastore` and `netbird-coturn` are named constants, declared by the render, asserted by name in the gateway assertions, and never referenced when the flag is off (no nix eval error on an ungated dereference). - [ ] The management `Signal` setting carries an explicit port; the signal URI is the front-door host with `:443` when a front door exists (the spike's `${domain}:443`/`missing port` traps are covered by an assertion). - [ ] Firewall: 8011/8012 open on the LAN-facing nic and `wt0` only; 51820/udp + 3478/udp remain the existing mesh/relay port groups; nothing new on the WAN. - [ ] Render string tests + the nix eval smoke pass for both renders; `go build`/`vet`/`golangci-lint` clean. - [ ] V1 verified live on both carriers (or the fallback chosen and recorded) in `docs/spike-findings/`; the outcome named on this ticket. - [ ] GOTCHAS gains entries for: signal port collision, datastore encryption key format, coturn secret ownership, LAN-before-`wt0` enrolment. - [ ] `docs/architecture` gains the mesh-plane view (ADR 0042 derived view); STATUS updated. ## Blocked by - None — can start immediately (depends on landed slices `approve-enroll-land`, `bootstrap:clan-seam`). ## Task manifest ```yaml task: mesh-plane-render implements_flow: p3-device-add-app implements_edge: "P3-S4→P3-S5 — approved on the dashboard — device enrolled in the mesh (the plane that makes it possible)" wireframe: [] interface: GatewayFacts.Mesh (bool) gates netbirdServer(g) in both gateway renders; generators netbird-datastore, netbird-coturn seam: internal/clan render string tests + nix eval smoke; live V1 on rehearsal-d acceptance: - given: a founding on the kanidm carrier or the IDIP carrier when: the gateway deploys then: netbird-management, netbird-signal and coturn are running with clan-var secrets, control ports on LAN nic + wt0 only - given: a client-credentials token from the carrier's issuer when: POST /api/setup-keys on a fresh plane then: HTTP 200 with a setup key (V1), or the PAT fallback is recorded depends_on: [approve-enroll-land, bootstrap:clan-seam] out_of_scope: [front-door routes, minting at Approve, gateway self-peer, netbird dashboard, members as netbird users] needs_human_decision: [] ```

swarm-claim host=matou-dev-server-01 run=13454
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=13454 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #961 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 961,
  "status": "success",
  "commits": [
    "dc4ff8cf41a07f392e6918ad58d667bf6fdf4a2f"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "docs/architecture/16-mesh-plane.md",
    "docs/architecture/README.md",
    "docs/architecture/index.html",
    "docs/spike-findings/2026-08-28-mesh-plane-v1-961.md",
    "internal/clan/clan.go",
    "internal/clan/netbird.go",
    "internal/clan/netbird_test.go",
    "internal/clan/seedcommunity_eval_test.go",
    "internal/clan/vmguest.go",
    "internal/founding/selfhostedpath.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/clan/ ./internal/founding/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ -run TestNetbird",
      "exit_code": 0
    },
    {
      "command": "IDSS_EVAL_SMOKE=1 nix develop .#go-ci -c go test ./internal/clan/ -run TestRentedGateway_EvalSmoke",
      "exit_code": 0
    },
    {
      "command": "IDSS_EVAL_SMOKE=1 nix develop .#go-ci -c go test ./internal/clan/ -run TestOwnVPSGateway_EvalSmoke",
      "exit_code": 0
    },
    {
      "command": "node scripts/check-mermaid.mjs",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Both gateway renders emit services.netbird.server gated on GatewayFacts.Mesh; management 8011, signal 8012, coturn enabled, Caddy keeps 443 (no nginx)": "netbird.go netbirdServer(g) (enable=true, port=8011, signal.port=8012, coturn.enable=true, enableNginx=false, dashboard.enable=false), spliced into renderGatewayGuest (public), renderGatewayGuestIDIP (public) and both full-install surfaces (renderControlPlaneSurface[IDIP]) in vmguest.go; GatewayFacts.Mesh in clan.go; TestNetbird_MeshPlaneOnBothRenders",
    "Generators netbird-datastore and netbird-coturn are named constants, declared by the render, asserted by name, never referenced when the flag is off": "NetbirdDatastoreGenerator/NetbirdCoturnGenerator constants + netbirdGenerators() in netbird.go; meshAssertionItems(g) names both (spliced into gatewayControlPlaneAssertions + idipAssertions); TestNetbird_GeneratorsDeclaredWithOwnership + TestNetbird_AssertionsNameTheGenerators + TestNetbird_NoMeshNoPlane (off-case references nothing)",
    "The management Signal setting carries an explicit port; the signal URI is the front-door host with :443 when a front door exists; the spike traps are covered by an assertion": "netbirdServer sets Signal.URI = mesh.<apex>:443 (Proto=https); meshAssertionItems asserts an explicit port on Signal.URI; TestNetbird_SignalURICarriesExplicitPort",
    "Firewall: 8011/8012 open on the LAN-facing nic and wt0 only; 51820/udp + 3478/udp remain the existing mesh/relay port groups; nothing new on the WAN": "netbirdMeshFirewall(g): 8011/8012 on interfaces.wt0 + GatewayFacts.MeshLANIface only, allowedUDPPorts=[51820 3478]; never in the global allowedTCPPorts; TestNetbird_FirewallControlPortsOffTheWAN",
    "Render string tests + the nix eval smoke pass for both renders; go build/vet/golangci-lint clean": "netbird_test.go (7 tests, all pass); TestRentedGateway_EvalSmoke + TestOwnVPSGateway_EvalSmoke both ran live with Mesh:true and evaluated to real drv paths (netbird vars sealed); go build/vet/golangci-lint/go test ./... all exit 0",
    "V1 verified live on both carriers (or the fallback chosen and recorded) in docs/spike-findings/; the outcome named on this ticket": "docs/spike-findings/2026-08-28-mesh-plane-v1-961.md — FALLBACK CHOSEN on both carriers (Netbird service-user PAT held as a clan var): kanidm has no client_credentials grant (spike Q4, live) and the idss-idp bridge is authorization_code-only (internal/controlapi/oidcprovider.go); the positive half (bearer token -> setup key) is proven live in spike #5 Q4; outcome named in the close comment below",
    "GOTCHAS gains entries for signal port collision, datastore encryption key format, coturn secret ownership, LAN-before-wt0 enrolment": "docs/GOTCHAS.md #119 (signal port), #120 (datastore base64 key), #121 (coturn turnserver ownership), #122 (LAN-before-wt0)",
    "docs/architecture gains the mesh-plane view (ADR 0042 derived view); STATUS updated": "docs/architecture/16-mesh-plane.md (mermaid + port table, parse-checked) + README index row + index.html registration; STATUS.md header + #961 prior lead"
  },
  "summary": "The community mesh plane (services.netbird.server — management 8011/signal 8012/coturn, no dashboard/nginx) now ships on every public gateway render on both carriers, gated on GatewayFacts.Mesh, with its two named clan-var secrets, the explicit mesh.<apex>:443 signal URI, and the spike-Q5 firewall; V1 fallback (PAT) recorded and both eval smokes pass live.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #961 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 961, "status": "success", "commits": [ "dc4ff8cf41a07f392e6918ad58d667bf6fdf4a2f" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "docs/architecture/16-mesh-plane.md", "docs/architecture/README.md", "docs/architecture/index.html", "docs/spike-findings/2026-08-28-mesh-plane-v1-961.md", "internal/clan/clan.go", "internal/clan/netbird.go", "internal/clan/netbird_test.go", "internal/clan/seedcommunity_eval_test.go", "internal/clan/vmguest.go", "internal/founding/selfhostedpath.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/clan/ ./internal/founding/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/clan/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/clan/ -run TestNetbird", "exit_code": 0 }, { "command": "IDSS_EVAL_SMOKE=1 nix develop .#go-ci -c go test ./internal/clan/ -run TestRentedGateway_EvalSmoke", "exit_code": 0 }, { "command": "IDSS_EVAL_SMOKE=1 nix develop .#go-ci -c go test ./internal/clan/ -run TestOwnVPSGateway_EvalSmoke", "exit_code": 0 }, { "command": "node scripts/check-mermaid.mjs", "exit_code": 0 } ], "criteria": { "Both gateway renders emit services.netbird.server gated on GatewayFacts.Mesh; management 8011, signal 8012, coturn enabled, Caddy keeps 443 (no nginx)": "netbird.go netbirdServer(g) (enable=true, port=8011, signal.port=8012, coturn.enable=true, enableNginx=false, dashboard.enable=false), spliced into renderGatewayGuest (public), renderGatewayGuestIDIP (public) and both full-install surfaces (renderControlPlaneSurface[IDIP]) in vmguest.go; GatewayFacts.Mesh in clan.go; TestNetbird_MeshPlaneOnBothRenders", "Generators netbird-datastore and netbird-coturn are named constants, declared by the render, asserted by name, never referenced when the flag is off": "NetbirdDatastoreGenerator/NetbirdCoturnGenerator constants + netbirdGenerators() in netbird.go; meshAssertionItems(g) names both (spliced into gatewayControlPlaneAssertions + idipAssertions); TestNetbird_GeneratorsDeclaredWithOwnership + TestNetbird_AssertionsNameTheGenerators + TestNetbird_NoMeshNoPlane (off-case references nothing)", "The management Signal setting carries an explicit port; the signal URI is the front-door host with :443 when a front door exists; the spike traps are covered by an assertion": "netbirdServer sets Signal.URI = mesh.<apex>:443 (Proto=https); meshAssertionItems asserts an explicit port on Signal.URI; TestNetbird_SignalURICarriesExplicitPort", "Firewall: 8011/8012 open on the LAN-facing nic and wt0 only; 51820/udp + 3478/udp remain the existing mesh/relay port groups; nothing new on the WAN": "netbirdMeshFirewall(g): 8011/8012 on interfaces.wt0 + GatewayFacts.MeshLANIface only, allowedUDPPorts=[51820 3478]; never in the global allowedTCPPorts; TestNetbird_FirewallControlPortsOffTheWAN", "Render string tests + the nix eval smoke pass for both renders; go build/vet/golangci-lint clean": "netbird_test.go (7 tests, all pass); TestRentedGateway_EvalSmoke + TestOwnVPSGateway_EvalSmoke both ran live with Mesh:true and evaluated to real drv paths (netbird vars sealed); go build/vet/golangci-lint/go test ./... all exit 0", "V1 verified live on both carriers (or the fallback chosen and recorded) in docs/spike-findings/; the outcome named on this ticket": "docs/spike-findings/2026-08-28-mesh-plane-v1-961.md — FALLBACK CHOSEN on both carriers (Netbird service-user PAT held as a clan var): kanidm has no client_credentials grant (spike Q4, live) and the idss-idp bridge is authorization_code-only (internal/controlapi/oidcprovider.go); the positive half (bearer token -> setup key) is proven live in spike #5 Q4; outcome named in the close comment below", "GOTCHAS gains entries for signal port collision, datastore encryption key format, coturn secret ownership, LAN-before-wt0 enrolment": "docs/GOTCHAS.md #119 (signal port), #120 (datastore base64 key), #121 (coturn turnserver ownership), #122 (LAN-before-wt0)", "docs/architecture gains the mesh-plane view (ADR 0042 derived view); STATUS updated": "docs/architecture/16-mesh-plane.md (mermaid + port table, parse-checked) + README index row + index.html registration; STATUS.md header + #961 prior lead" }, "summary": "The community mesh plane (services.netbird.server — management 8011/signal 8012/coturn, no dashboard/nginx) now ships on every public gateway render on both carriers, gated on GatewayFacts.Mesh, with its two named clan-var secrets, the explicit mesh.<apex>:443 signal URI, and the spike-Q5 firewall; V1 fallback (PAT) recorded and both eval smokes pass live.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#961
No description provided.