Web-SSH link now only shows up when SSH is enabled.

Ylian Saint-Hilaire committed Apr 29, 2021 at 23:49 UTC ec1bea57b2db49eb4649577c91e33333050c51de
2 files changed +2 -1
views/default.handlebars
+1 -1
@@ -6457,7 +6457,7 @@
6457 }
6458
6459 // SSH link
6460 - if ((((connectivity & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((meshrights & 8) != 0) && ((features & 0x40000000) == 0) && (node.agent.id != 14)) {
6460 + if ((features2 & 0x200) && (((connectivity & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((meshrights & 8) != 0) && ((features & 0x40000000) == 0) && (node.agent.id != 14)) {
6461 x += '<a href=# id=sshLink onclick=p10ssh("' + node._id + '") title="' + "Launch web-based SSH session to this device" + '.">' + "Web-SSH" + '</a>&nbsp;';
6462 }
6463
webserver.js
+1
@@ -2623,6 +2623,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2623 if (((typeof domain.passwordrequirements != 'object') || (domain.passwordrequirements.push2factor != false)) && (obj.parent.firebase != null)) { features2 += 0x00000040; } // Indicates device push notification 2FA is enabled
2624 if ((typeof domain.passwordrequirements != 'object') || (domain.passwordrequirements.logintokens != false)) { features2 += 0x00000080; } // Indicates login tokens are allowed
2625 if (req.session.loginToken != null) { features2 += 0x00000100; } // LoginToken mode, no account changes.
2626 + if (domain.ssh == true) { features2 += 0x00000200; } // SSH is enabled
2627
2628 // Create a authentication cookie
2629 const authCookie = obj.parent.encodeCookie({ userid: dbGetFunc.user._id, domainid: domain.id, ip: req.clientIp }, obj.parent.loginCookieEncryptionKey);