From 2f5c31499d07838872210897431bea7ca388a1e2 Mon Sep 17 00:00:00 2001 From: Lucio Chen Date: Tue, 2 Jun 2026 01:24:19 -0700 Subject: [PATCH] security review --- CLAUDE.md | 15 ++-- config.toml | 12 ++- internal/config/config.go | 24 ++++-- internal/server/handlers.go | 29 ++++++-- internal/server/mcp.go | 66 +++++++++++++---- internal/server/mcp_test.go | 60 +++++++++++++-- internal/server/middleware.go | 74 ++++++++++++++++--- internal/server/server.go | 66 +++++++++++++---- internal/server/templates/404.html | 2 +- internal/server/templates/admin.html | 5 +- internal/server/templates/admin_bin.html | 2 +- internal/server/templates/admin_bin_edit.html | 2 +- internal/server/templates/admin_edit.html | 2 +- internal/server/templates/admin_login.html | 2 +- internal/server/templates/admin_uploads.html | 2 +- internal/server/templates/bin_token.html | 2 +- internal/server/templates/bin_view.html | 2 +- internal/server/templates/index.html | 2 +- internal/slug/slug.go | 35 +++++++-- 19 files changed, 317 insertions(+), 87 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 53f0139..d6b4647 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -89,7 +89,7 @@ Templates and static files are embedded into the binary via `//go:embed` in `tem All JavaScript is vanilla ES5-style (`var`, not `const`/`let`). Most JS is inline in templates; shared upload logic lives in `static/upload.js` and is exposed as `window.GlimmerUpload`. No build step, no npm, no bundler. ### CSS framework -[Pico CSS 2](https://picocss.com/) loaded from CDN. Custom overrides in `static/style.css`. Admin pages use `data-theme="dark"`. +[Pico CSS 2](https://picocss.com/) is **vendored locally** at `static/pico.min.css` (served from `/static/pico.min.css`) so the app works fully offline with no external requests. Custom overrides in `static/style.css`. Admin pages use `data-theme="dark"`. Do not reintroduce CDN ``/`