update 04-22 23:43:14

This commit is contained in:
github-actions[bot] 2022-04-22 23:43:14 +08:00
parent 42aaaeb274
commit 129ee3397d
12 changed files with 85 additions and 51 deletions

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall PKG_NAME:=luci-app-passwall
PKG_VERSION:=4.53 PKG_VERSION:=4.53
PKG_RELEASE:=7 PKG_RELEASE:=8
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \

View File

@ -1,6 +1,8 @@
local api = require "luci.model.cbi.passwall.api.api" local api = require "luci.model.cbi.passwall.api.api"
local appname = api.appname local appname = api.appname
local fs = api.fs local fs = api.fs
local has_v2ray = api.is_finded("v2ray")
local has_xray = api.is_finded("xray")
m = Map(appname) m = Map(appname)
@ -128,25 +130,32 @@ o = s:option(Flag, "accept_icmpv6", translate("Hijacking ICMPv6 (IPv6 PING)"))
o:depends("ipv6_tproxy", true) o:depends("ipv6_tproxy", true)
o.default = 0 o.default = 0
o = s:option(Flag, "sniffing", translate("Sniffing (V2Ray/Xray)"), translate("When using the V2ray/Xray shunt, must be enabled, otherwise the shunt will invalid.")) if has_v2ray or has_xray then
o.default = 1 o = s:option(Flag, "sniffing", translate("Sniffing (V2Ray/Xray)"), translate("When using the V2ray/Xray shunt, must be enabled, otherwise the shunt will invalid."))
o.rmempty = false o.default = 1
o.rmempty = false
o = s:option(Flag, "route_only", translate("Sniffing Route Only (Xray)"), translate("When enabled, the server not will resolve the domain name again.")) if has_xray then
o.default = 0 route_only = s:option(Flag, "route_only", translate("Sniffing Route Only (Xray)"), translate("When enabled, the server not will resolve the domain name again."))
o:depends("sniffing", true) route_only.default = 0
route_only:depends("sniffing", true)
o = s:option(Value, "buffer_size", translate("Buffer Size (Xray)"), translate("Buffer size for every connection (kB)")) local domains_excluded = string.format("/usr/share/%s/rules/domains_excluded", appname)
o.rmempty = true o = s:option(TextValue, "no_sniffing_hosts", translate("No Sniffing Lists"), translate("Hosts added into No Sniffing Lists will not resolve again on server (Xray only)."))
o.datatype = "uinteger" o.rows = 15
o.wrap = "off"
local domains_excluded = string.format("/usr/share/%s/rules/domains_excluded", appname) o.cfgvalue = function(self, section) return fs.readfile(domains_excluded) or "" end
o = s:option(TextValue, "no_sniffing_hosts", translate("No Sniffing Lists"), translate("Hosts added into No Sniffing Lists will not resolve again on server (Xray only).")) o.write = function(self, section, value) fs.writefile(domains_excluded, value:gsub("\r\n", "\n")) end
o.rows = 15 o.remove = function(self, section, value)
o.wrap = "off" if route_only:formvalue(section) == "0" then
o.cfgvalue = function(self, section) return fs.readfile(domains_excluded) or "" end fs.writefile(domains_excluded, "")
o.write = function(self, section, value) fs.writefile(domains_excluded, value:gsub("\r\n", "\n")) end end
o.remove = function(self, section, value) fs.writefile(domains_excluded, "") end end
o:depends({sniffing = true, route_only = false}) o:depends({sniffing = true, route_only = false})
o = s:option(Value, "buffer_size", translate("Buffer Size (Xray)"), translate("Buffer size for every connection (kB)"))
o.rmempty = true
o.datatype = "uinteger"
end
end
return m return m

View File

