expose redis tls settings directly to config
This commit is contained in:
parent
2f1e9696a8
commit
f0256b08ff
5 changed files with 7 additions and 13 deletions
|
@ -58,7 +58,9 @@ db:
|
||||||
redis:
|
redis:
|
||||||
host: localhost
|
host: localhost
|
||||||
port: 6379
|
port: 6379
|
||||||
#tls: false
|
#tls:
|
||||||
|
# host: localhost
|
||||||
|
# rejectUnauthorized: false
|
||||||
#family: 0 # 0=Both, 4=IPv4, 6=IPv6
|
#family: 0 # 0=Both, 4=IPv4, 6=IPv6
|
||||||
#pass: example-pass
|
#pass: example-pass
|
||||||
#prefix: example-prefix
|
#prefix: example-prefix
|
||||||
|
|
|
@ -24,7 +24,7 @@ export type Source = {
|
||||||
db?: number;
|
db?: number;
|
||||||
prefix?: string;
|
prefix?: string;
|
||||||
user?: string;
|
user?: string;
|
||||||
tls?: boolean;
|
tls?: { [x: string]: string };
|
||||||
};
|
};
|
||||||
elasticsearch: {
|
elasticsearch: {
|
||||||
host: string;
|
host: string;
|
||||||
|
|
|
@ -211,10 +211,7 @@ export const db = new DataSource({
|
||||||
password: config.redis.pass,
|
password: config.redis.pass,
|
||||||
keyPrefix: `${config.redis.prefix}:query:`,
|
keyPrefix: `${config.redis.prefix}:query:`,
|
||||||
db: config.redis.db || 0,
|
db: config.redis.db || 0,
|
||||||
tls: config.redis.tls ? {
|
tls: config.redis.tls || {} ,
|
||||||
host: config.redis.host,
|
|
||||||
rejectUnauthorized: false, // TODO make configurable
|
|
||||||
} : {},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: false,
|
: false,
|
||||||
|
|
|
@ -10,10 +10,7 @@ export function createConnection() {
|
||||||
username: config.redis.user ?? "default",
|
username: config.redis.user ?? "default",
|
||||||
keyPrefix: `${config.redis.prefix}:`,
|
keyPrefix: `${config.redis.prefix}:`,
|
||||||
db: config.redis.db || 0,
|
db: config.redis.db || 0,
|
||||||
tls: config.redis.tls ? {
|
tls: config.redis.tls || {},
|
||||||
rejectUnauthorized: false, //TODO make configurable
|
|
||||||
host: config.redis.host,
|
|
||||||
} : {},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@ export function initialize<T>(name: string, limitPerSec = -1) {
|
||||||
user: config.redis.user ?? "default",
|
user: config.redis.user ?? "default",
|
||||||
password: config.redis.pass,
|
password: config.redis.pass,
|
||||||
db: config.redis.db || 0,
|
db: config.redis.db || 0,
|
||||||
tls: config.redis.tls ? {
|
tls: config.redis.tls || {},
|
||||||
host: config.redis.host, //TODO add configurable cert validation
|
|
||||||
} : {},
|
|
||||||
},
|
},
|
||||||
prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : "queue",
|
prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : "queue",
|
||||||
limiter:
|
limiter:
|
||||||
|
|
Loading…
Reference in a new issue