From 3d84888eb1218c8c7325347f6e7e348af2333bda Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Mon, 27 Feb 2023 22:56:16 +0100 Subject: [PATCH] revert: Allow postgres connections that require ssl mode (#408) This reverts commit eea57ff1211db87144f74923d79c8d8e671bae73. --- docker-compose.yml | 5 ----- server/.env.sample | 5 ----- server/db/knexfile.js | 7 +------ 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c09bb9e1..bbe31759 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,11 +23,6 @@ services: - TRUST_PROXY=0 - DATABASE_URL=postgresql://postgres@postgres/planka - SECRET_KEY=notsecretkey - # related: https://github.com/knex/knex/issues/2354 - # As knex does not pass query parameters from the connection string we - # have to use environment variables in order to pass the desired values, e.g. - # note: this is optional - # PGSSLMODE=require depends_on: - postgres diff --git a/server/.env.sample b/server/.env.sample index aac41a0d..b9b6f2e9 100644 --- a/server/.env.sample +++ b/server/.env.sample @@ -9,11 +9,6 @@ SECRET_KEY=notsecretkey # TRUST_PROXY=0 # TOKEN_EXPIRES_IN=365 # In days -# related: https://github.com/knex/knex/issues/2354 -# As knex does not pass query parameters from the connection string we -# have to use environment variables in order to pass the desired values, e.g. -# PGSSLMODE= - ## Do not edit this TZ=UTC diff --git a/server/db/knexfile.js b/server/db/knexfile.js index 7ba13d94..ef294733 100755 --- a/server/db/knexfile.js +++ b/server/db/knexfile.js @@ -8,12 +8,7 @@ dotenv.config({ module.exports = { client: 'pg', - connection: { - connectionString: process.env.DATABASE_URL, - ssl: { - rejectUnauthorized: false, - }, - }, + connection: process.env.DATABASE_URL, migrations: { tableName: 'migration', directory: path.join(__dirname, 'migrations'),