Correct Matrix and Pangolin mesh naming #364
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!364
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/matrix-pangolin-naming"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Correct the naming mix-up that assigned the Pangolin mesh name to the Matrix client. Matrix now has its own signed identity. Pangolin and its existing compatibility alias identify the established lighthouse, whose certificate identity is preserved.
Merge same-address host lists so the lighthouse aliases survive together in both discovery address families. Replace the misnamed client certificate/encrypted secret and reconcile the README. Native deployment files remain in the separate router-nebula project.
Validation: full nix flake check passed; targeted discovery assertions passed for all four NixOS hosts. The operator ran just test on Electra, preserving its igpu tier. Local name-resolution and authenticated connectivity acceptance passed for Matrix and both lighthouse names over IPv4 and IPv6. Native service acceptance and credential cleanup are complete. Detailed operational evidence is retained privately in KiwiFS.
Current-head automated review 134 is Ready to merge with no remaining actionable feedback; CI passed. Remaining: normal shared fleet rollout after merge. Closes #363; milestone 42, Correct Matrix and Pangolin mesh naming.
Automated code review
Reviewed commit:
0d26ca9c52d206622e5912288fc194a8437d238fVerdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The rename itself is internally consistent:
modules/networking/nebula.nixmoves the 10.10.0.11 / fd56:f458:569c::11 entries frompangolintomatrix, addspangolinas an alias of the lighthouse address10.10.0.1/fd56:f458:569c::1in bothhostMapand theipv6HostMapdefault, and theipv6HostMap ⊆ hostMapassertion (nebula.nix:135) still holds for every name. The newmeshHostshelper is the correct mechanism for two names sharing one address:lib.mapAttrs'collapses the duplicate10.10.0.1key and loses an alias, whereaslib.mkMergeover per-name attrsets concatenates both lists, sonetworking.hosts(nebula.nix:262) and the CoreDNS static zones (nebula.nix:39) now publish bothpangolinandpangolin-vps.nebula/certs/pangolin-vps.crtandsecrets/nebula/pangolin-vps.yamlare retained, so the lighthouse certificate identity is unchanged, and the three recipients in the newsecrets/nebula/matrix.yamlmatch the generic admin-only rule at.sops.yaml:266exactly (yubikey-nano5c, yubikey-5-nfc, provision-key). No consumer in the tree resolves the barepangolinmesh name or 10.10.0.11. The one substantive gap is the retirement handling of the deletedpangolincertificate, which contradicts the documented Nebula retirement rule in README.md.Blocking findings
None.
Important findings
pangolincertificate deleted without recording its fingerprint innebula/revoked.json(nebula/certs/pangolin.crt:1; medium confidence)The diff deletes
nebula/certs/pangolin.crtandsecrets/nebula/pangolin.yaml, butnebula/revoked.jsonstill contains onlychaosandcosmos, and those retired names keep their public certificates (nebula/certs/chaos.crt,nebula/certs/cosmos.crt) plus their key files' removal. README.md:439-443 states the repository rule: 'Nebula retirement is recorded innebula/revoked.jsonusing certificate fingerprints... All peers must load the blocklist to revoke their network access... Public certificates remain for audit, while retired encrypted node keys are removed.' README.md:127-128 adds that 'Reissue does not revoke the replaced certificate: its old signed permissions remain valid until expiry or explicit fingerprint blocklisting.' Thepki.blocklistevery NixOS peer loads is built directly from that file (modules/networking/nebula.nix:245,builtins.attrValues (builtins.fromJSON (builtins.readFile ../../nebula/revoked.json))).Impact: The old
pangolincertificate — the one that authorized the 10.10.0.11 / fd56:f458:569c::11 address now claimed bymatrix— keeps its signed route authority on every peer indefinitely, because its fingerprint is absent from the blocklist thatpki.blocklistand the bundle generator (justfiles/nebula.just:484-486) consume. Any stale deployment still holding that certificate stays valid against the newmatrixaddress, and the audit copy of the retired public certificate is lost, sojust nebula-listand future reissues can no longer see it.Suggested fix: Retire the name through the documented path instead of deleting the artefacts: keep
nebula/certs/pangolin.crtin the tree and record its fingerprint by runningjust nebula-revoke pangolin(the recipe's guard at justfiles/nebula.just:704-709 only refuses registerednixosConfigurationshosts, andpangolinis not one), deleting onlysecrets/nebula/pangolin.yaml. Then deploy the updatednebula/revoked.jsonblocklist to NixOS, native and mobile peers.Suggestions
pangolin(README.md:156; medium confidence)The diff deletes 'The Pangolin service uses its separate endpoint
https://pangolin.nimmog.uk.' The replacement paragraph only states that the mesh namespangolinandpangolin-vpsidentify the external lighthouse. The rest of the repository still treats Pangolin as a distinct service reachable at that URL:modules/services/newt.nix:23defaultsnixosConfig.newt.endpointtohttps://pangolin.nimmog.uk, README.md:334 documents 'the existing Pangolin HTTPS route atforge.nimmog.uk', README.md:366 describes 'native Newt supplies their Pangolin HTTP port', andsecrets/pangolin.yaml/modules/common/pangolin-mcp-launcher.nixconfigure the Pangolin API. After the change, the bare namepangolinresolves to the lighthouse at 10.10.0.1 (modules/networking/nebula.nix:25).Impact: Documentation ambiguity only: a reader looking up how to reach the Pangolin service can now infer that the bare name
pangolinis that service, while the change makes it an alias for the VPS lighthouse. No evaluated configuration or deployment behaviour changes, since no supplied consumer resolves the barepangolinmesh name.Suggested fix: Restore a one-line disambiguation inside the same paragraph, e.g. that the Pangolin service is reached over its own HTTPS route (
https://pangolin.nimmog.uk) and is not a mesh member, so the mesh aliaspangolinis not confused with the service.Tests and validation
Questions
pangolincertificate's revocation tracked out of band, or was the name considered never-issued (so no blocklisting is required)? Nothing in the supplied tree records its fingerprint.nebula/certs/matrix.crtandsecrets/nebula/matrix.yamlconsumed only byjust nebula-bundle matrixfor the non-NixOS Matrix client? Neither file is referenced by any NixOS host (hosts/contains only electra, lena, lyra, vega), so neither is gated bynix flake check.pangolin.meshthrough a lighthouse's dynamicserve_dnsrather than the /etc/hosts entries or the CoreDNS static zones? The retained certificate identity ispangolin-vps(nebula/certs/pangolin-vps.crt), soserve_dnswould publish onlypangolin-vps.mesh; the barepangolinalias exists only in the static hosts-file and CoreDNS paths, which covers NixOS members and resolver nodes but not clients pointed directly at lighthouse DNS (e.g. the mobiledns_resolversvalue at justfiles/nebula.just:639).Review limitations
nix flake check, the generated/etc/hosts, and the CoreDNS configuration were read from source only, not evaluated.nebula/certs/matrix.crtembeds the namematrixand the addresses 10.10.0.11 / fd56:f458:569c::11 now claimed for it inhostMapandipv6HostMap, nor the fingerprint of the deletedpangolin.crtneeded forrevoked.json.Diff coverage
README.md: reviewed — included in a context-limited batchmodules/networking/nebula.nix: reviewed — included in a context-limited batchnebula/certs/matrix.crt: reviewed — included in a context-limited batchnebula/certs/pangolin.crt: reviewed — included in a context-limited batchsecrets/nebula/matrix.yaml: reviewed — included in a context-limited batchsecrets/nebula/pangolin.yaml: reviewed — included in a context-limited batchReview metadata
Assessed review 133. The documentation suggestion is valid: restored the explicit Pangolin HTTPS endpoint clarification and documented the distinction between compatibility aliases and signed-identity discovery.
The retirement finding does not apply to this active-host naming correction under the operator's previously accepted replacement policy. Updated README to distinguish routine uncompromised replacement from targeted host retirement, and removed stale mandatory wording that contradicted that policy. Superseded public artifacts remain auditable in Git history and the published recovery checkpoint; the current certificate inventory describes active identities. No new revocation rollout is justified by this correction.
Remaining questions: Matrix's certificate/secret are intentionally used by the existing native bundle workflow. Compatibility discovery uses the maintained static resolver paths; the configured mobile DNS path was checked and its resolver returned the corrected records. Dynamic lighthouse discovery continues to advertise the signed identity. No further source or native-service change is needed for those questions.
Validation: focused documentation/policy consistency review and git diff --check passed. The existing source configuration and live canary validation remain unchanged. Posting this assessment before pushing the documentation fix to trigger a fresh automated review.
Automated code review
Reviewed commit:
3c3bba7cacb026a316aa6933941da64e0cc88842Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
The rename is internally consistent in the checked-out code.
matrixis added to bothhostMap(modules/networking/nebula.nix:32) andipv6HostMap(:112), so theipv6HostMap ⊆ hostMapassertion (:180-181) still holds;nebula/certs/matrix.crtandsecrets/nebula/matrix.yamlsatisfy thecert = ../../nebula/certs + "/${hostname}.crt"/sops.secrets."nebula/${hostname}-key"lookups (:192-193, :172), and the sops keymatrix-keymatches thenebula.just:290/302conventionsecrets/nebula/$NAME.yaml→["nebula"]["$NAME-key"].matrix.yaml's three age recipients match the external-node rule.sops.yaml:266(yubikey-nano5c,yubikey-5-nfc,provision-key), same as the deletedpangolin.yaml. NonixosConfigurationshost is namedpangolinormatrix(hosts/contains only electra, lena, lyra, vega), so deletingnebula/certs/pangolin.crtandsecrets/nebula/pangolin.yamlleaves no dangling reference; a repo-wide search forpangolinfinds only unrelated subsystems (secrets/pangolin.yamlfor MCP,modules/profiles/pi-pangolin.nix,pangolin-vpsinkeys/hermes-fleet-known-hosts). ThemeshHostshelper is required by the new aliasing: the previous inlinelib.mapAttrs'keyed by IP would have collapsedpangolin/pangolin-vps(both10.10.0.1, and bothfd56:f458:569c::1) to one/etc/hostsentry, whereaslib.mkMergeover per-name attrsets concatenates the alias lists. One name-space concern remains open and depends on live device state.Blocking findings
None.
Important findings
None.
Suggestions
pangolinhas two possible owners; the superseded certificate is not blocklisted (modules/networking/nebula.nix:25; medium confidence)The change makes
pangolinan alias of the lighthouse (pangolin = vpsPrimaryIp;at :25,pangolin = "fd56:f458:569c::1";at :106), someshHostsemitspangolin/pangolin.meshrecords for 10.10.0.1 innetworking.hosts(:262) andcoreDnsStaticZonesemits apangolin.meshzone (:50-70). The certificate and key that previously carried the signed namepangolinfor the Matrix client at 10.10.0.11 were deleted (nebula/certs/pangolin.crt,secrets/nebula/pangolin.yaml) rather than revoked:nebula/revoked.jsoncontains onlychaosandcosmos, sopki.blocklist(:245-247) does not contain that fingerprint, whilelighthouse.serve_dns = true(:150) publishes whatever identities are actually connected.Impact: If the Matrix client still has its old
pangolin-signed credentials installed and connected, the VPS lighthouse's dynamic DNS can advertisepangolinat 10.10.0.11 while the static hosts/CoreDNS records added by this change advertisepangolinat 10.10.0.1, and the old certificate keeps its route authority indefinitely. The README's new wording makes this optional hardening rather than a required step, so this is only observable if the old credentials were not withdrawn.Suggested fix: Confirm the Matrix client's old
pangolin-named certificate/key were removed from the device. If they remain, record that fingerprint innebula/revoked.jsonunder a key that is notpangolin—nebula.just:69/128/328refuse any name present as a key in that file, so apangolinkey would now block provisioning the active alias — matching the README's instruction to keep the superseded fingerprint separate from active host names.Tests and validation
Questions
nebula/certs/matrix.crtcarry the signed namematrixand both networks10.10.0.11andfd56:f458:569c::11/64?ipv6HostMap.matrixnow emits an AAAA record in/etc/hostsand in the CoreDNS template (nebula.nix:64-67), and the option description at :118 says to add nodes only 'with their certificate rollout', so the v2 IPv6 network needs confirmation viajust nebula-list(justfiles/nebula.just:667).pangolin-named certificate/key physically removed from the device, or is it still installed and connected to the VPS lighthouse?nebula/certs/pangolin.crtbe kept in-tree aschaos.crt/cosmos.crtare kept for retired hosts, or is deletion plus Git history the intended policy for a rename? The revised README states both rules, and no tooling injustfiles/nebula.justproduces or consumes 'recovery tags'.ipv6HostMap, mention the newpangolinalias alongside the VPS, as it does elsewhere?Review limitations
nix flake checkand four-host discovery assertions are taken as reported, not independently verified.nebula/certs/matrix.crtcannot be inspected without runningnebula-cert..sops.yaml.pangolinname-collision impact is not an observed defect.grepovertests/found nonebula/hostMap/ipv6HostMapmatches); that missing coverage was not treated as a defect.Diff coverage
README.md: reviewed — included in a context-limited batchmodules/networking/nebula.nix: reviewed — included in a context-limited batchnebula/certs/matrix.crt: reviewed — included in a context-limited batchnebula/certs/pangolin.crt: reviewed — included in a context-limited batchsecrets/nebula/matrix.yaml: reviewed — included in a context-limited batchsecrets/nebula/pangolin.yaml: reviewed — included in a context-limited batchReview metadata
Assessed current-head review 134: Ready to merge, with CI passed. Its remaining suggestion is conditional on an incomplete deployment; the accepted cutover prerequisites were rechecked successfully, so that condition does not apply. Detailed deployment evidence remains private under repository policy. No additional revocation or source change is justified.
The certificate metadata matches the intended active identity. Public artifact retention follows the now-explicit distinction between active-host replacement and host retirement; Git history and the published checkpoint retain the superseded artifact for audit. The README inventory's VPS entry includes its compatibility aliases, which the adjacent paragraph explicitly names; it is not a missing host.
No actionable feedback remains. Automated follow-up is stopping as ready to merge. The MR remains open and unmerged.