From 11a80d1b1506b05e1eeac64562cc45a0f16d882c 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 2d42c2522..b96dc643b 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 b4a933356..5f85cead8 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 93cb760f9..028403374 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 93de959a8..2295246eb 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) {