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
+1
View File
@@ -13,6 +13,7 @@
./honcho-console.nix # web console for it, tailnet-only on :8095
./livesync-bridge.nix
./luna-sites.nix # luna's LAN web apps: http://mars.sol/<name>/
./pass-broker-gateway.nix # Telegram approvals for every host's pass-broker, tailnet :8097
../../common.nix # shared base: user / ssh / nix / firewall
../../services/containers.nix
../../services/vpn/tailscale.nix
+25
View File
@@ -0,0 +1,25 @@
{ config, ... }:
# Approval gateway for every host's pass-broker
# (services/identity/pass-broker-gateway.nix): one Telegram bot and one chat.
# Not Hermes' bot: a bot has one getUpdates consumer.
{
imports = [ ../../services/identity/pass-broker-gateway.nix ];
homelab.passBrokerGateway = {
enable = true;
telegram.tokenFile = config.sops.secrets.pass_broker_telegram_token.path;
telegram.chatIdFile = config.sops.secrets.darman_telegram_user_id.path;
# sha256 of each host's pass_broker_gateway_token (secrets/<host>.yaml).
hosts = {
terra.tokenSha256 = "fac335a1c842eba95782df7f7e46c3bcae85eef286958d6abc10d93979a4356e";
titan.tokenSha256 = "23555315de23011627cbfc0cb43199de85fce9c47f63933664763638453dd15b";
};
};
sops.secrets.pass_broker_telegram_token = {
owner = "pass-broker-gateway";
restartUnits = [ "pass-broker-gateway.service" ];
};
sops.secrets.darman_telegram_user_id.owner = "pass-broker-gateway";
}
-2
View File
@@ -3,8 +3,6 @@
# sops-nix wiring for titan (laptop). Encrypted values in ../../secrets/titan.yaml,
# decrypted with titan's own SSH host key (recipient in ../../.sops.yaml).
# samba + pass-broker secrets are declared in profiles/workstation.nix.
# pass_broker_telegram_token must be titan's OWN bot: getUpdates has one
# consumer, so sharing terra's would split approval taps between the two.
{
sops.defaultSopsFile = ../../secrets/titan.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];