refactor: 🔧 allow redis user to be configured

Follow up #10366, 3df3c97deb
This commit is contained in:
ThatOneCalculator 2023-06-26 15:02:54 -07:00
parent 09b3e63558
commit d96877033b
No known key found for this signature in database
GPG key ID: 8703CACD01000000
4 changed files with 5 additions and 2 deletions

View file

@ -60,6 +60,7 @@ redis:
#pass: example-pass
#prefix: example-prefix
#db: 1
#user: default
# Please configure either MeiliSearch *or* Sonic.
# If both MeiliSearch and Sonic configurations are present, MeiliSearch will take precedence.

View file

@ -153,6 +153,7 @@ redis:
pass: {{ .Values.redis.auth.password | quote }}
#prefix: example-prefix
#db: 1
#user: default
# ┌─────────────────────┐
#───┘ Sonic configuration └─────────────────────────────────────

View file

@ -23,6 +23,7 @@ export type Source = {
pass: string;
db?: number;
prefix?: string;
user?: string;
};
elasticsearch: {
host: string;

View file

@ -5,9 +5,9 @@ export function createConnection() {
return new Redis({
port: config.redis.port,
host: config.redis.host,
family: config.redis.family == null ? 0 : config.redis.family,
family: config.redis.family ?? 0,
password: config.redis.pass,
username: "default",
username: config.redis.user ?? "default",
keyPrefix: `${config.redis.prefix}:`,
db: config.redis.db || 0,
tls: {