Minor fixes.
Ylian Saint-Hilaire committed
Feb 12, 2019 at 13:37 UTC
027a9944f5bde2371e4829935a9c2885945d83c4
5 files changed
+9
-6
meshagent.js
+4
-2
@@ -342,8 +342,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
342
// If the mesh agent web socket is closed, clean up.
343
ws.on('close', function (req) {
344
if (obj.nodeid != null) {
345
- //console.log('Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + obj.agentInfo.agentId);
346
- obj.parent.parent.debug(1, 'Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + obj.agentInfo.agentId);
345
+ var agentId = 'Unknown';
346
+ if (obj.agentInfo && obj.agentInfo.agentId) { agentId = obj.agentInfo.agentId; }
347
+ //console.log('Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + agentId);
348
+ obj.parent.parent.debug(1, 'Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + agentId);
349
350
// Log the agent disconnection
351
if (obj.parent.wsagentsDisconnections[obj.nodeid] == null) {
meshmail.js
+1
-1
@@ -130,7 +130,7 @@ module.exports.CreateMeshMail = function (parent) {
130
131
// Set all the options.
132
var options = { username: username, email: email, servername: domain.title };
133
- options.cookie = obj.parent.encodeCookie({ u: domain.id + '/' + username, e: email, a: 1 }, obj.mailCookieEncryptionKey);
133
+ options.cookie = obj.parent.encodeCookie({ u: domain.id + '/' + username.toLowerCase(), e: email, a: 1 }, obj.mailCookieEncryptionKey);
134
135
// Send the email
136
obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) });
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.2.7-y",
3
+ "version": "0.2.8-b",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
sample-config.json
+1
@@ -62,6 +62,7 @@
62
}
63
},
64
"_letsencrypt": {
65
+ "__comment__": "If your are having problems with Let's Encrypt, use https://letsdebug.net/ first to debug it.",
66
"email": "myemail@myserver.com ",
67
"names": "myserver.com,customer1.myserver.com",
68
"rsaKeySize": 3072,
webserver.js
+2
-2
@@ -639,9 +639,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
639
if ((idsplit.length != 2) || (idsplit[0] != domain.id)) {
640
res.render(obj.path.join(obj.parent.webViewsPath, 'message'), { title: domain.title, title2: domain.title2, title3: 'Account Verification', message: 'ERROR: Invalid domain. <a href="' + domain.url + '">Go to login page</a>.' });
641
} else {
642
- obj.db.Get('user/' + cookie.u, function (err, docs) {
642
+ obj.db.Get('user/' + cookie.u.toLowerCase(), function (err, docs) {
643
if (docs.length == 0) {
644
- res.render(obj.path.join(obj.parent.webViewsPath, 'message'), { title: domain.title, title2: domain.title2, title3: 'Account Verification', message: 'ERROR: Invalid username \"' + EscapeHtml(cookie.u) + '\". <a href="' + domain.url + '">Go to login page</a>.' });
644
+ res.render(obj.path.join(obj.parent.webViewsPath, 'message'), { title: domain.title, title2: domain.title2, title3: 'Account Verification', message: 'ERROR: Invalid username \"' + EscapeHtml(idsplit[1]) + '\". <a href="' + domain.url + '">Go to login page</a>.' });
645
} else {
646
var user = docs[0];
647
if (user.email != cookie.e) {