Added MeshCentral Assistant option to invitation email.
Ylian Saint-Hilaire committed
Feb 25, 2022 at 11:19 UTC
86a69706318897e1535b70a3283bb43e474a60d7
5 files changed
+30
-3
emails/mesh-invite.html
+5
@@ -32,6 +32,11 @@
32
<pre style="margin-left:30px" notrans="1">wget -q "[[[SERVERURL]]]/meshagents?script=1" --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh [[[SERVERURL]]] \'[[[MESHIDHEX]]]\'</pre>
33
</p>
34
</area-linux>
35
+ <area-assistant>
36
+ <p style="margin-left:30px">
37
+ <a href="[[[SERVERURL]]]/meshagents?id=10006&meshid=[[[MESHIDHEX]]]&tag=mailto:[[[EMAIL]]]">Click here to download the MeshCentral Assistant for Windows.</a>
38
+ </p>
39
+ </area-assistant>
40
<area-link>
41
<p>
42
To install the software, <a href="[[[SERVERURL]]][[[LINKURL]]][[[URLARGS2]]]">click here</a> and follow the instructions.
emails/mesh-invite.txt
+6
@@ -26,6 +26,12 @@ For Linux, cut & paste the following in a terminal to install the agent:
26
~wget -q "[[[SERVERURL]]]/meshagents?script=1" --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh [[[SERVERURL]]] '[[[MESHIDHEX]]]'
27
~
28
~</area-linux>
29
+~<area-assistant>
30
+For MeshCentral Assistant on Windows, nagivate to the following link to complete the process:
31
+~
32
+~[[[SERVERURL]]]/meshagents?id=10006&meshid=[[[MESHIDHEX]]]&tag=mailto:[[[EMAIL]]]
33
+~
34
+~</area-assistant>
35
~<area-link>
36
To install the software, navigate to [[[SERVERURL]]][[[LINKURL]]][[[URLARGS2]]] and follow the instructions.
37
~</area-link>
meshmail.js
+1
@@ -330,6 +330,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
330
if (loginkey != null) { options.urlargs1 = '?key=' + loginkey; options.urlargs2 = '&key=' + loginkey; } else { options.urlargs1 = ''; options.urlargs2 = ''; }
331
options.windows = ((os == 0) || (os == 1)) ? 1 : 0;
332
options.linux = ((os == 0) || (os == 2)) ? 1 : 0;
333
+ options.assistant = ((os == 0) || (os == 5)) ? 1 : 0;
334
options.osx = ((os == 0) || (os == 3)) ? 1 : 0;
335
options.link = (os == 4) ? 1 : 0;
336
options.linkurl = createInviteLink(domain, meshid, flags, expirehours);
package.json
+14
-2
@@ -36,6 +36,8 @@
36
"sample-config-advanced.json"
37
],
38
"dependencies": {
39
+ "@yetzt/nedb": "^1.8.0",
40
+ "archiver": "^4.0.2",
41
"body-parser": "^1.19.0",
42
"cbor": "~5.2.0",
43
"compression": "^1.7.4",
@@ -43,13 +45,23 @@
45
"express": "^4.17.0",
46
"express-handlebars": "^5.3.5",
47
"express-ws": "^4.0.0",
48
+ "image-size": "^1.0.1",
49
"ipcheck": "^0.1.0",
50
+ "loadavg-windows": "^1.1.1",
51
"minimist": "^1.2.5",
52
"multiparty": "^4.2.1",
49
- "@yetzt/nedb": "^1.8.0",
53
"node-forge": "^1.0.0",
54
+ "node-rdpjs-2": "^0.3.5",
55
+ "node-windows": "^0.1.4",
56
+ "nodemailer": "^6.7.2",
57
+ "otplib": "^10.2.3",
58
+ "pg": "^8.7.1",
59
+ "pgtools": "^0.3.2",
60
+ "ssh2": "^1.6.0",
61
+ "web-push": "^3.4.5",
62
"ws": "^5.2.3",
52
- "yauzl": "^2.10.0"
63
+ "yauzl": "^2.10.0",
64
+ "yubikeyotp": "^0.2.0"
65
},
66
"engines": {
67
"node": ">=10.0.0"
views/default.handlebars
+4
-1
@@ -4952,11 +4952,13 @@
4952
x += '<div id=emailInviteDiv style=display:none>' + format("Invite someone to install the mesh agent. An email with be sent with the link to the mesh agent installation for the \"{0}\" device group.", EscapeHtml(mesh.name)) + '<br /><br />';
4953
x += addHtmlValue("Name (optional)", '<input id=agentInviteName value="" style=width:230px maxlength=64 />');
4954
x += addHtmlValue("Email", '<input id=agentInviteEmail style=width:230px placeholder="' + "example@email.com" + '" onkeyup=validateAgentInvite()></input>');
4955
- x += addHtmlValue("Operating System", '<select id=agentInviteNameOs onchange=d2ChangedInviteType() style=width:236px><option value=4>' + "Send installation link" + '</option><option value=0 selected>' + "Any supported" + '</option><option value=1>' + "Windows only" + '</option><option value=3>' + "Apple macOS only" + '</option><option value=2>' + "Linux only" + '</option></select>');
4955
+ x += addHtmlValue("Operating System", '<select id=agentInviteNameOs onchange=d2ChangedInviteType() style=width:236px><option value=4>' + "Send installation link" + '</option><option value=0 selected>' + "Any supported" + '</option><option value=1>' + "Windows only" + '</option><option value=3>' + "Apple macOS only" + '</option><option value=2>' + "Linux only" + '</option><option value=5>' + "MeshCentral Assistant" + '</option></select>');
4956
x += '<div id=d2agentexpirediv>';
4957
x += addHtmlValue("Link Expiration", '<select id=agentInviteExpire style=width:236px><option value=1>' + "1 hour" + '</option><option value=8>' + "8 hours" + '</option><option value=24>' + "1 day" + '</option><option value=168>' + "1 week" + '</option><option value=5040>' + "1 month" + '</option><option value=0>' + "Unlimited" + '</option></select>');
4958
x += '</div>';
4959
+ x += '<div id=d2agentInstallTypeDiv2>';
4960
x += addHtmlValue("Installation Type", '<select id=agentInviteType style=width:236px><option value=0>' + "Background and interactive" + '</option><option value=2>' + "Background only" + '</option><option value=1>' + "Interactive only" + '</option></select>');
4961
+ x += '</div>';
4962
x += addHtmlValue("Message" + '<br />' + "(optional)", '<textarea id=agentInviteMessage value="" style=width:230px;height:100px;resize:none maxlength=1024 /></textarea>');
4963
x += '</div>';
4964
}
@@ -4981,6 +4983,7 @@
4983
if (features & 64) {
4984
QV('urlInviteDiv', Q('d2InviteType').value == 0);
4985
QV('d2agentexpirediv', Q('agentInviteNameOs').value == 4);
4986
+ QV('d2agentInstallTypeDiv2', Q('agentInviteNameOs').value < 2);
4987
QV('emailInviteDiv', Q('d2InviteType').value == 1);
4988
}
4989
QV('d2agentInstallTypeDiv', parseInt(Q('d2agentType').value) < 2);