From: Paul Donald Date: Wed, 31 Dec 2025 14:28:27 +0000 (+0100) Subject: luci-mod-system: extend dropbear listen options X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=37aa2807eaca83808b6a3d58645492e966e9c5fd;p=openwrt-luci.git luci-mod-system: extend dropbear listen options dropbear.init behaviours: Interface: For each interface, collect all its IPs, up to 10 endpoints total, and add `-p ` for each; if no interface was given, fall back to a plain `-p ` (listen on all interfaces and IPs). It binds to addresses, not the device. It collects all IPv4, and all IPv6 - ULA, but not LL - and binds to those. Ex: dropbear ... -p 192.168.1.1:22 -p 192.168.1.2:22 -p 192.168.1.3:22 ... DirectInterface: A single logical interface name; the first one is used (if multiple are given via `list`). Runs dropbear with `-l -p `, i.e., it binds directly to the layer 2 network device rather than specific IPs. Ex: dropbear ... -l br-lan -p 22 ... Closes openwrt/packages#25555 Closes #7484 Signed-off-by: Paul Donald --- diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js index 45b9994cc6..00acc920b9 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js @@ -17,8 +17,16 @@ return view.extend({ o = s.option(form.Flag, 'enable', _('Enable Instance'), _('Enable SSH service instance')); o.default = o.enabled; - o = s.option(widgets.NetworkSelect, 'Interface', _('Interface'), _('Listen only on the given interface or, if unspecified, on all')); - o.nocreate = true; + o = s.option(form.Flag, '_direct', _('Bind to Interface')); + o.default = o.disabled; + + o = s.option(widgets.NetworkSelect, 'DirectInterface', _('Interface'), _('Listen only on the given interface or, if unspecified, on all')); + o.nocreate = true; + o.depends('_direct', '1'); + + o = s.option(widgets.NetworkSelect, 'Interface', _('Interface'), _('Listen on up to 10 IPs on the given interface or, if unspecified, on all interfaces')); + o.nocreate = true; + o.depends('_direct', '0'); o = s.option(form.Value, 'Port', _('Port')); o.datatype = 'port';