From d6558ca327f24109530d4cb031e7a49ae9d21500 Mon Sep 17 00:00:00 2001 From: kiddin9 <48883331+kiddin9@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:14:53 +0800 Subject: [PATCH] Create luci-app-firewall.patch --- .github/diy/patches/luci-app-firewall.patch | 61 +++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/diy/patches/luci-app-firewall.patch diff --git a/.github/diy/patches/luci-app-firewall.patch b/.github/diy/patches/luci-app-firewall.patch new file mode 100644 index 000000000..c6e8f780a --- /dev/null +++ b/.github/diy/patches/luci-app-firewall.patch @@ -0,0 +1,61 @@ +--- a/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json ++++ b/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json +@@ -65,8 +65,5 @@ + "type": "view", + "path": "firewall/custom" + }, +- "depends": { +- "fs": { "/usr/share/fw3/helpers.conf": "file" } +- } + } + } + +--- a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js ++++ b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +@@ -59,8 +59,46 @@ return view.extend({ + o = s.option(form.Flag, 'fullcone', _('Enable FullCone NAT')); + if (fw4) + o = s.option(form.Flag, 'fullcone6', _('Enable FullCone NAT6')); ++ o.depends('fullcone', '1'); + } + ++ o = s.option(form.Flag, 'expose_wan', _('Expose WAN'), _('Danger! Proceed at your own risk.')); ++ ++ o = s.option(form.Value, 'export', _('Ports to Expose'), _('Multiple ports can be, separated by spaces, format: 80 81 82')); ++ o.depends('expose_wan', '1'); ++ o.validate = function(section_id, value) { ++ if (value.match(/^(\d+\s*)+$/)) { ++ return true; ++ } ++ return _('Please enter valid format.'); ++ }; ++ ++ o = s.option(form.ListValue, 'family', _('Restrict to address family')); ++ o.modalonly = true; ++ o.rmempty = true; ++ o.depends('expose_wan', '1'); ++ o.value('', _('IPv4 and IPv6')); ++ o.value('ipv4', _('IPv4 only')); ++ o.value('ipv6', _('IPv6 only')); ++ ++ o = s.option(form.ListValue, 'proto', _('Protocol')); ++ o.modalonly = true; ++ o.rmempty = true; ++ o.default = 'tcp'; ++ o.depends('expose_wan', '1'); ++ o.value('tcp', _('TCP')); ++ o.value('udp', _('UDP')); ++ o.value('tudp', _('TCP+UDP')); ++ ++ o = s.option(form.Flag, 'ex_ssh', _('Expose SSH')); ++ o.depends('expose_wan', '1'); ++ o = s.option(form.Flag, 'ex_backend', _('Expose Backend')); ++ o.depends('expose_wan', '1'); ++ o = s.option(form.Value, 'backend_port', _('Backend Port'), _('国内请使用除80,443外的端口')); ++ o.depends('ex_backend', '1'); ++ o.rmempty = false; ++ o.datatype = 'integer'; ++ + let p = [ + s.option(form.ListValue, 'input', _('Input')), + s.option(form.ListValue, 'output', _('Output')),