diff --git a/package/ctcgfw/luci-app-openclash/Makefile b/package/ctcgfw/luci-app-openclash/Makefile index 35a0cac735..8638810486 100644 --- a/package/ctcgfw/luci-app-openclash/Makefile +++ b/package/ctcgfw/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.37.4 +PKG_VERSION:=0.37.5 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong diff --git a/package/ctcgfw/luci-app-openclash/files/etc/config/openclash b/package/ctcgfw/luci-app-openclash/files/etc/config/openclash index 1122088782..ac29744758 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/config/openclash +++ b/package/ctcgfw/luci-app-openclash/files/etc/config/openclash @@ -23,7 +23,7 @@ config openclash 'config' option log_level 'silent' option proxy_mode 'Rule' option intranet_allowed '0' - option enable_udp_proxy '0' + option enable_udp_proxy '1' option lan_ac_mode '0' option operation_mode 'redir-host' option enable_rule_proxy '0' diff --git a/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash b/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash index e794c61037..15c30b63d9 100755 --- a/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash +++ b/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash @@ -4,6 +4,7 @@ START=99 STOP=15 +LOGTIME=$(date "+%Y-%m-%d %H:%M:%S") CLASH="/etc/openclash/clash" CLASH_CONFIG="/etc/openclash" CRON_FILE="/etc/crontabs/root" @@ -110,8 +111,8 @@ yml_check() sed -i "s/- \{2,\}/- /g" "$3" 2>/dev/null #检查关键字避免后续操作出错 - /usr/share/openclash/yml_field_name_ch.sh "$3" - + /usr/share/openclash/yml_field_name_ch.sh "$3" 2>/dev/null + #dns [ -z "$(grep "^dns:" "$3")" ] && { sed -i "s/^ \{1,\}dns:/dns:/g" "$3" 2>/dev/null @@ -131,7 +132,7 @@ yml_check() group_len=$(sed -n '/^Proxy Group:/=' "$3" 2>/dev/null) dns_len=$(sed -n '/^dns:/=' "$3" 2>/dev/null) rule_len=$(sed -n '/^Rule:/=' "$3" 2>/dev/null) - + if [ "$dns_len" -ge "$proxy_len" ] || [ "$dns_len" -ge "$rule_len" ] || [ "$dns_len" -ge "$group_len" ]; then echo "错误: 不支持的配置文件, General 设置部分应位于开头,请根据模板修改后重试!" > $START_LOG echo "${LOGTIME} Unsupported Config, Please Check The General Setting's location And Try-again!" >> $LOG_FILE @@ -192,7 +193,6 @@ yml_check() fi 2>/dev/null fi - if [ ! -z "$provider_len" ]; then proxy_provider_mode=1 fi @@ -208,10 +208,10 @@ yml_check() sed -i '/^ \{0,\}nameserver:/,/^Custom DNS End$/d' "$3" 2>/dev/null sed -i '/##Custom DNS##/r/tmp/bakdns.config' "$3" 2>/dev/null rm -rf /tmp/backdns.config 2>/dev/null - fi - + fi 2>/dev/null + yml_dns_check - + if [ ! -z "$(grep "^ \{1,\}port:" "$3")" ] || [ ! -z "$(grep "^ \{1,\}mode:" "$3")" ] || [ ! -z "$(grep "^ \{1,\}log-level:" "$3")" ]; then cp "$3" /tmp/config.check 2>/dev/null sed -i '/^dns:/,$d' /tmp/config.check 2>/dev/null @@ -240,7 +240,7 @@ yml_dns_check() sed -i '/^Proxy:/i\dns:' "$CONFIG_FILE" 2>/dev/null fi fi - + if [ -z "$(grep '^ \{0,\}nameserver:' "$CONFIG_FILE")" ]; then if [ "$proxy_provider_mode" -eq 1 ]; then sed -i '/^proxy-provider:/i\ nameserver:' "$CONFIG_FILE" 2>/dev/null @@ -256,21 +256,21 @@ yml_dns_check() if [ -z "$dns_port" ] || [ "$dns_port" -eq 53 ]; then dns_port=7874 fi - + if [ ! -z "$(grep "^ \{0,\}listen:" "$CONFIG_FILE")" ]; then - if [ "$ipv6_enable" -ne 1 ]; then + if [ "$ipv6_enable" != "1" ]; then sed -i "/^ \{0,\}listen:/c\ listen: 127.0.0.1:${dns_port}" "$CONFIG_FILE" 2>/dev/null else sed -i "/^ \{0,\}listen:/c\ listen: 0.0.0.0:${dns_port}" "$CONFIG_FILE" 2>/dev/null fi else - if [ "$ipv6_enable" -ne 1 ]; then + if [ "$ipv6_enable" != "1" ]; then sed -i "/^dns:/a\ listen: 127.0.0.1:${dns_port}" "$CONFIG_FILE" 2>/dev/null else sed -i "/^dns:/a\ listen: 0.0.0.0:${dns_port}" "$CONFIG_FILE" 2>/dev/null fi - fi - + fi 2>/dev/null + uci set openclash.config.dns_port="$dns_port" && uci commit openclash } @@ -290,7 +290,7 @@ yml_provider_path() sed -i "s#${provider_path}#./proxy_provider/${provider_name}#" "$1" 2>/dev/null fi done - fi + fi 2>/dev/null } #检查代理集文件防止启动失败 @@ -630,11 +630,11 @@ fi lan_ac() { - if [ -z "$1" ]; then + if [ -z "$1" ]; then return - fi + fi - ipset add "$2" "$1" 2>/dev/null + ipset add "$2" "$1" 2>/dev/null } @@ -662,7 +662,7 @@ else if [ ! -f "$CONFIG_FILE" ] && [ -f "$BACKUP_FILE" ]; then cp "$BACKUP_FILE" "$CONFIG_FILE" fi -fi +fi 2>/dev/null CONFIG_NAME=$(echo "$CONFIG_FILE" |awk -F '/' '{print $5}' 2>/dev/null) } @@ -715,6 +715,272 @@ do_run_mode() [ ! -x "/etc/openclash/core/clash" ] && chmod 4755 /etc/openclash/core/clash 2>/dev/null } +set_firewall() +{ +if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "udp dpt:53" |grep "0.0.0.0/0 \{0,\}0.0.0.0/0" |wc -l)" -gt 1 ] && [ "$enable_redirect_dns" -eq "1" ]; then + echo "发现53端口被劫持,清理防火墙规则..." >$START_LOG + pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/0.0.0.0\/0 \{0,\}0.0.0.0\/0 \{0,\}udp dpt:53/=' 2>/dev/null |sort -rn) + for pre_line in $pre_lines; do + iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1 + done + iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 >/dev/null 2>&1 + sleep 2 +fi + +if [ -z "$(uci get firewall.openclash 2>/dev/null)" ] || [ -z "$(uci get ucitrack.@openclash[-1].init 2>/dev/null)" ]; then + uci delete ucitrack.@openclash[-1] >/dev/null 2>&1 + uci add ucitrack openclash >/dev/null 2>&1 + uci set ucitrack.@openclash[-1].init=openclash >/dev/null 2>&1 + uci commit ucitrack >/dev/null 2>&1 + uci delete firewall.openclash >/dev/null 2>&1 + uci set firewall.openclash=include >/dev/null 2>&1 + uci set firewall.openclash.type=script >/dev/null 2>&1 + uci set firewall.openclash.path=/var/etc/openclash.include >/dev/null 2>&1 + uci set firewall.openclash.reload=1 >/dev/null 2>&1 +fi + +if [ "$(uci get firewall.@defaults[0].forward)" != "ACCEPT" ]; then + uci set firewall.@defaults[0].forward=ACCEPT >/dev/null 2>&1 + uci commit firewall >/dev/null 2>&1 + /etc/init.d/firewall reload >/dev/null 2>&1 +fi + +mkdir -p /var/etc +cat > "/var/etc/openclash.include" <<-EOF +/etc/init.d/openclash reload >/dev/null 2>&1 +EOF + +#lan_ac +if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then + if [ "$lan_ac_mode" = "0" ] && [ ! -z "$(uci get openclash.config.lan_ac_black_ips 2>/dev/null)" ]; then + ipset create lan_ac_black_ips hash:net + config_load "openclash" + config_list_foreach "config" "lan_ac_black_ips" lan_ac "lan_ac_black_ips" + elif [ "$lan_ac_mode" = "1" ] && [ ! -z "$(uci get openclash.config.lan_ac_white_ips 2>/dev/null)" ]; then + ipset create lan_ac_white_ips hash:net + config_load "openclash" + config_list_foreach "config" "lan_ac_white_ips" lan_ac "lan_ac_white_ips" + fi +fi + +if [ -z "$en_mode_tun" ]; then + #tcp + iptables -t nat -N openclash + iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN + iptables -t nat -A openclash -d 10.0.0.0/8 -j RETURN + iptables -t nat -A openclash -d 127.0.0.0/8 -j RETURN + iptables -t nat -A openclash -d 169.254.0.0/16 -j RETURN + iptables -t nat -A openclash -d 172.16.0.0/12 -j RETURN + iptables -t nat -A openclash -d 192.168.0.0/16 -j RETURN + iptables -t nat -A openclash -d 224.0.0.0/4 -j RETURN + iptables -t nat -A openclash -d 240.0.0.0/4 -j RETURN + if [ ! -z "$wan_ip4" ]; then + for wan_ip4s in $wan_ip4; do + iptables -t nat -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null + done + fi + iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port" + #iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j REDIRECT --to-ports "$proxy_port" + #iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j REDIRECT --to-ports "$proxy_port" + iptables -t nat -A PREROUTING -p tcp -j openclash + + #udp + if [ "$enable_udp_proxy" -eq 1 ]; then + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 + ip route add local default dev lo table "$PROXY_ROUTE_TABLE" + iptables -t mangle -N openclash + iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -d 0.0.0.0/8 -j RETURN + iptables -t mangle -A openclash -d 10.0.0.0/8 -j RETURN + iptables -t mangle -A openclash -d 127.0.0.0/8 -j RETURN + iptables -t mangle -A openclash -d 169.254.0.0/16 -j RETURN + iptables -t mangle -A openclash -d 172.16.0.0/12 -j RETURN + iptables -t mangle -A openclash -d 192.168.0.0/16 -j RETURN + iptables -t mangle -A openclash -d 224.0.0.0/4 -j RETURN + iptables -t mangle -A openclash -d 240.0.0.0/4 -j RETURN + if [ ! -z "$wan_ip4" ]; then + for wan_ip4s in $wan_ip4; do + iptables -t mangle -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null + done + fi + + iptables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK" + iptables -t mangle -A PREROUTING -p udp -j openclash + fi + + if [ "$en_mode" = "fake-ip" ]; then + iptables -t nat -A OUTPUT -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" + if [ "$enable_udp_proxy" -eq 1 ]; then + iptables -t mangle -A OUTPUT -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" + fi + fi + + if [ "$ipv6_enable" -eq 1 ]; then + #tcp + ip6tables -t nat -N openclash + if [ ! -z "$lan_ip6" ]; then + for lan_ip6s in $lan_ip6; do + ip6tables -t nat -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null + done + fi + ip6tables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port" + ip6tables -t nat -A PREROUTING -p tcp -j openclash + + #udp + if [ "$enable_udp_proxy" -eq 1 ]; then + ip6tables -t mangle -N openclash + if [ ! -z "$lan_ip6" ]; then + for lan_ip6s in $lan_ip6; do + if [ "$enable_udp_proxy" -eq 1 ]; then + ip6tables -t mangle -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null + fi + done + fi + ip6tables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK" + ip6tables -t mangle -A PREROUTING -p udp -j openclash + fi + fi +else + #TUN模式 + ipset create localnetwork hash:net + ipset add localnetwork 127.0.0.0/8 + ipset add localnetwork 10.0.0.0/8 + ipset add localnetwork 169.254.0.0/16 + ipset add localnetwork 192.168.0.0/16 + ipset add localnetwork 224.0.0.0/4 + ipset add localnetwork 240.0.0.0/4 + ipset add localnetwork 172.16.0.0/12 + if [ ! -z "$wan_ip4" ]; then + for wan_ip4s in $wan_ip4; do + ipset add localnetwork "$wan_ip4s" 2>/dev/null + done + fi + #启动TUN + if [ "$en_mode_tun" = "2" ]; then + ip tuntap add user root mode tun clash0 + ip link set clash0 up + ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE" + elif [ "$en_mode_tun" = "1" ]; then + TUN_WAIT=0 + while ( [ ! -z "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] ) + do + TUN_WAIT=$(expr "$TUN_WAIT" + 1) + sleep 2 + done + ip route replace default dev utun table "$PROXY_ROUTE_TABLE" + fi + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 + #设置防火墙 + iptables -t mangle -N openclash + iptables -t mangle -F openclash + iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN + if [ "$en_mode" = "fake-ip" ]; then + iptables -t mangle -A openclash -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" + fi + iptables -t mangle -I OUTPUT -j openclash + iptables -t mangle -I PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -I PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -I PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" + iptables -t nat -I PREROUTING -p tcp --dport 53 -j ACCEPT + #ipv6 + # if [ "$ipv6_enable" -eq 1 ]; then + # ip6tables -t mangle -I PREROUTING -j MARK --set-mark "$PROXY_FWMARK" + # fi +fi +} + +revert_firewall() +{ + rm -rf /var/etc/openclash.include 2>/dev/null + + #ipv4 + + ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1 + ip route del local default dev lo table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1 + + iptables -t nat -D PREROUTING -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1 + + iptables -t mangle -F openclash >/dev/null 2>&1 + iptables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1 + iptables -t mangle -X openclash >/dev/null 2>&1 + + iptables -t nat -F openclash >/dev/null 2>&1 + iptables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1 + iptables -t nat -X openclash >/dev/null 2>&1 + + out_lines=$(iptables -nvL OUTPUT -t mangle |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn) + for out_line in $out_lines; do + iptables -t mangle -D OUTPUT "$out_line" >/dev/null 2>&1 + done + + out_lines=$(iptables -nvL OUTPUT -t nat |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn) + for out_line in $out_lines; do + iptables -t nat -D OUTPUT "$out_line" >/dev/null 2>&1 + done + + #pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/8\.8\./=' 2>/dev/null |sort -rn) + #for pre_line in $pre_lines; do + # iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1 + #done + + #ipv6 + ip6tables -t mangle -F openclash >/dev/null 2>&1 + ip6tables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1 + ip6tables -t mangle -X openclash >/dev/null 2>&1 + + ip6tables -t nat -F openclash >/dev/null 2>&1 + ip6tables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1 + ip6tables -t nat -X openclash >/dev/null 2>&1 + + #TUN + ip route del default dev clash0 table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1 + ip route del default dev utun table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1 + ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1 + ip link set dev clash0 down >/dev/null 2>&1 + ip tuntap del clash0 mode tun >/dev/null 2>&1 + + iptables -t mangle -D OUTPUT -j openclash >/dev/null 2>&1 + iptables -t mangle -D PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -D PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -D PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1 + ip6tables -t mangle -D PREROUTING -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1 + iptables -t mangle -F openclash >/dev/null 2>&1 + iptables -t mangle -X openclash >/dev/null 2>&1 + + ipset destroy localnetwork >/dev/null 2>&1 + ipset destroy lan_ac_white_ips >/dev/null 2>&1 + ipset destroy lan_ac_black_ips >/dev/null 2>&1 +} + +get_config() +{ + enable_custom_dns=$(uci get openclash.config.enable_custom_dns 2>/dev/null) + rule_source=$(uci get openclash.config.rule_source 2>/dev/null) + enable_custom_clash_rules=$(uci get openclash.config.enable_custom_clash_rules 2>/dev/null) + da_password=$(uci get openclash.config.dashboard_password 2>/dev/null) + cn_port=$(uci get openclash.config.cn_port 2>/dev/null) + proxy_port=$(uci get openclash.config.proxy_port 2>/dev/null) + ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null) + http_port=$(uci get openclash.config.http_port 2>/dev/null) + socks_port=$(uci get openclash.config.socks_port 2>/dev/null) + enable_redirect_dns=$(uci get openclash.config.enable_redirect_dns 2>/dev/null) + lan_ip=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) + wan_ip4=$(ifconfig | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null) + lan_ip6=$(ifconfig | grep 'inet6 addr' | awk '{print $3}' 2>/dev/null) + direct_dns=$(uci get openclash.config.direct_dns 2>/dev/null) + disable_masq_cache=$(uci get openclash.config.disable_masq_cache 2>/dev/null) + log_level=$(uci get openclash.config.log_level 2>/dev/null) + proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null) + intranet_allowed=$(uci get openclash.config.intranet_allowed 2>/dev/null) + enable_udp_proxy=$(uci get openclash.config.enable_udp_proxy 2>/dev/null) + operation_mode=$(uci get openclash.config.operation_mode 2>/dev/null) + lan_ac_mode=$(uci get openclash.config.lan_ac_mode 2>/dev/null) + enable_rule_proxy=$(uci get openclash.config.enable_rule_proxy 2>/dev/null) +} + start() { #禁止多个实例 @@ -724,7 +990,7 @@ status=$(ps|grep -c /etc/init.d/openclash) config_choose enable=$(uci get openclash.config.enable 2>/dev/null) -LOGTIME=$(date "+%Y-%m-%d %H:%M:%S") + if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then #检查是否存在核心文件 do_run_mode @@ -735,29 +1001,7 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then } echo "OpenClash 开始启动..." >$START_LOG echo "第一步: 获取配置..." >$START_LOG - enable_custom_dns=$(uci get openclash.config.enable_custom_dns 2>/dev/null) - rule_source=$(uci get openclash.config.rule_source 2>/dev/null) - enable_custom_clash_rules=$(uci get openclash.config.enable_custom_clash_rules 2>/dev/null) - da_password=$(uci get openclash.config.dashboard_password 2>/dev/null) - cn_port=$(uci get openclash.config.cn_port 2>/dev/null) - proxy_port=$(uci get openclash.config.proxy_port 2>/dev/null) - ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null) - http_port=$(uci get openclash.config.http_port 2>/dev/null) - socks_port=$(uci get openclash.config.socks_port 2>/dev/null) - enable_redirect_dns=$(uci get openclash.config.enable_redirect_dns 2>/dev/null) - lan_ip=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) - wan_ip4=$(ifconfig | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null) - lan_ip6=$(ifconfig | grep 'inet6 addr' | awk '{print $3}' 2>/dev/null) - direct_dns=$(uci get openclash.config.direct_dns 2>/dev/null) - disable_masq_cache=$(uci get openclash.config.disable_masq_cache 2>/dev/null) - log_level=$(uci get openclash.config.log_level 2>/dev/null) - proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null) - intranet_allowed=$(uci get openclash.config.intranet_allowed 2>/dev/null) - enable_udp_proxy=$(uci get openclash.config.enable_udp_proxy 2>/dev/null) - operation_mode=$(uci get openclash.config.operation_mode 2>/dev/null) - lan_ac_mode=$(uci get openclash.config.lan_ac_mode 2>/dev/null) - enable_rule_proxy=$(uci get openclash.config.enable_rule_proxy 2>/dev/null) - + get_config echo "第二步: 配置文件检查..." >$START_LOG yml_check "$en_mode" "$enable_custom_dns" "$CONFIG_FILE" "$BACKUP_FILE" "$START_BACKUP" grep "^ \{0,\}Proxy Group:" "$CONFIG_FILE" >/dev/null 2>&1 && grep "^ \{0,\}Rule:" "$CONFIG_FILE" >/dev/null 2>&1 @@ -791,7 +1035,15 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then echo "" >$START_LOG else echo "第五步: 启动主程序..." >$START_LOG - nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 & + config_reload=$(uci get openclash.config.config_reload 2>/dev/null) + if [ -n "$(pidof clash)" ] && [ "$en_mode_tun" != "1" ] && [ "$config_reload" != "0" ]; then + curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null + else + kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null + nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 & + fi + uci set openclash.config.config_reload=1 + uci commit openclash #检测proxy_provider配置文件状态 echo "第六步: 等待主程序下载代理集..." >$START_LOG @@ -801,179 +1053,7 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then ln -s /usr/share/openclash/yacd /www/luci-static/openclash 2>/dev/null echo "第八步: 设置防火墙规则..." >$START_LOG - if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "udp dpt:53" |grep "0.0.0.0/0 \{0,\}0.0.0.0/0" |wc -l)" -gt 1 ] && [ "$enable_redirect_dns" -eq "1" ]; then - echo "发现53端口被劫持,清理防火墙规则..." >$START_LOG - pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/0.0.0.0\/0 \{0,\}0.0.0.0\/0 \{0,\}udp dpt:53/=' 2>/dev/null |sort -rn) - for pre_line in $pre_lines; do - iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1 - done - iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 >/dev/null 2>&1 - sleep 2 - fi - - if [ -z "$(uci get firewall.openclash 2>/dev/null)" ] || [ -z "$(uci get ucitrack.@openclash[-1].init 2>/dev/null)" ]; then - uci delete ucitrack.@openclash[-1] >/dev/null 2>&1 - uci add ucitrack openclash >/dev/null 2>&1 - uci set ucitrack.@openclash[-1].init=openclash >/dev/null 2>&1 - uci commit ucitrack >/dev/null 2>&1 - uci delete firewall.openclash >/dev/null 2>&1 - uci set firewall.openclash=include >/dev/null 2>&1 - uci set firewall.openclash.type=script >/dev/null 2>&1 - uci set firewall.openclash.path=/var/etc/openclash.include >/dev/null 2>&1 - uci set firewall.openclash.reload=1 >/dev/null 2>&1 - fi - - if [ "$(uci get firewall.@defaults[0].forward)" != "ACCEPT" ]; then - uci set firewall.@defaults[0].forward=ACCEPT >/dev/null 2>&1 - uci commit firewall >/dev/null 2>&1 - /etc/init.d/firewall reload >/dev/null 2>&1 - fi - -mkdir -p /var/etc -cat > "/var/etc/openclash.include" <<-EOF -/etc/init.d/openclash restart -EOF - #lan_ac - if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then - if [ "$lan_ac_mode" = "0" ] && [ ! -z "$(uci get openclash.config.lan_ac_black_ips 2>/dev/null)" ]; then - ipset create lan_ac_black_ips hash:net - config_load "openclash" - config_list_foreach "config" "lan_ac_black_ips" lan_ac "lan_ac_black_ips" - elif [ "$lan_ac_mode" = "1" ] && [ ! -z "$(uci get openclash.config.lan_ac_white_ips 2>/dev/null)" ]; then - ipset create lan_ac_white_ips hash:net - config_load "openclash" - config_list_foreach "config" "lan_ac_white_ips" lan_ac "lan_ac_white_ips" - fi - fi - - if [ -z "$en_mode_tun" ]; then - - #tcp - iptables -t nat -N openclash - iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN - iptables -t nat -A openclash -d 10.0.0.0/8 -j RETURN - iptables -t nat -A openclash -d 127.0.0.0/8 -j RETURN - iptables -t nat -A openclash -d 169.254.0.0/16 -j RETURN - iptables -t nat -A openclash -d 172.16.0.0/12 -j RETURN - iptables -t nat -A openclash -d 192.168.0.0/16 -j RETURN - iptables -t nat -A openclash -d 224.0.0.0/4 -j RETURN - iptables -t nat -A openclash -d 240.0.0.0/4 -j RETURN - if [ ! -z "$wan_ip4" ]; then - for wan_ip4s in $wan_ip4; do - iptables -t nat -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null - done - fi - iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port" - iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j REDIRECT --to-ports "$proxy_port" - iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j REDIRECT --to-ports "$proxy_port" - iptables -t nat -A PREROUTING -p tcp -j openclash - - #udp - if [ "$enable_udp_proxy" -eq 1 ]; then - ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 - ip route add local default dev lo table "$PROXY_ROUTE_TABLE" - iptables -t mangle -N openclash - iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -d 0.0.0.0/8 -j RETURN - iptables -t mangle -A openclash -d 10.0.0.0/8 -j RETURN - iptables -t mangle -A openclash -d 127.0.0.0/8 -j RETURN - iptables -t mangle -A openclash -d 169.254.0.0/16 -j RETURN - iptables -t mangle -A openclash -d 172.16.0.0/12 -j RETURN - iptables -t mangle -A openclash -d 192.168.0.0/16 -j RETURN - iptables -t mangle -A openclash -d 224.0.0.0/4 -j RETURN - iptables -t mangle -A openclash -d 240.0.0.0/4 -j RETURN - if [ ! -z "$wan_ip4" ]; then - for wan_ip4s in $wan_ip4; do - iptables -t mangle -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null - done - fi - - iptables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK" - iptables -t mangle -A PREROUTING -p udp -j openclash - fi - - if [ "$en_mode" = "fake-ip" ]; then - iptables -t nat -A OUTPUT -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" - if [ "$enable_udp_proxy" -eq 1 ]; then - iptables -t mangle -A OUTPUT -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" - fi - fi - - if [ "$ipv6_enable" -eq 1 ]; then - #tcp - ip6tables -t nat -N openclash - if [ ! -z "$lan_ip6" ]; then - for lan_ip6s in $lan_ip6; do - ip6tables -t nat -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null - done - fi - ip6tables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port" - ip6tables -t nat -A PREROUTING -p tcp -j openclash - - #udp - if [ "$enable_udp_proxy" -eq 1 ]; then - ip6tables -t mangle -N openclash - if [ ! -z "$lan_ip6" ]; then - for lan_ip6s in $lan_ip6; do - if [ "$enable_udp_proxy" -eq 1 ]; then - ip6tables -t mangle -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null - fi - done - fi - ip6tables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK" - ip6tables -t mangle -A PREROUTING -p udp -j openclash - fi - fi - else - #TUN模式 - ipset create localnetwork hash:net - ipset add localnetwork 127.0.0.0/8 - ipset add localnetwork 10.0.0.0/8 - ipset add localnetwork 169.254.0.0/16 - ipset add localnetwork 192.168.0.0/16 - ipset add localnetwork 224.0.0.0/4 - ipset add localnetwork 240.0.0.0/4 - ipset add localnetwork 172.16.0.0/12 - if [ ! -z "$wan_ip4" ]; then - for wan_ip4s in $wan_ip4; do - ipset add localnetwork "$wan_ip4s" 2>/dev/null - done - fi - #启动TUN - if [ "$en_mode_tun" = "2" ]; then - ip tuntap add user root mode tun clash0 - ip link set clash0 up - ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE" - elif [ "$en_mode_tun" = "1" ]; then - TUN_WAIT=0 - while ( [ ! -z "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] ) - do - TUN_WAIT=$(expr "$TUN_WAIT" + 1) - sleep 2 - done - ip route replace default dev utun table "$PROXY_ROUTE_TABLE" - fi - ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 - #设置防火墙 - iptables -t mangle -N openclash - iptables -t mangle -F openclash - iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN - if [ "$en_mode" = "fake-ip" ]; then - iptables -t mangle -A openclash -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" - fi - iptables -t mangle -I OUTPUT -j openclash - iptables -t mangle -I PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -I PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -I PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" - iptables -t nat -I PREROUTING -p tcp --dport 53 -j ACCEPT - #ipv6 - # if [ "$ipv6_enable" -eq 1 ]; then - # ip6tables -t mangle -I PREROUTING -j MARK --set-mark "$PROXY_FWMARK" - # fi - fi + set_firewall echo "第九步: 重启 Dnsmasq 程序..." >$START_LOG change_dns "$enable_redirect_dns" "$disable_masq_cache" @@ -1067,108 +1147,70 @@ fi stop() { - echo "OpenClash 开始关闭..." >$START_LOG - echo "第一步: 备份当前节点状态..." >$START_LOG - /usr/share/openclash/openclash_history_get.sh & - wait - echo "第二步: 删除 OpenClash 防火墙规则..." >$START_LOG - rm -rf /var/etc/openclash.include 2>/dev/null - -#ipv4 + #禁止多个实例 + status=$(ps|grep -c /etc/init.d/openclash) + [ "$status" -gt "3" ] && exit 0 + + enable=$(uci get openclash.config.enable 2>/dev/null) - ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1 - ip route del local default dev lo table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1 + echo "OpenClash 开始关闭..." >$START_LOG + echo "第一步: 备份当前节点状态..." >$START_LOG + /usr/share/openclash/openclash_history_get.sh & + wait - iptables -t nat -D PREROUTING -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1 + echo "第二步: 删除 OpenClash 防火墙规则..." >$START_LOG + revert_firewall - iptables -t mangle -F openclash >/dev/null 2>&1 - iptables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1 - iptables -t mangle -X openclash >/dev/null 2>&1 - - iptables -t nat -F openclash >/dev/null 2>&1 - iptables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1 - iptables -t nat -X openclash >/dev/null 2>&1 - - ipset destroy lan_ac_white_ips >/dev/null 2>&1 - ipset destroy lan_ac_black_ips >/dev/null 2>&1 - - out_lines=$(iptables -nvL OUTPUT -t mangle |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn) - for out_line in $out_lines; do - iptables -t mangle -D OUTPUT "$out_line" >/dev/null 2>&1 - done - - out_lines=$(iptables -nvL OUTPUT -t nat |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn) - for out_line in $out_lines; do - iptables -t nat -D OUTPUT "$out_line" >/dev/null 2>&1 - done - - pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/8.8./=' 2>/dev/null |sort -rn) - for pre_line in $pre_lines; do - iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1 - done - -#ipv6 - ip6tables -t mangle -F openclash >/dev/null 2>&1 - ip6tables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1 - ip6tables -t mangle -X openclash >/dev/null 2>&1 - - ip6tables -t nat -F openclash >/dev/null 2>&1 - ip6tables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1 - ip6tables -t nat -X openclash >/dev/null 2>&1 - -#TUN - ip link set dev clash0 down >/dev/null 2>&1 - ip tuntap del clash0 mode tun >/dev/null 2>&1 - ip route del default dev clash0 table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1 - ip route del default dev utun table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1 - ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1 + echo "第三步: 关闭 OpenClash 守护程序..." >$START_LOG + watchdog_pids=$(ps |grep openclash_watchdog.sh |grep -v grep |awk '{print $1}' 2>/dev/null) + for watchdog_pid in $watchdog_pids; do + kill -9 "$watchdog_pid" >/dev/null 2>&1 + done - iptables -t mangle -D OUTPUT -j openclash >/dev/null 2>&1 - iptables -t mangle -D PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -D PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -D PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1 - ip6tables -t mangle -D PREROUTING -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1 - iptables -t mangle -F openclash >/dev/null 2>&1 - iptables -t mangle -X openclash >/dev/null 2>&1 - ipset destroy localnetwork >/dev/null 2>&1 + echo "第四步: 关闭 Clash 主程序..." >$START_LOG + if [ "$enable" -eq 0 ]; then + kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null + fi - echo "第三步: 关闭 OpenClash 守护程序..." >$START_LOG - watchdog_pids=$(ps |grep openclash_watchdog.sh |grep -v grep |awk '{print $1}' 2>/dev/null) - for watchdog_pid in $watchdog_pids; do - kill -9 "$watchdog_pid" >/dev/null 2>&1 - done + echo "第五步: 重启 Dnsmasq 程序..." >$START_LOG + dns_port=$(uci get openclash.config.dns_port 2>/dev/null) + redirect_dns=$(uci get openclash.config.redirect_dns 2>/dev/null) + masq_cache=$(uci get openclash.config.masq_cache 2>/dev/null) + revert_dns "$redirect_dns" "$masq_cache" "$dns_port" + /etc/init.d/dnsmasq restart >/dev/null 2>&1 - echo "第四步: 关闭 Clash 主程序..." >$START_LOG - kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null + echo "第六步:删除 OpenClash 残留文件..." >$START_LOG + if [ "$enable" -eq 0 ]; then + rm -rf $LOG_FILE 2>/dev/null + rm -rf /tmp/openclash_debug.log 2>/dev/null + rm -rf /www/luci-static/openclash 2>/dev/null + rm -rf /tmp/openclash_last_version 2>/dev/null + rm -rf /tmp/clash_last_version 2>/dev/null + rm -rf /tmp/Proxy_Group 2>/dev/null + rm -rf /tmp/rules_name 2>/dev/null + echo "OpenClash 关闭成功!" >$START_LOG + sleep 5 + fi - echo "第五步: 重启 Dnsmasq 程序..." >$START_LOG - dns_port=$(uci get openclash.config.dns_port 2>/dev/null) - redirect_dns=$(uci get openclash.config.redirect_dns 2>/dev/null) - masq_cache=$(uci get openclash.config.masq_cache 2>/dev/null) - revert_dns "$redirect_dns" "$masq_cache" "$dns_port" - /etc/init.d/dnsmasq restart >/dev/null 2>&1 - - echo "第六步:删除 OpenClash 残留文件..." >$START_LOG - enable=$(uci get openclash.config.enable 2>/dev/null) - if [ "$enable" -eq 0 ]; then - rm -rf $LOG_FILE 2>/dev/null - rm -rf /www/luci-static/openclash 2>/dev/null - rm -rf /tmp/openclash_last_version 2>/dev/null - rm -rf /tmp/clash_last_version 2>/dev/null - rm -rf /tmp/Proxy_Group 2>/dev/null - rm -rf /tmp/rules_name 2>/dev/null - echo "OpenClash 关闭成功!" >$START_LOG - sleep 5 - fi - - rm -rf $START_LOG 2>/dev/null - del_cron - echo "OpenClash Already Stop" + rm -rf $START_LOG 2>/dev/null + del_cron + echo "OpenClash Already Stop" } restart() { - stop - start + stop + start +} + +reload() +{ + revert_firewall 2>/dev/null + config_choose 2>/dev/null + do_run_mode 2>/dev/null + get_config 2>/dev/null + set_firewall 2>/dev/null + /usr/share/openclash/openclash_history_set.sh + echo "${LOGTIME} OpenClash Reload After Firewall Restart" >> $LOG_FILE } diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/Country.mmdb b/package/ctcgfw/luci-app-openclash/files/etc/openclash/Country.mmdb index c068fc5f01..7ed9ddc341 100644 Binary files a/package/ctcgfw/luci-app-openclash/files/etc/openclash/Country.mmdb and b/package/ctcgfw/luci-app-openclash/files/etc/openclash/Country.mmdb differ diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/custom/openclash_custom_fake_black.conf b/package/ctcgfw/luci-app-openclash/files/etc/openclash/custom/openclash_custom_fake_black.conf index e7df6a0434..e013577039 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/custom/openclash_custom_fake_black.conf +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/custom/openclash_custom_fake_black.conf @@ -17,6 +17,10 @@ ina.ntp.org.cn 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org +time1.cloud.tencent.com +time.ustc.edu.cn +pool.ntp.org +ntp.ubuntu.com ntp.aliyun.com ntp1.aliyun.com ntp2.aliyun.com diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/lhie1.yaml b/package/ctcgfw/luci-app-openclash/files/etc/openclash/lhie1.yaml index 85c5769883..bb5485e7b9 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/lhie1.yaml +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/lhie1.yaml @@ -4052,7 +4052,6 @@ Rule: - DOMAIN-SUFFIX,iflyad.bj.openstorage.cn,AdBlock - DOMAIN-SUFFIX,iframe.travel.yahoo.com,AdBlock - DOMAIN-SUFFIX,ig.nukefans.net,AdBlock -- DOMAIN-SUFFIX,igexin.com,AdBlock - DOMAIN-SUFFIX,igj5y.yongchanghengyuan.com,AdBlock - DOMAIN-SUFFIX,ih.adscale.de,AdBlock - DOMAIN-SUFFIX,ihualun.com,AdBlock @@ -6143,7 +6142,6 @@ Rule: - DOMAIN-SUFFIX,pv.focus.cn,AdBlock - DOMAIN-SUFFIX,pv.ra.icast.cn,AdBlock - DOMAIN-SUFFIX,pv.sogou.com,AdBlock -- DOMAIN-SUFFIX,pv.sohu.com,AdBlock - DOMAIN-SUFFIX,pv.xcar.com.cn,AdBlock - DOMAIN-SUFFIX,pv.zdnet.com.cn,AdBlock - DOMAIN-SUFFIX,pv.zol.com.cn,AdBlock @@ -8507,15 +8505,16 @@ Rule: # > BBC iPlayer # - USER-AGENT,BBCiPlayer*,GlobalTV - DOMAIN-KEYWORD,bbcfmt,GlobalTV -- DOMAIN-SUFFIX,bbc.com,GlobalTV -- DOMAIN-SUFFIX,bbc.co,GlobalTV -- DOMAIN-SUFFIX,bbc.co.uk,GlobalTV -- DOMAIN-SUFFIX,bbci.co,GlobalTV -- DOMAIN-SUFFIX,bbci.co.uk,GlobalTV +- DOMAIN,aod-dash-uk-live.akamaized.net,GlobalTV +- DOMAIN,aod-hls-uk-live.akamaized.net,GlobalTV - DOMAIN,vod-dash-uk-live.akamaized.net,GlobalTV - DOMAIN,vod-thumb-uk-live.akamaized.net,GlobalTV -- DOMAIN,vod-dash-uk-live.bbcfmt.hs.llnwd.net,GlobalTV -- DOMAIN,vod-thumb-uk-live.bbcfmt.hs.llnwd.net,GlobalTV +- DOMAIN-SUFFIX,bbc.co,GlobalTV +- DOMAIN-SUFFIX,bbc.co.uk,GlobalTV +- DOMAIN-SUFFIX,bbc.com,GlobalTV +- DOMAIN-SUFFIX,bbcfmt.hs.llnwd.net,GlobalTV +- DOMAIN-SUFFIX,bbci.co,GlobalTV +- DOMAIN-SUFFIX,bbci.co.uk,GlobalTV # > DAZN - DOMAIN-SUFFIX,d151l6v8er5bdm.cloudfront.net,GlobalTV @@ -9590,16 +9589,51 @@ Rule: - DOMAIN-SUFFIX,telegra.ph,Telegram - DOMAIN-SUFFIX,telegram.me,Telegram - DOMAIN-SUFFIX,telegram.org,Telegram -- IP-CIDR,91.108.4.0/22,Telegram -- IP-CIDR,91.108.56.0/22,Telegram -- IP-CIDR,109.239.140.0/24,Telegram +- IP-CIDR,149.154.167.99/32,Telegram +- IP-CIDR,149.154.175.10/32,Telegram +- IP-CIDR,149.154.167.40/32,Telegram +- IP-CIDR,149.154.167.42/32,Telegram +- IP-CIDR,149.154.175.117/32,Telegram +- IP-CIDR,149.154.175.50/32,Telegram +- IP-CIDR,149.154.167.50/32,Telegram +- IP-CIDR,149.154.167.51/32,Telegram +- IP-CIDR,149.154.175.100/32,Telegram +- IP-CIDR,149.154.167.91/32,Telegram +- IP-CIDR,149.154.167.90/32,Telegram +- IP-CIDR,149.154.165.120/32,Telegram +- IP-CIDR,149.154.166.120/32,Telegram +- IP-CIDR,149.154.164.250/32,Telegram +- IP-CIDR,149.154.167.117/32,Telegram +- IP-CIDR,149.154.167.118/32,Telegram +- IP-CIDR,149.154.167.192/27,Telegram +- IP-CIDR,149.154.164.8/29 ,Telegram +- IP-CIDR,91.108.8.0/27,Telegram +- IP-CIDR,91.108.12.0/27,Telegram +- IP-CIDR,91.108.16.0/27,Telegram +- IP-CIDR,91.108.56.0/24,Telegram +- IP-CIDR,91.108.4.0/24,Telegram - IP-CIDR,149.154.160.0/22,Telegram - IP-CIDR,149.154.164.0/22,Telegram - IP-CIDR,149.154.168.0/22,Telegram - IP-CIDR,149.154.172.0/22,Telegram -- IP-CIDR6,2001:67c:4e8::/48,Telegram +- IP-CIDR,91.108.56.0/22,Telegram +- IP-CIDR,91.108.4.0/22,Telegram +- IP-CIDR,91.108.8.0/22,Telegram +- IP-CIDR,91.108.16.0/22,Telegram +- IP-CIDR,91.108.12.0/22,Telegram +- IP-CIDR,149.154.160.0/20,Telegram +- IP-CIDR6,2001:b28:f23d:f001::e/128,Telegram +- IP-CIDR6,2001:67c:4e8:f002::e/128,Telegram +- IP-CIDR6,2001:b28:f23d:f003::e/128,Telegram +- IP-CIDR6,2001:b28:f23d:f001::a/128,Telegram +- IP-CIDR6,2001:67c:4e8:f002::a/128,Telegram +- IP-CIDR6,2001:b28:f23d:f003::a/128,Telegram +- IP-CIDR6,2001:67c:4e8:f004::a/128,Telegram +- IP-CIDR6,2001:b28:f23f:f005::a/128,Telegram +- IP-CIDR6,2001:67c:4e8:fa60::/64,Telegram - IP-CIDR6,2001:b28:f23d::/48,Telegram - IP-CIDR6,2001:b28:f23f::/48,Telegram +- IP-CIDR6,2001:67c:4e8::/48,Telegram diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/openclash_version b/package/ctcgfw/luci-app-openclash/files/etc/openclash/openclash_version index ac95424cfb..380584ec3f 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/openclash_version +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/openclash_version @@ -1,2 +1,2 @@ -v0.37.4-beta -data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXMAAAAqCAMAAAB2kksrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwd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AJdbQFcrBKn8/S0tLQ0NAGXI1FkbxlZWUnicGNjY2yytgGZJo4lMhHnM1klrIFaaJzobuxzdw2kMUEXI5zsdQWaJevr69gYGAHZ52iyd8Zdapyn7iUlJQHbKXB2ecJWIVJns47l8uDqsF0dHSkzuYFYpeJweJZptM1h7URgsMCc7QBcrNRUVFUVFRVVVVSUlIFdrcLfL1WVlYHeLkKe7wGd7gOf8ADdLUEdrYOgMAEdbYDdbUDdLQSg8NXV1cSg8QShMQThMUAcrIOf78Nfr8Nfr4Mfb4Mfb0Je7sJersIebkJeroIebo6OjqqqqrU1NTV1dWrq6tISEipqak7OzuAgIB+fn7w9/vC3u5JSUmBgYHq6uqEvN1MTEz19fXz8/OEvd3B3u709PTh7/eFvt5/f3+DvNyCqcDB3e3v9PfB1eDg6u+JiYno6Ojg6vChv9DB3e7A1N/g7vaErMIFZZsFZ58UXomFvd4JeLhHm8zW1taDq8KCutsFa6bC3+8FZ6ALb6iEtNALernD3+9Inc05lckJaaDv9vqFvd0GWIcGdbQLdK+Dr8jR4OgIV4TB1+NVos8IcKwKebgHXo+yz+DB1+Qwk8ujxdjP5PFnqs9kmbdTU1MPgMEQgcJZWVlaWlpfX19bW1tcXFxNTU1eXl5PT09QUFBYWFhdXV1OTk7///////9VHktaAAABAHRSTlP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AU/cHJQAADBRJREFUeNrsVwt0FNUZniUu4ZG4SWTJEggJgUnKIwTYhIAEyiMR5FWxIBU4iICiiIISIahtCTGv1to2fWhbQDZPzBJC3pGQ8IaAIKKgglJFxbRaXUupCcF86X/vPHZml2BObTln9/Cdk7n/8/tnvjs7MxHa28tX9r/iDfiDB+AHz9jb24X2uPVXvAO/9wh8HtYulA9s8RL8zjPwuV1Y6S2St/zWQ/CMMPBbb8FPPQSfC9/e0vxmw4s0/6enQPjGa3BL85uPrz0Fwr+9Brc0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su513U9L5l8nH19+1567lh/3fZG5C+rquvFdCV998PDhg2OO+0pKP1I3Zqizv66ul4atV90CF80X1I3sPqnh8LTwxGjmPpAYvvyhQ3t6Lj1ObkjimIf23PVRdvbk8GmHD/cc7DtGmtix5mllBpuE7WIrubHcNog2C8vxo6SWqDRYt8sNLGKz6fJSt36ASJFmjc3RrCFvlgm3lziJWuWzKknTnoaF3RYKntfgBd/EC4oZ4pvI4BvC3cbExGi2Dk2UcEEKs/g8Z39i4goN24rExuf1aJS7fZfp/cQQlVodvGGyNFGFsNEdVtFiscRaZa8wyZJUuLFNLCRbOko1VrW+tfBui+VusY3ZoqjPs25RT98miqLGSaJZha068tbCWAu1teoGsSHSDGdloRzg0F3X6cbTqp1wrMeKHscSJCe6sVHSdt6xoStWDF0mh58/1rhMq6nOW9YY7aJ5dGP0aWrfoG7TPJqxYoPMtozmsV2at4FiIdQ+7zs191C84CkQWr0GL3oKvEjzX3sKhKteg196CrxI8994CoSFbd6Cn3kIuglBtzS/yXhTqPaaG/3nnoFu7wvtvWOavQMeIvk/2oX29uog71D9jx6Abm++397+HwEGAJzPiOSi3Qf/AAAAAElFTkSuQmCC \ No newline at end of file +v0.37.5-beta +data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXMAAAAqCAMAAAB2kksrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyL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EXpEEWYnCwsJBQUGx0OIJZJkrjsZGirHB1OCStchCQkImcJq2trZKn8+jxdmEss2Xl5cnicEFcrBlZWWNjY3w9fcKYZMIX5FzsdRyn7hHnM1zobuxzdwFaaJFkbyDrcUYYo02ksYWaJfB2eevr68JWIVgYGAHZ52iyd8ZdaqUlJQGZJoHbKWEtNBJns50dHSyytgFYpejzuaJweIwk8sndKE1h7VGg6YRgsMCc7QBcrNRUVFUVFRVVVVSUlILfL0FdrdWVlYHeLkKe7wDdLUDdLQEdbYEdrYOf8AOgMADdbUSg8MSg8RXV1cShMQAcrIThMUGd7gOf78Nfr8Nfr4Mfb4Mfb0IebkJeroJe7sJers6OjqqqqrU1NTV1dWrq6tISEipqak7OzuAgIB+fn7C3u7w9/tJSUmBgYHq6urz8/P19fVMTEz09PSHv9+ErMLh7/d/f3+DvNyFvt7v9PfB1eCCqcDA1N8FZ5+Gvt/g6u/B3e2hv9CJiYng6vDB3e5Gm8vo6OjC3+/g7vaGv9/B3u4UXol0s9gFZZvW1taDq8JHm8zD3+8Fa6YLb6iEvd0FZ6AIaJ8LermDu9xInc2DqsHv9vqDr8gGWIcLdK8GdbRVos8IcKwLeLdEmcoXe7Nnqs81jsLR4OiAudkzeqPB1+PP5PFGhqpkmLUmbJQvkstTU1MPgMEQgcJZWVlaWlpfX19bW1tcXFxNTU1eXl5PT09QUFBYWFhdXV1OTk7///////+KC4QFAAABAHRSTlP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AU/cHJQAADAJJREFUeNrsVwtUVGUeH4HBwQfiQIOMioiJXsRXgo8ZBHJVfGRa+TiGZraWmmX57LW7Ijiyj9pddtfaQhweg8EgLyUDNJ/5JkvNnlq229Y+cqd13UCMH/2/7z7m3gGMs3U8Z+b4O8f7/Z+//72/7+PeUdfSUrGs31VfwJ+8AE8/5Wxp0bUkrrnqG/iDV+DpqBZdxaBGH8H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rBUNsp/w+MYL+mjLIbKchnYwuu0V9G0nGeW5e9WMtDqwLPCOan0w6uWjK/imLTvp9wtyH6uq68l0ZsPDAnj0Hgk/6iUovqAse5u6vq7udLfVDWNHahSdTwrWaP1Q3OrBb7Z4ZA1KimftEyoBFDx7ePzD4JLnhKcEP7p/y8ZYtkwbM2LNn4N9TgsWJ7WueUam3i9guNJFr5bZesJtZjl9FtQS5wbJdamARu12TF7u1AwSKNKhsjgYVeYNEuL3UTdQk3VVphvo2zOxYyNikhl/KBdkM90th8AvnXn1KSjRbh6WIuCCGWXyuuz0lZShb9kpFfmc2aVEvJxZr/ZRwhVoZvG6SOFGBbkNrWASz2Wy1SJ4j1Zzq2NAsOMgWr2KNRalvctxtNt8tNDNbELR51i1o6ZsFQVA5qTTL0aQhb3JYzdTWpBnEhogz3JUOKcChea4z9W6ZkvdOHDpxb7LoRNfXi9rO3Tts6NBhi6Xwpr31i9WaSl44K1J63Yiujz5DmXXKNs2lGUPXSWyLaV49C66jWPimxfVzv1dzL8VvvAW6Jp/Br70FPqT5b70Fums+g196C3xI8195C3Tzmn0FP/cSdNWF3dL8JuNLXZXPHPRfeAe6fqRr6RXf4BvwEsn/2aJraakK8w3V/+gF6PrlRy0t3wkwACodWEdnsCi2AAAAAElFTkSuQmCC \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/controller/openclash.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/controller/openclash.lua index 66d2672422..25b1e53923 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/controller/openclash.lua +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/controller/openclash.lua @@ -32,7 +32,7 @@ function index() entry({"admin", "services", "openclash", "groups-config"},cbi("openclash/groups-config"), nil).leaf = true entry({"admin", "services", "openclash", "proxy-provider-config"},cbi("openclash/proxy-provider-config"), nil).leaf = true entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Config Manage"), 70).leaf = true - entry({"admin", "services", "openclash", "log"},form("openclash/log"),_("Logs"), 80).leaf = true + entry({"admin", "services", "openclash", "log"},form("openclash/log"),_("Server Logs"), 80).leaf = true end local fs = require "luci.openclash" @@ -81,6 +81,13 @@ local function daip() return daip end +local function uh_port() + local uh_port = luci.sys.exec("uci get uhttpd.main.listen_http |awk -F ':' '{print $NF}'") + if uh_port ~= "80" then + return ":" .. uh_port + end +end + local function dase() return luci.sys.exec("uci get openclash.config.dashboard_password 2>/dev/null") end @@ -99,7 +106,7 @@ local function startlog() end local function coremodel() - local coremodel = luci.sys.exec("cat /proc/cpuinfo |grep 'cpu model' 2>/dev/null |awk -F ': ' '{print $2}' 2>/dev/null") + local coremodel = luci.sys.exec("cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_ARCH 2>/dev/null |awk -F '\"' '{print $2}' 2>/dev/null") local coremodel2 = luci.sys.exec("opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null") if not coremodel or coremodel == "" then return coremodel2 .. "," .. coremodel2 @@ -212,6 +219,7 @@ function action_status() watchdog = is_watchdog(), daip = daip(), dase = dase(), + uh_port = uh_port(), web = is_web(), cn_port = cn_port(), mode = mode(); diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/log.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/log.lua index d284353d58..bbcaea1d0a 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/log.lua +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/log.lua @@ -2,11 +2,8 @@ local NXFS = require "nixio.fs" local SYS = require "luci.sys" local HTTP = require "luci.http" -local DISP = require "luci.dispatcher" -local UTIL = require "luci.util" - -m = Map("openclash", translate("Server logs")) +m = Map("openclash", translate("Server Logs")) s = m:section(TypedSection, "openclash") m.pageaction = false s.anonymous = true diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/settings.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/settings.lua index 2f7f7c4e0a..91da6acfdf 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/settings.lua +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/settings.lua @@ -34,6 +34,7 @@ s:tab("dashboard", translate("Dashboard Settings")) s:tab("rules_update", translate("Rules Update")) s:tab("geo_update", translate("GEOIP Update")) s:tab("version_update", translate("Version Update")) +s:tab("debug", translate("Debug Logs")) ---- Operation Mode o = s:taboption("op_mode", ListValue, "operation_mode", font_red..bold_on..translate("Select Operation Mode")..bold_off..font_off) @@ -62,7 +63,7 @@ o:depends("en_mode", "redir-host") o:depends("en_mode", "fake-ip") o:value("0", translate("Disable")) o:value("1", translate("Enable")) -o.default = "0" +o.default = "1" o = s:taboption("op_mode", ListValue, "proxy_mode", font_red..bold_on..translate("Proxy Mode")..bold_off..font_off) o.description = translate("Select Proxy Mode") @@ -450,6 +451,24 @@ o.description = translate("Set Dashboard Secret") core_update = s:taboption("version_update", DummyValue, "", nil) core_update.template = "openclash/update" +---- debug +debug_log = s:taboption("debug", Value, "debug_log") +debug_log.template = "cbi/tvalue" +debug_log.readonly=true +debug_log.rows = 30 +debug_log.wrap = "off" +function debug_log.cfgvalue(self, section) + return NXFS.readfile("/tmp/openclash_debug.log") or "" +end + +o = s:taboption("debug", Button, translate("Generate Logs")) +o.title = translate("Generate Logs") +o.inputtitle = translate("Click to Generate") +o.inputstyle = "reload" +o.write = function() + SYS.call("/usr/share/openclash/openclash_debug.sh") +end + -- [[ Edit Server ]] -- s = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)")) s.anonymous = true diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/status.htm b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/status.htm index 9bd57d677c..637a869b10 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/status.htm +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/status.htm @@ -44,41 +44,7 @@ var dase = document.getElementById('_dase'); var dapo = document.getElementById('_dapo'); var clashversion = document.getElementById('_clashversion'); - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) { - if ( x && x.status == 200 ) { - clash.innerHTML = status.clash ? '<%:RUNNING%>' : '<%:NOT RUNNING%>'; - if ( status.mode == "fake-ip\n" ) - { - mode.innerHTML = status.clash ? "<%: Fake-IP(增强)模式 %>" : '<%:NOT RUNNING%>'; - } - else if ( status.mode == "redir-host\n" ) - { - mode.innerHTML = status.clash ? "<%: Redir-Host(兼容)模式 %>" : '<%:NOT RUNNING%>'; - } - else if ( status.mode == "redir-host-tun\n" ) - { - mode.innerHTML = status.clash ? "<%: Redir-Host(TUN)模式 %>" : '<%:NOT RUNNING%>'; - } - else if ( status.mode == "fake-ip-tun\n" ) - { - mode.innerHTML = status.clash ? "<%: Fake-IP(TUN)模式 %>" : '<%:NOT RUNNING%>'; - } - else if ( status.mode == "redir-host-vpn\n" ) - { - mode.innerHTML = status.clash ? "<%: Redir-Host(游戏)模式 %>" : '<%:NOT RUNNING%>'; - } - else if ( status.mode == "fake-ip-vpn\n" ) - { - mode.innerHTML = status.clash ? "<%: Fake-IP(游戏)模式 %>" : '<%:NOT RUNNING%>'; - } - watchdog.innerHTML = status.watchdog ? '<%:RUNNING%> ' : '<%:NOT RUNNING%>'; - daip.innerHTML = status.daip ? ""+status.daip+"" : ""+"<%:Not Set%>"+""; - dase.innerHTML = status.dase ? ""+status.dase+"" : ""+"<%:Not Set%>"+""; - dapo.innerHTML = status.cn_port ? ""+status.cn_port+"" : ""+"<%:Not Set%>"+""; - web.innerHTML = status.web ? '' : '<%:NOT RUNNING%>'; - webo.innerHTML = status.web ? '' : '<%:NOT RUNNING%>'; - } - }); + XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) { if ( x && x.status == 200 ) { clash.innerHTML = status.clash ? '<%:RUNNING%>' : '<%:NOT RUNNING%>'; @@ -115,13 +81,21 @@ } }); + function winOpen(url) + { + var winOpen = window.open(url); + if(winOpen == null || typeof(winOpen) == 'undefined'){ + window.location.href=url; + } + } + function ycad_dashboard(btn) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', status.cn_port, function(x, status) { btn.disabled = true; btn.value = '<%:打开控制面板%>'; - url1='<%="http://'+window.location.hostname+'/luci-static/openclash?hostname='+ status.daip + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>'; - window.open(url1); + url1='<%="http://'+window.location.hostname+status.uh_port+'/luci-static/openclash?hostname='+ status.daip + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>'; + winOpen(url1); return false; }); } @@ -131,7 +105,7 @@ btn.disabled = true; btn.value = '<%:打开控制面板%>'; url2='http://'+window.location.hostname+':'+status.cn_port+'/ui'; - window.open(url2); + winOpen(url2); return false; }); } @@ -139,25 +113,25 @@ function homepage() { url3='https://github.com/vernesong/OpenClash'; - window.open(url3); + winOpen(url3); } function wikipage() { url5='https://github.com/vernesong/OpenClash/wiki'; - window.open(url5); + winOpen(url5); } function telegrampage() { url6='https://t.me/joinchat/D4mVX0n-n5mOK6YO_W3_Og'; - window.open(url6); + winOpen(url6); } function sponsorpage() { url7='https://ko-fi.com/vernesong'; - window.open(url7); + winOpen(url7); } @@ -197,7 +171,7 @@ function go_update() { url4='https://github.com/vernesong/OpenClash/releases'; - window.open(url4); + winOpen(url4); } var startlog = document.getElementById('_clashstart'); diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/update.htm b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/update.htm index 4ffb03f6bd..5a7420b0ca 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/update.htm +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/update.htm @@ -7,7 +7,7 @@

