Added LoginKey support to MeshCmd
This commit is contained in:
parent
4e3b1dd9ba
commit
ba4b5f541d
|
@ -2120,6 +2120,7 @@ function startRouter() {
|
||||||
url += '?user=' + settings.username + '&pass=' + settings.password;
|
url += '?user=' + settings.username + '&pass=' + settings.password;
|
||||||
}
|
}
|
||||||
if (settings.emailtoken) { url += '&token=**email**'; } else if (settings.token != null) { url += '&token=' + settings.token; }
|
if (settings.emailtoken) { url += '&token=**email**'; } else if (settings.token != null) { url += '&token=' + settings.token; }
|
||||||
|
if (settings.loginkey) { url += '&key=' + settings.loginkey; }
|
||||||
options = http.parseUri(url);
|
options = http.parseUri(url);
|
||||||
} catch (e) { console.log("Unable to parse \"serverUrl\"."); process.exit(1); return; }
|
} catch (e) { console.log("Unable to parse \"serverUrl\"."); process.exit(1); return; }
|
||||||
options.checkServerIdentity = onVerifyServer;
|
options.checkServerIdentity = onVerifyServer;
|
||||||
|
|
|
@ -4233,6 +4233,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||||
debugLevel: 0
|
debugLevel: 0
|
||||||
};
|
};
|
||||||
if (user != null) { meshaction.username = user.name; }
|
if (user != null) { meshaction.username = user.name; }
|
||||||
|
if (req.query.key != null) { meshaction.loginKey = req.query.key; }
|
||||||
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
|
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
|
||||||
if (obj.args.lanonly != true) { meshaction.serverUrl = ((obj.args.notls == true) ? 'ws://' : 'wss://') + obj.getWebServerName(domain) + ':' + httpsPort + '/' + ((domain.id == '') ? '' : ('/' + domain.id)) + 'meshrelay.ashx'; }
|
if (obj.args.lanonly != true) { meshaction.serverUrl = ((obj.args.notls == true) ? 'ws://' : 'wss://') + obj.getWebServerName(domain) + ':' + httpsPort + '/' + ((domain.id == '') ? '' : ('/' + domain.id)) + 'meshrelay.ashx'; }
|
||||||
res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'text/plain', 'Content-Disposition': 'attachment; filename="meshaction.txt"' });
|
res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'text/plain', 'Content-Disposition': 'attachment; filename="meshaction.txt"' });
|
||||||
|
@ -4247,6 +4248,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||||
debugLevel: 0
|
debugLevel: 0
|
||||||
};
|
};
|
||||||
if (user != null) { meshaction.username = user.name; }
|
if (user != null) { meshaction.username = user.name; }
|
||||||
|
if (req.query.key != null) { meshaction.loginKey = req.query.key; }
|
||||||
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
|
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
|
||||||
if (obj.args.lanonly != true) { meshaction.serverUrl = ((obj.args.notls == true) ? 'ws://' : 'wss://') + obj.getWebServerName(domain) + ':' + httpsPort + '/' + ((domain.id == '') ? '' : ('/' + domain.id)) + 'meshrelay.ashx'; }
|
if (obj.args.lanonly != true) { meshaction.serverUrl = ((obj.args.notls == true) ? 'ws://' : 'wss://') + obj.getWebServerName(domain) + ':' + httpsPort + '/' + ((domain.id == '') ? '' : ('/' + domain.id)) + 'meshrelay.ashx'; }
|
||||||
res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'text/plain', 'Content-Disposition': 'attachment; filename="meshaction.txt"' });
|
res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'text/plain', 'Content-Disposition': 'attachment; filename="meshaction.txt"' });
|
||||||
|
|
Loading…
Reference in New Issue