1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed insecure dependencies.

This commit is contained in:
Ylian Saint-Hilaire 2021-10-12 11:20:33 -07:00
parent 57b1622d2d
commit 959c147295
5 changed files with 18 additions and 7 deletions

3
db.js
View file

@ -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