about summary refs log tree commit diff
path: root/streaming/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-11 11:23:50 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-11 11:23:50 +0100
commit89bee860cdae399b796814f80a48eafa8b838d92 (patch)
tree7f31aaa85f78b170f22cadd8c53fca8d09f8e795 /streaming/index.js
parent3cef04610cd809c7bd01adc00d34fb3d25261a16 (diff)
parent13a7f05030cdcbab24aeb25944a9a430238dbff1 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/services/post_status_service.rb
  Small conflict due to handling of instance-local toots.
  A subsequent change is required to ensure instance-local polls are not leaked
  through Update.
Diffstat (limited to 'streaming/index.js')
-rw-r--r--streaming/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 869186934..d4fb8cad3 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -89,7 +89,6 @@ 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: {
@@ -99,11 +98,15 @@ 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,
     },
   };
 
-  const app    = express();
+  if (!!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable') {
+    pgConfigs.development.ssl = true;
+    pgConfigs.production.ssl  = true;
+  }
+
+  const app = express();
   app.set('trusted proxy', process.env.TRUSTED_PROXY_IP || 'loopback,uniquelocal');
 
   const pgPool = new pg.Pool(Object.assign(pgConfigs[env], dbUrlToConfig(process.env.DATABASE_URL)));