Harden the chat hub, evict idle rate-limit keys, isolate Dozzle
Test and deploy / test (push) Successful in 16s
Test and deploy / deploy (push) Successful in 30s

- Chat: cap frame, message and file URL sizes, put a write deadline on
  every send so a stalled client can't hold the hub lock, and check the
  save, prune and history errors instead of broadcasting an unsaved
  message. ChatPanel's maxlength stays under the server cap.
- RateLimiter: sweep keys idle past the window, at most once a window.
- Dozzle: move to an internal dozzle-net shared only with Caddy, so the
  admin gate is the only way to reach the Docker socket.
- Drop the GraphQL WebSocket transport: the route is POST-only and the
  schema has no subscriptions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-26 15:15:31 +00:00
co-authored by Claude Opus 5.5
parent 223c8ae35a
commit 18265871e1
7 changed files with 78 additions and 15 deletions
+10
View File
@@ -58,6 +58,16 @@ func TestRateLimiterAllow(t *testing.T) {
}
})
t.Run("keys idle past the window are evicted", func(t *testing.T) {
rl := NewRateLimiter(1, 5*time.Millisecond)
rl.Allow("gone")
time.Sleep(10 * time.Millisecond)
rl.Allow("other")
if _, ok := rl.attempts["gone"]; ok {
t.Fatal("idle key still stored, want evicted")
}
})
t.Run("max of zero denies everything", func(t *testing.T) {
rl := NewRateLimiter(0, time.Minute)
if rl.Allow("ip") {