From f40d21fdfdb79bd9e37c70db035a3cc1eb40347c Mon Sep 17 00:00:00 2001 From: xangelo Date: Wed, 4 Dec 2024 13:26:13 -0500 Subject: [PATCH] chore(db): fix db ssl for DO --- knexfile.ts | 14 ++++++++++++-- src/server/lib/db.ts | 7 ++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/knexfile.ts b/knexfile.ts index 92d17cd..987738c 100644 --- a/knexfile.ts +++ b/knexfile.ts @@ -8,7 +8,12 @@ const connectionUrl = process.env.DATABASE_URL; const config: { [key: string]: Knex.Config } = { development: { client: "pg", - connection: connectionUrl, + connection: { + connectionString: connectionUrl, + ssl: { + rejectUnauthorized: false + } + }, pool: { min: 2, max: 10 @@ -20,7 +25,12 @@ const config: { [key: string]: Knex.Config } = { production: { client: "pg", - connection: connectionUrl, + connection: { + connectionString: connectionUrl, + ssl: { + rejectUnauthorized: false + } + }, pool: { min: 2, max: 10 diff --git a/src/server/lib/db.ts b/src/server/lib/db.ts index a950463..7b9fe4a 100644 --- a/src/server/lib/db.ts +++ b/src/server/lib/db.ts @@ -7,5 +7,10 @@ const connectionUrl = process.env.DATABASE_URL; export const db = knex({ client: 'pg', - connection: connectionUrl + connection: { + connectionString: connectionUrl, + ssl: { + rejectUnauthorized: false + } + } }); -- 2.25.1