From 42e733681aef45c9e6224aed288e4c845782c173 Mon Sep 17 00:00:00 2001 From: Sascha Date: Fri, 8 Mar 2019 14:36:28 +0100 Subject: [PATCH] config: add DB_SSLMODE for managed/remote PG (#10210) * config: add DB_SSLMODE for managed/remote PG * streaming: set PG sslmode, defaults to prefer --- config/database.yml | 2 ++ streaming/index.js | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/config/database.yml b/config/database.yml index 82e560515c..c10bff6b2e 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,6 +3,7 @@ default: &default pool: <%= ENV["DB_POOL"] || ENV['MAX_THREADS'] || 5 %> timeout: 5000 encoding: unicode + sslmode: <%= ENV['DB_SSLMODE'] || "prefer" %> development: <<: *default @@ -31,3 +32,4 @@ production: host: <%= ENV['DB_HOST'] || 'localhost' %> port: <%= ENV['DB_PORT'] || 5432 %> prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> + diff --git a/streaming/index.js b/streaming/index.js index b4d09d0ad2..21a1d47ef2 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -89,6 +89,9 @@ const startWorker = (workerId) => { host: process.env.DB_HOST || pg.defaults.host, port: process.env.DB_PORT || pg.defaults.port, max: 10, + ssl: { + sslmode: process.env.DB_SSLMODE || 'prefer', + }, }, production: { @@ -98,6 +101,9 @@ const startWorker = (workerId) => { host: process.env.DB_HOST || 'localhost', port: process.env.DB_PORT || 5432, max: 10, + ssl: { + sslmode: process.env.DB_SSLMODE || 'prefer', + }, }, };