about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-03-10 19:19:52 -0700
committerReverite <github@reverite.sh>2019-03-10 19:19:52 -0700
commit229e2726cad36066afb210d7087a40cd9f955483 (patch)
treea14d55e9469f1f339fc40b777827aa4886bb7889 /streaming
parent715c552fe4c1b2d59bf1f281d77b6e2546bdb531 (diff)
parent3cef04610cd809c7bd01adc00d34fb3d25261a16 (diff)
Merge branch 'glitch'
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 406ee09e1..869186934 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -24,7 +24,7 @@ const dbUrlToConfig = (dbUrl) => {
     return {};
   }
 
-  const params = url.parse(dbUrl);
+  const params = url.parse(dbUrl, true);
   const config = {};
 
   if (params.auth) {
@@ -45,8 +45,8 @@ const dbUrlToConfig = (dbUrl) => {
 
   const ssl = params.query && params.query.ssl;
 
-  if (ssl) {
-    config.ssl = ssl === 'true' || ssl === '1';
+  if (ssl && ssl === 'true' || ssl === '1') {
+    config.ssl = true;
   }
 
   return config;
@@ -89,6 +89,7 @@ const startWorker = (workerId) => {
       host:     process.env.DB_HOST || pg.defaults.host,
       port:     process.env.DB_PORT || pg.defaults.port,
       max:      10,
+      ssl:      !!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable' ? true : undefined,
     },
 
     production: {
@@ -98,6 +99,7 @@ const startWorker = (workerId) => {
       host:     process.env.DB_HOST || 'localhost',
       port:     process.env.DB_PORT || 5432,
       max:      10,
+      ssl:      !!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable' ? true : undefined,
     },
   };