diff --git a/config_example.yml b/config_example.yml index 509a25c..1b6db9d 100644 --- a/config_example.yml +++ b/config_example.yml @@ -17,6 +17,7 @@ nodes: aliases_path: /var/www/html/meshviewer/data/aliases.json influxdb: enable: false + host: http://localhost:8086 database: ffhb username: password: diff --git a/models/config.go b/models/config.go index 17c0e89..205f247 100644 --- a/models/config.go +++ b/models/config.go @@ -34,6 +34,7 @@ type Config struct { } `yaml:"nodes"` Influxdb struct { Enable bool `yaml:"enable"` + Addr string `yaml:"host"` Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` diff --git a/stats_db.go b/stats_db.go index ab889b4..fee5372 100644 --- a/stats_db.go +++ b/stats_db.go @@ -22,7 +22,7 @@ type StatsDb struct { func NewStatsDb() *StatsDb { // Make client c, err := client.NewHTTPClient(client.HTTPConfig{ - Addr: "http://localhost:8086", + Addr: config.Influxdb.Addr, Username: config.Influxdb.Username, Password: config.Influxdb.Password, })