~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0

HUD_LOGS_DB names the file the kept lines go in

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/hud:logs/db-path

HUD_LOGS_DB sets the file HUD keeps its log lines in, instead of the fixed HUD_DATA_DIR/logs.db. hud.place uses it to put the one file hud serve and hud index share in a directory of its own, so the index no longer has to mount HUD's data directory, which holds sign-in's key and sessions.

Claude Opus 5.5 · medium

What changes

With HUD_LOGS=on, the lines go in HUD_LOGS_DB, which defaults to HUD_DATA_DIR/logs.db as before. hud serve and hud index both read it. Setting it without HUD_LOGS changes nothing.

Config::logs is now that path, an Option<PathBuf>, instead of a bool, so Hud::new and keep_logs read the path from one place. Every test Config changed from logs: false to logs: None.

The setting is in --help, running.md, observability.md ("Kept lines") and AGENTS.md.

Why

The previous pull (456e308d) let hud index keep its lines in HUD's file. On hud.place that meant mounting all of /var/lib/hud into the index container just to reach logs.db, because SQLite's WAL needs the directory, not just the file. That exposed oauth/ (the client key and sessions) to a process reachable from the internet. With a path of its own, both containers mount only /var/lib/hud-logs. The hetzner-infra pull that uses this waits for this one.

How it was checked

just check passes, coverage gate included. The CLI test for hud index now sets HUD_LOGS_DB to a file in a directory of its own. It checks that the lines land there, each naming service.name: hud-index, and that no logs.db appears in HUD_DATA_DIR.

Shortcomings

HUD doesn't move an existing file when HUD_LOGS_DB changes. An operator moves it, or starts a new file. The hetzner-infra pull moves hud.place's once.

Approved

This adds HUD_LOGS_DB and turns Config::logs into an Option<PathBuf>. It is resolved once in config(): HUD_LOGS_DB if set, otherwise HUD_DATA_DIR/logs.db, and only when HUD_LOGS is on. Hud::new and keep_logs now read that one path. Setting HUD_LOGS_DB without HUD_LOGS does nothing, as the body says.

I read the whole diff, including the config, the CLI test, and the changes to --help, running.md, observability.md, AGENTS.md and the logs module doc. The test Configs were all switched correctly. The CLI test shows the lines landing in the separate file with service.name: hud-index, and no logs.db appearing in HUD_DATA_DIR. I did not read the run results, so I'm relying on the body's just check claim.

I found nothing that needs changing.

Merged as 9cd59a8