Skip to content

Commit 56657b2

Browse files
luci-app-upnp: Adapt to revised package UCI options
The following UI options have changed: - STUN server (`stun_host`): Accepting port - STUN port: Removed, as now accepted in STUN server - Use STUN for CGNATs (`use_stun`): New options for IPv4 CGNAT use, and updated help with newer wording of RFC 5780 - Override public IPv4 (`external_ip`): UI option added - Allow third-party mapping (`allow_third_party_mapping`): Inverted from secure mode and extended to PCP - Download/upload speed (`download_kbps`/`upload_kbps`): In kbit/s and datatype set - UPnP IGD compatibility mode (`upnp_igd_compat`): As extensible list - Enable PCP/NAT-PMP protocols (`enable_pcp_natpmp`): UCI option renamed - Set `notify_interval` minimum to 900s (default), as recommended by [UDA 1.1] (2x=1800 in the standard), because daemon erroneously suggested 30x less in the past, and to reduce multicast traffic and power consumption in wireless networks, clearer help - ACL: Update help for new ACL denied with no entry as default [UDA 1.1]: https://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf#page=30 More details on changed options can be found in the dependent package PR Depends on https://redirect.github.com/openwrt/packages/pull/26793 Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
1 parent c791014 commit 56657b2

File tree

1 file changed

+35
-27
lines changed
  • applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp

1 file changed

+35
-27
lines changed

applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'require uci';
66
'require rpc';
77
'require form';
8+
'require tools.widgets as widgets';
89

