nix trusts the swarm's root through its own CA bundle, so root's nix clients reach the cache
This commit is contained in:
parent
526cfbec1b
commit
9d62ef44b5
1 changed files with 299 additions and 79 deletions
|
|
@ -540,7 +540,8 @@ the store under the hive's own store identity every ten minutes. It writes the
|
|||
key to `/run/hyperhive-priv/attic/public-key` (`0700` directory, `0600` file)
|
||||
and the nix.conf fragment `/run/hyperhive-nix/cache.conf`, which the host's
|
||||
nix.conf includes, with the cache's address as `extra-substituters`, the key as
|
||||
`extra-trusted-public-keys` and `netrc-file = /run/hyperhive-nix/netrc`. The
|
||||
`extra-trusted-public-keys`, `netrc-file = /run/hyperhive-nix/netrc` and
|
||||
`ssl-cert-file = /run/hyperhive-nix/ca-bundle.crt`. The
|
||||
netrc (`root:root 0600`) holds the pull token's entry for the cache's host and
|
||||
then the entries of the host's own netrc, which is `nix.settings.netrc-file`
|
||||
when the host sets it and nix's default `/etc/nix/netrc` otherwise, because
|
||||
|
|
@ -548,6 +549,15 @@ when the host sets it and nix's default `/etc/nix/netrc` otherwise, because
|
|||
on every run, so an edit to the host's netrc reaches the daemon within ten
|
||||
minutes. An entry for the cache's own host in the host's netrc gives way to the
|
||||
pull token's. The unit doesn't see a netrc that the host names only in
|
||||
`nix.extraOptions`. The CA bundle (`root:root 0644`) is the host's own bundle,
|
||||
which is `nix.settings.ssl-cert-file` when the host sets it and
|
||||
`security.pki.caBundle` otherwise, followed by the swarm's root from
|
||||
`<deploy.hive-controller.tls.stateDir>/swarm-services-root.pem`. The cache's
|
||||
certificate chains to that root, which no build-time bundle holds, and every
|
||||
nix client of the host (the daemon, `hive-priv`, root's `nixos-rebuild`) reads
|
||||
the fragment. Only nix trusts the root; the host's system trust stays as it was.
|
||||
A host without the root yet gets its own bundle alone until a later run finds
|
||||
it. The unit doesn't see an `ssl-cert-file` that the host names only in
|
||||
`nix.extraOptions`. The cache's address is the host's
|
||||
`services.hyperhive.swarm.attic.domain` and `cache`. The unit restarts
|
||||
`nix-daemon` only when the fragment changed after the daemon started, which
|
||||
|
|
|
|||
Loading…
Reference in a new issue