function update

This commit is contained in:
2026-05-19 04:30:14 +00:00
parent 1293bafffa
commit 3f82dfd9e9
13 changed files with 8080 additions and 152 deletions
+5
View File
@@ -41,6 +41,7 @@ type Config struct {
IPInfoDBFile string // e.g. "asn.mmdb" or "country.mmdb"
IPInfoDBPath string // absolute path where the MMDB is saved
IPInfoRefreshDays int // auto-refresh interval in days
DataFile string // path to crowdsec-dash-data.json
}
// FirstRunError is returned when the config file was just created and needs editing.
@@ -109,6 +110,7 @@ func Load() (*Config, error) {
IPInfoDBFile: strVal(vals, "ipinfo_db_file", "asn.mmdb"),
IPInfoDBPath: strVal(vals, "ipinfo_db_path", "/var/lib/crowdsec/data/GeoLite2-ASN.mmdb"),
IPInfoRefreshDays: intVal(vals, "ipinfo_refresh_days", 7),
DataFile: strVal(vals, "data_file", "./crowdsec-dash-data.json"),
UIPassword: strVal(vals, "ui_password", "changeme"),
UISessionSecret: vals["ui_session_secret"],
PollIntervalSec: intVal(vals, "poll_interval_sec", 15),
@@ -235,6 +237,9 @@ ipinfo_token =
ipinfo_db_file = asn.mmdb
ipinfo_db_path = /var/lib/crowdsec/data/GeoLite2-ASN.mmdb
ipinfo_refresh_days = 7
# Dashboard state file (hub removed-items tracking)
data_file = ./crowdsec-dash-data.json
`, secret)
return os.WriteFile(path, []byte(content), 0600)