From 826ad213d62f4978d023ce595b99a79b3b62532e Mon Sep 17 00:00:00 2001 From: Raccoon Li Date: Mon, 8 May 2017 20:38:59 +0800 Subject: [PATCH] fix(config): some environment config not parse properly --- lib/config/environment.js | 12 ++++++------ lib/config/oldEnvironment.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/config/environment.js b/lib/config/environment.js index 75a5bc54..cd0c0097 100644 --- a/lib/config/environment.js +++ b/lib/config/environment.js @@ -5,11 +5,11 @@ module.exports = { urlpath: process.env.HMD_URL_PATH, port: process.env.HMD_PORT, urladdport: process.env.HMD_URL_ADDPORT, - usessl: process.env.HMD_PROTOCOL_USESSL, + usessl: (process.env.HMD_PROTOCOL_USESSL === 'true'), alloworigin: process.env.HMD_ALLOW_ORIGIN ? process.env.HMD_ALLOW_ORIGIN.split(',') : undefined, - usecdn: process.env.HMD_USECDN, - allowanonymous: process.env.HMD_ALLOW_ANONYMOUS, - allowfreeurl: process.env.HMD_ALLOW_FREEURL, + usecdn: (process.env.HMD_USECDN === 'true'), + allowanonymous: (process.env.HMD_ALLOW_ANONYMOUS === 'true'), + allowfreeurl: (process.env.HMD_ALLOW_FREEURL === 'true'), defaultpermission: process.env.HMD_DEFAULT_PERMISSION, dburl: process.env.HMD_DB_URL, imageUploadType: process.env.HMD_IMAGE_UPLOAD_TYPE, @@ -59,6 +59,6 @@ module.exports = { searchAttributes: process.env.HMD_LDAP_SEARCHATTRIBUTES, tlsca: process.env.HMD_LDAP_TLS_CA }, - email: process.env.HMD_EMAIL, - allowemailregister: process.env.HMD_ALLOW_EMAIL_REGISTER + email: (process.env.HMD_EMAIL === 'true'), + allowemailregister: (process.env.HMD_ALLOW_EMAIL_REGISTER === 'true') } diff --git a/lib/config/oldEnvironment.js b/lib/config/oldEnvironment.js index 00324e4b..67e70ff0 100644 --- a/lib/config/oldEnvironment.js +++ b/lib/config/oldEnvironment.js @@ -1,7 +1,7 @@ 'use strict' module.exports = { - debug: process.env.DEBUG, + debug: (process.env.DEBUG === 'true'), dburl: process.env.DATABASE_URL, urlpath: process.env.URL_PATH, port: process.env.PORT