nats and bao can listen on a routable address, opt-in
This commit is contained in:
parent
4b71bd97eb
commit
892675628d
1 changed files with 174 additions and 6 deletions
|
|
@ -2891,6 +2891,30 @@ in
|
|||
misconfiguration rather than a topology.
|
||||
'';
|
||||
};
|
||||
|
||||
openFirewall = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Open {option}`services.hyperhive.swarm.bao.port` in the host firewall
|
||||
on every interface, so hives on other hosts can reach the addresses in
|
||||
{option}`services.hyperhive.deploy.bao.extraListenAddresses` over the
|
||||
LAN or the internet. Off by default: the port is otherwise open only on
|
||||
the agent bridge.
|
||||
|
||||
⚠️ This exposes the secret store beyond the tunnel. Every listener
|
||||
requires a client certificate signed by
|
||||
{option}`services.hyperhive.deploy.bao.clientCaFile`, and nothing
|
||||
answers without one, which is why setting this without that file, or
|
||||
without any extra address, fails evaluation. Whether the store may be
|
||||
reachable at all from outside a private network is the operator's
|
||||
decision.
|
||||
|
||||
Point `bao.<swarm domain>` in the operator's upstream DNS at the
|
||||
address the other hives reach.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# ⚠️ Gated on `deploy.bao.enable`, and that is load-bearing rather than
|
||||
|
|
@ -2936,6 +2960,24 @@ in
|
|||
deploy.bao.otel.telemetryPort. Pick free ports.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = !baoDeploy.openFirewall || baoDeploy.clientCaFile != null;
|
||||
message = ''
|
||||
services.hyperhive.deploy.bao.openFirewall opens the store's port to
|
||||
every interface, but services.hyperhive.deploy.bao.clientCaFile is
|
||||
null, so its listeners would not require a client certificate. Set
|
||||
clientCaFile, or leave openFirewall off.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = !baoDeploy.openFirewall || baoDeploy.extraListenAddresses != [ ];
|
||||
message = ''
|
||||
services.hyperhive.deploy.bao.openFirewall is set, but
|
||||
services.hyperhive.deploy.bao.extraListenAddresses is empty: the
|
||||
store listens on loopback only, so the open port reaches nothing.
|
||||
Name the address other hives reach, or leave openFirewall off.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.ui.domain != cfg.domain;
|
||||
message = ''
|
||||
|
|
@ -3090,6 +3132,11 @@ in
|
|||
# certificate its CA signed.
|
||||
services.hyperhive.network.exposeHostPorts = [ cfg.port ];
|
||||
|
||||
# Every listener, bridge-IP passthrough included, requires the client
|
||||
# certificate (see `listenerTls`), so opening the port host-wide adds
|
||||
# reach and no unauthenticated path.
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf baoDeploy.openFirewall [ cfg.port ];
|
||||
|
||||
# The operators' door to the UI, shaped like ./swarm-victorialogs.nix's
|
||||
# vhost. It proxies to the container's nginx over loopback (shared
|
||||
# netns), so no port opens anywhere. `auth_request` only proves a
|
||||
|
|
|
|||
Loading…
Reference in a new issue