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