Skip to content

Commit

Permalink
luci-app-upnp: Update plugin title/menu to include PCP as supported
Browse files Browse the repository at this point in the history
as well and revise the wording and remove redundancies.
- Mention `UPnP IGD` as `UPnP` is probably not specific enough
- Include current wording in `LUCI_TITLE` for easy finding

Updated title: `UPnP IGD & PCP/NAT-PMP Service`
Current title: `Universal Plug & Play`
Updated menu option: `UPnP IGD & PCP/NAT-PMP`
Current menu option: `UPnP`
Updated wording: `port forwards` (used in Network -> Firewall)
Current wording: `redirects`

Port Control Protocol (PCP) is the successor to NAT-PMP and has similar
protocol concepts and packet formats, but adds IPv6 support.
PCP standard:
https://datatracker.ietf.org/doc/html/rfc6887
https://en.wikipedia.org/wiki/Port_Control_Protocol
NAT-PMP std. (see 9.1 Simplicity - 9.3 for some diff. to UPnP IGD):
https://datatracker.ietf.org/doc/html/rfc6886

Signed-off-by: Self-Hosting-Group <155233284+Self-Hosting-Group@users.noreply.github.com>
  • Loading branch information
Self-Hosting-Group committed Jan 31, 2024
1 parent 3e0f119 commit 1b54f4b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion applications/luci-app-upnp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

include $(TOPDIR)/rules.mk

LUCI_TITLE:=Universal Plug & Play configuration module
LUCI_TITLE:=Universal Plug and Play (UPnP IGD & PCP/NAT-PMP) configuration module
LUCI_DEPENDS:=+luci-base +miniupnpd +rpcd-mod-ucode

include ../../luci.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ handleDelRule = function(num, ev) {
};

return baseclass.extend({
title: _('Active UPnP Redirects'),
title: _('Active UPnP IGD & PCP/NAT-PMP Port Forwards'),

load: function() {
return Promise.all([
Expand Down Expand Up @@ -67,7 +67,7 @@ return baseclass.extend({
];
});

cbi_update_table(table, rows, E('em', _('There are no active redirects.')));
cbi_update_table(table, rows, E('em', _('There are no active port forwards.')));

return table;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ return view.extend({
];
});

cbi_update_table(nodes.querySelector('#upnp_status_table'), rows, E('em', _('There are no active redirects.')));
cbi_update_table(nodes.querySelector('#upnp_status_table'), rows, E('em', _('There are no active port forwards.')));

return;
},
Expand All @@ -72,8 +72,8 @@ return view.extend({

var m, s, o;

m = new form.Map('upnpd', [_('Universal Plug & Play')],
_('UPnP allows clients in the local network to automatically configure the router.'));
m = new form.Map('upnpd', [_('UPnP IGD & PCP/NAT-PMP Service')],
_('UPnP IGD & PCP/NAT-PMP allows clients on the local network to automatically configure port forwards on the router. Also known as Universal Plug and Play.'));

s = m.section(form.GridSection, '_active_rules');

Expand Down Expand Up @@ -107,27 +107,27 @@ return view.extend({
];
});

cbi_update_table(table, rows, E('em', _('There are no active redirects.')));
cbi_update_table(table, rows, E('em', _('There are no active port forwards.')));

return E('div', { 'class': 'cbi-section cbi-tblsection' }, [
E('h3', _('Active UPnP Redirects')), table ]);
E('h3', _('Active Service Port Forwards')), table ]);
}, o, this);

s = m.section(form.NamedSection, 'config', 'upnpd', _('MiniUPnP settings'));
s = m.section(form.NamedSection, 'config', 'upnpd', _('Service Settings'));
s.addremove = false;
s.tab('general', _('General Settings'));
s.tab('advanced', _('Advanced Settings'));

o = s.taboption('general', form.Flag, 'enabled', _('Start UPnP and NAT-PMP service'));
o = s.taboption('general', form.Flag, 'enabled', _('Start service'));
o.rmempty = false;

