diff --git a/htdocs/luci-static/resources/view/homeproxy/node.js b/htdocs/luci-static/resources/view/homeproxy/node.js index 7f278461..3067d30b 100644 --- a/htdocs/luci-static/resources/view/homeproxy/node.js +++ b/htdocs/luci-static/resources/view/homeproxy/node.js @@ -515,6 +515,7 @@ return view.extend({ so.value('shadowsocks', _('Shadowsocks')); so.value('shadowtls', _('ShadowTLS')); so.value('socks', _('Socks')); + so.value('ssh', _('SSH')); so.value('trojan', _('Trojan')); if (features.with_quic) so.value('tuic', _('Tuic')); @@ -537,6 +538,7 @@ return view.extend({ so = ss.option(form.Value, 'username', _('Username')); so.depends('type', 'http'); so.depends('type', 'socks'); + so.depends('type', 'ssh'); so.modalonly = true; so = ss.option(form.Value, 'password', _('Password')); @@ -544,6 +546,7 @@ return view.extend({ so.depends('type', 'http'); so.depends('type', 'hysteria2'); so.depends('type', 'shadowsocks'); + so.depends('type', 'ssh'); so.depends('type', 'trojan'); so.depends('type', 'tuic'); so.depends({'type': 'shadowtls', 'shadowtls_version': '2'}); @@ -704,6 +707,32 @@ return view.extend({ so.rmempty = false; so.modalonly = true; + /* SSH config start */ + so = ss.option(form.Value, 'ssh_client_version', _('Client version'), + _('Random version will be used if empty.')); + so.depends('type', 'ssh'); + so.modalonly = true; + + so = ss.option(form.DynamicList, 'ssh_host_key', _('Host key'), + _('Accept any if empty.')); + so.depends('type', 'ssh'); + so.modalonly = true; + + so = ss.option(form.DynamicList, 'ssh_host_key_algo', _('Host key algorithms')) + so.depends('type', 'ssh'); + so.modalonly = true; + + so = ss.option(form.Value, 'ssh_priv_key', _('Private key')); + so.password = true; + so.depends('type', 'ssh'); + so.modalonly = true; + + so = ss.option(form.Value, 'ssh_priv_key_pp', _('Private key passphrase')); + so.password = true; + so.depends('type', 'ssh'); + so.modalonly = true; + /* SSH config end */ + /* TUIC config start */ so = ss.option(form.Value, 'uuid', _('UUID')); so.depends('type', 'tuic'); diff --git a/root/etc/homeproxy/scripts/generate_client.uc b/root/etc/homeproxy/scripts/generate_client.uc index 196cb220..c40b2adc 100755 --- a/root/etc/homeproxy/scripts/generate_client.uc +++ b/root/etc/homeproxy/scripts/generate_client.uc @@ -127,7 +127,8 @@ function generate_outbound(node) { server: node.address, server_port: strToInt(node.port), - username: node.username, + username: (node.type !== 'ssh') ? node.username : null, + user: (node.tpye === 'ssh') ? node.username : null, password: node.password, /* Direct */ @@ -151,6 +152,12 @@ function generate_outbound(node) { plugin_opts: node.shadowsocks_plugin_opts, /* ShadowTLS / Socks */ version: (node.type === 'shadowtls') ? strToInt(node.shadowtls_version) : ((node.type === 'socks') ? node.socks_version : null), + /* SSH */ + client_version: node.ssh_client_version, + host_key: node.ssh_host_key, + host_key_algorithms: node.ssh_host_key_algo, + private_key: node.ssh_priv_key, + private_key_passphrase: node.ssh_priv_key_pp, /* Tuic */ uuid: node.uuid, congestion_control: node.tuic_congestion_control,