mirror of
https://github.com/kenzok8/small-package
synced 2025-01-08 13:27:36 +08:00
add folder
This commit is contained in:
parent
0d2b833dcb
commit
d9affc88d3
87
.github/diy/patches/0004-luci-mod-status-firewall-disable-legacy-firewall-rul.patch
vendored
Normal file
87
.github/diy/patches/0004-luci-mod-status-firewall-disable-legacy-firewall-rul.patch
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
From 44cb42a004b8334d784814c5f616c8d8ceda6b22 Mon Sep 17 00:00:00 2001
|
||||
From: kenzok8 <kenzok8@gmail.com>
|
||||
Date: Fri, 13 Sep 2024 19:44:52 +0800
|
||||
Subject: [PATCH 4/5] luci-mod-status: firewall: disable legacy firewall rule
|
||||
warning
|
||||
|
||||
Signed-off-by: kenzok8 <kenzok8@gmail.com>
|
||||
---
|
||||
.../resources/view/status/nftables.js | 14 --------------
|
||||
.../share/luci/menu.d/luci-mod-status.json | 19 ++++++++++++++++---
|
||||
2 files changed, 16 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js b/feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
|
||||
index be62d91..1718494 100644
|
||||
--- a/feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
|
||||
+++ b/feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
|
||||
@@ -672,26 +672,12 @@ return view.extend({
|
||||
return node;
|
||||
},
|
||||
|
||||
- checkLegacyRules: function(ipt4save, ipt6save) {
|
||||
- if (ipt4save.match(/\n-A /) || ipt6save.match(/\n-A /)) {
|
||||
- ui.addNotification(_('Legacy rules detected'), [
|
||||
- E('p', _('There are legacy iptables rules present on the system. Mixing iptables and nftables rules is discouraged and may lead to incomplete traffic filtering.')),
|
||||
- E('button', {
|
||||
- 'class': 'btn cbi-button',
|
||||
- 'click': function() { location.href = 'nftables/iptables' }
|
||||
- }, _('Open iptables rules overview…'))
|
||||
- ], 'warning');
|
||||
- }
|
||||
- },
|
||||
-
|
||||
render: function(data) {
|
||||
var view = E('div'),
|
||||
nft = data[0],
|
||||
ipt = data[1],
|
||||
ipt6 = data[2];
|
||||
|
||||
- this.checkLegacyRules(ipt, ipt6);
|
||||
-
|
||||
if (!Array.isArray(nft.nftables))
|
||||
return E('em', _('No nftables ruleset loaded.'));
|
||||
|
||||
diff --git a/feeds/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json b/feeds/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
|
||||
index 190eef0..e9cf485 100644
|
||||
--- a/feeds/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
|
||||
+++ b/feeds/luci/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
|
||||
@@ -39,20 +39,33 @@
|
||||
}
|
||||
},
|
||||
|
||||
- "admin/status/nftables": {
|
||||
+ "admin/status/firewall": {
|
||||
"title": "Firewall",
|
||||
"order": 3,
|
||||
+ "action": {
|
||||
+ "type": "alias",
|
||||
+ "path": "admin/status/firewall/nftables"
|
||||
+ },
|
||||
+ "depends": {
|
||||
+ "acl": [ "luci-mod-status-firewall" ]
|
||||
+ }
|
||||
+ },
|
||||
+
|
||||
+ "admin/status/firewall/nftables": {
|
||||
+ "title": "NFtables Firewall",
|
||||
+ "order": 1,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "status/nftables"
|
||||
},
|
||||
"depends": {
|
||||
- "acl": [ "luci-mod-status-firewall" ],
|
||||
"fs": { "/usr/sbin/nft": "executable" }
|
||||
}
|
||||
},
|
||||
|
||||
- "admin/status/nftables/iptables": {
|
||||
+ "admin/status/firewall/iptables": {
|
||||
+ "title": "IPtables Firewall",
|
||||
+ "order": 2,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "status/iptables"
|
||||
--
|
||||
2.42.0
|
||||
|
Loading…
Reference in New Issue
Block a user