From 1c04503fa7a2eff735c640d79d78a31f2eea637b Mon Sep 17 00:00:00 2001 From: Peter Rounce Date: Tue, 16 Jun 2026 14:01:44 +0000 Subject: [PATCH] Log missing static files at debug instead of info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RenderStaticContent logged every failed os.Open at INFO level. In practice these are almost entirely vulnerability scanners probing for .env, .git/config, js/sendgrid.js and similar — normal 404s for files the hub doesn't ship. Logging them at INFO buried real operational events and crowded the About-page log viewer (last 20 lines). Downgrade to debug so the noise is still available on demand (flip log_level to debug) without polluting the default INFO stream. Co-Authored-By: Claude Opus 4.8 --- CLAUDE.md | 2 +- docker/card/build/build.go | 2 +- docker/card/web/render.go | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f09f1e3..3e9a874 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -93,7 +93,7 @@ Entry point: `main.go` → opens SQLite DB → runs CLI or starts HTTP server on - `phoenix/` — HTTP client for Phoenix Server API (invoices, payments, balance, channels). Uses basic auth from phoenix config (password cached at startup with `sync.Once`) - `crypto/` — AES-CMAC authentication and AES decryption for Bolt Card NFC protocol - `util/` — Error handling helpers (`CheckAndLog`), random hex generation, QR code encoding -- `build/` — Version string (currently "0.20.0"), date/time injected at build +- `build/` — Version string (currently "0.20.1"), date/time injected at build - `web-content/` — Static assets under `public/`, SPA build output under `admin/spa/` ### Route Groups (`web/app.go`) diff --git a/docker/card/build/build.go b/docker/card/build/build.go index 5d10af2..e3d0a72 100644 --- a/docker/card/build/build.go +++ b/docker/card/build/build.go @@ -1,5 +1,5 @@ package build -var Version string = "0.20.0" +var Version string = "0.20.1" var Date string var Time string diff --git a/docker/card/web/render.go b/docker/card/web/render.go index bff9cca..c26a1b3 100644 --- a/docker/card/web/render.go +++ b/docker/card/web/render.go @@ -79,7 +79,10 @@ func RenderStaticContent(w http.ResponseWriter, request string) { content, err := os.Open(fullPath) if err != nil { - log.Info(err.Error()) + // Missing static files are normal 404s — mostly vulnerability + // scanners probing for .env, .git/config, etc. Log at debug so + // this background noise doesn't bury operational INFO lines. + log.Debug(err.Error()) Blank(w, nil) return }