diff --git a/MeshCentralServer.njsproj b/MeshCentralServer.njsproj index 4f834b58..82b29408 100644 --- a/MeshCentralServer.njsproj +++ b/MeshCentralServer.njsproj @@ -627,6 +627,7 @@ + @@ -640,9 +641,11 @@ + + @@ -650,14 +653,17 @@ + + + @@ -671,9 +677,11 @@ + + @@ -681,9 +689,11 @@ + + diff --git a/db.js b/db.js index 9877f860..0496de7a 100644 --- a/db.js +++ b/db.js @@ -923,7 +923,8 @@ module.exports.CreateDB = function (parent, func) { } else { // Use NeDB (The default) obj.databaseType = 1; - Datastore = require('nedb'); + try { Datastore = require('@yetzt/nedb'); } catch (ex) { } // This is the NeDB with fixed security dependencies. + if (Datastore == null) { Datastore = require('nedb'); } // So not to break any existing installations, if the old NeDB is present, use it. var datastoreOptions = { filename: parent.getConfigFilePath('meshcentral.db'), autoload: true }; // If a DB encryption key is provided, perform database encryption diff --git a/dependencies.txt b/dependencies.txt index 4c1b0ae8..7ad08f24 100644 --- a/dependencies.txt +++ b/dependencies.txt @@ -6,9 +6,9 @@ "express-handlebars": "^3.1.0", "express-ws": "^4.0.0", "ipcheck": "^0.1.0", - "minimist": "^1.2.0", + "minimist": "^1.2.5", "multiparty": "^4.2.1", - "nedb": "^1.8.0", + "@yetzt/nedb": "^1.8.0", "node-forge": "^0.10.0", "ws": "^5.2.3", "yauzl": "^2.10.0" \ No newline at end of file diff --git a/meshcentral.js b/meshcentral.js index bcc71279..617c7aff 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -3298,8 +3298,8 @@ function mainStart() { } // Build the list of required modules - var modules = ['ws@5.2.3', 'cbor@5.2.0', 'nedb', 'https', 'yauzl', 'ipcheck', 'express', 'archiver@4.0.2', 'multiparty', 'node-forge', 'express-ws@4.0.0', 'compression', 'body-parser', 'cookie-session', 'express-handlebars']; - if (require('os').platform() == 'win32') { modules.push('node-windows'); modules.push('loadavg-windows'); if (sspi == true) { modules.push('node-sspi'); } } // Add Windows modules + var modules = ['ws@5.2.3', 'cbor@5.2.0', '@yetzt/nedb', 'https', 'yauzl', 'ipcheck', 'express', 'archiver@4.0.2', 'multiparty', 'node-forge', 'express-ws@4.0.0', 'compression', 'body-parser', 'cookie-session', 'express-handlebars']; + if (require('os').platform() == 'win32') { modules.push('node-windows@0.1.4'); modules.push('loadavg-windows'); if (sspi == true) { modules.push('node-sspi'); } } // Add Windows modules if (ldap == true) { modules.push('ldapauth-fork'); } if (mstsc == true) { modules.push('node-rdpjs-2'); } if (ssh == true) { if (nodeVersion < 11) { addServerWarning('MeshCentral SSH support requires NodeJS 11 or higher.', 1); } else { modules.push('ssh2'); } } diff --git a/package.json b/package.json index 383c1052..4394d15a 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "express-handlebars": "^3.1.0", "express-ws": "^4.0.0", "ipcheck": "^0.1.0", - "minimist": "^1.2.0", + "minimist": "^1.2.5", "multiparty": "^4.2.1", - "nedb": "^1.8.0", + "@yetzt/nedb": "^1.8.0", "node-forge": "^0.10.0", "ws": "^5.2.3", "yauzl": "^2.10.0"