Skip to content

Commit 70f10e8

Browse files
luci-app-upnp: Adapt to revised package UCI options
The following UI options have changed: - STUN server (`stun_host`): Allow port inclusion - STUN port: Removed, as now accepted in STUN server - Use STUN (`use_stun`): New option 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 (`upnp_igd_download`/`upnp_igd_upload`): 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/OpenWrt wrongly suggested 30x less in the past, and to reduce multicast traffic and power consumption in wireless networks, clearer help - Router/friendly name (`upnp_igd_friendly_name`): UI option added to set name displayed in windows explorer - 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/24988 Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
1 parent dc65d47 commit 70f10e8

File tree

1 file changed

+44
-29
lines changed
  • applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp

1 file changed

+44
-29
lines changed

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

Lines changed: 44 additions & 29 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',
@@ -144,36 +145,39 @@ return view.extend({
144145
o = s.taboption('setup', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol'));
145146
o.default = '1';
146147

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

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

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

161-
o = s.taboption('advanced', form.Value, 'stun_host', _('STUN host'));
167+
o = s.taboption('advanced', form.Value, 'stun_host', _('STUN server'));
162168
o.depends('use_stun', '1');
169+
o.depends('use_stun', 'allow-filtered');
163170
o.retain = true;
164-
o.datatype = 'host';
171+
o.datatype = 'or(hostname,hostport,ip4addr("nomask"))';
172+
o.placeholder = 'stun.nextcloud.com';
165173

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

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

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

@@ -196,35 +200,46 @@ return view.extend({
196200
o.retain = true;
197201

198202
o = s.taboption('igd-settings', form.Value, 'notify_interval', _('Notify interval'),
199-
_('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')
203+
_('A 900s interval results in %s announces with a minimum cache-control max-age header of 1800', 'A 900s interval results in %s (%s = SSDP) announces with a minimum cache-control max-age header of 1800')
200204
.format('<abbr title="Simple Service Discovery Protocol">SSDP</abbr>'));
201-
o.datatype = 'uinteger';
205+
o.datatype = 'min(900)';
202206
o.placeholder = '900';
203207
o.depends('enable_upnp', '1');
204208
o.retain = true;
205209

206-
o = s.taboption('igd-settings', form.Value, 'download', _('Download speed'),
207-
_('Report maximum download speed in kByte/s'));
210+
o = s.taboption('igd-settings', form.Value, 'upnp_igd_download', _('Download speed'),
211+
_('Report maximum link speed in kbit/s'));
208212
o.depends('enable_upnp', '1');
209213
o.retain = true;
214+
o.datatype = 'uinteger';
215+
o.placeholder = 'Default interface link speed';
210216

211-
o = s.taboption('igd-settings', form.Value, 'upload', _('Upload speed'),
212-
_('Report maximum upload speed in kByte/s'));
217+
o = s.taboption('igd-settings', form.Value, 'upnp_igd_upload', _('Upload speed'),
218+
_('Report maximum link speed in kbit/s'));
213219
o.depends('enable_upnp', '1');
214220
o.retain = true;
221+
o.datatype = 'uinteger';
222+
o.placeholder = 'Default interface link speed';
215223

216224
o = s.taboption('igd-settings', form.Value, 'presentation_url', _('Presentation URL'),
217225
_('Report custom router web interface (presentation) URL'));
218226
o.placeholder = 'http://192.168.1.1/';
219227
o.depends('enable_upnp', '1');
220228
o.retain = true;
221229

222-
o = s.taboption('igd-settings', form.Value, 'model_number', _('Announced model number'));
230+
o = s.taboption('igd-settings', form.Value, 'upnp_igd_friendly_name', _('Router/friendly name'));
223231
o.depends('enable_upnp', '1');
224232
o.retain = true;
233+
o.placeholder = 'OpenWrt router';
234+
235+
o = s.taboption('igd-settings', form.Value, 'model_number', _('Announced model number'));
236+
// o.depends('enable_upnp', '1');
237+
o.depends('to-disable-rarely-used', '1');
238+
o.retain = true;
225239

226240
o = s.taboption('igd-settings', form.Value, 'serial_number', _('Announced serial number'));
227-
o.depends('enable_upnp', '1');
241+
// o.depends('enable_upnp', '1');
242+
o.depends('to-disable-rarely-used', '1');
228243
o.retain = true;
229244

230245
o = s.taboption('igd-settings', form.Value, 'uuid', _('Device UUID'));
@@ -233,7 +248,7 @@ return view.extend({
233248
o.retain = true;
234249

235250
s = m.section(form.GridSection, 'perm_rule', _('Service Access Control List'),
236-
_('ACL specify which client addresses and ports can be mapped, IPv6 always allowed.'));
251+
_('The ACL specifies which client addresses and ports can be mapped. ACL denied with no entry. IPv6 is always allowed unless disabled.'));
237252
s.sortable = true;
238253
s.anonymous = true;
239254
s.addremove = true;

0 commit comments

Comments
 (0)