OpenClash: bump to v0.41.13-beta
This commit is contained in:
parent
4da95c3acd
commit
625a3c9e83
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.41.12
|
||||
PKG_VERSION:=0.41.13
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
|
||||
@ -462,6 +462,6 @@ function action_refresh_log()
|
||||
end
|
||||
|
||||
function action_del_log()
|
||||
luci.sys.exec("echo '' > /tmp/openclash.log")
|
||||
luci.sys.exec(": > /tmp/openclash.log")
|
||||
return
|
||||
end
|
||||
@ -57,7 +57,7 @@ o = s:taboption("op_mode", Flag, "enable_udp_proxy", font_red..bold_on..translat
|
||||
o.description = translate("Select Mode For UDP Traffics, The Servers Must Support UDP while Choose Proxy")
|
||||
o:depends("en_mode", "redir-host")
|
||||
o:depends("en_mode", "fake-ip")
|
||||
o.default = "1"
|
||||
o.default=1
|
||||
|
||||
o = s:taboption("op_mode", ListValue, "stack_type", translate("Select Stack Type"))
|
||||
o.description = translate("Select Stack Type For Tun Mode, According To The Running Speed on Your Machine")
|
||||
@ -83,7 +83,7 @@ o.default=0
|
||||
|
||||
o = s:taboption("op_mode", Flag, "common_ports", font_red..bold_on..translate("Common Ports Proxy Mode")..bold_off..font_off)
|
||||
o.description = translate("Only Common Ports, Prevent BT/P2P Passing")
|
||||
o.default = "0"
|
||||
o.default=0
|
||||
o:depends("en_mode", "redir-host")
|
||||
o:depends("en_mode", "redir-host-tun")
|
||||
o:depends("en_mode", "redir-host-vpn")
|
||||
@ -91,7 +91,7 @@ o:depends("en_mode", "redir-host-mix")
|
||||
|
||||
o = s:taboption("op_mode", Flag, "china_ip_route", translate("China IP Route"))
|
||||
o.description = translate("Bypass The China Network Flows, Improve Performance")
|
||||
o.default = "0"
|
||||
o.default=0
|
||||
o:depends("en_mode", "redir-host")
|
||||
o:depends("en_mode", "redir-host-tun")
|
||||
o:depends("en_mode", "redir-host-vpn")
|
||||
@ -99,7 +99,7 @@ o:depends("en_mode", "redir-host-mix")
|
||||
|
||||
o = s:taboption("op_mode", Flag, "small_flash_memory", translate("Small Flash Memory"))
|
||||
o.description = translate("Move Core And GEOIP Data File To /tmp/etc/openclash For Small Flash Memory Device")
|
||||
o.default = "0"
|
||||
o.default=0
|
||||
|
||||
---- Operation Mode
|
||||
switch_mode = s:taboption("op_mode", DummyValue, "", nil)
|
||||
@ -145,7 +145,7 @@ o.default = "silent"
|
||||
|
||||
o = s:taboption("settings", Flag, "intranet_allowed", translate("Only intranet allowed"))
|
||||
o.description = translate("When Enabled, The Control Panel And The Connection Broker Port Will Not Be Accessible From The Public Network")
|
||||
o.default = 0
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("settings", Value, "proxy_port")
|
||||
o.title = translate("Redir Port")
|
||||
@ -178,11 +178,11 @@ o.description = translate("Please Make Sure Ports Available")
|
||||
---- DNS Settings
|
||||
o = s:taboption("dns", Flag, "enable_redirect_dns", font_red..bold_on..translate("Redirect Local DNS Setting")..bold_off..font_off)
|
||||
o.description = translate("Set Local DNS Redirect")
|
||||
o.default = 1
|
||||
o.default=1
|
||||
|
||||
o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate("Custom DNS Setting")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off
|
||||
o.default = 0
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("dns", Flag, "ipv6_enable", translate("Enable ipv6 Resolve"))
|
||||
o.description = font_red..bold_on..translate("Enable Clash to Resolve ipv6 DNS Requests")..bold_off..font_off
|
||||
@ -300,7 +300,7 @@ o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Suppor
|
||||
---- Rules Settings
|
||||
o = s:taboption("rules", Flag, "rule_source", translate("Enable Other Rules"))
|
||||
o.description = translate("Use Other Rules")
|
||||
o.default = 0
|
||||
o.default=0
|
||||
|
||||
if op_mode == "fake-ip" then
|
||||
o = s:taboption("rules", Flag, "enable_custom_clash_rules", font_red..bold_on..translate("Custom Clash Rules(Access Control)")..bold_off..font_off)
|
||||
@ -308,7 +308,7 @@ else
|
||||
o = s:taboption("rules", Flag, "enable_custom_clash_rules", font_red..bold_on..translate("Custom Clash Rules")..bold_off..font_off)
|
||||
end
|
||||
o.description = translate("Use Custom Rules")
|
||||
o.default = 0
|
||||
o.default=0
|
||||
|
||||
custom_rules = s:taboption("rules", Value, "custom_rules")
|
||||
custom_rules:depends("enable_custom_clash_rules", 1)
|
||||
|
||||
@ -52,7 +52,7 @@ function line_tolocal(str){
|
||||
}else{
|
||||
strt[i]=v;}})
|
||||
var old_log_line = sessionStorage.log_line;
|
||||
if ( old_log_line != null) {
|
||||
if ( old_log_line != null && strt.length != null ) {
|
||||
if (old_log_line - strt.length < 0) {
|
||||
sessionStorage.log_line = strt.length;
|
||||
return strt.slice('-'+(strt.length-old_log_line))
|
||||
@ -68,11 +68,14 @@ function line_tolocal(str){
|
||||
return strt
|
||||
}
|
||||
}
|
||||
else if ( strt.length != null ) {
|
||||
sessionStorage.log_line = strt.length;
|
||||
return strt
|
||||
}
|
||||
else {
|
||||
sessionStorage.log_line = strt.length;
|
||||
return strt
|
||||
}
|
||||
|
||||
sessionStorage.log_line = "0";
|
||||
return strt
|
||||
}
|
||||
}
|
||||
|
||||
function poll_log(){
|
||||
|
||||
@ -922,15 +922,10 @@ do_run_file()
|
||||
nohup /usr/share/openclash/openclash_core.sh "$core_type" &
|
||||
}
|
||||
|
||||
if [ "$china_ip_route" = "1" ]; then
|
||||
if [ ! -f "$chnr_path" ]; then
|
||||
echo "检测到大陆白名单列表不存在,准备开始下载..." >$START_LOG
|
||||
nofile=1
|
||||
nohup /usr/share/openclash/openclash_chnroute.sh &
|
||||
else
|
||||
ipset -! flush china_ip_route 2>/dev/null
|
||||
ipset -! restore </etc/openclash/china_ip_route.ipset 2>/dev/null
|
||||
fi
|
||||
if [ "$china_ip_route" = "1" ] && [ ! -f "$chnr_path" ]; then
|
||||
echo "检测到大陆白名单列表不存在,准备开始下载..." >$START_LOG
|
||||
nofile=1
|
||||
nohup /usr/share/openclash/openclash_chnroute.sh &
|
||||
fi
|
||||
|
||||
if [ "$nofile" = "1" ]; then
|
||||
@ -1238,6 +1233,11 @@ cat > "/var/etc/openclash.include" <<-EOF
|
||||
/etc/init.d/openclash reload >/dev/null 2>&1
|
||||
EOF
|
||||
|
||||
if [ "$china_ip_route" = "1" ] && [ -f "/etc/openclash/china_ip_route.ipset" ]; then
|
||||
ipset -! flush china_ip_route 2>/dev/null
|
||||
ipset -! restore </etc/openclash/china_ip_route.ipset 2>/dev/null
|
||||
fi
|
||||
|
||||
#lan_ac
|
||||
if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then
|
||||
if [ "$lan_ac_mode" = "0" ]; then
|
||||
@ -1356,7 +1356,7 @@ if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 3 ]; then
|
||||
fi
|
||||
iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1
|
||||
if [ "$en_mode" = "redir-host" ]; then
|
||||
iptables -t mangle -A openclash -m set --match-set china_ip_route dst -j RETURN >/dev/null 2>&1
|
||||
iptables -t nat -A openclash_output -m set --match-set china_ip_route dst -j RETURN >/dev/null 2>&1
|
||||
fi
|
||||
if [ "$intranet_allowed" -eq 1 ]; then
|
||||
iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j DNAT --to-destination "$lan_ip:$proxy_port"
|
||||
|
||||
@ -73,6 +73,7 @@ EOF
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 系统信息 =====================#
|
||||
|
||||
主机型号: $(cat /tmp/sysinfo/model 2>/dev/null)
|
||||
固件版本: $(cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_RELEASE 2>/dev/null |awk -F '"' '{print $2}' 2>/dev/null)
|
||||
LuCI版本: $(opkg status luci 2>/dev/null |grep 'Version' |awk -F ': ' '{print $2}' 2>/dev/null)
|
||||
@ -92,6 +93,7 @@ EOF
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 依赖检查 =====================#
|
||||
|
||||
dnsmasq-full: $(ts_re "$(opkg status dnsmasq-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
coreutils: $(ts_re "$(opkg status coreutils 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
coreutils-nohup: $(ts_re "$(opkg status coreutils-nohup 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
@ -102,11 +104,16 @@ ca-certificates: $(ts_re "$(opkg status ca-certificates 2>/dev/null |grep 'Statu
|
||||
ipset: $(ts_re "$(opkg status ipset 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
ip-full: $(ts_re "$(opkg status ip-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
iptables-mod-tproxy: $(ts_re "$(opkg status iptables-mod-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
kmod-ipt-tproxy: $(ts_re "$(opkg status kmod-ipt-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
iptables-mod-extra: $(ts_re "$(opkg status iptables-mod-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
kmod-ipt-extra: $(ts_re "$(opkg status kmod-ipt-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
libcap: $(ts_re "$(opkg status libcap 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
libcap-bin: $(ts_re "$(opkg status libcap-bin 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
ruby: $(ts_re "$(opkg status ruby 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
ruby-yaml: $(ts_re "$(opkg status ruby-yaml 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
ruby-psych: $(ts_re "$(opkg status ruby-psych 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
ruby-pstore: $(ts_re "$(opkg status ruby-pstore 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
ruby-dbm: $(ts_re "$(opkg status ruby-dbm 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
kmod-tun(TUN模式): $(ts_re "$(opkg status kmod-tun 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
luci-compat(Luci-19.07): $(ts_re "$(opkg status luci-compat 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
|
||||
EOF
|
||||
@ -115,6 +122,7 @@ EOF
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 内核检查 =====================#
|
||||
|
||||
EOF
|
||||
if pidof clash >/dev/null; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
@ -209,6 +217,7 @@ fi
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 插件设置 =====================#
|
||||
|
||||
当前配置文件: $RAW_CONFIG_FILE
|
||||
启动配置文件: $CONFIG_FILE
|
||||
运行模式: $en_mode
|
||||
@ -282,7 +291,15 @@ iptables-save -t mangle >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== IPSET状态 =====================#
|
||||
|
||||
EOF
|
||||
ipset list |grep "Name:" >> "$DEBUG_LOG"
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 路由表状态 =====================#
|
||||
|
||||
EOF
|
||||
echo "#route -n" >> "$DEBUG_LOG"
|
||||
route -n >> "$DEBUG_LOG" 2>/dev/null
|
||||
@ -295,6 +312,7 @@ if [ "$en_mode" != "fake-ip" ] && [ "$en_mode" != "redir-host" ]; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== Tun设备状态 =====================#
|
||||
|
||||
EOF
|
||||
ip tuntap list >> "$DEBUG_LOG" 2>/dev/null
|
||||
fi
|
||||
@ -302,12 +320,14 @@ fi
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 端口占用状态 =====================#
|
||||
|
||||
EOF
|
||||
netstat -nlp |grep clash >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 测试本机DNS查询 =====================#
|
||||
|
||||
EOF
|
||||
nslookup www.baidu.com >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
@ -315,6 +335,7 @@ if [ -s "/tmp/resolv.conf.auto" ]; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== resolv.conf.auto =====================#
|
||||
|
||||
EOF
|
||||
cat /tmp/resolv.conf.auto >> "$DEBUG_LOG"
|
||||
fi
|
||||
@ -323,6 +344,7 @@ if [ -s "/tmp/resolv.conf.d/resolv.conf.auto" ]; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== resolv.conf.d =====================#
|
||||
|
||||
EOF
|
||||
cat /tmp/resolv.conf.d/resolv.conf.auto >> "$DEBUG_LOG"
|
||||
fi
|
||||
@ -330,12 +352,14 @@ fi
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 测试本机网络连接 =====================#
|
||||
|
||||
EOF
|
||||
curl -I -m 5 www.baidu.com >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 测试本机网络下载 =====================#
|
||||
|
||||
EOF
|
||||
VERSION_URL="https://raw.githubusercontent.com/vernesong/OpenClash/master/version"
|
||||
if pidof clash >/dev/null; then
|
||||
@ -347,6 +371,7 @@ fi
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 最近运行日志 =====================#
|
||||
|
||||
EOF
|
||||
tail -n 50 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ urlencode() {
|
||||
if [ "$#" -eq "1" ]; then
|
||||
data=$(curl -s -o /dev/null -w %{url_effective} --get --data-urlencode "$1" "")
|
||||
if [ ! -z "$data" ]; then
|
||||
echo "${data##/?}"
|
||||
echo "$(echo ${data##/?} |sed 's/\//%2f/g' |sed 's/:/%3a/g' |sed 's/?/%3f/g' |sed 's/(/%28/g' |sed 's/)/%29/g' |sed 's/\^/%5e/g' |sed 's/=/%3d/g' |sed 's/|/%7c/g')"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -36,7 +36,7 @@ restore_history() {
|
||||
GROUP_STATE_NUM=$(expr "$GROUP_STATE_NUM" + 1)
|
||||
GROUP_STATE=$(GROUP_STATE "$GROUP_NAME")
|
||||
done
|
||||
curl -m 5 --retry 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X PUT -d '{"name":"'"$NOW_NAME"'"}' http://"$LAN_IP":"$PORT"/proxies/"$GROUP_NAME" >/dev/null 2>&1
|
||||
curl -m 5 --retry 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X PUT -d '{"name":"'"$NOW_NAME"'"}' http://"$LAN_IP":"$PORT"/proxies/"$GROUP_NAME" >> "$LOG_FILE"
|
||||
}
|
||||
|
||||
close_all_conection() {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user