Skip to content

Commit

Permalink
Merge branch 'Ylianst:master' into oidc-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrhakr authored Sep 6, 2022
2 parents a27a02c + b62e555 commit 8f4e9c9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
13 changes: 9 additions & 4 deletions db.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ module.exports.CreateDB = function (parent, func) {
validIdentifiers[docs[i]._id] = 1;
}
}

// Fix all of the creating & login to ticks by seconds, not milliseconds.
obj.GetAllType('user', function (err, docs) {
if (err != null) { parent.debug('db', 'ERROR (GetAll user): ' + err); }
Expand Down Expand Up @@ -675,7 +675,7 @@ module.exports.CreateDB = function (parent, func) {
obj.file = new sqlite3.Database(parent.path.join(parent.datapath, 'meshcentral.sqlite'), sqlite3.OPEN_READWRITE, function (err) {
if (err && (err.code == 'SQLITE_CANTOPEN')) {
// Database needs to be created
obj.file = new sqlite3.Database(parent.path.join(parent.datapath, 'meshcentral.sqlite'), function(err) {
obj.file = new sqlite3.Database(parent.path.join(parent.datapath, 'meshcentral.sqlite'), function (err) {
if (err) { console.log("SQLite Error: " + err); exit(1); return; }
obj.file.exec(`
CREATE TABLE main (id VARCHAR(256) PRIMARY KEY NOT NULL, type CHAR(32), domain CHAR(64), extra CHAR(255), extraex CHAR(255), doc JSON);
Expand Down Expand Up @@ -724,7 +724,7 @@ module.exports.CreateDB = function (parent, func) {
obj.file.indexes.create('meshcenral', 'intelamt.uuid');
obj.file.indexes.create('events', 'userid', { include: ['action'] });
obj.file.indexes.create('events', 'domain', { include: ['nodeid', 'time'] });
obj.file.indexes.create('events', 'ids', { include: ['time'] });
obj.file.indexes.create('events', 'ids', { include: ['time'] });
obj.file.indexes.create('events', 'time');
obj.file.indexes.create('power', 'nodeid', { include: ['time'] });
obj.file.indexes.create('power', 'time');
Expand All @@ -743,7 +743,7 @@ module.exports.CreateDB = function (parent, func) {

try {
if (connectinArgs.ssl) {
if (connectinArgs.ssl.dontcheckserveridentity == true) { connectionObject.ssl.checkServerIdentity = function(name, cert) { return undefined; } };
if (connectinArgs.ssl.dontcheckserveridentity == true) { connectionObject.ssl.checkServerIdentity = function (name, cert) { return undefined; } };
if (connectinArgs.ssl.cacertpath) { connectionObject.ssl.ca = [require('fs').readFileSync(connectinArgs.ssl.cacertpath, 'utf8')]; }
if (connectinArgs.ssl.clientcertpath) { connectionObject.ssl.cert = [require('fs').readFileSync(connectinArgs.ssl.clientcertpath, 'utf8')]; }
if (connectinArgs.ssl.clientkeypath) { connectionObject.ssl.key = [require('fs').readFileSync(connectinArgs.ssl.clientkeypath, 'utf8')]; }
Expand Down Expand Up @@ -828,6 +828,11 @@ module.exports.CreateDB = function (parent, func) {
} else if (parent.args.mongodb) {
// Use MongoDB
obj.databaseType = 3;

// If running an older NodeJS version, TextEncoder/TextDecoder is required
if (global.TextEncoder == null) { global.TextEncoder = require('util').TextEncoder; }
if (global.TextDecoder == null) { global.TextDecoder = require('util').TextDecoder; }

require('mongodb').MongoClient.connect(parent.args.mongodb, { useNewUrlParser: true, useUnifiedTopology: true }, function (err, client) {
if (err != null) { console.log("Unable to connect to database: " + err); process.exit(); return; }
Datastore = client;
Expand Down
18 changes: 18 additions & 0 deletions docs/docs/meshcentral/devicetabs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Device Tabs

## Search or Filter

You can search your list of agents using any of these criteria using the filter box (also viewable in the tooltip of the Filter box):

user:xxx or u:xxx
ip:xxx
group:xxx or g:xxx
tag:xxx or t:xxx
atag:xxx or a:xxx
os:xxx
amt:xxx
desc:xxx
wsc:ok
wsc:noav
wsc:noupdate
wsc:nofirewall
wsc:any

## General

For viewing general information about the agent
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "1.0.81",
"version": "1.0.82",
"keywords": [
"Remote Device Management",
"Remote Device Monitoring",
Expand Down

0 comments on commit 8f4e9c9

Please sign in to comment.