From 05a940e7324ad135258d36232ad378b128764354 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 18 Nov 2020 21:42:03 +1000 Subject: [PATCH 1/2] Fix instances where config file exists and env vars don't --- backend/index.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/backend/index.js b/backend/index.js index 50a263bac..3118cdc07 100644 --- a/backend/index.js +++ b/backend/index.js @@ -13,7 +13,6 @@ async function appStart () { const internalCertificate = require('./internal/certificate'); const internalIpRanges = require('./internal/ip_ranges'); - return migrate.latest() .then(setup) .then(() => { @@ -43,13 +42,14 @@ async function appStart () { }); } -async function createDbConfigFromEnvironment(){ +async function createDbConfigFromEnvironment() { return new Promise((resolve, reject) => { - const envMysqlHost = process.env.DB_MYSQL_HOST; - const envMysqlPort = process.env.DB_MYSQL_PORT; - const envMysqlUser = process.env.DB_MYSQL_USER; - const envMysqlName = process.env.DB_MYSQL_NAME; - const envSqliteFile = process.env.DB_SQLITE_FILE; + const envMysqlHost = process.env.DB_MYSQL_HOST || null; + const envMysqlPort = process.env.DB_MYSQL_PORT || null; + const envMysqlUser = process.env.DB_MYSQL_USER || null; + const envMysqlName = process.env.DB_MYSQL_NAME || null; + const envSqliteFile = process.env.DB_SQLITE_FILE || null; + if ((envMysqlHost && envMysqlPort && envMysqlUser && envMysqlName) || envSqliteFile) { const fs = require('fs'); const filename = (process.env.NODE_CONFIG_DIR || './config') + '/' + (process.env.NODE_ENV || 'default') + '.json'; @@ -119,7 +119,7 @@ async function createDbConfigFromEnvironment(){ } }); } else { - // resolve(); + resolve(); } }); } @@ -130,3 +130,4 @@ try { logger.error(err.message, err); process.exit(1); } + From 94eec805df2bc2f92f1902f66da513e1740d4670 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 18 Nov 2020 21:46:21 +1000 Subject: [PATCH 2/2] Version bump --- .version | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.version b/.version index 24ba9a38d..860487ca1 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.7.0 +2.7.1 diff --git a/README.md b/README.md index a80d05243..a6e99bc06 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@



- +