MeshCMD fixes.
Ylian Saint-Hilaire committed
Jun 21, 2019 at 17:42 UTC
0d2efd47ea117c5e47a772fff17eaec8155af020
6 files changed
+21
-27
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
agents/meshcmd.js
+7
-10
@@ -112,7 +112,7 @@ function run(argv) {
112
if ((typeof args.remotenodeid) == 'string') { settings.remotenodeid = args.remotenodeid; }
113
if ((typeof args.username) == 'string') { settings.username = args.username; }
114
if ((typeof args.password) == 'string') { settings.password = args.password; }
115
- if ((typeof args.wss) == 'string') { settings.wss = args.wss; }
115
+ if ((typeof args.url) == 'string') { settings.url = args.url; }
116
if ((typeof args.profile) == 'string') { settings.profile = args.profile; }
117
if ((typeof args.type) == 'string') { settings.type = args.type; }
118
if ((typeof args.user) == 'string') { settings.username = args.user; }
@@ -205,10 +205,10 @@ function run(argv) {
205
} else if (action == 'amtccm') {
206
console.log('AmtCCM will attempt to activate Intel AMT on this computer into client control mode (CCM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work and a administrator password must be provided. Example usage:\r\n\r\n meshcmd amtccm --pass mypassword');
207
} else if (action == 'amtacm') {
208
- console.log('AmtACM will attempt to activate Intel AMT on this computer into admin control mode (ACM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work and a administrator password and provisioning certificate must be provided via RCS. Example usage:\r\n\r\n meshcmd amtacm --wss servername:port');
208
+ console.log('AmtACM will attempt to activate Intel AMT on this computer into admin control mode (ACM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work. Example usage:\r\n\r\n meshcmd amtacm --url [url]');
209
console.log('\r\nPossible arguments:\r\n');
210
- console.log(' --wss [server:port] The address of the AMT remote configuration server.');
211
- console.log(' --profile [name] The name of the AMT profile stored on the AMT remote configuration server.');
210
+ console.log(' --url wss://server/ The address of the Intel AMT activation server.');
211
+ console.log(' --profile [name] Optional name of the Intel AMT profile stored on the activation server.');
212
} else if (action == 'amtdeactivate') {
213
console.log('AmtDeactivate will attempt to deactivate Intel AMT on this computer when in client control mode (CCM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be activated in client control mode for this command to work. Example usage:\r\n\r\n meshcmd amtdeactivate');
214
} else if (action == 'amtacmdeactivate') {
@@ -498,11 +498,8 @@ function run(argv) {
498
activeToCCM();
499
} else if (settings.action == 'amtacm') {
500
// Start activation to ACM
501
- if ((settings.wss == null) || (typeof settings.wss != 'string') || (settings.wss == '')) { console.log('No server URL specified, use --wss [url].'); exit(1); return; }
502
- //if ((settings.profile == null) || (typeof settings.profile != 'string') || (settings.profile == '')) { console.log('No or invalid \"profile name\" specified, use --profile [name].'); exit(1); return; }
501
+ if ((settings.url == null) || (typeof settings.url != 'string') || (settings.url == '')) { console.log('No activation server URL specified, use --url [url].'); exit(1); return; }
502
if ((typeof settings.profile != 'string') || (settings.profile == '')) { settings.profile = null; }
504
- //settings.protocol = 'http:';
505
- settings.localport = 16992;
503
debug(1, "Settings: " + JSON.stringify(settings));
504
activeToACM();
505
} else if (settings.action == 'amtdeactivate') {
@@ -926,10 +923,10 @@ function activeToACMEx(fwNonce, dnsSuffix, digestRealm, uuid) {
923
console.log('UUID: ' + uuid);
924
console.log('Realm: ' + digestRealm);
925
console.log('Nonce: ' + fwNonce);
929
- console.log('Connecting to ' + settings.wss);
926
+ console.log('Connecting to ' + settings.url);
927
928
// Establish WebSocket connection to activation server
932
- var options = http.parseUri(settings.wss);
929
+ var options = http.parseUri(settings.url);
930
options.checkServerIdentity = function (clientName, certs) { }; // TODO
931
options.rejectUnauthorized = false;
932
var connection = http.request(options);
agents/meshcmd.min.js
+7
-10
@@ -112,7 +112,7 @@ function run(argv) {
112
if ((typeof args.remotenodeid) == 'string') { settings.remotenodeid = args.remotenodeid; }
113
if ((typeof args.username) == 'string') { settings.username = args.username; }
114
if ((typeof args.password) == 'string') { settings.password = args.password; }
115
- if ((typeof args.wss) == 'string') { settings.wss = args.wss; }
115
+ if ((typeof args.url) == 'string') { settings.url = args.url; }
116
if ((typeof args.profile) == 'string') { settings.profile = args.profile; }
117
if ((typeof args.type) == 'string') { settings.type = args.type; }
118
if ((typeof args.user) == 'string') { settings.username = args.user; }
@@ -205,10 +205,10 @@ function run(argv) {
205
} else if (action == 'amtccm') {
206
console.log('AmtCCM will attempt to activate Intel AMT on this computer into client control mode (CCM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work and a administrator password must be provided. Example usage:\r\n\r\n meshcmd amtccm --pass mypassword');
207
} else if (action == 'amtacm') {
208
- console.log('AmtACM will attempt to activate Intel AMT on this computer into admin control mode (ACM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work and a administrator password and provisioning certificate must be provided via RCS. Example usage:\r\n\r\n meshcmd amtacm --wss servername:port');
208
+ console.log('AmtACM will attempt to activate Intel AMT on this computer into admin control mode (ACM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work. Example usage:\r\n\r\n meshcmd amtacm --url [url]');
209
console.log('\r\nPossible arguments:\r\n');
210
- console.log(' --wss [server:port] The address of the AMT remote configuration server.');
211
- console.log(' --profile [name] The name of the AMT profile stored on the AMT remote configuration server.');
210
+ console.log(' --url wss://server/ The address of the Intel AMT activation server.');
211
+ console.log(' --profile [name] Optional name of the Intel AMT profile stored on the activation server.');
212
} else if (action == 'amtdeactivate') {
213
console.log('AmtDeactivate will attempt to deactivate Intel AMT on this computer when in client control mode (CCM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be activated in client control mode for this command to work. Example usage:\r\n\r\n meshcmd amtdeactivate');
214
} else if (action == 'amtacmdeactivate') {
@@ -498,11 +498,8 @@ function run(argv) {
498
activeToCCM();
499
} else if (settings.action == 'amtacm') {
500
// Start activation to ACM
501
- if ((settings.wss == null) || (typeof settings.wss != 'string') || (settings.wss == '')) { console.log('No server URL specified, use --wss [url].'); exit(1); return; }
502
- //if ((settings.profile == null) || (typeof settings.profile != 'string') || (settings.profile == '')) { console.log('No or invalid \"profile name\" specified, use --profile [name].'); exit(1); return; }
501
+ if ((settings.url == null) || (typeof settings.url != 'string') || (settings.url == '')) { console.log('No activation server URL specified, use --url [url].'); exit(1); return; }
502
if ((typeof settings.profile != 'string') || (settings.profile == '')) { settings.profile = null; }
504
- //settings.protocol = 'http:';
505
- settings.localport = 16992;
503
debug(1, "Settings: " + JSON.stringify(settings));
504
activeToACM();
505
} else if (settings.action == 'amtdeactivate') {
@@ -926,10 +923,10 @@ function activeToACMEx(fwNonce, dnsSuffix, digestRealm, uuid) {
923
console.log('UUID: ' + uuid);
924
console.log('Realm: ' + digestRealm);
925
console.log('Nonce: ' + fwNonce);
929
- console.log('Connecting to ' + settings.wss);
926
+ console.log('Connecting to ' + settings.url);
927
928
// Establish WebSocket connection to activation server
932
- var options = http.parseUri(settings.wss);
929
+ var options = http.parseUri(settings.url);
930
options.checkServerIdentity = function (clientName, certs) { }; // TODO
931
options.rejectUnauthorized = false;
932
var connection = http.request(options);
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.3.6-u",
3
+ "version": "0.3.6-v",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
views/default-min.handlebars
+6
-6
@@ -8821,8 +8821,8 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
8821
// Windows agent install
8822
//x += "<div id=agins_windows>To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and configuration file and install the agent on the computer to manage.<br /><br />";
8823
x += "<div id=agins_windows>To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and install it the computer to manage. This agent has server and device group information embedded within it.<br /><br />";
8824
- x += addHtmlValue('Mesh Agent', '<a id=aginsw32lnk href="meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=0" download title="32bit version of the MeshAgent">Windows (.exe)</a>');
8825
- x += addHtmlValue('Mesh Agent', '<a id=aginsw64lnk href="meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=0" download title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
8824
+ x += addHtmlValue('Mesh Agent', '<a id=aginsw32lnk href="meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=0" download onclick="setDialogMode(0)" title="32bit version of the MeshAgent">Windows (.exe)</a>');
8825
+ x += addHtmlValue('Mesh Agent', '<a id=aginsw64lnk href="meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=0" download onclick="setDialogMode(0)" title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
8826
if (debugmode > 0) { x += addHtmlValue('Settings File', '<a id=aginswmshlnk href="meshsettings?id=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank">' + EscapeHtml(mesh.name) + ' settings (.msh)</a>'); }
8827
x += "</div>";
8828
@@ -8838,8 +8838,8 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
8838
8839
// Windows agent uninstall
8840
x += "<div id=agins_windows_un style=display:none>To remove a mesh agent, download the file below, run it and click \"uninstall\".<br /><br />";
8841
- x += addHtmlValue('Mesh Agent', '<a href="meshagents?id=3" download title="32bit version of the MeshAgent">Windows (.exe)</a>');
8842
- x += addHtmlValue('Mesh Agent', '<a href="meshagents?id=4" download title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
8841
+ x += addHtmlValue('Mesh Agent', '<a href="meshagents?id=3" download onclick="setDialogMode(0)" title="32bit version of the MeshAgent">Windows (.exe)</a>');
8842
+ x += addHtmlValue('Mesh Agent', '<a href="meshagents?id=4" download onclick="setDialogMode(0)" title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
8843
x += "</div>";
8844
8845
// Linux agent uninstall
@@ -10161,7 +10161,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
10161
++count;
10162
date = new Date(date.getTime() - (1000 * 60 * 60 * 24)); // Substract one day
10163
}
10164
- QH('p10html2', '<table cellpadding=2 cellspacing=0><thead><tr style=><th scope=col style=text-align:center;width:150px>Day</th><th scope=col style=text-align:center><a download href="devicepowerevents.ashx?id=' + currentNode._id + '"><img title="Download power events" src="images/link4.png" /></a>7 Day Power State</th></tr></thead><tbody>' + x + '</tbody></table>');
10164
+ QH('p10html2', '<table cellpadding=2 cellspacing=0><thead><tr style=><th scope=col style=text-align:center;width:150px>Day</th><th scope=col style=text-align:center><a download href="devicepowerevents.ashx?id=' + currentNode._id + '" onclick="setDialogMode(0)"><img title="Download power events" src="images/link4.png" /></a>7 Day Power State</th></tr></thead><tbody>' + x + '</tbody></table>');
10165
}
10166
10167
// Return a color for the given power state
@@ -10316,7 +10316,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
10316
function p10showMeshRouterDialog() {
10317
if (xxdialogMode) return;
10318
var x = "<div>MeshCentral Router is a Windows tool for TCP port mapping. You can, for example, RDP into a remote device thru this server.</div><br />";
10319
- x += addHtmlValue('Win32 Executable', '<a style=cursor:pointer download href="meshagents?meshaction=winrouter">MeshCentralRouter.exe</a>');
10319
+ x += addHtmlValue('Win32 Executable', '<a style=cursor:pointer download href="meshagents?meshaction=winrouter" onclick="setDialogMode(0)">MeshCentralRouter.exe</a>');
10320
setDialogMode(2, "MeshCentral Router", 1, null, x, "fileDownload");
10321
}
10322