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>
80 lines
3.2 KiB
Nix
80 lines
3.2 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
# mars — on-site x86_64 box for Hermes Agent (luna), plus the web apps she
|
|
# hosts herself. See hermes-agent.nix for what Hermes is and why it moved here
|
|
# from jupiter, and luna-sites.nix for the app hosting.
|
|
{
|
|
imports = [
|
|
./hardware-configuration.nix
|
|
./disk-config.nix # disko: OS-disk partitions + filesystems
|
|
./secrets.nix # sops-nix: samba/tailscale/hermes secrets
|
|
./hermes-agent.nix
|
|
./honcho.nix # luna's memory server (Postgres + Ollama embeddings)
|
|
./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
|
|
../../services/monitoring/node-exporter.nix
|
|
];
|
|
|
|
networking.hostName = "mars";
|
|
networking.networkmanager.enable = true; # DHCP on-site, same as jupiter
|
|
users.users.darman.extraGroups = [ "docker" ]; # merges with common.nix; podman debug access
|
|
|
|
# ---- Boot (UEFI, confirmed) ----
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
# jupiter's samba share (services/network/samba.nix), mounted on demand so
|
|
# mars doesn't stall when jupiter is off — also where Hermes's shared
|
|
# dropbox lives (hermes-agent.nix). Tighter modes than terra's equivalent
|
|
# mount (0770/gid=hermes, not 0755/gid=users) since the hermes-agent
|
|
# container (uid 986/gid 983, no podman userns remapping) needs group
|
|
# write here, not just darman.
|
|
fileSystems."/mnt/jupiter" = {
|
|
device = "//jupiter/data";
|
|
fsType = "cifs";
|
|
options = [
|
|
"credentials=${config.sops.templates."jupiter-smb.credentials".path}"
|
|
"uid=1000"
|
|
"gid=983"
|
|
"file_mode=0770"
|
|
"dir_mode=0770"
|
|
"nofail"
|
|
"x-systemd.automount" # lazy-mount so boot doesn't stall if jupiter's down
|
|
# NO idle-timeout here (unlike terra's): podman-hermes-agent.service
|
|
# RequiresMountsFor this path, so an idle auto-unmount silently kills
|
|
# the container with it — confirmed the hard way (~60-70s per start).
|
|
"x-systemd.mount-timeout=10s"
|
|
"_netdev"
|
|
# Hermes' RequiresMountsFor mounts this at boot, not lazily, and nothing
|
|
# retries a failed mount.
|
|
"x-systemd.requires=jupiter-reachable.service"
|
|
];
|
|
};
|
|
|
|
# jupiter resolves to its tailnet IP, and network-online.target fires on the
|
|
# LAN link before tailscaled has routed tailscale0. 5min covers jupiter
|
|
# cold-booting alongside mars.
|
|
systemd.services.jupiter-reachable = {
|
|
description = "Wait for jupiter's samba over the tailnet";
|
|
after = [ "network-online.target" "tailscaled.service" ];
|
|
wants = [ "network-online.target" ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
RemainAfterExit = true;
|
|
TimeoutStartSec = 300;
|
|
};
|
|
script = ''
|
|
until timeout 2 ${pkgs.bash}/bin/bash -c 'exec 3<>/dev/tcp/jupiter/445' 2>/dev/null; do
|
|
sleep 2
|
|
done
|
|
'';
|
|
};
|
|
|
|
system.stateVersion = "26.05"; # set at install time; do NOT bump on upgrades
|
|
}
|