From d5036ba9d1577375cee6f4a7853cec3b4e960a41 Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Thu, 1 Aug 2019 10:39:42 -0500 Subject: [PATCH 1/2] Convert Heroku environment variable to a proper boolean value before initializing. Resolves #229. --- server/init.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/init.js b/server/init.js index 95b3ed52..69c450a0 100644 --- a/server/init.js +++ b/server/init.js @@ -13,7 +13,14 @@ module.exports = { * Detect the most appropriate start mode */ startDetect: function () { - if (process.env.WIKI_JS_HEROKU) { + let isHeroku = typeof process.env.WIKIJS_HEROKU === 'boolean' + ? process.env.WIKIJS_HEROKU + : ( + process.env.WIKIJS_HEROKU === '1' + || process.env.WIKIJS_HEROKU === 'true' + ) + + if (isHeroku) { return this.startInHerokuMode() } else { return this.startInBackgroundMode() From e4be63a95353f1432a12dfabd3a2150b94009650 Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Fri, 2 Aug 2019 14:18:56 -0500 Subject: [PATCH 2/2] Update init.js --- server/init.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/init.js b/server/init.js index 69c450a0..463205aa 100644 --- a/server/init.js +++ b/server/init.js @@ -13,11 +13,11 @@ module.exports = { * Detect the most appropriate start mode */ startDetect: function () { - let isHeroku = typeof process.env.WIKIJS_HEROKU === 'boolean' - ? process.env.WIKIJS_HEROKU + let isHeroku = typeof process.env.WIKI_JS_HEROKU === 'boolean' + ? process.env.WIKI_JS_HEROKU : ( - process.env.WIKIJS_HEROKU === '1' - || process.env.WIKIJS_HEROKU === 'true' + process.env.WIKI_JS_HEROKU === '1' + || process.env.WIKI_JS_HEROKU === 'true' ) if (isHeroku) {