geoip and config editor online

This commit is contained in:
2026-05-17 15:38:10 +00:00
parent f4a88035ee
commit 1293bafffa
25 changed files with 1645 additions and 31 deletions
+8 -1
View File
@@ -12,6 +12,7 @@ import (
"crowdsec-dashy/internal/config"
"crowdsec-dashy/internal/crowdsec"
"crowdsec-dashy/internal/geoip"
"crowdsec-dashy/internal/router"
webfiles "crowdsec-dashy/web"
)
@@ -69,10 +70,16 @@ func main() {
log.Printf("[WARN] cscli not found at %s — bouncer/machine/hub/metrics features disabled", cfg.CscliPath)
}
// ----------------------------------------------------------------
// GeoIP auto-updater
// ----------------------------------------------------------------
geoUpdater := geoip.New(cfg.IPInfoToken, cfg.IPInfoDBFile, cfg.IPInfoDBPath, cfg.IPInfoRefreshDays)
go geoUpdater.Start(context.Background())
// ----------------------------------------------------------------
// Build router
// ----------------------------------------------------------------
handler, err := router.New(cfg, lapi, webfiles.FS)
handler, err := router.New(cfg, lapi, webfiles.FS, geoUpdater)
if err != nil {
log.Fatalf("failed to initialise router: %v", err)
}