Commit Graph
7 Commits
Author SHA1 Message Date
barrypandClaude Fable 5.1 2919037d3b Update argon2 to 0.6
The only API change affecting us is that PasswordHash moved to
password_hash::phc; use the argon2 crate's top-level re-export instead.
Existing argon2id hashes in password files still verify.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:22:39 -07:00
barrypandClaude Fable 5.1 44c8e6b6f8 Updated rust libraries
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:21:53 -07:00
barrypandClaude Fable 5.1 1467b71037 Make shutdown event-driven and address review findings
Replace the non-blocking accept + 50ms poll with a plain blocking
accept(). A signal-hook thread waits for SIGTERM/SIGINT, sets a flag,
and wakes accept() with a throwaway connection to the socket.

On shutdown the listener is closed and the socket file unlinked before
the grace period, so clients that connect late fail fast with ENOENT
instead of queueing and being reset. In-flight handlers are tracked by
a counter + Condvar rather than a Vec of JoinHandles.

Accepted streams now get a 5s read/write timeout so a silent client
cannot pin a handler thread or stretch every shutdown to the full
grace period. Transient accept() errors are logged and retried instead
of exiting the daemon. A second SIGTERM/SIGINT during the grace period
forces an immediate exit with status 1.

Tests: wrap the child in the kill-on-drop guard immediately after
spawn, drop the redundant wall-clock assertion, and add a case for a
client that connects but never sends.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:19:36 -07:00
barrypandClaude Fable 5.1 08aace5428 Bump version to 0.4.0 and add --version to both binaries
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:13:12 -07:00
barrypandClaude Fable 5.1 1749d9c08e Add CLAUDE.md with build commands and architecture notes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:08:11 -07:00
barrypandClaude Fable 5.1 ab163ca5e6 Fix clippy warnings in repository tests
Use assert!/assert!(!..) instead of assert_eq! against literal bools,
and drop a needless borrow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:06:28 -07:00
barrypandClaude Fable 5.1 6385be0890 Handle SIGTERM/SIGINT for a graceful shutdown
Running as PID 1 in a container, the daemon silently dropped SIGTERM,
so `docker stop` always hit the 10s timeout and SIGKILL, and host
reboots waited on it.

The accept loop now polls a non-blocking listener and a shutdown flag
registered via signal-hook. On SIGTERM or SIGINT it stops accepting,
gives in-flight requests up to 3s to finish, removes the socket file,
and exits with status 0. Log lines mark signal receipt and completion.

Adds integration tests that spawn the binary, perform an auth
round-trip, signal it, and assert a clean exit and socket removal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
2026-09-12 13:05:20 -07:00