diff --git a/packages/backend/ormconfig.js b/packages/backend/ormconfig.js index 5f85cead8a..c230e09fd5 100644 --- a/packages/backend/ormconfig.js +++ b/packages/backend/ormconfig.js @@ -12,4 +12,8 @@ export default new DataSource({ extra: config.db.extra, entities: entities, migrations: ["migration/*.js"], + ssl: { + rejectUnauthorized: false, + ca: process.env.DB_SSL_CERT, + }, }); diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 0fa5fdff67..85c4e424aa 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -207,9 +207,14 @@ export const db = new DataSource({ host: config.redis.host, port: config.redis.port, family: config.redis.family == null ? 0 : config.redis.family, + user: "default", password: config.redis.pass, keyPrefix: `${config.redis.prefix}:query:`, db: config.redis.db || 0, + tls: { + host: config.redis.host, + rejectUnauthorized: false, + }, }, } : false, @@ -218,6 +223,10 @@ export const db = new DataSource({ maxQueryExecutionTime: 300, entities: entities, migrations: ["../../migration/*.js"], + ssl: { + rejectUnauthorized: false, + ca: process.env.DB_SSL_CERT, + }, }); export async function initDb(force = false) { diff --git a/packages/backend/src/db/redis.ts b/packages/backend/src/db/redis.ts index 6ad3de386f..0a88a0deb4 100644 --- a/packages/backend/src/db/redis.ts +++ b/packages/backend/src/db/redis.ts @@ -7,8 +7,13 @@ export function createConnection() { host: config.redis.host, family: config.redis.family == null ? 0 : config.redis.family, password: config.redis.pass, + username: "default", keyPrefix: `${config.redis.prefix}:`, db: config.redis.db || 0, + tls: { + rejectUnauthorized: false, + host: config.redis.host, + }, }); } diff --git a/packages/backend/src/queue/initialize.ts b/packages/backend/src/queue/initialize.ts index 0686fe9cd3..4d7facd136 100644 --- a/packages/backend/src/queue/initialize.ts +++ b/packages/backend/src/queue/initialize.ts @@ -7,8 +7,12 @@ export function initialize(name: string, limitPerSec = -1) { port: config.redis.port, host: config.redis.host, family: config.redis.family == null ? 0 : config.redis.family, + user: "default", password: config.redis.pass, db: config.redis.db || 0, + tls: { + host: config.redis.host, + }, }, prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : "queue", limiter: