diff --git a/config/default.yaml b/config/default.yaml index dce95440c8b..8d3a5cd9692 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -93,14 +93,15 @@ database: redis: hostname: '127.0.0.1' port: 6379 - auth: null # Used by both standalone and sentinel + auth: null db: 0 sentinel: enabled: false enable_tls: false master_name: '' + password: '' sentinels: - - hostname: '' + - host: '' port: 26379 # SMTP server to send emails diff --git a/config/production.yaml.example b/config/production.yaml.example index 908f6f41d09..f9bb033f0da 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example @@ -91,14 +91,15 @@ database: redis: hostname: '127.0.0.1' port: 6379 - auth: null # Used by both standalone and sentinel + auth: null db: 0 sentinel: enabled: false enable_tls: false master_name: '' + password: '' sentinels: - - hostname: '' + - host: '' port: 26379 # SMTP server to send emails diff --git a/server/core/initializers/checker-before-init.ts b/server/core/initializers/checker-before-init.ts index 7e2c32bbf97..a87ef747838 100644 --- a/server/core/initializers/checker-before-init.ts +++ b/server/core/initializers/checker-before-init.ts @@ -269,7 +269,7 @@ export function checkMissedConfig () { [ // set [ 'redis.hostname', 'redis.port' ], // alternative [ 'redis.socket' ], - [ 'redis.sentinel.master_name', 'redis.sentinel.sentinels[0].hostname', 'redis.sentinel.sentinels[0].port' ] + [ 'redis.sentinel.master_name', 'redis.sentinel.sentinels[0].host', 'redis.sentinel.sentinels[0].port' ] ] ] const miss: string[] = [] diff --git a/server/core/initializers/config.ts b/server/core/initializers/config.ts index 21a788921fd..3fa3ecc5018 100644 --- a/server/core/initializers/config.ts +++ b/server/core/initializers/config.ts @@ -53,8 +53,9 @@ const CONFIG = { SENTINEL: { ENABLED: config.has('redis.sentinel.enabled') ? config.get('redis.sentinel.enabled') : false, ENABLE_TLS: config.has('redis.sentinel.enable_tls') ? config.get('redis.sentinel.enable_tls') : false, - SENTINELS: config.has('redis.sentinel.sentinels') ? config.get<{ hostname: string, port: number }[]>('redis.sentinel.sentinels') : [], - MASTER_NAME: config.has('redis.sentinel.master_name') ? config.get('redis.sentinel.master_name') : null + SENTINELS: config.has('redis.sentinel.sentinels') ? config.get<{ host: string, port: number }[]>('redis.sentinel.sentinels') : [], + MASTER_NAME: config.has('redis.sentinel.master_name') ? config.get('redis.sentinel.master_name') : null, + PASSWORD: config.has('redis.sentinel.password') ? config.get('redis.sentinel.password') : null } }, SMTP: { diff --git a/server/core/lib/redis.ts b/server/core/lib/redis.ts index ed2f9c90344..937c8e34c0b 100644 --- a/server/core/lib/redis.ts +++ b/server/core/lib/redis.ts @@ -75,7 +75,8 @@ class Redis { connectionName, connectTimeout, enableTLSForSentinelMode: CONFIG.REDIS.SENTINEL.ENABLE_TLS, - sentinelPassword: CONFIG.REDIS.AUTH, + sentinelPassword: CONFIG.REDIS.SENTINEL.PASSWORD, + password: CONFIG.REDIS.AUTH, sentinels: CONFIG.REDIS.SENTINEL.SENTINELS, name: CONFIG.REDIS.SENTINEL.MASTER_NAME, ...options