feat(honcho): Claude Code memory in luna's Honcho

mars: bearer-gated tailnet door to Honcho on :8099 (Caddy), limited to
luna's workspace; Honcho itself stays on loopback with auth off, so
Hermes and honcho-console are unchanged.

terra: config for the claude-honcho plugin (installed via /plugin) plus a
SessionStart hook that adds luna as an observer of each Claude session,
so Hermes' directional recall sees what is learned here. HONCHO_* env in
settings.json pins the server: the plugin's config migration otherwise
drops baseUrl and falls back to Plastic Labs' cloud.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 05:56:44 +01:00
co-authored by Claude Opus 5.5
parent f0a6c3552e
commit cd1915336b
6 changed files with 129 additions and 4 deletions
+1
View File
@@ -11,6 +11,7 @@
./hermes-agent.nix
./honcho.nix # luna's memory server (Postgres + Ollama embeddings)
./honcho-console.nix # web console for it, tailnet-only on :8095
./honcho-gate.nix # bearer-gated tailnet door to it for Claude Code, :8099
./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
+45
View File
@@ -0,0 +1,45 @@
{ config, ... }:
# Tailnet door to luna's Honcho (honcho.nix) for Claude Code on terra
# (hosts/terra/claude-honcho.nix). Honcho itself stays on loopback with auth
# off, so Hermes and honcho-console need no key; this bearer token is the only
# credential, and it reaches luna's workspace only. 8099 stays closed in the
# firewall: tailscale0 only, like honcho-console.
let
port = 8099;
in
{
imports = [ ../../services/network/caddy.nix ];
# Fails closed: an unset token must not turn "Bearer " into the password.
services.caddy.virtualHosts.":${toString port}".extraConfig = ''
@allowed {
expression `{env.HONCHO_GATE_TOKEN} != "" && {http.request.header.Authorization} == "Bearer " + {env.HONCHO_GATE_TOKEN}`
path /v3/workspaces /v3/workspaces/luna/*
not path /v3/workspaces/luna/webhooks*
}
# Workspace get-or-create only; listing, keys and other workspaces stay out.
@workspaceCreate {
path /v3/workspaces
not method POST
}
handle @workspaceCreate {
respond 403
}
handle @allowed {
reverse_proxy 127.0.0.1:8000
}
handle {
respond 403
}
'';
services.caddy.environmentFile = config.sops.templates."honcho-gate.env".path;
# Same value in secrets/terra.yaml, where the Claude Code plugin sends it.
sops.secrets.honcho_gate_token.restartUnits = [ "caddy.service" ];
sops.templates."honcho-gate.env" = {
content = "HONCHO_GATE_TOKEN=${config.sops.placeholder.honcho_gate_token}\n";
restartUnits = [ "caddy.service" ];
};
}