Repository navigation
feat: public /api/health served by the agentbbs process - #143
Merged
Merged
Conversation
https://bbs.profullstack.com/ is Caddy's file_server, so a 200 there says nothing about the BBS. /api/health is now answered by agentbbs itself on its loopback HTTP listener (Caddy proxies it, like /verify) after a `select 1` on the SQLite store with a 3s cap: 200 {"status":"ok","db":"ok"} or 503 {"status":"error","db":"down"}, Cache-Control: no-store. Adds Store.Ping. For status.profullstack.com. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan10 finding(s) HIGH/CRITICAL: 7 | LOW: 3
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For status.profullstack.com (Gatus).
Why it was 404:
https://bbs.profullstack.com/is Caddy'sfile_serverover${DATA_DIR}/web, so nothing answered/api/health, and a 200 on/only proves Caddy is up. The existing/healthzlives on agentbbs's loopback listener (AGENTBBS_HTTP_ADDR, 127.0.0.1:8088) and is not proxied.GET /api/healthon that loopback mux, answered by the agentbbs process that serves SSH :22select 1on the SQLite store (newStore.Ping) with a 3s cap{"status":"ok","db":"ok"}/ 503{"status":"error","db":"down"},Cache-Control: no-store, no error detailssetup.shCaddyfile:handle /api/health { reverse_proxy http://${HTTP_ADDR} }, same as/verify; deploy rewrites the Caddyfile, reloads Caddy and restarts agentbbshealth_test.gocovers ok and closed-store 503Verified locally:
go build ./...,go vet,go test ./cmd/agentbbs ./internal/store,bash -n setup.sh.🤖 Generated with Claude Code