Fixed config.json capitalization issue.

Ylian Saint-Hilaire committed Nov 4, 2022 at 11:50 UTC 4087a02fdbc8e7d754b409a949fa15cf47879ca0
3 files changed +7 -4
common.js
+3 -1
@@ -145,7 +145,9 @@ module.exports.zeroPad = function(num, c) { if (c == null) { c = 2; } var s = '0
145 // Exceptions is an array of "keyname" or "parent\keyname"
146 module.exports.objKeysToLower = function (obj, exceptions, parent) {
147 for (var i in obj) {
148 - if ((typeof obj[i] == 'object') && ((exceptions == null) || (exceptions.indexOf(i.toLowerCase()) == -1)) && ((parent != null) && (exceptions.indexOf(parent.toLowerCase() + '/' + i.toLowerCase()) == -1))) {
148 + if ((typeof obj[i] == 'object') &&
149 + ((exceptions == null) || (exceptions.indexOf(i.toLowerCase()) == -1) && ((parent == null) || (exceptions.indexOf(parent.toLowerCase() + '/' + i.toLowerCase()) == -1)))
150 + ) {
151 module.exports.objKeysToLower(obj[i], exceptions, i); // LowerCase all key names in the child object
152 }
153 if (i.toLowerCase() !== i) { obj[i.toLowerCase()] = obj[i]; delete obj[i]; } // LowerCase all key names
meshcentral.js
+2 -2
@@ -703,7 +703,7 @@ function CreateMeshCentralServer(config, args) {
703 obj.args = args = config2.settings;
704
705 // Lower case all keys in the config file
706 - obj.common.objKeysToLower(config2, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders']);
706 + obj.common.objKeysToLower(config2, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders', 'telegram/proxy']);
707
708 // Grad some of the values from the original config.json file if present.
709 if ((config.settings.vault != null) && (config2.settings != null)) { config2.settings.vault = config.settings.vault; }
@@ -3802,7 +3802,7 @@ function getConfig(createSampleConfig) {
3802
3803 // Lower case all keys in the config file
3804 try {
3805 - require('./common.js').objKeysToLower(config, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders']);
3805 + require('./common.js').objKeysToLower(config, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders', 'telegram/proxy']);
3806 } catch (ex) {
3807 console.log('CRITICAL ERROR: Unable to access the file \"./common.js\".\r\nCheck folder & file permissions.');
3808 process.exit();
package.json
+2 -1
@@ -37,6 +37,7 @@
37 "sample-config-advanced.json"
38 ],
39 "dependencies": {
40 + "@yetzt/nedb": "^1.8.0",
41 "archiver": "^5.3.1",
42 "body-parser": "^1.19.0",
43 "cbor": "~5.2.0",
@@ -46,9 +47,9 @@
47 "express-handlebars": "^5.3.5",
48 "express-ws": "^4.0.0",
49 "ipcheck": "^0.1.0",
50 + "ldapauth-fork": "^5.0.5",
51 "minimist": "^1.2.5",
52 "multiparty": "^4.2.1",
51 - "@yetzt/nedb": "^1.8.0",
53 "node-forge": "^1.0.0",
54 "ws": "^5.2.3",
55 "yauzl": "^2.10.0"