@ -1182,14 +1182,16 @@ add_firewall_rule() {
} }
fi fi
$ipt_m -A PSW -p udp --dport 53 -j RETURN
$ip6t_m -A PSW -p udp --dport 53 -j RETURN
# 加载ACLS # 加载ACLS
load_acl load_acl
# dns_hijack "force" # dns_hijack "force"
[ -n "${is_tproxy}" -o -n "${udp_flag}" ] && { [ -n "${is_tproxy}" -o -n "${udp_flag}" ] && {
sysctl -w net.bridge.bridge-nf-call-iptables=0 2>/dev/null sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1
[ "$PROXY_IPV6" == "1" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=0 2>/dev/null [ "$PROXY_IPV6" == "1" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1
} }
echolog "防火墙规则加载完成!" echolog "防火墙规则加载完成!"
} }

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall2 PKG_NAME:=luci-app-passwall2
PKG_VERSION:=1.3 PKG_VERSION:=1.3
PKG_RELEASE:=18 PKG_RELEASE:=20
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \

View File

@ -8,6 +8,7 @@ local tcp_proxy_way = var["-tcp_proxy_way"]
local redir_port = var["-redir_port"] local redir_port = var["-redir_port"]
local sniffing = var["-sniffing"] local sniffing = var["-sniffing"]
local route_only = var["-route_only"] local route_only = var["-route_only"]
local buffer_size = var["-buffer_size"]
local local_socks_address = var["-local_socks_address"] or "0.0.0.0" local local_socks_address = var["-local_socks_address"] or "0.0.0.0"
local local_socks_port = var["-local_socks_port"] local local_socks_port = var["-local_socks_port"]
local local_socks_username = var["-local_socks_username"] local local_socks_username = var["-local_socks_username"]
@ -790,25 +791,23 @@ if inbounds or outbounds then
-- 路由 -- 路由
routing = routing, routing = routing,
-- 本地策略 -- 本地策略
--[[
policy = { policy = {
levels = { levels = {
[0] = { [0] = {
handshake = 4, -- handshake = 4,
connIdle = 300, -- connIdle = 300,
uplinkOnly = 2, -- uplinkOnly = 2,
downlinkOnly = 5, -- downlinkOnly = 5,
bufferSize = 10240, bufferSize = buffer_size and tonumber(buffer_size) or nil,
statsUserUplink = false, statsUserUplink = false,
statsUserDownlink = false statsUserDownlink = false
} }
}, },
system = { -- system = {
statsInboundUplink = false, -- statsInboundUplink = false,
statsInboundDownlink = false -- statsInboundDownlink = false
} -- }
} }
]]--
} }
table.insert(outbounds, { table.insert(outbounds, {
protocol = "freedom", protocol = "freedom",

View File

@ -1,6 +1,8 @@
local api = require "luci.model.cbi.passwall2.api.api" local api = require "luci.model.cbi.passwall2.api.api"
local appname = api.appname local appname = api.appname
local fs = api.fs local fs = api.fs
local has_v2ray = api.is_finded("v2ray")
local has_xray = api.is_finded("xray")
m = Map(appname) m = Map(appname)
@ -114,21 +116,33 @@ o = s:option(Flag, "accept_icmpv6", translate("Hijacking ICMPv6 (IPv6 PING)"))
o:depends("ipv6_tproxy", true) o:depends("ipv6_tproxy", true)
o.default = 0 o.default = 0
o = s:option(Flag, "sniffing", translate("Sniffing (V2Ray/Xray)"), translate("When using the V2ray/Xray shunt, must be enabled, otherwise the shunt will invalid.")) if has_v2ray or has_xray then
o.default = 1 o = s:option(Flag, "sniffing", translate("Sniffing (V2Ray/Xray)"), translate("When using the V2ray/Xray shunt, must be enabled, otherwise the shunt will invalid."))
o.rmempty = false o.default = 1
o.rmempty = false
o = s:option(Flag, "route_only", translate("Sniffing Route Only (Xray)"), translate("When enabled, the server not will resolve the domain name again.")) if has_xray then
o.default = 0 route_only = s:option(Flag, "route_only", translate("Sniffing Route Only (Xray)"), translate("When enabled, the server not will resolve the domain name again."))
o:depends("sniffing", true) route_only.default = 0
route_only:depends("sniffing", true)
local domains_excluded = string.format("/usr/share/%s/domains_excluded", appname) local domains_excluded = string.format("/usr/share/%s/domains_excluded", appname)
o = s:option(TextValue, "no_sniffing_hosts", translate("No Sniffing Lists"), translate("Hosts added into No Sniffing Lists will not resolve again on server (Xray only).")) o = s:option(TextValue, "no_sniffing_hosts", translate("No Sniffing Lists"), translate("Hosts added into No Sniffing Lists will not resolve again on server (Xray only)."))
o.rows = 15 o.rows = 15
o.wrap = "off" o.wrap = "off"
o.cfgvalue = function(self, section) return fs.readfile(domains_excluded) or "" end o.cfgvalue = function(self, section) return fs.readfile(domains_excluded) or "" end
o.write = function(self, section, value) fs.writefile(domains_excluded, value:gsub("\r\n", "\n")) end o.write = function(self, section, value) fs.writefile(domains_excluded, value:gsub("\r\n", "\n")) end
o.remove = function(self, section, value) fs.writefile(domains_excluded, "") end o.remove = function(self, section, value)
o:depends({sniffing = true, route_only = false}) if route_only:formvalue(section) == "0" then
fs.writefile(domains_excluded, "")
end
end
o:depends({sniffing = true, route_only = false})
o = s:option(Value, "buffer_size", translate("Buffer Size (Xray)"), translate("Buffer size for every connection (kB)"))
o.rmempty = true
o.datatype = "uinteger"
end
end
return m return m

View File

@ -1143,3 +1143,9 @@ msgstr "不进行流量嗅探的域名列表"
msgid "Hosts added into No Sniffing Lists will not resolve again on server (Xray only)." msgid "Hosts added into No Sniffing Lists will not resolve again on server (Xray only)."
msgstr "加入的域名不会再次在服务器解析仅适用于Xray。" msgstr "加入的域名不会再次在服务器解析仅适用于Xray。"
msgid "Buffer Size (Xray)"
msgstr "缓冲区大小Xray"
msgid "Buffer size for every connection (kB)"
msgstr "每一个连接的缓冲区大小kB"

View File

@ -300,6 +300,8 @@ run_v2ray() {
local route_only=$(config_t_get global_forwarding route_only 0) local route_only=$(config_t_get global_forwarding route_only 0)
[ "${route_only}" = "1" ] && _extra_param="${_extra_param} -route_only 1" [ "${route_only}" = "1" ] && _extra_param="${_extra_param} -route_only 1"
} }
local buffer_size=$(config_t_get global_forwarding buffer_size)
[ -n "${buffer_size}" ] && _extra_param="${_extra_param} -buffer_size ${buffer_size}"
[ "$direct_dns_protocol" = "auto" ] && { [ "$direct_dns_protocol" = "auto" ] && {
direct_dns_protocol="udp" direct_dns_protocol="udp"
direct_dns_udp_server=${AUTO_DNS} direct_dns_udp_server=${AUTO_DNS}
@ -749,8 +751,8 @@ start() {
run_global run_global
source $APP_PATH/iptables.sh start source $APP_PATH/iptables.sh start
source $APP_PATH/helper_dnsmasq.sh logic_restart source $APP_PATH/helper_dnsmasq.sh logic_restart
sysctl -w net.bridge.bridge-nf-call-iptables=0 2>/dev/null sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1
[ "$PROXY_IPV6" == "1" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=0 2>/dev/null [ "$PROXY_IPV6" == "1" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1
fi fi
} }
start_crontab start_crontab

View File

@ -816,6 +816,8 @@ add_firewall_rule() {
fi fi
fi fi
$ipt_m -A PSW2 -p udp --dport 53 -j RETURN
$ip6t_m -A PSW2 -p udp --dport 53 -j RETURN
# 加载ACLS # 加载ACLS
load_acl load_acl

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-socat PKG_NAME:=luci-app-socat
PKG_VERSION:=20200824 PKG_VERSION:=20200824
PKG_RELEASE:=4 PKG_RELEASE:=5
PKG_MAINTAINER:=Lienol <lawlienol@gmail.com> PKG_MAINTAINER:=Lienol <lawlienol@gmail.com>

View File

@ -11,7 +11,7 @@ EOF
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
delete ucitrack.@socat[-1] delete ucitrack.@socat[-1]
add ucitrack socat add ucitrack socat
set ucitrack.@socat[-1].init=socat set ucitrack.@socat[-1].init=luci_socat
commit ucitrack commit ucitrack
EOF EOF