From aa8e8248a1c16b14c92ec5e07136a060bef24e7c Mon Sep 17 00:00:00 2001 From: actions-user Date: Tue, 24 Sep 2024 00:14:56 +0800 Subject: [PATCH] update 2024-09-24 00:14:56 --- .../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 +++++++++++------- .../luasrc/model/cbi/passwall2/client/acl.lua | 8 ++- .../model/cbi/passwall2/client/acl_config.lua | 18 +++++++ .../luasrc/passwall2/util_xray.lua | 5 +- luci-app-passwall2/po/zh-cn/passwall2.po | 6 +++ .../root/usr/share/passwall2/app.sh | 19 ++++--- .../root/usr/share/passwall2/iptables.sh | 50 +++++++++++------- .../root/usr/share/passwall2/nftables.sh | 52 +++++++++++-------- 13 files changed, 208 insertions(+), 96 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 6b4319ef..d825e878 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 aaddfb65..3bce1c88 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 = "