From 276954bfd046ae5d5dfad1a81b8b33b5a2b3baa8 Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sat, 21 Oct 2023 21:10:34 -0700 Subject: [PATCH] th: sure. why not. let's interpolate DB_HOST. --- streaming/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/streaming/index.js b/streaming/index.js index 65d019dea7..08095f0186 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -94,6 +94,12 @@ const parseJSON = (json, req) => { * @returns {Object.} the configuration for the PostgreSQL connection */ const pgConfigFromEnv = (env) => { + if (env.DB_HOST) { + env.DB_HOST = env.DB_HOST.replaceAll(/\$\w+|\$\{\w+\}/g, (match) => { + const name = match.startsWith('${') ? match.slice(2, -1) : match.slice(1); + return env[name]; + }); + } const pgConfigs = { development: { user: env.DB_USER || pg.defaults.user,