feat(mars): pass-broker approval gateway for every host

A Telegram bot has a single getUpdates consumer, so a broker per host
would split approval taps between them. mars now runs the gateway: the
bot's only poller, relaying prompts and taps for terra's and titan's
brokers over the tailnet (:8097) without ever seeing an item. Each broker
authenticates with its own pass_broker_gateway_token; mars holds only the
sha256, and the prompt is labelled with the host that token belongs to.

The bot token and chat id move to mars and are dropped from the other
hosts' sops files (terra.yaml also loses its leftover LibreChat keys and
gains protonvpn_wg_private_key, which a later commit uses). Covered by
checks.pass-broker-gateway (two nodes: labels, cancel, expiry, per-host
token isolation, gateway down); the fakes are shared with checks.pass-broker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 11:34:19 +02:00
co-authored by Claude Opus 5.5
parent 760e353335
commit e95726d69c
24 changed files with 1164 additions and 250 deletions
+7 -9
View File
@@ -45,22 +45,20 @@ in
environment.systemPackages = [ unstable.proton-pass-cli ];
# Proton Pass for scripts/deploy and Claude, one Telegram tap per use. Your
# own pass-cli stays logged out here: the broker's session is the only one.
# Proton Pass for scripts/deploy and Claude, one Telegram tap per use via
# the gateway on mars. Your own pass-cli stays logged out here: the
# broker's session is the only one.
homelab.passBroker = {
enable = true;
passCli = unstable.proton-pass-cli;
patFile = config.sops.secrets.pass_broker_pat.path;
telegram.tokenFile = config.sops.secrets.pass_broker_telegram_token.path;
telegram.chatIdFile = config.sops.secrets.darman_telegram_user_id.path;
gateway.tokenFile = config.sops.secrets.pass_broker_gateway_token.path;
};
# pass-broker (services/identity/pass-broker.nix): the agent PAT and its
# dedicated Telegram bot. Owner pass-broker, so darman cannot read them.
# Owner pass-broker, so darman cannot read them. The token's sha256 is in
# hosts/mars/pass-broker-gateway.nix.
sops.secrets.pass_broker_pat.owner = "pass-broker";
sops.secrets.pass_broker_telegram_token.owner = "pass-broker";
# Not broker-specific; a second reader needs a sops.templates copy, not a new owner.
sops.secrets.darman_telegram_user_id.owner = "pass-broker";
sops.secrets.pass_broker_gateway_token.owner = "pass-broker";
# run0 waits on systemd over D-Bus, whose 25s default call timeout runs out
# while the polkit dialog is still open (slow typing, a vault lookup).