s.taboption('general', form.Flag, 'enable_upnp', _('Enable UPnP functionality')).default = '1'
s.taboption('general', form.Flag, 'enable_natpmp', _('Enable NAT-PMP functionality')).default = '1'
s.taboption('general', form.Flag, 'enable_upnp', _('Enable UPnP IGD protocol')).default = '1'
s.taboption('general', form.Flag, 'enable_natpmp', _('Enable PCP/NAT-PMP protocol')).default = '1'

s.taboption('general', form.Flag, 'secure_mode', _('Enable secure mode'),
_('Allow adding forwards only to requesting ip addresses')).default = '1'
_('Allow adding port forwards only to requesting IP addresses')).default = '1'

s.taboption('general', form.Flag, 'igdv1', _('Enable IGDv1 mode'),
s.taboption('general', form.Flag, 'igdv1', _('Enable UPnP IGDv1 mode'),
_('Advertise as IGDv1 device instead of IGDv2')).default = '0'

s.taboption('general', form.Flag, 'log_output', _('Enable additional logging'),
Expand All @@ -143,7 +143,7 @@ return view.extend({
o.datatype = 'port'
o.default = 5000

s.taboption('advanced', form.Flag, 'system_uptime', _('Report system instead of daemon uptime')).default = '1'
s.taboption('advanced', form.Flag, 'system_uptime', _('Report system instead of service uptime')).default = '1'

s.taboption('advanced', form.Value, 'uuid', _('Device UUID'))
s.taboption('advanced', form.Value, 'serial_number', _('Announced serial number'))
Expand All @@ -153,18 +153,18 @@ return view.extend({
o.datatype = 'uinteger'
o.placeholder = 30

o = s.taboption('advanced', form.Value, 'clean_ruleset_threshold', _('Clean rules threshold'))
o = s.taboption('advanced', form.Value, 'clean_ruleset_threshold', _('Clean rules threshold'), _('Clean up this number of expired port forwards at once'))
o.datatype = 'uinteger'
o.placeholder = 20

o = s.taboption('advanced', form.Value, 'clean_ruleset_interval', _('Clean rules interval'))
o = s.taboption('advanced', form.Value, 'clean_ruleset_interval', _('Intra-cleanse interval'), _('Value in seconds, %s means immediate').format('0'))
o.datatype = 'uinteger'
o.placeholder = 600

o = s.taboption('advanced', form.Value, 'presentation_url', _('Presentation URL'))
o.placeholder = 'http://192.168.1.1/'

o = s.taboption('advanced', form.Value, 'upnp_lease_file', _('UPnP lease file'))
o = s.taboption('advanced', form.Value, 'upnp_lease_file', _('Service lease file'))
o.placeholder = '/var/run/miniupnpd.leases'

s.taboption('advanced', form.Flag, 'use_stun', _('Use STUN'))
Expand All @@ -178,8 +178,8 @@ return view.extend({
o.datatype = 'port'
o.placeholder = '0-65535'

s = m.section(form.GridSection, 'perm_rule', _('MiniUPnP ACLs'),
_('ACLs specify which external ports may be redirected to which internal addresses and ports'))
s = m.section(form.GridSection, 'perm_rule', _('Service ACLs'),
_('ACLs specify which external ports may be forwarded to which internal addresses and ports'))

s.sortable = true
s.anonymous = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"admin/services/upnp": {
"title": "UPnP",
"title": "UPnP IGD & PCP/NAT-PMP",
"action": {
"type": "view",
"path": "upnp/upnp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"luci-app-upnp": {
"description": "Grant access to upnp procedures",
"description": "Grant access to UPnP IGD & PCP/NAT-PMP configuration",
"read": {
"ubus": {
"luci.upnp": [ "get_status" ],
Expand Down

0 comments on commit 1b54f4b

Please sign in to comment.