luci-mod-system: extend dropbear listen options
authorPaul Donald <redacted>
Wed, 31 Dec 2025 14:28:27 +0000 (15:28 +0100)
committerPaul Donald <redacted>
Wed, 31 Dec 2025 14:28:27 +0000 (15:28 +0100)
dropbear.init behaviours:

Interface: For each interface, collect all its IPs,
up to 10 endpoints total, and add `-p <addr:port>` for
each; if no interface was given, fall back to a plain
`-p <port>` (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 <device> -p <port>`, 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 <redacted>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js

index 45b9994cc6f35f952f09a333df8a78652803a78c..00acc920b91a94ab6f64e1a3e6c0f53b35c0b24f 100644 (file)
@@ -17,8 +17,16 @@ return view.extend({
                o = s.option(form.Flag, 'enable', _('Enable Instance'), _('Enable <abbr title="Secure Shell">SSH</abbr> 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';
git clone https://git.99rst.org/PROJECT