mirror of https://github.com/kenzok8/small.git
update 2024-02-23 20:15:25
This commit is contained in:
parent
b5f27529dd
commit
b94896a297
|
@ -6,7 +6,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=4.74-2
|
||||
PKG_VERSION:=4.74-3
|
||||
PKG_RELEASE:=
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
|
|
@ -255,6 +255,7 @@ o = s:option(Flag, option_name("tls"), translate("TLS"))
|
|||
o.default = 0
|
||||
o:depends({ [option_name("protocol")] = "vmess" })
|
||||
o:depends({ [option_name("protocol")] = "vless" })
|
||||
o:depends({ [option_name("protocol")] = "http" })
|
||||
o:depends({ [option_name("protocol")] = "socks" })
|
||||
o:depends({ [option_name("protocol")] = "trojan" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks" })
|
||||
|
|
|
@ -352,9 +352,8 @@ o = s:option(Flag, option_name("tls"), translate("TLS"))
|
|||
o.default = 0
|
||||
o:depends({ [option_name("protocol")] = "vmess" })
|
||||
o:depends({ [option_name("protocol")] = "vless" })
|
||||
o:depends({ [option_name("protocol")] = "socks" })
|
||||
o:depends({ [option_name("protocol")] = "http" })
|
||||
o:depends({ [option_name("protocol")] = "trojan" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks" })
|
||||
|
||||
o = s:option(ListValue, option_name("alpn"), translate("alpn"))
|
||||
o.default = "default"
|
||||
|
|
|
@ -129,6 +129,7 @@ o.validate = function(self, value, t)
|
|||
end
|
||||
o:depends({ [option_name("protocol")] = "vmess" })
|
||||
o:depends({ [option_name("protocol")] = "vless" })
|
||||
o:depends({ [option_name("protocol")] = "http" })
|
||||
o:depends({ [option_name("protocol")] = "socks" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks" })
|
||||
o:depends({ [option_name("protocol")] = "trojan" })
|
||||
|
|
|
@ -215,7 +215,6 @@ o.validate = function(self, value, t)
|
|||
end
|
||||
end
|
||||
o:depends({ [option_name("protocol")] = "http" })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks" })
|
||||
o:depends({ [option_name("protocol")] = "vmess" })
|
||||
o:depends({ [option_name("protocol")] = "vless" })
|
||||
o:depends({ [option_name("protocol")] = "trojan" })
|
||||
|
@ -224,10 +223,9 @@ if singbox_tags:find("with_reality_server") then
|
|||
-- [[ REALITY部分 ]] --
|
||||
o = s:option(Flag, option_name("reality"), translate("REALITY"))
|
||||
o.default = 0
|
||||
o:depends({ [option_name("protocol")] = "vless", [option_name("tls")] = true })
|
||||
o:depends({ [option_name("protocol")] = "vmess", [option_name("tls")] = true })
|
||||
o:depends({ [option_name("protocol")] = "shadowsocks", [option_name("tls")] = true })
|
||||
o:depends({ [option_name("protocol")] = "http", [option_name("tls")] = true })
|
||||
o:depends({ [option_name("protocol")] = "vmess", [option_name("tls")] = true })
|
||||
o:depends({ [option_name("protocol")] = "vless", [option_name("tls")] = true })
|
||||
o:depends({ [option_name("protocol")] = "trojan", [option_name("tls")] = true })
|
||||
|
||||
o = s:option(Value, option_name("reality_private_key"), translate("Private Key"))
|
||||
|
|
|
@ -799,24 +799,29 @@ run_redir() {
|
|||
_args="${_args} udp_redir_port=${UDP_REDIR_PORT}"
|
||||
config_file=$(echo $config_file | sed "s/TCP/TCP_UDP/g")
|
||||
}
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
[ "${DNS_MODE}" != "sing-box" ] && [ "${DNS_MODE}" != "udp" ] && {
|
||||
DNS_MODE="sing-box"
|
||||
v2ray_dns_mode="tcp"
|
||||
}
|
||||
[ "${DNS_MODE}" = "sing-box" ] && {
|
||||
resolve_dns=1
|
||||
config_file=$(echo $config_file | sed "s/.json/_DNS.json/g")
|
||||
_args="${_args} remote_dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
FILTER_PROXY_IPV6=0
|
||||
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
_args="${_args} remote_dns_protocol=${v2ray_dns_mode}"
|
||||
_args="${_args} dns_listen_port=${dns_listen_port}"
|
||||
local logout=""
|
||||
case "$v2ray_dns_mode" in
|
||||
tcp)
|
||||
_args="${_args} remote_dns_tcp_server=${REMOTE_DNS}"
|
||||
logout=" - 域名解析 DNS Over TCP"
|
||||
logout=" - 域名解析 DNS Over TCP (${REMOTE_DNS})"
|
||||
;;
|
||||
doh)
|
||||
remote_dns_doh=$(config_t_get global remote_dns_doh "https://1.1.1.1/dns-query")
|
||||
_args="${_args} remote_dns_doh=${remote_dns_doh}"
|
||||
logout=" - 域名解析 DNS Over HTTPS"
|
||||
logout=" - 域名解析 DNS Over HTTPS (${remote_dns_doh})"
|
||||
;;
|
||||
esac
|
||||
local remote_fakedns=$(config_t_get global remote_fakedns 0)
|
||||
|
@ -849,16 +854,21 @@ run_redir() {
|
|||
_args="${_args} udp_redir_port=${UDP_REDIR_PORT}"
|
||||
config_file=$(echo $config_file | sed "s/TCP/TCP_UDP/g")
|
||||
}
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
[ "${DNS_MODE}" != "xray" ] && [ "${DNS_MODE}" != "udp" ] && {
|
||||
DNS_MODE="xray"
|
||||
v2ray_dns_mode="tcp"
|
||||
}
|
||||
[ "${DNS_MODE}" = "xray" ] && {
|
||||
resolve_dns=1
|
||||
config_file=$(echo $config_file | sed "s/.json/_DNS.json/g")
|
||||
_args="${_args} dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
FILTER_PROXY_IPV6=0
|
||||
local _dns_client_ip=$(config_t_get global dns_client_ip)
|
||||
[ -n "${_dns_client_ip}" ] && _args="${_args} dns_client_ip=${_dns_client_ip}"
|
||||
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
|
||||
_args="${_args} dns_listen_port=${dns_listen_port}"
|
||||
_args="${_args} remote_dns_tcp_server=${REMOTE_DNS}"
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
[ "$v2ray_dns_mode" = "tcp+doh" ] && {
|
||||
remote_dns_doh=$(config_t_get global remote_dns_doh "https://1.1.1.1/dns-query")
|
||||
_args="${_args} remote_dns_doh=${remote_dns_doh}"
|
||||
|
@ -1183,6 +1193,7 @@ start_dns() {
|
|||
local _args="type=$DNS_MODE config_file=$config_file log_file=$log_file"
|
||||
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
|
||||
_args="${_args} remote_dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
FILTER_PROXY_IPV6=0
|
||||
use_tcp_node_resolve_dns=1
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
_args="${_args} dns_listen_port=${dns_listen_port}"
|
||||
|
@ -1190,7 +1201,7 @@ start_dns() {
|
|||
case "$v2ray_dns_mode" in
|
||||
tcp)
|
||||
_args="${_args} remote_dns_tcp_server=${REMOTE_DNS}"
|
||||
echolog " - 域名解析 DNS Over TCP..."
|
||||
echolog " - 域名解析 DNS Over TCP (${REMOTE_DNS})"
|
||||
;;
|
||||
doh)
|
||||
remote_dns_doh=$(config_t_get global remote_dns_doh "https://1.1.1.1/dns-query")
|
||||
|
@ -1206,7 +1217,7 @@ start_dns() {
|
|||
[ "${_is_ip}" = "true" ] && _doh_bootstrap=${_doh_host}
|
||||
[ -n "${_doh_bootstrap}" ] && REMOTE_DNS=${_doh_bootstrap}:${_doh_port}
|
||||
unset _doh_url _doh_host_port _doh_host _is_ip _doh_port _doh_bootstrap
|
||||
echolog " - 域名解析 DNS Over HTTPS..."
|
||||
echolog " - 域名解析 DNS Over HTTPS (${remote_dns_doh})"
|
||||
;;
|
||||
esac
|
||||
_args="${_args} dns_socks_address=127.0.0.1 dns_socks_port=${tcp_node_socks_port}"
|
||||
|
@ -1221,6 +1232,7 @@ start_dns() {
|
|||
local _args="type=$DNS_MODE config_file=$config_file log_file=$log_file"
|
||||
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
|
||||
_args="${_args} dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
FILTER_PROXY_IPV6=0
|
||||
local _dns_client_ip=$(config_t_get global dns_client_ip)
|
||||
[ -n "${_dns_client_ip}" ] && _args="${_args} dns_client_ip=${_dns_client_ip}"
|
||||
use_tcp_node_resolve_dns=1
|
||||
|
@ -1253,6 +1265,7 @@ start_dns() {
|
|||
[ "$CHINADNS_NG" = "1" ] && [ -n "$(first_type chinadns-ng)" ] && ([ "${CHN_LIST}" = "direct" ] || [ "${USE_GFW_LIST}" = "1" ]) && {
|
||||
[ "$FILTER_PROXY_IPV6" = "1" ] && {
|
||||
local _no_ipv6_rules="gt"
|
||||
FILTER_PROXY_IPV6=0
|
||||
}
|
||||
local china_ng_listen_port=$(expr $dns_listen_port + 1)
|
||||
local china_ng_listen="127.0.0.1#${china_ng_listen_port}"
|
||||
|
@ -1406,6 +1419,7 @@ acl_app() {
|
|||
[ "$dns_mode" = "xray" ] && [ "$v2ray_dns_mode" = "tcp+doh" ] && remote_dns_doh=${remote_dns_doh:-https://1.1.1.1/dns-query}
|
||||
local type=${dns_mode}
|
||||
[ "${dns_mode}" = "sing-box" ] && type="singbox"
|
||||
filter_proxy_ipv6=0
|
||||
run_${type} flag=acl_${sid} type=$dns_mode dns_socks_address=127.0.0.1 dns_socks_port=$socks_port dns_listen_port=${_dns_port} remote_dns_protocol=${v2ray_dns_mode} remote_dns_tcp_server=${remote_dns} remote_dns_doh="${remote_dns_doh}" remote_dns_query_strategy=${DNS_QUERY_STRATEGY} dns_client_ip=${dns_client_ip} dns_query_strategy=${DNS_QUERY_STRATEGY} config_file=$config_file
|
||||
fi
|
||||
eval node_${tcp_node}_$(echo -n "${remote_dns}" | md5sum | cut -d " " -f1)=${_dns_port}
|
||||
|
@ -1414,6 +1428,7 @@ acl_app() {
|
|||
[ "$chinadns_ng" = "1" ] && [ -n "$(first_type chinadns-ng)" ] && ([ "${chn_list}" = "direct" ] || [ "${use_gfw_list}" = "1" ]) && {
|
||||
[ "$filter_proxy_ipv6" = "1" ] && {
|
||||
local _no_ipv6_rules="gt"
|
||||
filter_proxy_ipv6=0
|
||||
}
|
||||
chinadns_port=$(expr $chinadns_port + 1)
|
||||
_china_ng_listen="127.0.0.1#${chinadns_port}"
|
||||
|
@ -1485,6 +1500,7 @@ acl_app() {
|
|||
_dns_port=$dns_port
|
||||
config_file=$(echo $config_file | sed "s/TCP_/DNS_${_dns_port}_TCP_/g")
|
||||
remote_dns_doh=${remote_dns}
|
||||
filter_proxy_ipv6=0
|
||||
[ "$dns_mode" = "xray" ] && [ "$v2ray_dns_mode" = "tcp+doh" ] && remote_dns_doh=${remote_dns_doh:-https://1.1.1.1/dns-query}
|
||||
_extra_param="dns_listen_port=${_dns_port} remote_dns_protocol=${v2ray_dns_mode} remote_dns_tcp_server=${remote_dns} remote_dns_doh=${remote_dns_doh} remote_dns_query_strategy=${DNS_QUERY_STRATEGY} dns_client_ip=${dns_client_ip} dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
fi
|
||||
|
|
|
@ -1037,7 +1037,7 @@ add_firewall_rule() {
|
|||
$ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST) -j PSW_RULE
|
||||
[ "${USE_PROXY_LIST}" = "1" ] && $ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST) -j PSW_RULE
|
||||
[ "${USE_GFW_LIST}" = "1" ] && $ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_GFW) -j PSW_RULE
|
||||
[ "${CHN_LIST}" != "0" ] && $ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_CHN)$(get_jump_ipt ${CHN_LIST} "-j PSW_RULE")
|
||||
[ "${CHN_LIST}" != "0" ] && $ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_CHN) $(get_jump_ipt ${CHN_LIST} "-j PSW_RULE")
|
||||
[ "${LOCALHOST_UDP_PROXY_MODE}" != "disable" ] && $ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") -j PSW_RULE
|
||||
$ipt_m -A PSW $(comment "本机") -p udp -i lo $(REDIRECT $UDP_REDIR_PORT TPROXY)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue