chore(db): fix db ssl for DO
authorxangelo <me@xangelo.ca>
Wed, 4 Dec 2024 18:26:13 +0000 (13:26 -0500)
committerxangelo <me@xangelo.ca>
Wed, 4 Dec 2024 18:26:13 +0000 (13:26 -0500)
knexfile.ts
src/server/lib/db.ts

index 92d17cdafe2da9cc72330be8d44320ef0623188d..987738cb5a779eca7fbc95854d9c757356f9e22c 100644 (file)
@@ -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
index a950463fe9787c24c28cfad444fa36d41f03c1de..7b9fe4abb28f7a07e9b60f1dfb0c93d3859e68d8 100644 (file)
@@ -7,5 +7,10 @@ const connectionUrl = process.env.DATABASE_URL;
 
 export const db = knex({
   client: 'pg',
-  connection: connectionUrl
+  connection: {
+    connectionString: connectionUrl,
+    ssl: {
+      rejectUnauthorized: false
+    }
+  }
 });