Initial version

This commit is contained in:
2026-08-03 10:53:59 +08:00
commit 0c79eb3806
11 changed files with 1510 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package botfilter
import "log"
type filterLogger struct {
name string
enabled bool
}
func (l filterLogger) blocked(ip, reason string, score int) {
if !l.enabled {
return
}
// This is intentionally opt-in. Logging every rejected request during a
// flood can become a second source of CPU and disk pressure.
log.Printf("botfilter[%s]: blocked client=%s reason=%q score=%d", l.name, ip, reason, score)
}