From 4087a02fdbc8e7d754b409a949fa15cf47879ca0 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 4 Nov 2022 11:50:42 -0700 Subject: [PATCH] Fixed config.json capitalization issue. --- common.js | 4 +++- meshcentral.js | 4 ++-- package.json | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common.js b/common.js index 74747db5..93e6fd5c 100644 --- a/common.js +++ b/common.js @@ -145,7 +145,9 @@ module.exports.zeroPad = function(num, c) { if (c == null) { c = 2; } var s = '0 // Exceptions is an array of "keyname" or "parent\keyname" module.exports.objKeysToLower = function (obj, exceptions, parent) { for (var i in obj) { - if ((typeof obj[i] == 'object') && ((exceptions == null) || (exceptions.indexOf(i.toLowerCase()) == -1)) && ((parent != null) && (exceptions.indexOf(parent.toLowerCase() + '/' + i.toLowerCase()) == -1))) { + if ((typeof obj[i] == 'object') && + ((exceptions == null) || (exceptions.indexOf(i.toLowerCase()) == -1) && ((parent == null) || (exceptions.indexOf(parent.toLowerCase() + '/' + i.toLowerCase()) == -1))) + ) { module.exports.objKeysToLower(obj[i], exceptions, i); // LowerCase all key names in the child object } if (i.toLowerCase() !== i) { obj[i.toLowerCase()] = obj[i]; delete obj[i]; } // LowerCase all key names diff --git a/meshcentral.js b/meshcentral.js index 49d13f31..16fe6961 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -703,7 +703,7 @@ function CreateMeshCentralServer(config, args) { obj.args = args = config2.settings; // Lower case all keys in the config file - obj.common.objKeysToLower(config2, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders']); + obj.common.objKeysToLower(config2, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders', 'telegram/proxy']); // Grad some of the values from the original config.json file if present. if ((config.settings.vault != null) && (config2.settings != null)) { config2.settings.vault = config.settings.vault; } @@ -3802,7 +3802,7 @@ function getConfig(createSampleConfig) { // Lower case all keys in the config file try { - require('./common.js').objKeysToLower(config, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders']); + require('./common.js').objKeysToLower(config, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders', 'telegram/proxy']); } catch (ex) { console.log('CRITICAL ERROR: Unable to access the file \"./common.js\".\r\nCheck folder & file permissions.'); process.exit(); diff --git a/package.json b/package.json index bad5a43a..b50f086c 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "sample-config-advanced.json" ], "dependencies": { + "@yetzt/nedb": "^1.8.0", "archiver": "^5.3.1", "body-parser": "^1.19.0", "cbor": "~5.2.0", @@ -46,9 +47,9 @@ "express-handlebars": "^5.3.5", "express-ws": "^4.0.0", "ipcheck": "^0.1.0", + "ldapauth-fork": "^5.0.5", "minimist": "^1.2.5", "multiparty": "^4.2.1", - "@yetzt/nedb": "^1.8.0", "node-forge": "^1.0.0", "ws": "^5.2.3", "yauzl": "^2.10.0"