Update luci-app-firewall.patch

This commit is contained in:
kiddin9 authored and GitHub committed 2026-09-30 00:43:31 +08:00
1 parent a633bba059
commit 2898166234
1 file changed
+13 -43
+13 -43
View File
@@ -1,3 +1,15 @@
--- a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js
+++ b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js
@@ -23,7 +23,7 @@ return view.extend({
render(fwuser) {
return E([
E('h2', _('Firewall - Custom Rules')),
- E('p', {}, _('Custom rules allow you to execute arbitrary iptables commands which are not otherwise covered by the firewall framework. The commands are executed after each firewall restart, right after the default ruleset has been loaded.')),
+ E('p', {}, _('Custom rules allow you to define custom firewall rules which are not otherwise covered by the firewall framework. On firewall4 systems, these rules must use nftables syntax.'))
E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 25 }, [ fwuser != null ? fwuser : '' ]))
]);
},
--- 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 @@
@@ -12,7 +24,7 @@
--- a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
+++ b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
@@ -73,11 +73,49 @@ return view.extend({
@@ -73,11 +73,12 @@ return view.extend({
addTCPCCAOption();
if (fw4)
o = s.option(form.Flag, 'fullcone6', _('Enable FullCone NAT6'));
@@ -20,45 +32,3 @@
}
else {
addTCPCCAOption();
}
+ 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')),