Fix configuration for prometheus address (#2763)

The env variable for prometheus address is not respected as it should be set as
viper default config.

Ticket: https://mattermost.atlassian.net/browse/43295
pull/2622/head^2
Spiros Economakis 2 years ago committed by GitHub
parent af35a8e2c2
commit 539aee6a46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      config.json
  2. 2
      docker/config.json
  3. 16
      server-config.json
  4. 3
      server/services/config/config.go

@ -1,8 +1,8 @@
{
"serverRoot": "http://localhost:8000",
"port": 8000,
"dbtype": "sqlite3",
"dbconfig": "./focalboard.db?_busy_timeout=5000",
"port": 8000,
"dbtype": "sqlite3",
"dbconfig": "./focalboard.db?_busy_timeout=5000",
"dbtableprefix": "",
"postgres_dbconfig": "dbname=focalboard sslmode=disable",
"useSSL": false,
@ -10,7 +10,7 @@
"filesdriver": "local",
"filespath": "./files",
"telemetry": true,
"prometheus_address": ":9092",
"prometheusaddress": ":9092",
"webhook_update": [],
"session_expire_time": 2592000,
"session_refresh_time": 18000,

@ -8,7 +8,7 @@
"webpath": "./pack",
"filespath": "./files",
"telemetry": true,
"prometheus_address": ":9092",
"prometheusaddress": ":9092",
"session_expire_time": 2592000,
"session_refresh_time": 18000,
"localOnly": false,

@ -1,14 +1,14 @@
{
"serverRoot": "http://localhost:8000",
"port": 8000,
"dbtype": "sqlite3",
"serverRoot": "http://localhost:8000",
"port": 8000,
"dbtype": "sqlite3",
"dbconfig": "./focalboard.db",
"postgres_dbconfig": "dbname=focalboard sslmode=disable",
"useSSL": false,
"webpath": "./pack",
"filespath": "./files",
"postgres_dbconfig": "dbname=focalboard sslmode=disable",
"useSSL": false,
"webpath": "./pack",
"filespath": "./files",
"telemetry": true,
"prometheus_address": ":9092",
"prometheusaddress": ":9092",
"session_expire_time": 2592000,
"session_refresh_time": 18000,
"localOnly": false,

@ -40,7 +40,7 @@ type Configuration struct {
MaxFileSize int64 `json:"maxfilesize" mapstructure:"mafilesize"`
Telemetry bool `json:"telemetry" mapstructure:"telemetry"`
TelemetryID string `json:"telemetryid" mapstructure:"telemetryid"`
PrometheusAddress string `json:"prometheus_address" mapstructure:"prometheus_address"`
PrometheusAddress string `json:"prometheusaddress" mapstructure:"prometheusaddress"`
WebhookUpdate []string `json:"webhook_update" mapstructure:"webhook_update"`
Secret string `json:"secret" mapstructure:"secret"`
SessionExpireTime int64 `json:"session_expire_time" mapstructure:"session_expire_time"`
@ -95,6 +95,7 @@ func ReadConfigFile(configFilePath string) (*Configuration, error) {
viper.SetDefault("AuthMode", "native")
viper.SetDefault("NotifyFreqCardSeconds", 120) // 2 minutes after last card edit
viper.SetDefault("NotifyFreqBoardSeconds", 86400) // 1 day after last card edit
viper.SetDefault("PrometheusAddress", "")
err := viper.ReadInConfig() // Find and read the config file
if err != nil { // Handle errors reading the config file

Loading…
Cancel
Save