geoip and config editor online
This commit is contained in:
+8
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user