feat: add redis password (#201)

This commit is contained in:
bootgo 2025-07-29 21:34:44 +08:00 committed by GitHub
parent 02b4171576
commit f589bb94bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -27,9 +27,11 @@ type Client = redis.Client
func New() *redis.Client { func New() *redis.Client {
addr := os.Getenv("REDIS_ADDR") addr := os.Getenv("REDIS_ADDR")
password := os.Getenv("REDIS_PASSWORD")
rdb := redis.NewClient(&redis.Options{ rdb := redis.NewClient(&redis.Options{
Addr: addr, // Redis地址 Addr: addr, // Redis地址
DB: 0, // 默认数据库 DB: 0, // 默认数据库
Password: password,
// 连接池配置 // 连接池配置
PoolSize: 100, // 最大连接数建议设置为CPU核心数*10 PoolSize: 100, // 最大连接数建议设置为CPU核心数*10
MinIdleConns: 10, // 最小空闲连接 MinIdleConns: 10, // 最小空闲连接

View File

@ -23,6 +23,7 @@ export REDIS_AOF_ENABLED=no
export REDIS_IO_THREADS=4 export REDIS_IO_THREADS=4
export ALLOW_EMPTY_PASSWORD=yes export ALLOW_EMPTY_PASSWORD=yes
export REDIS_ADDR="localhost:6379" export REDIS_ADDR="localhost:6379"
export REDIS_PASSWORD=""
# This Upload component used in Agent / workflow File/Image With LLM , support the component of imagex / storage # This Upload component used in Agent / workflow File/Image With LLM , support the component of imagex / storage
# default: storage, use the settings of storage component # default: storage, use the settings of storage component