Block aggressive bots

This commit is contained in:
dtonon
2024-09-26 07:54:55 +02:00
parent 743e0057e3
commit acb6039d33
2 changed files with 23 additions and 1 deletions

View File

@@ -159,10 +159,12 @@ func main() {
mux.HandleFunc("/{code}", renderEvent)
mux.HandleFunc("/{$}", renderHomepage)
loggedMux := loggingMiddleware(mux)
agentMux := agentBlock(loggedMux)
corsHandler := cors.Default().Handler(
http.HandlerFunc(
ipblock(loggedMux), // Wrap loggedMux with IP blocking
ipblock(agentMux),
),
)
go updateCloudflareRangesRoutine()