Fix streaming API always attempting to use SSL with Postgres (#10231)

Fix #10223
This commit is contained in:
Eugen Rochko 2019-03-11 00:51:23 +01:00 committed by GitHub
parent 5506b9406d
commit 13a7f05030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,6 @@ const startWorker = (workerId) => {
host: process.env.DB_HOST || pg.defaults.host, host: process.env.DB_HOST || pg.defaults.host,
port: process.env.DB_PORT || pg.defaults.port, port: process.env.DB_PORT || pg.defaults.port,
max: 10, max: 10,
ssl: !!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable' ? true : undefined,
}, },
production: { production: {
@ -99,10 +98,14 @@ const startWorker = (workerId) => {
host: process.env.DB_HOST || 'localhost', host: process.env.DB_HOST || 'localhost',
port: process.env.DB_PORT || 5432, port: process.env.DB_PORT || 5432,
max: 10, max: 10,
ssl: !!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable' ? true : undefined,
}, },
}; };
if (!!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable') {
pgConfigs.development.ssl = true;
pgConfigs.production.ssl = true;
}
const app = express(); const app = express();
app.set('trusted proxy', process.env.TRUSTED_PROXY_IP || 'loopback,uniquelocal'); app.set('trusted proxy', process.env.TRUSTED_PROXY_IP || 'loopback,uniquelocal');