Fix #280 follow-up: remove PALETTE_TRUSTED_IP_HEADER
CI / test (pull_request) Successful in 26s
CI / docker (pull_request) Skipped

Per owner decision the optional proxy-header escape hatch is dead config:
remove the env var, its plumbing (Config.TrustedIPHeader, SetTrustedIPHeader),
and the README row. Rate-limit keying is always the peer address; no
client-supplied IP header is ever trusted. Tests updated to assert headers
(CF-Connecting-IP included) never influence clientIP.
This commit is contained in:
fen
2026-09-17 20:45:54 -05:00
parent ed435c5e13
commit b99e1bdb27
4 changed files with 18 additions and 56 deletions
-5
View File
@@ -28,10 +28,6 @@ type Config struct {
DBPath string
MaxTextBytes int64
MaxItemBytes int64
// TrustedIPHeader optionally names a proxy-controlled client-IP header
// (e.g. CF-Connecting-IP behind Cloudflare) to key rate limits on. Empty
// (default) keys on the peer address only. See clientip.go (#280).
TrustedIPHeader string
}
type apiServer struct {
@@ -43,7 +39,6 @@ type apiServer struct {
}
func NewServer(st *store.Store, cfg Config, ui *web.UI, ss *settingsStore, adminKey string) *apiServer {
SetTrustedIPHeader(cfg.TrustedIPHeader) // #280
return &apiServer{store: st, cfg: cfg, ui: ui, settings: ss, adminKey: adminKey}
}