swarm-bao: make the store's name resolve where the store runs
Nothing resolved `bao.<swarm.domain>`. It is absent from `swarm.serviceDomains` and, unlike every other swarm service, contributed no `gateway.localNames` entry — so the name a reader dials answered only if an operator had published an external record, which nothing asks them to do. Cross-hive traffic goes via the domain either way; only what it resolves to varies, and for a multi-host swarm that is the operator's upstream DNS. This covers the deployment with no upstream record to configure. DNS only, and that asymmetry is deliberate: bao stays out of `serviceDomains` and gets no vhost. Its leaf comes from its own CA, so a services-CA entry would mint one nothing uses, and nginx terminating TLS would strip the client certificate the store authenticates every hive with. `swarm-nats.nix` documents the same exclusion for itself. module-eval gains the presence and absence arms: claiming a name this host does not serve would point every local reader at the wrong machine. Refs #3862
This commit is contained in:
parent
a977e30d66
commit
f3ce94b4f6
2 changed files with 26 additions and 0 deletions
|
|
@ -103,6 +103,8 @@ let
|
|||
# is deployed" from "this host can authenticate to the store".
|
||||
matrixNoBaoIdentity = hive { deploy.matrix.enable = true; };
|
||||
|
||||
baoNames = machine: machine.services.hyperhive.gateway.localNames;
|
||||
|
||||
# A priority collision is a property of the *option*, not
|
||||
# of the merged value's interior — nix throws the moment the value is
|
||||
# demanded at all, so `seq`-ing each `serviceConfig` value to WHNF is
|
||||
|
|
@ -250,6 +252,18 @@ let
|
|||
in
|
||||
s ? swarm-bao-matrix-token && s.swarm-bao-matrix-token.requires == [ "swarm-bao-pki.service" ];
|
||||
}
|
||||
{
|
||||
# The name a reader dials has to resolve where the store runs; a
|
||||
# multi-host swarm resolves it upstream instead.
|
||||
name = "the store's host answers for the store's name";
|
||||
ok = builtins.elem "bao.t.local" (baoNames baoPkcs11);
|
||||
}
|
||||
{
|
||||
# Absence arm, and the one that matters: claiming a name this host does
|
||||
# not serve points every local reader at the wrong machine.
|
||||
name = "a hive that does not run the store claims no name for it";
|
||||
ok = !(builtins.elem "bao.t.local" (baoNames bare));
|
||||
}
|
||||
];
|
||||
|
||||
bad = builtins.filter (c: !c.ok) cases;
|
||||
|
|
|
|||
Loading…
Reference in a new issue