已选择编译版本 <%:Collecting data...%> 上次检查更新时间 <%:Collecting data...%> - 处理器架构(PROC) <%:Collecting data...%> 处理器架构(OPKG) <%:Collecting data...%> + 处理器架构(OS) <%:Collecting data...%> 处理器架构(OPKG) <%:Collecting data...%>

内核路径:/etc/openclash/core/clash @@ -43,7 +43,7 @@

- +
<%:Collecting data...%>
@@ -71,99 +71,6 @@ var ma_core_game_up = document.getElementById('ma_core_game_up'); var ma_op_up = document.getElementById('ma_op_up'); var restore = document.getElementById('restore'); - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) { - if ( x && x.status == 200 ) { - var cpu_models = status.coremodel; - var arr_model = cpu_models.split(","); - var cpu_model1 = arr_model[0]; - var cpu_model22 = arr_model[1]; - cpu_model.innerHTML = cpu_model1 ? ""+cpu_model1+"" : "<%:Model Not Found%>"; - cpu_model2.innerHTML = cpu_model22 ? ""+cpu_model22+"" : "<%:Model Not Found%>"; - if ( status.corever != "0\n" && status.corever != "" ) { - core_version.innerHTML = ""+status.corever+""; - } - else { - core_version.innerHTML = "<%:未选择编译版本,请到常规设置标签中配置%>"; - } - if ( status.upchecktime != "1" ) { - checktime.innerHTML = ""+status.upchecktime+""; - } - else { - checktime.innerHTML = "<%:查询更新失败%>"; - } - if ( status.corecv == "0" ) { - core_cv.innerHTML = "<%:File Not Exist%>"; - } - else if (status.corecv != "") { - core_cv.innerHTML = ""+status.corecv+""; - } - else { - core_cv.innerHTML = "<%:Unknown%>"; - } - if ( status.coretuncv == "0" ) { - core_tun_cv.innerHTML = "<%:File Not Exist%>"; - } - else if (status.coretuncv != "") { - core_tun_cv.innerHTML = ""+status.coretuncv+""; - } - else { - core_tun_cv.innerHTML = "<%:Unknown%>"; - } - if ( status.coregamecv == "0" ) { - core_game_cv.innerHTML = "<%:File Not Exist%>"; - } - else if (status.coregamecv != "") { - core_game_cv.innerHTML = ""+status.coregamecv+""; - } - else { - core_game_cv.innerHTML = "<%:Unknown%>"; - } - var corelv = status.corelv; - var arr_core = corelv.split(","); - var corelvis = arr_core[0]; - var coretunlvis = arr_core[1]; - var coregamelvis = arr_core[2]; - var new_ch = arr_core[3]; - if ( new_ch == "2" || new_ch == "4" ) { - core_lv.innerHTML = ""+corelvis+"<%:%>"; - } - else if (corelvis != "" && corelvis != "\n" ) { - core_lv.innerHTML = ""+corelvis+""; - } - else { - core_lv.innerHTML = "<%:Unknown%>"; - } - if ( new_ch == "3" || new_ch == "4" ) { - core_tun_lv.innerHTML = ""+coretunlvis+"<%:%>"; - } - else if (coretunlvis != "" && coretunlvis != "\n" ) { - core_tun_lv.innerHTML = ""+coretunlvis+""; - } - else { - core_tun_lv.innerHTML = "<%:Unknown%>"; - } - if (coregamelvis != "" && coregamelvis != "\n" ) { - core_game_lv.innerHTML = ""+coregamelvis+""; - } - else { - core_game_lv.innerHTML = "<%:Unknown%>"; - } - var oplv = status.oplv; - var arr_op = oplv.split(","); - var oplvis = arr_op[0]; - var new_op = arr_op[1]; - op_cv.innerHTML = status.opcv ? ""+status.opcv+"" : "<%:Unknown%>"; - if ( new_op == "2" ) { - op_lv.innerHTML = ""+oplvis+"<%:%>"; - } - else if (oplvis != "" && oplvis != "\n") { - op_lv.innerHTML = ""+oplvis+""; - } - else { - op_lv.innerHTML = "<%:Unknown%>"; - } - } - }); XHR.poll(6, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) { if ( x && x.status == 200 ) { @@ -269,6 +176,14 @@ ma_op_up.innerHTML = ''; restore.innerHTML = ''; + function winOpen(url) + { + var winOpen = window.open(url); + if(winOpen == null || typeof(winOpen) == 'undefined'){ + window.location.href=url; + } + } + function core_update(btn) { @@ -320,7 +235,7 @@ if ( x && x.status == 200 ) { if ( status.corever != "0\n" ) { url1='https://github.com/vernesong/OpenClash/releases/download/Clash/clash-'+status.corever+'.tar.gz'; - window.open(url1); + winOpen(url1); } else { alert('未选择编译版本,请到常规设置标签中配置!') @@ -341,7 +256,7 @@ var coretunlvis = arr_core[1]; if ( status.corever != "0\n" && coretunlvis != "\n" && coretunlvis != "" ) { url3='https://github.com/Dreamacro/clash/releases/download/TUN/clash-'+status.corever+'-'+coretunlvis+'.gz'; - window.open(url3); + winOpen(url3); } else if ( status.corever == "0\n" ) { alert('未选择编译版本,请到常规设置标签中配置!') @@ -362,7 +277,7 @@ if ( x && x.status == 200 ) { if ( status.corever != "0\n" ) { url4='https://github.com/vernesong/OpenClash/releases/download/TUN/clash-'+status.corever+'.tar.gz'; - window.open(url4); + winOpen(url4); } else { alert('未选择编译版本,请到常规设置标签中配置!') @@ -382,7 +297,7 @@ var oplvis = oplv.substring(oplv.indexOf("v") + 1,oplv.indexOf(",")); if ( oplvis != "" && oplvis != "\n" ) { url2='https://github.com/vernesong/OpenClash/releases/download/v'+oplvis+'/luci-app-openclash_'+oplvis+'_all.ipk'; - window.open(url2); + winOpen(url2); } else { alert('最新版本获取失败,请稍后再试!') diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/index.html b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/index.html index e079ebfadd..343e651233 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/index.html +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/index.html @@ -1 +1 @@ -Clash
\ No newline at end of file +Clash
\ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/js/1.bundle.587bc7edc5f3d06c94f4.min.js b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/js/1.bundle.ccbf66abd21c384a0bf9.min.js similarity index 99% rename from package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/js/1.bundle.587bc7edc5f3d06c94f4.min.js rename to package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/js/1.bundle.ccbf66abd21c384a0bf9.min.js index 0823b091f0..213db2f3f2 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/js/1.bundle.587bc7edc5f3d06c94f4.min.js +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/dashboard/js/1.bundle.ccbf66abd21c384a0bf9.min.js @@ -1,2 +1,2 @@ -/*! For license information please see 1.bundle.587bc7edc5f3d06c94f4.min.js.LICENSE.txt */ +/*! For license information please see 1.bundle.ccbf66abd21c384a0bf9.min.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(e,t,n){"use strict";e.exports=n(50)},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},,,,function(e,t,n){e.exports=n(54)()},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(51)},function(e,t,n){var r=n(39)(Object,"create");e.exports=r},function(e,t,n){var r=n(109);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(115);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(38),o=n(88);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(22).Symbol;e.exports=r},function(e,t,n){var r=n(85),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){e.exports=function(){"use strict";var e="millisecond",t="second",n="minute",r="hour",o="day",i="week",a="month",u="quarter",l="year",s=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,c=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},d={s:f,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+f(r,2,"0")+":"+f(o,2,"0")},m:function(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,a),o=t-r<0,i=e.clone().add(n+(o?-1:1),a);return Number(-(n+(t-r)/(o?r-i:i-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(s){return{M:a,y:l,w:i,d:o,D:"date",h:r,m:n,s:t,ms:e,Q:u}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h="en",m={};m[h]=p;var v=function(e){return e instanceof w},g=function(e,t,n){var r;if(!e)return h;if("string"==typeof e)m[e]&&(r=e),t&&(m[e]=t,r=e);else{var o=e.name;m[o]=e,r=o}return!n&&r&&(h=r),r||!n&&h},y=function(e,t,n){if(v(e))return e.clone();var r=t?"string"==typeof t?{format:t,pl:n}:t:{};return r.date=e,new w(r)},b=d;b.l=g,b.i=v,b.w=function(e,t){return y(e,{locale:t.$L,utc:t.$u,$offset:t.$offset})};var w=function(){function f(e){this.$L=this.$L||g(e.locale,null,!0),this.parse(e)}var d=f.prototype;return d.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(b.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(s);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(t)}(e),this.init()},d.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},d.$utils=function(){return b},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(e,t){var n=y(e);return this.startOf(t)<=n&&n<=this.endOf(t)},d.isAfter=function(e,t){return y(e)=0;d--){var p=o[d];"."===p?c(o,d):".."===p?(c(o,d),f++):f&&(c(o,d),f--)}if(!u)for(;f--;f)o.unshift("..");!u||""===o[0]||o[0]&&s(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function d(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var p=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=d(t),o=d(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var h=function(e,t){if(!e)throw new Error("Invariant failed")};function m(e){return"/"===e.charAt(0)?e:"/"+e}function v(e){return"/"===e.charAt(0)?e.substr(1):e}function g(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function y(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function b(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function w(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(l.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(i){throw i instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):i}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=f(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function x(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=w(e,t,d(),g.location);c.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,f({action:"REPLACE",location:r}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=g.index+e;return t>=0&&t=200&&e<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(i)})),e.exports=l}).call(this,n(65))},function(e,t,n){"use strict";var r=n(5),o=n(67),i=n(30),a=n(69),u=n(72),l=n(73),s=n(34);e.exports=function(e){return new Promise((function(t,c){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password||"";d.Authorization="Basic "+btoa(h+":"+m)}var v=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),i(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,c,r),p=null}},p.onabort=function(){p&&(c(s("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){c(s("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),c(s(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var g=n(74),y=(e.withCredentials||l(v))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(b){if("json"!==e.responseType)throw b}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),c(e),p=null)})),void 0===f&&(f=null),p.send(f)}))}},function(e,t,n){"use strict";var r=n(68);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e,t){t=t||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(i,(function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):void 0!==t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):void 0!==e[o]&&(n[o]=e[o])})),r.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var u=o.concat(i).concat(a),l=Object.keys(t).filter((function(e){return-1===u.indexOf(e)}));return r.forEach(l,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function u(e,t,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var u=new a(n,r||e,i),l=o?o+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],u]:e._events[l].push(u):(e._events[l]=u,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),s.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);rO.length&&O.push(e)}function z(e,t,n){return null==e?0:function e(t,n,r,o){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var l=!1;if(null===t)l=!0;else switch(u){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case i:case a:l=!0}}if(l)return r(o,t,""===n?"."+A(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s