From 23c8f175bbafc1303a5ff9f00c1d192597c1e079 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Mon, 1 Sep 2025 16:49:53 +0200 Subject: [PATCH] Fix supabase IPV6 only host --- backend/api/ecosystem.config.js | 2 +- backend/shared/src/supabase/init.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/api/ecosystem.config.js b/backend/api/ecosystem.config.js index f7bbe9ed..41980791 100644 --- a/backend/api/ecosystem.config.js +++ b/backend/api/ecosystem.config.js @@ -3,7 +3,7 @@ module.exports = { { name: "api", script: "node", - args: "-r tsconfig-paths/register backend/api/lib/serve.js", + args: "-r tsconfig-paths/register --dns-result-order=ipv4first backend/api/lib/serve.js", env: { NODE_ENV: "production", NODE_PATH: "/usr/src/app/node_modules", // <- ensures Node finds tsconfig-paths diff --git a/backend/shared/src/supabase/init.ts b/backend/shared/src/supabase/init.ts index fc351162..3cda92fe 100644 --- a/backend/shared/src/supabase/init.ts +++ b/backend/shared/src/supabase/init.ts @@ -53,11 +53,13 @@ const newClient = ( const { instanceId, password, ...settings } = props const config = { - host: 'db.ltzepxnhhnrnvovqblfr.supabase.co', + // This host is IPV4 compatible, for the google cloud VM + host: 'aws-1-us-west-1.pooler.supabase.com', port: 5432, - user: `postgres`, + user: `postgres.ltzepxnhhnrnvovqblfr`, password: password, database: 'postgres', + pool_mode: 'session', ssl: { rejectUnauthorized: false }, family: 4, // <- forces IPv4 ...settings,