feat(redis): support TLS for Redis connections (#1930)

[Feature]: Support TLS for Redis connections
This commit is contained in:
qilifan
2026-07-06 23:02:02 +08:00
committed by GitHub
parent d3c03b2f34
commit d5b8d2f886
6 changed files with 122 additions and 8 deletions
+6 -4
View File
@@ -52,6 +52,7 @@ import (
"github.com/Tencent/WeKnora/internal/application/service/file"
memoryService "github.com/Tencent/WeKnora/internal/application/service/memory"
"github.com/Tencent/WeKnora/internal/application/service/retriever"
"github.com/Tencent/WeKnora/internal/common"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/database"
"github.com/Tencent/WeKnora/internal/datasource"
@@ -439,10 +440,11 @@ func initRedisClient() (*redis.Client, error) {
}
client := redis.NewClient(&redis.Options{
Addr: redisAddr,
Username: os.Getenv("REDIS_USERNAME"),
Password: os.Getenv("REDIS_PASSWORD"),
DB: db,
Addr: redisAddr,
Username: os.Getenv("REDIS_USERNAME"),
Password: os.Getenv("REDIS_PASSWORD"),
DB: db,
TLSConfig: common.RedisTLSConfig(),
})
_, err = client.Ping(context.Background()).Result()