update-10.22

This commit is contained in:
github-actions[bot]
2021-10-22 09:11:10 +08:00
parent 5634ea4947
commit e85466fee3
5 changed files with 31 additions and 20 deletions

View File

@@ -521,9 +521,9 @@ function action_rule_mode()
local cn_port = cn_port() local cn_port = cn_port()
if not daip or not cn_port then return end if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port))) info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
mode = info["mode"] mode = info["mode"] or "rule"
else else
mode = uci:get("openclash", "config", "proxy_mode") or "info" mode = uci:get("openclash", "config", "proxy_mode") or "rule"
end end
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
luci.http.write_json({ luci.http.write_json({
@@ -591,7 +591,7 @@ function action_log_level()
local cn_port = cn_port() local cn_port = cn_port()
if not daip or not cn_port then return end if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port))) info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
level = info["log-level"] level = info["log-level"] or "info"
else else
level = uci:get("openclash", "config", "log_level") or "info" level = uci:get("openclash", "config", "log_level") or "info"
end end

View File

@@ -74,47 +74,47 @@ config dns_servers
config dns_servers config dns_servers
option type 'https' option type 'https'
option group 'fallback'
option enabled '1'
option ip 'doh.pub/dns-query' option ip 'doh.pub/dns-query'
option group 'fallback'
option enabled '1'
config dns_servers config dns_servers
option type 'https' option type 'https'
option group 'fallback'
option enabled '1'
option ip 'dns.alidns.com/dns-query' option ip 'dns.alidns.com/dns-query'
option group 'fallback'
option enabled '1'
config dns_servers config dns_servers
option type 'https' option type 'https'
option group 'fallback' option group 'fallback'
option enabled '1'
option ip 'cloudflare-dns.com/dns-query' option ip 'cloudflare-dns.com/dns-query'
option enabled '1'
config dns_servers config dns_servers
option group 'fallback' option group 'fallback'
option enabled '1'
option ip 'dns.rubyfish.cn/dns-query' option ip 'dns.rubyfish.cn/dns-query'
option type 'https' option type 'https'
option enabled '1'
config dns_servers config dns_servers
option enabled '0'
option group 'fallback' option group 'fallback'
option ip 'dns.google' option ip 'dns.google'
option port '853' option port '853'
option type 'tls' option type 'tls'
option enabled '0'
config dns_servers config dns_servers
option enabled '0'
option group 'fallback' option group 'fallback'
option type 'https' option type 'https'
option ip '1.1.1.1/dns-query' option ip '1.1.1.1/dns-query'
option enabled '0'
config dns_servers config dns_servers
option enabled '0'
option group 'fallback' option group 'fallback'
option ip '1.1.1.1' option ip '1.1.1.1'
option port '853' option port '853'
option type 'tls' option type 'tls'
option enabled '0'
config dns_servers config dns_servers
option enabled '0' option enabled '0'
@@ -122,17 +122,24 @@ config dns_servers
option ip '8.8.8.8' option ip '8.8.8.8'
option port '853' option port '853'
option type 'tls' option type 'tls'
config dns_servers config dns_servers
option enabled '0'
option type 'udp' option type 'udp'
option group 'fallback' option group 'fallback'
option ip '2001:4860:4860::8888' option ip '2001:4860:4860::8888'
option port '53' option port '53'
option enabled '0'
config dns_servers config dns_servers
option enabled '0'
option type 'udp' option type 'udp'
option group 'fallback' option group 'fallback'
option ip '2001:4860:4860::8844' option ip '2001:4860:4860::8844'
option port '53' option port '53'
option enabled '0'
config dns_servers
option type 'udp'
option group 'fallback'
option ip '2001:da8::666'
option port '53'
option enabled '1'

View File

@@ -981,12 +981,12 @@ check_run_quick()
else else
if [ -s "/tmp/openclash.change" ]; then if [ -s "/tmp/openclash.change" ]; then
for i in $check_file; do for i in $check_file; do
if [ -z "$(grep "$i $(date -r $i)" "/tmp/openclash.change")" ]; then if [ -z "$(grep "$i $(date -r $i)$" "/tmp/openclash.change")" ]; then
LOG_OUT "Tip: Because of the file【 $i 】modificated, Pause quick start..." LOG_OUT "Tip: Because of the file【 $i 】modificated, Pause quick start..."
quick_start=false quick_start=false
break break
fi fi
done done 2>/dev/null
fi fi
fi fi
} }
@@ -998,7 +998,7 @@ write_run_quick()
: > "/tmp/openclash.change" : > "/tmp/openclash.change"
for i in $check_file; do for i in $check_file; do
echo "$i $(date -r $i)" >> "/tmp/openclash.change" echo "$i $(date -r $i)" >> "/tmp/openclash.change"
done done 2>/dev/null
fi fi
} }

View File

@@ -232,9 +232,11 @@ change_dns()
uci commit dhcp uci commit dhcp
/etc/init.d/dnsmasq restart >/dev/null 2>&1 /etc/init.d/dnsmasq restart >/dev/null 2>&1
fi fi
iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1
iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1
iptables -t nat -I OUTPUT -j openclash_output >/dev/null 2>&1 iptables -t nat -I OUTPUT -j openclash_output >/dev/null 2>&1
iptables -t mangle -I OUTPUT -j openclash_output >/dev/null 2>&1 iptables -t mangle -I OUTPUT -j openclash_output >/dev/null 2>&1
nohup /usr/share/openclash/openclash_watchdog.sh & [ "$(unify_ps_status "openclash_watchdog.sh")" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && nohup /usr/share/openclash/openclash_watchdog.sh &
fi fi
} }

View File

@@ -618,6 +618,7 @@ EOF
fi fi
if [ ! -z "$grpc_service_name" ]; then if [ ! -z "$grpc_service_name" ]; then
cat >> "$SERVER_FILE" <<-EOF cat >> "$SERVER_FILE" <<-EOF
network: grpc
grpc-opts: grpc-opts:
grpc-service-name: "$grpc_service_name" grpc-service-name: "$grpc_service_name"
EOF EOF
@@ -625,6 +626,7 @@ EOF
if [ "$obfs_trojan" = "ws" ]; then if [ "$obfs_trojan" = "ws" ]; then
if [ -n "$trojan_ws_path" ] || [ -n "$trojan_ws_headers" ]; then if [ -n "$trojan_ws_path" ] || [ -n "$trojan_ws_headers" ]; then
cat >> "$SERVER_FILE" <<-EOF cat >> "$SERVER_FILE" <<-EOF
network: ws
ws-opts: ws-opts:
EOF EOF
fi fi