summaryrefslogtreecommitdiff
path: root/lib/config/index.js
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-01-29 15:53:14 +0100
committerGitHub2018-01-29 15:53:14 +0100
commite18e05541c52908034b672a2abe79a1c51df5607 (patch)
tree1d7f23195aebec9b127015b48b73c7333ef6f07f /lib/config/index.js
parentd8766bbc081fde4b7169047f63f9b944fa555684 (diff)
parentbd92010dd2e16d6fd87012ebd17fde0e9c01c4f6 (diff)
Merge pull request #705 from SISheogorath/fix/camelcaseConfig
Remove camel case from `imageuploadtype` in config
Diffstat (limited to 'lib/config/index.js')
-rw-r--r--lib/config/index.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/config/index.js b/lib/config/index.js
index 4f6b4b6a..0051e485 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -13,6 +13,7 @@ const debugConfig = {
debug: (env === Environment.development)
}
+// Get version string from package.json
const {version} = require(path.join(appRootPath, 'package.json'))
const packageConfig = {
@@ -20,7 +21,7 @@ const packageConfig = {
minimumCompatibleVersion: '0.5.0'
}
-const configFilePath = path.join(__dirname, '../../config.json')
+const configFilePath = path.join(appRootPath, 'config.json')
const fileConfig = fs.existsSync(configFilePath) ? require(configFilePath)[env] : undefined
let config = require('./default')
@@ -97,8 +98,13 @@ config.isLDAPEnable = config.ldap.url
config.isSAMLEnable = config.saml.idpSsoUrl
config.isPDFExportEnable = config.allowpdfexport
+// merge legacy values
+if (config.imageUploadType && !config.imageuploadtype) {
+ config.imageuploadtype = config.imageUploadType
+}
+
// figure out mime types for image uploads
-switch (config.imageUploadType) {
+switch (config.imageuploadtype) {
case 'imgur':
config.allowedUploadMimeTypes = [
'image/jpeg',