From cc32d09913c52f3ca12acb7c3b537108f3e94cee Mon Sep 17 00:00:00 2001 From: sparrow Date: Wed, 28 Jun 2023 01:48:55 +0100 Subject: [PATCH] Remove static postgres tls settings They can be configured through `extra` in config. --- .config/example.yml | 5 +++-- packages/backend/ormconfig.js | 4 ---- packages/backend/src/config/types.ts | 1 - packages/backend/src/db/postgre.ts | 4 ---- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.config/example.yml b/.config/example.yml index 2d42c2522b..b96dc643ba 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -48,8 +48,9 @@ db: # Extra Connection options #extra: - # TODO: find another example - # ssl: true + # ssl: + # host: localhost + # rejectUnauthorized: false # ┌─────────────────────┐ #───┘ Redis configuration └───────────────────────────────────── diff --git a/packages/backend/ormconfig.js b/packages/backend/ormconfig.js index b4a9333560..5f85cead8a 100644 --- a/packages/backend/ormconfig.js +++ b/packages/backend/ormconfig.js @@ -12,8 +12,4 @@ export default new DataSource({ extra: config.db.extra, entities: entities, migrations: ["migration/*.js"], - ssl: config.db.ssl ? { - rejectUnauthorized: false, //TODO make configurable - ca: process.env.DB_SSL_CERT, - } : undefined, }); diff --git a/packages/backend/src/config/types.ts b/packages/backend/src/config/types.ts index 93cb760f9b..028403374f 100644 --- a/packages/backend/src/config/types.ts +++ b/packages/backend/src/config/types.ts @@ -15,7 +15,6 @@ export type Source = { pass: string; disableCache?: boolean; extra?: { [x: string]: string }; - ssl?: boolean; }; redis: { host: string; diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 93de959a81..2295246eb1 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -223,10 +223,6 @@ export const db = new DataSource({ maxQueryExecutionTime: 300, entities: entities, migrations: ["../../migration/*.js"], - ssl: config.db.ssl ? { - rejectUnauthorized: false, - ca: process.env.DB_SSL_CERT, - } : undefined, }); export async function initDb(force = false) {