Added Router and Assistant alternate path, #3988.
This commit is contained in:
parent
68c5aae0b0
commit
cee069d1df
|
@ -179,7 +179,7 @@
|
||||||
"status": [
|
"status": [
|
||||||
"PAS INSTALLÉ",
|
"PAS INSTALLÉ",
|
||||||
"FONCTIONNEMENT",
|
"FONCTIONNEMENT",
|
||||||
"NE PAS COURRIR"
|
"PAS EN FONCTIONNEMENT"
|
||||||
],
|
],
|
||||||
"statusDescription": "Statut actuel de l'agent",
|
"statusDescription": "Statut actuel de l'agent",
|
||||||
"agentVersion": "Nouvelle version",
|
"agentVersion": "Nouvelle version",
|
||||||
|
|
|
@ -2693,8 +2693,8 @@ function CreateMeshCentralServer(config, args) {
|
||||||
// List of possible mesh agent install scripts
|
// List of possible mesh agent install scripts
|
||||||
const meshToolsList = {
|
const meshToolsList = {
|
||||||
'MeshCentralRouter': { localname: 'MeshCentralRouter.exe', dlname: 'winrouter' },
|
'MeshCentralRouter': { localname: 'MeshCentralRouter.exe', dlname: 'winrouter' },
|
||||||
'MeshCentralAssistant': { localname: 'MeshCentralAssistant.exe', dlname: 'winassistant', winhash: true }
|
'MeshCentralAssistant': { localname: 'MeshCentralAssistant.exe', dlname: 'winassistant', winhash: true },
|
||||||
//'MeshCentralRouterMacOS': { localname: 'MeshCentralRouter.dmg', dlname: 'MeshCentralRouter.dmg' }
|
'MeshCentralRouterMacOS': { localname: 'MeshCentralRouter.dmg', dlname: 'MeshCentralRouter.dmg' }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update the list of available mesh agents
|
// Update the list of available mesh agents
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
24
webserver.js
24
webserver.js
|
@ -5115,21 +5115,27 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
||||||
// Download tools using a cookie
|
// Download tools using a cookie
|
||||||
if (c.download == req.query.meshaction) {
|
if (c.download == req.query.meshaction) {
|
||||||
if (req.query.meshaction == 'winrouter') {
|
if (req.query.meshaction == 'winrouter') {
|
||||||
var p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.exe');
|
var p = null;
|
||||||
|
if (obj.meshToolsBinaries['MeshCentralRouter']) { p = obj.meshToolsBinaries['MeshCentralRouter'].path; }
|
||||||
|
if ((p == null) || (!obj.fs.existsSync(p))) { p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.exe'); }
|
||||||
if (obj.fs.existsSync(p)) {
|
if (obj.fs.existsSync(p)) {
|
||||||
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.exe', null, 'MeshCentralRouter.exe');
|
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.exe', null, 'MeshCentralRouter.exe');
|
||||||
try { res.sendFile(p); } catch (ex) { }
|
try { res.sendFile(p); } catch (ex) { }
|
||||||
} else { try { res.sendStatus(404); } catch (ex) { } }
|
} else { try { res.sendStatus(404); } catch (ex) { } }
|
||||||
return;
|
return;
|
||||||
} else if (req.query.meshaction == 'winassistant') {
|
} else if (req.query.meshaction == 'winassistant') {
|
||||||
var p = obj.path.join(__dirname, 'agents', 'MeshCentralAssistant.exe');
|
var p = null;
|
||||||
|
if (obj.meshToolsBinaries['MeshCentralAssistant']) { p = obj.meshToolsBinaries['MeshCentralAssistant'].path; }
|
||||||
|
if ((p == null) || (!obj.fs.existsSync(p))) { p = obj.path.join(__dirname, 'agents', 'MeshCentralAssistant.exe'); }
|
||||||
if (obj.fs.existsSync(p)) {
|
if (obj.fs.existsSync(p)) {
|
||||||
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralAssistant.exe', null, 'MeshCentralAssistant.exe');
|
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralAssistant.exe', null, 'MeshCentralAssistant.exe');
|
||||||
try { res.sendFile(p); } catch (ex) { }
|
try { res.sendFile(p); } catch (ex) { }
|
||||||
} else { try { res.sendStatus(404); } catch (ex) { } }
|
} else { try { res.sendStatus(404); } catch (ex) { } }
|
||||||
return;
|
return;
|
||||||
} else if (req.query.meshaction == 'macrouter') {
|
} else if (req.query.meshaction == 'macrouter') {
|
||||||
var p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.dmg');
|
var p = null;
|
||||||
|
if (obj.meshToolsBinaries['MeshCentralRouterMacOS']) { p = obj.meshToolsBinaries['MeshCentralRouterMacOS'].path; }
|
||||||
|
if ((p == null) || (!obj.fs.existsSync(p))) { p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.dmg'); }
|
||||||
if (obj.fs.existsSync(p)) {
|
if (obj.fs.existsSync(p)) {
|
||||||
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.dmg', null, 'MeshCentralRouter.dmg');
|
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.dmg', null, 'MeshCentralRouter.dmg');
|
||||||
try { res.sendFile(p); } catch (ex) { }
|
try { res.sendFile(p); } catch (ex) { }
|
||||||
|
@ -5190,21 +5196,27 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
||||||
res.send(JSON.stringify(meshaction, null, ' '));
|
res.send(JSON.stringify(meshaction, null, ' '));
|
||||||
return;
|
return;
|
||||||
} else if (req.query.meshaction == 'winrouter') {
|
} else if (req.query.meshaction == 'winrouter') {
|
||||||
var p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.exe');
|
var p = null;
|
||||||
|
if (parent.meshToolsBinaries['MeshCentralRouter']) { p = parent.meshToolsBinaries['MeshCentralRouter'].path; }
|
||||||
|
if ((p == null) || !obj.fs.existsSync(p)) { p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.exe'); }
|
||||||
if (obj.fs.existsSync(p)) {
|
if (obj.fs.existsSync(p)) {
|
||||||
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.exe', null, 'MeshCentralRouter.exe');
|
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.exe', null, 'MeshCentralRouter.exe');
|
||||||
try { res.sendFile(p); } catch (ex) { }
|
try { res.sendFile(p); } catch (ex) { }
|
||||||
} else { try { res.sendStatus(404); } catch (ex) { } }
|
} else { try { res.sendStatus(404); } catch (ex) { } }
|
||||||
return;
|
return;
|
||||||
} else if (req.query.meshaction == 'winassistant') {
|
} else if (req.query.meshaction == 'winassistant') {
|
||||||
var p = obj.path.join(__dirname, 'agents', 'MeshCentralAssistant.exe');
|
var p = null;
|
||||||
|
if (parent.meshToolsBinaries['MeshCentralAssistant']) { p = parent.meshToolsBinaries['MeshCentralAssistant'].path; }
|
||||||
|
if ((p == null) || !obj.fs.existsSync(p)) { p = obj.path.join(__dirname, 'agents', 'MeshCentralAssistant.exe'); }
|
||||||
if (obj.fs.existsSync(p)) {
|
if (obj.fs.existsSync(p)) {
|
||||||
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralAssistant.exe', null, 'MeshCentralAssistant.exe');
|
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralAssistant.exe', null, 'MeshCentralAssistant.exe');
|
||||||
try { res.sendFile(p); } catch (ex) { }
|
try { res.sendFile(p); } catch (ex) { }
|
||||||
} else { try { res.sendStatus(404); } catch (ex) { } }
|
} else { try { res.sendStatus(404); } catch (ex) { } }
|
||||||
return;
|
return;
|
||||||
} else if (req.query.meshaction == 'macrouter') {
|
} else if (req.query.meshaction == 'macrouter') {
|
||||||
var p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.dmg');
|
var p = null;
|
||||||
|
if (parent.meshToolsBinaries['MeshCentralRouterMacOS']) { p = parent.meshToolsBinaries['MeshCentralRouterMacOS'].path; }
|
||||||
|
if ((p == null) || !obj.fs.existsSync(p)) { p = obj.path.join(__dirname, 'agents', 'MeshCentralRouter.dmg'); }
|
||||||
if (obj.fs.existsSync(p)) {
|
if (obj.fs.existsSync(p)) {
|
||||||
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.dmg', null, 'MeshCentralRouter.dmg');
|
setContentDispositionHeader(res, 'application/octet-stream', 'MeshCentralRouter.dmg', null, 'MeshCentralRouter.dmg');
|
||||||
try { res.sendFile(p); } catch (ex) { }
|
try { res.sendFile(p); } catch (ex) { }
|
||||||
|
|
Loading…
Reference in New Issue