From 7f57749263fb05405d6fb61a6feb7eded9131668 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Mon, 23 Sep 2024 21:30:13 +0800 Subject: [PATCH] luci-app-passwall: sync upstream last commit: https://github.com/xiaorouji/openwrt-passwall/commit/7db4e89eeae24f4f61091d9f998c452a52612749 --- .../luasrc/model/cbi/passwall/client/acl.lua | 8 ++- .../model/cbi/passwall/client/acl_config.lua | 16 ++++++ luci-app-passwall/po/zh-cn/passwall.po | 6 +++ .../root/usr/share/passwall/app.sh | 16 ++++-- .../root/usr/share/passwall/iptables.sh | 50 +++++++++++-------- .../root/usr/share/passwall/nftables.sh | 50 +++++++++++-------- 6 files changed, 100 insertions(+), 46 deletions(-) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua index 6b4319ef9..d825e8786 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua @@ -48,7 +48,7 @@ o = s:option(DummyValue, "sources", translate("Source")) o.rawhtml = true o.cfgvalue = function(t, n) local e = '' - local v = Value.cfgvalue(t, n) or '' + local v = Value.cfgvalue(t, n) or '-' string.gsub(v, '[^' .. " " .. ']+', function(w) local a = w if mac_t[w] then @@ -62,6 +62,12 @@ o.cfgvalue = function(t, n) return e end +o = s:option(DummyValue, "interface", translate("Source Interface")) +o.cfgvalue = function(t, n) + local v = Value.cfgvalue(t, n) or '-' + return v +end + --[[ ---- TCP No Redir Ports o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index aaddfb65f..3bce1c883 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -54,6 +54,10 @@ o = s:option(Value, "remarks", translate("Remarks")) o.default = arg[1] o.rmempty = true +o = s:option(Flag, "use_interface", translate("Use Interface With ACLs")) +o.default = 0 +o.rmempty = false + local mac_t = {} sys.net.mac_hints(function(e, t) mac_t[#mac_t + 1] = { @@ -74,6 +78,17 @@ table.sort(mac_t, function(a,b) return false end) +local device_list = {} +device_list = sys.net.devices() +table.sort(device_list) +interface = s:option(ListValue, "interface", translate("Source Interface")) + +for k, name in ipairs(device_list) do + interface:value(name) +end + +interface:depends({ use_interface = 1 }) + ---- Source sources = s:option(DynamicList, "sources", translate("Source")) sources.description = "