fixes
This commit is contained in:
1 parent
f30adf05af
commit
8824af8699
29 files changed
+1201
-115
No files matched your search
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"git.tornberg.me/go-otel/internal/auth"
|
||||
"git.tornberg.me/go-otel/internal/collector"
|
||||
"git.tornberg.me/go-otel/internal/geoip"
|
||||
"git.tornberg.me/go-otel/internal/blocker"
|
||||
"git.tornberg.me/go-otel/internal/honeypot"
|
||||
kube "git.tornberg.me/go-otel/internal/kubernetes"
|
||||
@@ -244,6 +245,13 @@ func main() {
|
||||
}
|
||||
// Update collector with wsServer
|
||||
coll.SetBroadcaster(wsServer)
|
||||
// Optional MaxMind databases for the UI's IP details dialog.
|
||||
geo, err := geoip.Open(os.Getenv("OTEL_GEOIP_CITY_DB"), os.Getenv("OTEL_GEOIP_ASN_DB"))
|
||||
if err != nil {
|
||||
log.Fatalf("failed to open geoip database: %v", err)
|
||||
}
|
||||
defer geo.Close()
|
||||
|
||||
ingestKey := os.Getenv("OTEL_INGEST_KEY")
|
||||
coll.SetIngestKey(ingestKey)
|
||||
oidcAuth := auth.NewOidcAuth(ingestKey)
|
||||
@@ -299,6 +307,7 @@ func main() {
|
||||
// Public OIDC endpoints
|
||||
uiMux.HandleFunc("POST /api/auth/token", oidcAuth.HandleTokenExchange)
|
||||
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 ipBlocker != nil {
|
||||
uiMux.Handle("GET /api/blocker/status", oidcAuth.RequireAuth(http.HandlerFunc(ipBlocker.HandleStatus)))
|
||||
|
||||
Reference in new issue
Block a user