include db for gitea build
Build and Publish / Metadata (push) Successful in 10s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 2m16s

This commit is contained in:
mats committed 2026-09-20 11:01:56 +02:00
1 parent 8de4a2e010
commit 645f923175
33 files changed
+1490 -150

No files matched your search

+11
View File
@@ -9,6 +9,7 @@ import (
"os"
"strings"
"git.tornberg.me/go-otel/internal/alerts"
"git.tornberg.me/go-otel/internal/auth"
"git.tornberg.me/go-otel/internal/collector"
"git.tornberg.me/go-otel/internal/geoip"
@@ -243,6 +244,12 @@ func main() {
if err != nil {
log.Printf("ip blocker disabled: %v", err)
}
// Optional spike alerts (Telegram / webhook): off unless a channel is
// configured or OTEL_ALERT_DRY_RUN=true.
var alertRunner *alerts.Runner
if chStore, ok := store.(*storage.ClickHouseStore); ok {
alertRunner = alerts.Start(context.Background(), alerts.ConfigFromEnv(), chStore.Conn(), chStore.Database())
}
// Update collector with wsServer
coll.SetBroadcaster(wsServer)
// Optional MaxMind databases for the UI's IP details dialog.
@@ -309,6 +316,10 @@ func main() {
uiMux.HandleFunc("GET /api/auth/config", oidcAuth.HandleConfig)
uiMux.Handle("GET /api/ip/{ip}", oidcAuth.RequireAuth(http.HandlerFunc(geo.Handler)))
uiMux.Handle("/api/honeypot/ips", oidcAuth.RequireAuth(http.HandlerFunc(honeypotTracker.HandleIPsForUser)))
if alertRunner != nil {
uiMux.Handle("GET /api/alerts", oidcAuth.RequireAuth(http.HandlerFunc(alertRunner.HandleStatus)))
uiMux.Handle("POST /api/alerts/test", oidcAuth.RequireAuth(http.HandlerFunc(alertRunner.HandleTest)))
}
if ipBlocker != nil {
uiMux.Handle("GET /api/blocker/status", oidcAuth.RequireAuth(http.HandlerFunc(ipBlocker.HandleStatus)))
}