From 97c5ac5bfbd4f6c71b94dba37f9687617647c940 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Thu, 21 Dec 2023 03:33:37 +0200 Subject: [PATCH] luci-app-sshtunnel: servers: make a link to man ssh_config Use Debian man pages because it has many versions and languages. Signed-off-by: Sergey Ponomarev (cherry picked from commit 059850ba0cb4afbd0c4434f0ef4825326b7baa2f) --- .../resources/view/sshtunnel/ssh_servers.js | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/applications/luci-app-sshtunnel/htdocs/luci-static/resources/view/sshtunnel/ssh_servers.js b/applications/luci-app-sshtunnel/htdocs/luci-static/resources/view/sshtunnel/ssh_servers.js index 30b1b4fb30..74182c5cca 100644 --- a/applications/luci-app-sshtunnel/htdocs/luci-static/resources/view/sshtunnel/ssh_servers.js +++ b/applications/luci-app-sshtunnel/htdocs/luci-static/resources/view/sshtunnel/ssh_servers.js @@ -46,9 +46,12 @@ return view.extend({ o = s.taboption('general', form.Value, 'user', _('User')); o.default = 'root'; - o = s.taboption('general', form.ListValue, 'IdentityFile', _('Key file'), - _('Private key file with authentication identity. ' + - 'See ssh_config IdentityFile') + o = s.taboption('general', form.ListValue, 'IdentityFile', _('Identity Key'), + _('Private key file with authentication identity.') + '
' + + _('If not specified then a default will be used.') + '
' + + _('For Dropbear %s').format('id_dropbear') + '
' + + _('For OpenSSH %s').format('id_rsa, id_ed25519, id_ecdsa') + + _manSshConfig('IdentityFile') ); o.value(''); for (var sshKeyName of sshKeyNames) { @@ -57,7 +60,7 @@ return view.extend({ o.optional = true; - o = s.taboption('advanced', form.ListValue, 'LogLevel', _('Log level'), 'See ssh_config LogLevel'); + o = s.taboption('advanced', form.ListValue, 'LogLevel', _('Log level')); o.value('QUIET', 'QUIET'); o.value('FATAL', 'FATAL'); o.value('ERROR', 'ERROR'); @@ -70,8 +73,8 @@ return view.extend({ o.modalonly = true; o = s.taboption('advanced', form.ListValue, 'Compression', _('Use compression'), - _('Compression may be useful on slow connections. ' + - 'See ssh_config Compression') + _('Compression may be useful on slow connections.') + + _manSshConfig('Compression') ); o.value('yes', _('Yes')); o.value('no', _('No')); @@ -87,18 +90,17 @@ return view.extend({ o.optional = true; o.modalonly = true; - o = s.taboption('advanced', form.Value, 'ServerAliveCountMax', _('Server alive count max'), - _('The number of server alive messages which may be sent before SSH disconnects from the server. ' + - 'See ssh_config ServerAliveCountMax') + o = s.taboption('advanced', form.Value, 'ServerAliveCountMax', _('Server keep alive attempts'), + _('The number of server alive messages which may be sent before SSH disconnects from the server.') + + _manSshConfig('ServerAliveCountMax') ); o.placeholder = '3'; o.datatype = 'uinteger'; o.optional = true; o.modalonly = true; - o = s.taboption('advanced', form.Value, 'ServerAliveInterval', _('Server alive interval'), - _('Keep-alive interval (seconds). ' + - 'See ssh_config ServerAliveInterval') + o = s.taboption('advanced', form.Value, 'ServerAliveInterval', _('Server keep alive interval (seconds)'), + _manSshConfig('ServerAliveInterval') ); o.optional = true; o.default = '60'; @@ -106,9 +108,9 @@ return view.extend({ o.modalonly = true; o = s.taboption('advanced', form.ListValue, 'CheckHostIP', _('Check host IP'), - _('Check the host IP address in the known_hosts file. ' + - 'This allows ssh to detect whether a host key changed due to DNS spoofing. ' + - 'See ssh_config CheckHostIP') + _('Check the host IP address in the %s file.').format('known_hosts') + '
' + + _('This allows SSH to detect whether a host key changed due to DNS spoofing.') + + _manSshConfig('CheckHostIP') ); o.value('yes', _('Yes')); o.value('no', _('No')); @@ -116,8 +118,9 @@ return view.extend({ o.modalonly = true; o = s.taboption('advanced', form.ListValue, 'StrictHostKeyChecking', _('Strict host key checking'), - _('Refuse to connect to hosts whose host key has changed. ' + - 'See ssh_config StrictHostKeyChecking')); + _('Refuse to connect to hosts whose host key has changed.') + + _manSshConfig('StrictHostKeyChecking') + ); o.value('accept-new', _('Accept new and check if not changed')); o.value('yes', _('Yes')); o.value('no', _('No')); @@ -149,3 +152,9 @@ function _findAllPossibleIdKeys(entries) { } return Array.from(sshKeyNames); } + +function _manSshConfig(opt) { + return '
' + _('See %s.') + .format('ssh_config ' + opt + ''); +} + -- 2.30.2