910
const callInitAction = rpc.declare({
1011
object: 'luci',
@@ -143,36 +144,39 @@ return view.extend({
143144
o = s.taboption('setup', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol'));
144145
o.default = '1';
145146

146-
o = s.taboption('setup', form.Flag, 'enable_natpmp', _('Enable PCP/NAT-PMP protocols'));
147+
o = s.taboption('setup', form.Flag, 'enable_pcp_natpmp', _('Enable PCP/NAT-PMP protocols'));
147148
o.default = '1';
148149

149-
o = s.taboption('setup', form.Flag, 'igdv1', _('UPnP IGDv1 compatibility mode'),
150-
_('Advertise as IGDv1 (IPv4 only) device instead of IGDv2'));
151-
o.default = '1';
152-
o.rmempty = false;
150+
o = s.taboption('setup', form.ListValue, 'upnp_igd_compat', _('UPnP IGD compatibility mode'),
151+
_('Act/emulate as specific/different device to workaround/support/handle/bypass/assist/mitigate IGDv2 incompatible clients'));
152+
o.value('igdv1', _('IGDv1 (IPv4 only)'));
153+
o.value('igdv2', _('IGDv2'));
154+
o.default = 'igdv1';
153155
o.depends('enable_upnp', '1');
154156
o.retain = true;
155157

156-
s.taboption('advanced', form.Flag, 'use_stun', _('Use %s', 'Use %s (%s = STUN)')
157-
.format('<a href="https://en.wikipedia.org/wiki/STUN" target="_blank" rel="noreferrer"><abbr title="Session Traversal Utilities for NAT">STUN</abbr></a>'),
158-
_('To detect the public IPv4 address for unrestricted full-cone/one-to-one NATs'));
158+
o = s.taboption('advanced', form.RichListValue, 'use_stun', _('Use %s for CGNATs', 'Use %s (%s = STUN) for CGNATs')
159+
.format('<a href="https://en.wikipedia.org/wiki/STUN" target="_blank" rel="noreferrer"><abbr title="Session Traversal Utilities for NAT">STUN</abbr></a>'),
160+
_('Enable unrestricted endpoint-independent (1:1) CGNATs and detect public IPv4'));
161+
o.value('0', _('Disabled'));
162+
o.value('1', _('Enabled'), _('Test requires currently an additional firewall rule'));
163+
o.value('allow-filtered', _('Enabled (allow filtered)'), _('Allow filtered CGNAT test result'));
164+
o.default = '0';
159165

160-
o = s.taboption('advanced', form.Value, 'stun_host', _('STUN host'));
166+
o = s.taboption('advanced', form.Value, 'stun_host', _('STUN server'));
161167
o.depends('use_stun', '1');
168+
o.depends('use_stun', 'allow-filtered');
162169
o.retain = true;
163-
o.datatype = 'host';
170+
o.datatype = 'or(hostname,hostport,ip4addr("nomask"))';
171+
o.placeholder = 'stun.nextcloud.com';
164172

165-
o = s.taboption('advanced', form.Value, 'stun_port', _('STUN port'));
166-
o.depends('use_stun', '1');
167-
o.retain = true;
168-
o.datatype = 'port';
169-
o.placeholder = '3478';
173+
o = s.taboption('advanced', form.Value, 'external_ip', _('Override public IPv4'),
174+
_('Manually set reported public/external (WAN) IPv4 address'));
175+
o.depends('use_stun', '0');
176+
o.datatype = 'ip4addr("nomask")';
170177

171-
o = s.taboption('advanced', form.Flag, 'secure_mode', _('Enable secure mode'),
172-
_('Allow adding port maps for requesting IP addresses only'));
173-
o.default = '1';
174-
o.depends('enable_upnp', '1');
175-
o.retain = true;
178+
o = s.taboption('advanced', form.Flag, 'allow_third_party_mapping', _('Allow third-party mapping'),
179+
_('Allow adding port maps for non-requesting IP addresses'));
176180

177181
s.taboption('advanced', form.Flag, 'ipv6_disable', _('Disable IPv6 mapping'));
178182

@@ -190,22 +194,26 @@ return view.extend({
190194
o.retain = true;
191195

192196
o = s.taboption('igd-settings', form.Value, 'notify_interval', _('Notify interval'),
193-
_('A 900s interval will result in %s notifications with the minimum max-age of 1800s', 'A 900s interval will result in %s (%s = SSDP) notifications with the minimum max-age of 1800s')
197+
_('A 900s interval results in %s announces with a minimum cache-control max-age of 1800', 'A 900s interval results in %s (%s = SSDP) announces with a minimum cache-control max-age of 1800')
194198
.format('<abbr title="Simple Service Discovery Protocol">SSDP</abbr>'));
195-
o.datatype = 'uinteger';
199+
o.datatype = 'min(900)';
196200
o.placeholder = '900';
197201
o.depends('enable_upnp', '1');
198202
o.retain = true;
199203

200-
o = s.taboption('igd-settings', form.Value, 'download', _('Download speed'),
201-
_('Report maximum download speed in kByte/s'));
204+
o = s.taboption('igd-settings', form.Value, 'download_kbps', _('Download speed'),
205+
_('Report maximum link speed in kbit/s'));
202206
o.depends('enable_upnp', '1');
203207
o.retain = true;
208+
o.datatype = 'uinteger';
209+
o.placeholder = 'Default interface link speed';
204210

205-
o = s.taboption('igd-settings', form.Value, 'upload', _('Upload speed'),
206-
_('Report maximum upload speed in kByte/s'));
211+
o = s.taboption('igd-settings', form.Value, 'upload_kbps', _('Upload speed'),
212+
_('Report maximum link speed in kbit/s'));
207213
o.depends('enable_upnp', '1');
208214
o.retain = true;
215+
o.datatype = 'uinteger';
216+
o.placeholder = 'Default interface link speed';
209217

210218
o = s.taboption('igd-settings', form.Value, 'presentation_url', _('Presentation URL'),
211219
_('Report custom router web interface (presentation) URL'));
@@ -232,7 +240,7 @@ return view.extend({
232240
o.retain = true;
233241

234242
s = m.section(form.GridSection, 'perm_rule', _('Service Access Control List'),
235-
_('ACL specify which client addresses and ports can be mapped, IPv6 always allowed.'));
243+
_('The ACL specifies which client addresses and ports can be mapped. ACL denied with no entry. IPv6 is always allowed unless disabled.'));
236244
s.sortable = true;
237245
s.anonymous = true;
238246
s.addremove = true;

0 commit comments

Comments
 (0)