update 2023-10-16 23:36:58
This commit is contained in:
parent
44b8e056f1
commit
510e6d5caf
|
@ -16,6 +16,7 @@
|
||||||
volatile int should_exit = false;
|
volatile int should_exit = false;
|
||||||
|
|
||||||
void signal_handler(int signum) {
|
void signal_handler(int signum) {
|
||||||
|
syslog(LOG_ERR, "Signal %s received, exiting...", strsignal(signum));
|
||||||
should_exit = true;
|
should_exit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +31,8 @@ int main(int argc, char *argv[]) {
|
||||||
signal(SIGINT, signal_handler);
|
signal(SIGINT, signal_handler);
|
||||||
signal(SIGTERM, signal_handler);
|
signal(SIGTERM, signal_handler);
|
||||||
signal(SIGQUIT, signal_handler);
|
signal(SIGQUIT, signal_handler);
|
||||||
|
signal(SIGSEGV, signal_handler);
|
||||||
|
signal(SIGABRT, signal_handler);
|
||||||
|
|
||||||
struct nf_queue queue[1];
|
struct nf_queue queue[1];
|
||||||
memset(queue, 0, sizeof(struct nf_queue));
|
memset(queue, 0, sizeof(struct nf_queue));
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-mosdns
|
PKG_NAME:=luci-app-mosdns
|
||||||
PKG_VERSION:=1.5.12
|
PKG_VERSION:=1.5.13
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI Support for mosdns
|
LUCI_TITLE:=LuCI Support for mosdns
|
||||||
|
|
|
@ -123,7 +123,11 @@ init_yaml() {
|
||||||
sed -i "/ecs_remote/d;" $CONF
|
sed -i "/ecs_remote/d;" $CONF
|
||||||
fi
|
fi
|
||||||
# DNS Leak
|
# DNS Leak
|
||||||
[ $dns_leak -eq 1 ] && sed -i "0,/primary: query_is_non_local_ip/s/primary: query_is_non_local_ip/primary: forward_remote_upstream/" $CONF
|
if [ $dns_leak -eq 1 ]; then
|
||||||
|
sed -i "s/primary: UNDEFINED/primary: forward_remote_upstream/g" $CONF
|
||||||
|
else
|
||||||
|
sed -i "s/primary: UNDEFINED/primary: query_is_non_local_ip/g" $CONF
|
||||||
|
fi
|
||||||
# Cloudflare IP
|
# Cloudflare IP
|
||||||
if [ $cloudflare -eq 1 ]; then
|
if [ $cloudflare -eq 1 ]; then
|
||||||
cloudflare_ip=$(sh $MOSDNS_SCRIPT cloudflare)
|
cloudflare_ip=$(sh $MOSDNS_SCRIPT cloudflare)
|
||||||
|
|
|
@ -153,7 +153,7 @@ plugins:
|
||||||
- tag: fallback
|
- tag: fallback
|
||||||
type: fallback
|
type: fallback
|
||||||
args:
|
args:
|
||||||
primary: query_is_non_local_ip
|
primary: UNDEFINED
|
||||||
secondary: forward_remote_upstream
|
secondary: forward_remote_upstream
|
||||||
threshold: 500
|
threshold: 500
|
||||||
always_standby: true
|
always_standby: true
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-passwall
|
PKG_NAME:=luci-app-passwall
|
||||||
PKG_VERSION:=4.71-1
|
PKG_VERSION:=4.71-2
|
||||||
PKG_RELEASE:=
|
PKG_RELEASE:=
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS:= \
|
PKG_CONFIG_DEPENDS:= \
|
||||||
|
|
|
@ -248,7 +248,7 @@ o.cfgvalue = function(self, section)
|
||||||
return m:get(section, "v2ray_dns_mode")
|
return m:get(section, "v2ray_dns_mode")
|
||||||
end
|
end
|
||||||
o.write = function(self, section, value)
|
o.write = function(self, section, value)
|
||||||
if dns_mode:formvalue(section) == "xray" then
|
if s.fields["dns_mode"]:formvalue(section) == "xray" then
|
||||||
return m:set(section, "v2ray_dns_mode", value)
|
return m:set(section, "v2ray_dns_mode", value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -261,7 +261,7 @@ o.cfgvalue = function(self, section)
|
||||||
return m:get(section, "v2ray_dns_mode")
|
return m:get(section, "v2ray_dns_mode")
|
||||||
end
|
end
|
||||||
o.write = function(self, section, value)
|
o.write = function(self, section, value)
|
||||||
if dns_mode:formvalue(section) == "sing-box" then
|
if s.fields["dns_mode"]:formvalue(section) == "sing-box" then
|
||||||
return m:set(section, "v2ray_dns_mode", value)
|
return m:set(section, "v2ray_dns_mode", value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -334,6 +334,17 @@ if api.is_finded("chinadns-ng") then
|
||||||
o:depends({ tcp_proxy_mode = "chnroute", dns_mode = "dns2socks" })
|
o:depends({ tcp_proxy_mode = "chnroute", dns_mode = "dns2socks" })
|
||||||
o:depends({ tcp_proxy_mode = "chnroute", dns_mode = "xray" })
|
o:depends({ tcp_proxy_mode = "chnroute", dns_mode = "xray" })
|
||||||
o:depends({ tcp_proxy_mode = "chnroute", dns_mode = "sing-box" })
|
o:depends({ tcp_proxy_mode = "chnroute", dns_mode = "sing-box" })
|
||||||
|
chinadns_ng_default_tag = s:option(ListValue, "chinadns_ng_default_tag", translate("ChinaDNS-NG Domain Default Tag"))
|
||||||
|
chinadns_ng_default_tag.default = "smart"
|
||||||
|
chinadns_ng_default_tag:value("smart", translate("Smart DNS"))
|
||||||
|
chinadns_ng_default_tag:value("gfw", translate("Remote DNS"))
|
||||||
|
chinadns_ng_default_tag:value("chn", translate("Direct DNS"))
|
||||||
|
chinadns_ng_default_tag.description = "<ul>"
|
||||||
|
.. "<li>" .. translate("Forward to both remote and direct DNS, if the direct DNS resolution result is a mainland China ip, then use the direct result, otherwise use the remote result") .. "</li>"
|
||||||
|
.. "<li>" .. translate("Remote DNS can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "</li>"
|
||||||
|
.. "<li>" .. translate("Direct DNS Internet experience may be better, but DNS will be leaked!") .. "</li>"
|
||||||
|
.. "</ul>"
|
||||||
|
chinadns_ng_default_tag:depends("chinadns_ng", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if has_chnlist then
|
if has_chnlist then
|
||||||
|
|
|
@ -382,6 +382,17 @@ o.rmempty = false
|
||||||
if api.is_finded("chinadns-ng") then
|
if api.is_finded("chinadns-ng") then
|
||||||
o = s:taboption("DNS", Flag, "chinadns_ng", translate("ChinaDNS-NG"), translate("The effect is better, but will increase the memory."))
|
o = s:taboption("DNS", Flag, "chinadns_ng", translate("ChinaDNS-NG"), translate("The effect is better, but will increase the memory."))
|
||||||
o.default = "0"
|
o.default = "0"
|
||||||
|
chinadns_ng_default_tag = s:taboption("DNS", ListValue, "chinadns_ng_default_tag", translate("ChinaDNS-NG Domain Default Tag"))
|
||||||
|
chinadns_ng_default_tag.default = "smart"
|
||||||
|
chinadns_ng_default_tag:value("smart", translate("Smart DNS"))
|
||||||
|
chinadns_ng_default_tag:value("gfw", translate("Remote DNS"))
|
||||||
|
chinadns_ng_default_tag:value("chn", translate("Direct DNS"))
|
||||||
|
chinadns_ng_default_tag.description = "<ul>"
|
||||||
|
.. "<li>" .. translate("Forward to both remote and direct DNS, if the direct DNS resolution result is a mainland China ip, then use the direct result, otherwise use the remote result") .. "</li>"
|
||||||
|
.. "<li>" .. translate("Remote DNS can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "</li>"
|
||||||
|
.. "<li>" .. translate("Direct DNS Internet experience may be better, but DNS will be leaked!") .. "</li>"
|
||||||
|
.. "</ul>"
|
||||||
|
chinadns_ng_default_tag:depends("chinadns_ng", true)
|
||||||
o:depends({dns_mode = "dns2socks"})
|
o:depends({dns_mode = "dns2socks"})
|
||||||
o:depends({dns_mode = "dns2tcp"})
|
o:depends({dns_mode = "dns2tcp"})
|
||||||
o:depends({dns_mode = "sing-box", remote_fakedns = false})
|
o:depends({dns_mode = "sing-box", remote_fakedns = false})
|
||||||
|
|
|
@ -45,11 +45,9 @@ o = s:option(Flag, option_name("tls_allowInsecure"), translate("allowInsecure"),
|
||||||
o.default = "0"
|
o.default = "0"
|
||||||
|
|
||||||
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("hop_interval"), translate("Hop Interval"))
|
o = s:option(Value, option_name("hop_interval"), translate("Hop Interval"))
|
||||||
|
|
|
@ -33,11 +33,9 @@ o.default = "1"
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Flag, option_name("ignoreClientBandwidth"), translate("ignoreClientBandwidth"))
|
o = s:option(Flag, option_name("ignoreClientBandwidth"), translate("ignoreClientBandwidth"))
|
||||||
|
|
|
@ -20,10 +20,10 @@ function gen_config_server(node)
|
||||||
type = "password",
|
type = "password",
|
||||||
password = node.hysteria2_auth_password
|
password = node.hysteria2_auth_password
|
||||||
},
|
},
|
||||||
bandwidth = {
|
bandwidth = (node.hysteria2_up_mbps or node.hysteria2_down_mbps) and {
|
||||||
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or "1 gbps",
|
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or nil,
|
||||||
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or "1 gbps",
|
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or nil
|
||||||
},
|
} or nil,
|
||||||
ignoreClientBandwidth = (node.hysteria2_ignoreClientBandwidth == "1") and true or false,
|
ignoreClientBandwidth = (node.hysteria2_ignoreClientBandwidth == "1") and true or false,
|
||||||
disableUDP = (node.hysteria2_udp == "0") and true or false,
|
disableUDP = (node.hysteria2_udp == "0") and true or false,
|
||||||
}
|
}
|
||||||
|
@ -85,10 +85,10 @@ function gen_config(var)
|
||||||
maxIdleTimeout = (node.hysteria2_idle_timeout) and tonumber(node.hysteria2_idle_timeout) or nil,
|
maxIdleTimeout = (node.hysteria2_idle_timeout) and tonumber(node.hysteria2_idle_timeout) or nil,
|
||||||
disablePathMTUDiscovery = (node.hysteria2_disable_mtu_discovery) and true or false,
|
disablePathMTUDiscovery = (node.hysteria2_disable_mtu_discovery) and true or false,
|
||||||
},
|
},
|
||||||
bandwidth = {
|
bandwidth = (node.hysteria2_up_mbps or node.hysteria2_down_mbps) and {
|
||||||
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or "100 mbps",
|
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or nil,
|
||||||
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or "100 mbps"
|
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or nil
|
||||||
},
|
} or nil,
|
||||||
fast_open = (node.fast_open == "1") and true or false,
|
fast_open = (node.fast_open == "1") and true or false,
|
||||||
lazy = (node.hysteria2_lazy_start == "1") and true or false,
|
lazy = (node.hysteria2_lazy_start == "1") and true or false,
|
||||||
socks5 = (local_socks_address and local_socks_port) and {
|
socks5 = (local_socks_address and local_socks_port) and {
|
||||||
|
|
|
@ -169,6 +169,15 @@ msgstr "远程DNS可以避免更多的DNS泄露,但会导致规则列表外的
|
||||||
msgid "Direct DNS Internet experience may be better, but DNS will be leaked!"
|
msgid "Direct DNS Internet experience may be better, but DNS will be leaked!"
|
||||||
msgstr "直连DNS上网体验可能会更佳,但是会泄露DNS!"
|
msgstr "直连DNS上网体验可能会更佳,但是会泄露DNS!"
|
||||||
|
|
||||||
|
msgid "ChinaDNS-NG Domain Default Tag"
|
||||||
|
msgstr "ChinaDNS-NG 域名默认标签"
|
||||||
|
|
||||||
|
msgid "Smart DNS"
|
||||||
|
msgstr "智能 DNS"
|
||||||
|
|
||||||
|
msgid "Forward to both remote and direct DNS, if the direct DNS resolution result is a mainland China ip, then use the direct result, otherwise use the remote result"
|
||||||
|
msgstr "同时转发给远程和直连DNS,如果直连DNS解析结果是大陆ip,则使用直连结果,否则使用远程结果"
|
||||||
|
|
||||||
msgid "Filter Proxy Host IPv6"
|
msgid "Filter Proxy Host IPv6"
|
||||||
msgstr "过滤代理域名 IPv6"
|
msgstr "过滤代理域名 IPv6"
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ config global
|
||||||
option when_chnroute_default_dns 'direct'
|
option when_chnroute_default_dns 'direct'
|
||||||
option tcp_proxy_mode 'chnroute'
|
option tcp_proxy_mode 'chnroute'
|
||||||
option udp_proxy_mode 'chnroute'
|
option udp_proxy_mode 'chnroute'
|
||||||
|
option chinadns_ng_default_tag 'smart'
|
||||||
option localhost_tcp_proxy_mode 'default'
|
option localhost_tcp_proxy_mode 'default'
|
||||||
option localhost_udp_proxy_mode 'default'
|
option localhost_udp_proxy_mode 'default'
|
||||||
option acl_enable '0'
|
option acl_enable '0'
|
||||||
|
|
|
@ -485,7 +485,7 @@ run_chinadns_ng() {
|
||||||
|
|
||||||
echolog " | - (chinadns-ng) 最高支持4级域名过滤..."
|
echolog " | - (chinadns-ng) 最高支持4级域名过滤..."
|
||||||
|
|
||||||
local _default_tag
|
local _default_tag=$(config_t_get global chinadns_ng_default_tag smart)
|
||||||
local _extra_param=""
|
local _extra_param=""
|
||||||
[ -n "$_chnlist" ] && {
|
[ -n "$_chnlist" ] && {
|
||||||
[ -s "${RULES_PATH}/chnlist" ] && {
|
[ -s "${RULES_PATH}/chnlist" ] && {
|
||||||
|
@ -510,7 +510,7 @@ run_chinadns_ng() {
|
||||||
#当只有使用gfwlist模式时设置默认DNS为本地直连
|
#当只有使用gfwlist模式时设置默认DNS为本地直连
|
||||||
[ -n "$_gfwlist" ] && [ -z "$_chnlist" ] && _default_tag="chn"
|
[ -n "$_gfwlist" ] && [ -z "$_chnlist" ] && _default_tag="chn"
|
||||||
}
|
}
|
||||||
[ -n "$_default_tag" ] && _extra_param="${_extra_param} -d ${_default_tag}"
|
[ -n "$_default_tag" ] && [ "$_default_tag" != "smart" ] && _extra_param="${_extra_param} -d ${_default_tag}"
|
||||||
|
|
||||||
_log_path="/dev/null"
|
_log_path="/dev/null"
|
||||||
ln_run "$(first_type chinadns-ng)" chinadns-ng "$_log_path" -v -b 127.0.0.1 -l "${_listen_port}" ${_dns_china:+-c "${_dns_china}"} ${_dns_trust:+-t "${_dns_trust}"} ${_extra_param} -f ${_no_ipv6_rules:+-N=${_no_ipv6_rules}}
|
ln_run "$(first_type chinadns-ng)" chinadns-ng "$_log_path" -v -b 127.0.0.1 -l "${_listen_port}" ${_dns_china:+-c "${_dns_china}"} ${_dns_trust:+-t "${_dns_trust}"} ${_extra_param} -f ${_no_ipv6_rules:+-N=${_no_ipv6_rules}}
|
||||||
|
|
|
@ -45,11 +45,9 @@ o = s:option(Flag, option_name("tls_allowInsecure"), translate("allowInsecure"),
|
||||||
o.default = "0"
|
o.default = "0"
|
||||||
|
|
||||||
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("hop_interval"), translate("Hop Interval"))
|
o = s:option(Value, option_name("hop_interval"), translate("Hop Interval"))
|
||||||
|
|
|
@ -33,11 +33,9 @@ o.default = "1"
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
o = s:option(Value, option_name("up_mbps"), translate("Max upload Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
o = s:option(Value, option_name("down_mbps"), translate("Max download Mbps"))
|
||||||
o.default = "100"
|
|
||||||
o.rewrite_option = o.option
|
o.rewrite_option = o.option
|
||||||
|
|
||||||
o = s:option(Flag, option_name("ignoreClientBandwidth"), translate("ignoreClientBandwidth"))
|
o = s:option(Flag, option_name("ignoreClientBandwidth"), translate("ignoreClientBandwidth"))
|
||||||
|
|
|
@ -20,10 +20,10 @@ function gen_config_server(node)
|
||||||
type = "password",
|
type = "password",
|
||||||
password = node.hysteria2_auth_password
|
password = node.hysteria2_auth_password
|
||||||
},
|
},
|
||||||
bandwidth = {
|
bandwidth = (node.hysteria2_up_mbps or node.hysteria2_down_mbps) and {
|
||||||
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or "1 gbps",
|
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or nil,
|
||||||
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or "1 gbps",
|
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or nil
|
||||||
},
|
} or nil,
|
||||||
ignoreClientBandwidth = (node.hysteria2_ignoreClientBandwidth == "1") and true or false,
|
ignoreClientBandwidth = (node.hysteria2_ignoreClientBandwidth == "1") and true or false,
|
||||||
disableUDP = (node.hysteria2_udp == "0") and true or false,
|
disableUDP = (node.hysteria2_udp == "0") and true or false,
|
||||||
}
|
}
|
||||||
|
@ -82,10 +82,10 @@ function gen_config(var)
|
||||||
maxIdleTimeout = (node.hysteria2_idle_timeout) and tonumber(node.hysteria2_idle_timeout) or nil,
|
maxIdleTimeout = (node.hysteria2_idle_timeout) and tonumber(node.hysteria2_idle_timeout) or nil,
|
||||||
disablePathMTUDiscovery = (node.hysteria2_disable_mtu_discovery) and true or false,
|
disablePathMTUDiscovery = (node.hysteria2_disable_mtu_discovery) and true or false,
|
||||||
},
|
},
|
||||||
bandwidth = {
|
bandwidth = (node.hysteria2_up_mbps or node.hysteria2_down_mbps) and {
|
||||||
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or "100 mbps",
|
up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or nil,
|
||||||
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or "100 mbps"
|
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or nil
|
||||||
},
|
} or nil,
|
||||||
fast_open = (node.fast_open == "1") and true or false,
|
fast_open = (node.fast_open == "1") and true or false,
|
||||||
lazy = (node.hysteria2_lazy_start == "1") and true or false,
|
lazy = (node.hysteria2_lazy_start == "1") and true or false,
|
||||||
socks5 = (local_socks_address and local_socks_port) and {
|
socks5 = (local_socks_address and local_socks_port) and {
|
||||||
|
|
Loading…
Reference in New Issue