diff --git a/bridge-history-api/cmd/api/app/app.go b/bridge-history-api/cmd/api/app/app.go index 16a406c709..04f0b2ff21 100644 --- a/bridge-history-api/cmd/api/app/app.go +++ b/bridge-history-api/cmd/api/app/app.go @@ -1,6 +1,7 @@ package app import ( + "crypto/tls" "fmt" "os" "os/signal" @@ -52,11 +53,16 @@ func action(ctx *cli.Context) error { log.Error("failed to close db", "err", err) } }() - redisClient := redis.NewClient(&redis.Options{ + opts := &redis.Options{ Addr: cfg.Redis.Address, + Username: cfg.Redis.Username, Password: cfg.Redis.Password, - DB: cfg.Redis.DB, - }) + } + // Production Redis service has enabled transit_encryption. + if !cfg.Redis.Local { + opts.TLSConfig = &tls.Config{MinVersion: tls.VersionTLS12} + } + redisClient := redis.NewClient(opts) api.InitController(db, redisClient) router := gin.Default() diff --git a/bridge-history-api/conf/config.json b/bridge-history-api/conf/config.json index e7bcbfac46..8b20106e42 100644 --- a/bridge-history-api/conf/config.json +++ b/bridge-history-api/conf/config.json @@ -45,7 +45,8 @@ }, "redis": { "address": "localhost:6379", + "username": "default", "password": "", - "db": 0 + "local": true } } diff --git a/bridge-history-api/internal/config/config.go b/bridge-history-api/internal/config/config.go index 1c135dbd6c..4235e3448a 100644 --- a/bridge-history-api/internal/config/config.go +++ b/bridge-history-api/internal/config/config.go @@ -33,8 +33,10 @@ type LayerConfig struct { // RedisConfig redis config type RedisConfig struct { Address string `json:"address"` + Username string `json:"username"` Password string `json:"password"` DB int `json:"db"` + Local bool `json:"local"` } // Config is the configuration of the bridge history backend diff --git a/common/version/version.go b/common/version/version.go index 08f65b8210..0cfd443e50 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.3.45" +var tag = "v4.3.46" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {