diff --git a/app/config/config.go b/app/config/config.go index c09b27f..f0a81c0 100644 --- a/app/config/config.go +++ b/app/config/config.go @@ -13,6 +13,7 @@ import ( type RedisConfig struct { Addr string `yaml:"addr"` + User string `yaml:"user"` Password string `yaml:"password"` DB int `yaml:"db"` CacheID string `yaml:"cache_id"` diff --git a/app/config/config_test.go b/app/config/config_test.go index 9d95755..d9aad83 100644 --- a/app/config/config_test.go +++ b/app/config/config_test.go @@ -63,6 +63,7 @@ func TestParse(t *testing.T) { }, Redis: RedisConfig{ Addr: "localhost:6379", + User: "myuser", Password: "passwd", DB: 4, Prefix: "some::ship", @@ -89,6 +90,7 @@ telegram: channel: -123456789 redis: addr: "localhost:6379" + user: "myuser" password: "passwd" db: 4 prefix: "some::ship" diff --git a/cmd/thalos/main.go b/cmd/thalos/main.go index b5284f1..d8390e7 100644 --- a/cmd/thalos/main.go +++ b/cmd/thalos/main.go @@ -239,6 +239,7 @@ func main() { // Connect to redis rdb := redis.NewClient(&redis.Options{ Addr: conf.Redis.Addr, + Username: conf.Redis.User, Password: conf.Redis.Password, DB: conf.Redis.DB, }) diff --git a/config.example.yml b/config.example.yml index afcad35..0935d91 100644 --- a/config.example.yml +++ b/config.example.yml @@ -53,6 +53,9 @@ redis: # Address (and port) to redis server addr: "localhost:6379" + # Username to use when authenticating + user: "" + # Password to use when authenticating pasword: ""