From c5c2f40d670d8221ee39e694585614b34d1b0ce0 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:43:57 +0800 Subject: [PATCH 01/41] fix typo --- luci-app-openclash/root/usr/share/openclash/openclash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash.sh b/luci-app-openclash/root/usr/share/openclash/openclash.sh index 716c4fd76b..99e5890cf0 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash.sh @@ -629,8 +629,8 @@ sub_info_get() fi if [ -n "$template_path" ]; then template_path_encode=$(urlencode "$template_path") - [ -n "$key_match_param" ] && key_match_param="$(urlencode "$key_match_param")" - [ -n "$key_ex_match_param" ] && key_ex_match_param="$(urlencode "$key_ex_match_param")" + [ -n "$key_match_param" ] && key_match_param="$(urlencode "(?i)$key_match_param")" + [ -n "$key_ex_match_param" ] && key_ex_match_param="$(urlencode "(?i)$key_ex_match_param")" subscribe_url_param="?target=clash&new_name=true&url=$subscribe_url&config=$template_path_encode&include=$key_match_param&exclude=$key_ex_match_param&emoji=$emoji&list=false&sort=$sort$udp&scv=$skip_cert_verify&append_type=$node_type&fdn=true$rule_provider" c_address="$convert_address" else From d135fed22162b971cb0f8ff048acb5cf219dc5cd Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:49:25 +0800 Subject: [PATCH 02/41] chore: disable core log color --- .github/workflows/compile_meta_core.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile_meta_core.yml b/.github/workflows/compile_meta_core.yml index a350c8dcd6..3b4db447b3 100644 --- a/.github/workflows/compile_meta_core.yml +++ b/.github/workflows/compile_meta_core.yml @@ -89,6 +89,7 @@ jobs: - name: Compile Meta Clash run: | cp ../tmp/Makefile ./Makefile + sed -i 's/ForceColors: true,/ForceColors: false,/g' ./log/log.go 2>/dev/null make releases - name: Copy Clash Bin From d8072dcbd2f894e19e93faf13dfce1d846176832 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:10:56 +0800 Subject: [PATCH 03/41] fix typo --- luci-app-openclash/luasrc/view/openclash/status.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index 7ac882c7dc..655a989d2f 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -850,11 +850,11 @@ btn.disabled = true; btn.value = '<%:Yacd Control Panel%>'; if (status.daip && window.location.hostname == status.daip) { - url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/#/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>'; + url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>'; } else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) { var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://'; - url1='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/yacd/#/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>'; + url1='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/yacd/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>'; } else { url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/"%>'; From 53832ed52b4676eacf0add887aa4d9052f32dc8e Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:16:23 +0800 Subject: [PATCH 04/41] 0.45.158 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 857d548584..b1dcf76d4b 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.157 +PKG_VERSION:=0.45.158 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From b49a0c4a1765ddbfede3065feb33c67d013d58e5 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 8 Dec 2023 17:06:57 +0800 Subject: [PATCH 05/41] chore: refine --- img/meta.png | Bin 0 -> 12699 bytes .../luasrc/model/cbi/openclash/settings.lua | 8 +++--- .../luasrc/view/openclash/status.htm | 8 +++--- .../po/zh-cn/openclash.zh-cn.po | 10 ++++---- .../root/usr/share/openclash/clash_version.sh | 8 +++--- .../root/usr/share/openclash/openclash.sh | 6 ++--- .../usr/share/openclash/openclash_chnroute.sh | 20 +++++++-------- .../usr/share/openclash/openclash_core.sh | 24 +++++++++--------- .../openclash/openclash_download_dashboard.sh | 2 +- .../openclash/openclash_download_rule_list.sh | 20 +++++++-------- .../usr/share/openclash/openclash_geoip.sh | 10 ++++---- .../usr/share/openclash/openclash_geosite.sh | 10 ++++---- .../usr/share/openclash/openclash_ipdb.sh | 10 ++++---- .../usr/share/openclash/openclash_rule.sh | 24 +++++++++--------- .../usr/share/openclash/openclash_update.sh | 8 +++--- .../usr/share/openclash/openclash_version.sh | 8 +++--- 16 files changed, 87 insertions(+), 89 deletions(-) create mode 100644 img/meta.png diff --git a/img/meta.png b/img/meta.png new file mode 100644 index 0000000000000000000000000000000000000000..776ff94fa9f9f2b44e962e0e911e95efea0174e1 GIT binary patch literal 12699 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"..translate("Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it").. "
"..font_green..translate("Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off")..font_off.. "
"..font_green..translate("Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check")..font_off.. -"
"..font_green..translate("Note: Game proxy please use nodes except Vmess")..font_off.. -"
"..font_green..translate("Note: If you need to perform client access control in Fake-ip mode, please change the DNS hijacking mode to firewall forwarding")..font_off.. -"
"..translate("Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance").. +"
"..font_green..translate("Note: Game proxy please use nodes except VMess")..font_off.. +"
"..font_green..translate("Note: If you need to perform client access control in Fake-IP mode, please change the DNS hijacking mode to firewall forwarding")..font_off.. +"
"..translate("Note: The default proxy routes local traffic, BT, PT download, etc., please use Redir-Host mode as much as possible and pay attention to traffic avoidance").. "
"..translate("Note: If the connection is abnormal, please follow the steps on this page to check first")..": "..""..translate("Click to the page").."" s = m:section(TypedSection, "openclash") @@ -932,7 +932,6 @@ o.rmempty = true o.description = translate("Custom GeoIP Dat URL, Click Button Below To Refresh After Edit") o:value("https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat", translate("Loyalsoldier-testingcf-jsdelivr-Version")..translate("(Default)")) o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat", translate("Loyalsoldier-fastly-jsdelivr-Version")) -o:value("https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/dists/v2ray-rules-dat/geoip.dat", translate("OSDN-Version")..translate("(Default)")) o.default = "https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" o:depends("geoip_auto_update", "1") @@ -976,7 +975,6 @@ o.rmempty = true o.description = translate("Custom GeoSite Data URL, Click Button Below To Refresh After Edit") o:value("https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat", translate("Loyalsoldier-testingcf-jsdelivr-Version")..translate("(Default)")) o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat", translate("Loyalsoldier-fastly-jsdelivr-Version")) -o:value("https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/dists/v2ray-rules-dat/geosite.dat", translate("OSDN-Version")..translate("(Default)")) o.default = "https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat" o:depends("geosite_auto_update", "1") diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index 655a989d2f..f4e4ca655f 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -39,17 +39,17 @@ <% if uci:get("openclash", "config", "enable_meta_core") ~= '1' then %> - + <% else %> - + <% end %>

- currentversion + currentversion

@@ -943,7 +943,7 @@ function clashversion_error() { - clashversion.innerHTML = 'currentversion'; + clashversion.innerHTML = 'currentversion'; }; function logo_error(imgobj,imgSrc) diff --git a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po index b1703690d3..5fd73ca54b 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -2962,7 +2962,7 @@ msgid "Update GeoIP Dat" msgstr "更新 GeoIP Dat 数据库" msgid "Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it" -msgstr "注意: 路由不建议开启 IPV6 和相关服务,目前反馈的网络连接问题多数与它有关" +msgstr "注意: 路由不建议开启 IPv6 和相关服务,目前反馈的网络连接问题多数与它有关" msgid "Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off" msgstr "注意: 浏览器开启安全 DNS,会导致分流异常,请注意关闭" @@ -2970,16 +2970,16 @@ msgstr "注意: 浏览器开启安全 DNS,会导致分流异常,请注意关 msgid "Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check" msgstr "注意: 部分软件会修改设备 HOSTS,会导致分流异常,请注意检查" -msgid "Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance" +msgid "Note: The default proxy routes local traffic, BT, PT download, etc., please use Redir-Host mode as much as possible and pay attention to traffic avoidance" msgstr "注意: 默认代理路由本机流量,BT、PT 下载等请尽量使用 redir 模式并注意进行流量规避" -msgid "Note: Game proxy please use nodes except Vmess" -msgstr "注意: 游戏代理请使用 Vmess 以外的节点" +msgid "Note: Game proxy please use nodes except VMess" +msgstr "注意: 游戏代理请使用 VMess 以外的节点" msgid "Note: If the connection is abnormal, please follow the steps on this page to check first" msgstr "注意: 连接异常时请按照此页步骤先进行检查" -msgid "Note: If you need to perform client access control in Fake-ip mode, please change the DNS hijacking mode to firewall forwarding" +msgid "Note: If you need to perform client access control in Fake-IP mode, please change the DNS hijacking mode to firewall forwarding" msgstr "注意: Fake-ip 模式下如需要进行客户端访问控制,请将DNS劫持模式改为防火墙转发" msgid "Click to the page" diff --git a/luci-app-openclash/root/usr/share/openclash/clash_version.sh b/luci-app-openclash/root/usr/share/openclash/clash_version.sh index b1f62eaf5a..bb74e8528f 100644 --- a/luci-app-openclash/root/usr/share/openclash/clash_version.sh +++ b/luci-app-openclash/root/usr/share/openclash/clash_version.sh @@ -21,14 +21,14 @@ set_lock if [ "$TIME" != "$CHTIME" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL -m 60 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL -m 60 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL -m 60 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL -m 60 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL -m 60 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL -m 60 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL -m 60 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL -m 60 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -ne 0 ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/openclash.sh b/luci-app-openclash/root/usr/share/openclash/openclash.sh index 99e5890cf0..a9b6b2dace 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash.sh @@ -89,12 +89,12 @@ config_download() { if [ -n "$subscribe_url_param" ]; then if [ -n "$c_address" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" "$c_address""$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" "$c_address""$subscribe_url_param" -o "$CFG_FILE" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" https://api.dler.io/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" https://api.dler.io/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" "$subscribe_url" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" "$subscribe_url" -o "$CFG_FILE" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi } diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh b/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh index b784c527ba..ee81f5436d 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh @@ -41,13 +41,13 @@ LOG_OUT "Start Downloading The Chnroute Cidr List..." if [ -z "$CHNR_CUSTOM_URL" ]; then if pidof clash >/dev/null; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ispip.clang.cn/all_cn.txt -o /tmp/china_ip_route.txt 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ispip.clang.cn/all_cn.txt -o /tmp/china_ip_route.txt 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" != "0" ] || ! pidof clash >/dev/null; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ispip.clang.cn/all_cn_cidr.txt -o /tmp/china_ip_route.txt 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ispip.clang.cn/all_cn_cidr.txt -o /tmp/china_ip_route.txt 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$CHNR_CUSTOM_URL" -o /tmp/china_ip_route.txt 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$CHNR_CUSTOM_URL" -o /tmp/china_ip_route.txt 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -s "/tmp/china_ip_route.txt" ]; then @@ -81,9 +81,9 @@ #ipv6 LOG_OUT "Start Downloading The Chnroute6 Cidr List..." if [ -z "$CHNR6_CUSTOM_URL" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ispip.clang.cn/all_cn_ipv6.txt -o /tmp/china_ip6_route.txt 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip6_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ispip.clang.cn/all_cn_ipv6.txt -o /tmp/china_ip6_route.txt 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip6_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$CHNR6_CUSTOM_URL" -o /tmp/china_ip6_route.txt 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip6_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$CHNR6_CUSTOM_URL" -o /tmp/china_ip6_route.txt 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_ip6_route.txt" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq "0" ] && [ -s "/tmp/china_ip6_route.txt" ]; then LOG_OUT "Chnroute6 Cidr List Download Success, Check Updated..." @@ -116,18 +116,18 @@ #CN DOMAIN LOG_OUT "Start Downloading The CN Domains List..." if [ -n "$CNDOMAIN_CUSTOM_URL" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$CNDOMAIN_CUSTOM_URL" -o "/tmp/china_domains.list" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$CNDOMAIN_CUSTOM_URL" -o "/tmp/china_domains.list" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/felixonmars/dnsmasq-china-list@master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/felixonmars/dnsmasq-china-list@master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf -o "/tmp/china_domains.list" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/china_domains.list" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi fi diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_core.sh b/luci-app-openclash/root/usr/share/openclash/openclash_core.sh index 0bae43d1b5..5f989a63dd 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_core.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_core.sh @@ -62,14 +62,14 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then LOG_OUT "【TUN】Core Downloading, Please Try to Download and Upload Manually If Fails" if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ]; then @@ -80,14 +80,14 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then LOG_OUT "【Meta】Core Downloading, Please Try to Download and Upload Manually If Fails" if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ]; then @@ -98,14 +98,14 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then LOG_OUT "【Dev】Core Downloading, Please Try to Download and Upload Manually If Fails" if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_download_dashboard.sh b/luci-app-openclash/root/usr/share/openclash/openclash_download_dashboard.sh index ec3e7cf041..1ebd070ffe 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_download_dashboard.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_download_dashboard.sh @@ -35,7 +35,7 @@ FILE_PATH_INCLUDE="metacubexd-gh-pages" fi - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$DASH_FILE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$DASH_FILE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$DASH_FILE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$DASH_FILE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -s "$DASH_FILE_DIR" ] && [ -z "$(grep "404: Not Found" "$DASH_FILE_DIR")" ] && [ -z "$(grep "Package size exceeded the configured limit" "$DASH_FILE_DIR")" ]; then unzip -qt "$DASH_FILE_DIR" >/dev/null 2>&1 diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh b/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh index 02880db4c1..48f4b3b7b8 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh @@ -63,32 +63,32 @@ urlencode() { [ "$RULE_TYPE" != "netflix" ] && [ "$RULE_TYPE" != "disney" ] && DOWNLOAD_PATH=$(urlencode "$DOWNLOAD_PATH") if [ "$RULE_TYPE" = "netflix" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$RULE_TYPE" = "disney" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$RULE_TYPE" = "game" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/FQrabbit/SSTap-Rule@master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/FQrabbit/SSTap-Rule@master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi elif [ "$RULE_TYPE" = "provider" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/"$(echo "$DOWNLOAD_PATH" |awk -F '/master' '{print $1}' 2>/dev/null)"@master"$(echo "$DOWNLOAD_PATH" |awk -F 'master' '{print $2}')" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/"$(echo "$DOWNLOAD_PATH" |awk -F '/master' '{print $1}' 2>/dev/null)"@master"$(echo "$DOWNLOAD_PATH" |awk -F 'master' '{print $2}')" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod""$(echo "$DOWNLOAD_PATH" |awk -F '/master' '{print $1}' 2>/dev/null)"/master"$(echo "$DOWNLOAD_PATH" |awk -F 'master' '{print $2}')" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod""$(echo "$DOWNLOAD_PATH" |awk -F '/master' '{print $1}' 2>/dev/null)"/master"$(echo "$DOWNLOAD_PATH" |awk -F 'master' '{print $2}')" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi fi diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_geoip.sh b/luci-app-openclash/root/usr/share/openclash/openclash_geoip.sh index 6cd11f011e..ebd84850d1 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_geoip.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_geoip.sh @@ -30,17 +30,17 @@ if [ -z "$GEOIP_CUSTOM_URL" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "${github_address_mod}gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "${github_address_mod}gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://raw.fastgit.org/Loyalsoldier/v2ray-rules-dat/release/geoip.dat" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://raw.fastgit.org/Loyalsoldier/v2ray-rules-dat/release/geoip.dat" -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOIP_CUSTOM_URL" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOIP_CUSTOM_URL" -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq "0" ] && [ -s "/tmp/GeoIP.dat" ]; then LOG_OUT "GeoIP Dat Download Success, Check Updated..." diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_geosite.sh b/luci-app-openclash/root/usr/share/openclash/openclash_geosite.sh index f220fc3cc1..030bf9ee2b 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_geosite.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_geosite.sh @@ -30,17 +30,17 @@ if [ -z "$GEOSITE_CUSTOM_URL" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/Loyalsoldier/v2ray-rules-dat/release/geosite.dat -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/Loyalsoldier/v2ray-rules-dat/release/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOSITE_CUSTOM_URL" -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOSITE_CUSTOM_URL" -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq "0" ] && [ -s "/tmp/GeoSite.dat" ]; then LOG_OUT "GeoSite Database Download Success, Check Updated..." diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_ipdb.sh b/luci-app-openclash/root/usr/share/openclash/openclash_ipdb.sh index 154f721689..4327963623 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_ipdb.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_ipdb.sh @@ -30,17 +30,17 @@ if [ -z "$GEOIP_CUSTOM_URL" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOIP_CUSTOM_URL" -o /tmp/Country.mmdb 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOIP_CUSTOM_URL" -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -s "/tmp/Country.mmdb" ]; then LOG_OUT "Geoip Database Download Success, Check Updated..." diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_rule.sh b/luci-app-openclash/root/usr/share/openclash/openclash_rule.sh index c40ce28e86..c649a7cc45 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_rule.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_rule.sh @@ -36,41 +36,41 @@ if [ "$rule_name" = "lhie1" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/dler-io/Rules@master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/dler-io/Rules@master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/dler-io/Rules/master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/dler-io/Rules/master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/dler-io/Rules/master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/dler-io/Rules/master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/dler-io/Rules/master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/dler-io/Rules/master/Clash/Rule.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi sed -i '1i rules:' /tmp/rules.yaml elif [ "$rule_name" = "ConnersHua" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/DivineEngine/Profiles@master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/DivineEngine/Profiles@master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/DivineEngine/Profiles/master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/DivineEngine/Profiles/master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Outbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi sed -i "s/# - RULE-SET,ChinaIP,DIRECT/- RULE-SET,ChinaIP,DIRECT/g" /tmp/rules.yaml 2>/dev/null sed -i "s/- GEOIP,/#- GEOIP,/g" /tmp/rules.yaml 2>/dev/null elif [ "$rule_name" = "ConnersHua_return" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/DivineEngine/Profiles@master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/DivineEngine/Profiles@master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/DivineEngine/Profiles/master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/DivineEngine/Profiles/master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/Inbound.yaml -o /tmp/rules.yaml 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/rules.yaml" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi fi if [ -s "/tmp/rules.yaml" ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_update.sh b/luci-app-openclash/root/usr/share/openclash/openclash_update.sh index 0bd1f04f3a..3f0383e514 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_update.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_update.sh @@ -49,14 +49,14 @@ if [ -n "$OP_CV" ] && [ -n "$OP_LV" ] && [ "$(expr "$OP_LV" \> "$OP_CV")" -eq 1 LOG_OUT "Start Downloading【OpenClash - v$LAST_VER】..." if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -s "/tmp/openclash.ipk" ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_version.sh b/luci-app-openclash/root/usr/share/openclash/openclash_version.sh index d4f9690ed1..faace5b6a8 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_version.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_version.sh @@ -12,14 +12,14 @@ LOG_FILE="/tmp/openclash.log" if [ "$TIME" != "$CHTIME" ]; then if [ "$github_address_mod" != "0" ]; then if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi else - curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" + curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE" fi if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -z "$(cat $LAST_OPVER |grep '')" ]; then From f8c11eeff191631fbf52a5201b8969834483d4e3 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 8 Dec 2023 17:07:42 +0800 Subject: [PATCH 06/41] 0.45.159 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index b1dcf76d4b..eee611cff6 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.158 +PKG_VERSION:=0.45.159 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From 2c800e32de187c2b7024feb95cccd03ab9f07319 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 8 Dec 2023 17:33:23 +0800 Subject: [PATCH 07/41] chore: refine --- luci-app-openclash/po/zh-cn/openclash.zh-cn.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po index 5fd73ca54b..084b53b886 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -2971,7 +2971,7 @@ msgid "Note: Some software will modify the device HOSTS, which will cause abnorm msgstr "注意: 部分软件会修改设备 HOSTS,会导致分流异常,请注意检查" msgid "Note: The default proxy routes local traffic, BT, PT download, etc., please use Redir-Host mode as much as possible and pay attention to traffic avoidance" -msgstr "注意: 默认代理路由本机流量,BT、PT 下载等请尽量使用 redir 模式并注意进行流量规避" +msgstr "注意: 默认代理路由本机流量,BT、PT 下载等请尽量使用 Redir-Host 模式并注意进行流量规避" msgid "Note: Game proxy please use nodes except VMess" msgstr "注意: 游戏代理请使用 VMess 以外的节点" @@ -2980,7 +2980,7 @@ msgid "Note: If the connection is abnormal, please follow the steps on this page msgstr "注意: 连接异常时请按照此页步骤先进行检查" msgid "Note: If you need to perform client access control in Fake-IP mode, please change the DNS hijacking mode to firewall forwarding" -msgstr "注意: Fake-ip 模式下如需要进行客户端访问控制,请将DNS劫持模式改为防火墙转发" +msgstr "注意: Fake-IP 模式下如需要进行客户端访问控制,请将DNS劫持模式改为防火墙转发" msgid "Click to the page" msgstr "点击前往" From d3d219cd6799d897347864cef83b9845af963c12 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:43:41 +0800 Subject: [PATCH 08/41] chore: fix typo --- luci-app-openclash/luasrc/view/openclash/status.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index f4e4ca655f..99ab621051 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -441,7 +441,7 @@ } if(rdmdl==16) { - startlog.innerHTML = '<%:Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance%>'; + startlog.innerHTML = '<%:Note: The default proxy routes local traffic, BT, PT download, etc., please use Redir-Host mode as much as possible and pay attention to traffic avoidance%>'; } } } From 7eaf7a58bad147957ee96f370e90549f6ba427f6 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sun, 10 Dec 2023 02:18:48 +0800 Subject: [PATCH 09/41] chore: #3661 --- luci-app-openclash/luasrc/view/openclash/status.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index 99ab621051..03bfa68f3c 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -39,11 +39,11 @@ <% if uci:get("openclash", "config", "enable_meta_core") ~= '1' then %> - + <% else %> - + <% end %> From 12afbe840ee0fb806203a7bf96956c46078e2fe5 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Wed, 13 Dec 2023 07:55:16 +0800 Subject: [PATCH 10/41] workflow: revert --- .github/workflows/compile_meta_core.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/compile_meta_core.yml b/.github/workflows/compile_meta_core.yml index 3b4db447b3..a350c8dcd6 100644 --- a/.github/workflows/compile_meta_core.yml +++ b/.github/workflows/compile_meta_core.yml @@ -89,7 +89,6 @@ jobs: - name: Compile Meta Clash run: | cp ../tmp/Makefile ./Makefile - sed -i 's/ForceColors: true,/ForceColors: false,/g' ./log/log.go 2>/dev/null make releases - name: Copy Clash Bin From d7fd2a130bc97f99086cc3ac3186387936ba9624 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:50:46 +0800 Subject: [PATCH 11/41] chore: refine subscribe code --- .../luasrc/controller/openclash.lua | 2 +- luci-app-openclash/root/etc/init.d/openclash | 16 ++ .../root/usr/share/openclash/openclash.sh | 179 +----------------- .../openclash/openclash_dler_checkin.lua | 14 +- 4 files changed, 26 insertions(+), 185 deletions(-) diff --git a/luci-app-openclash/luasrc/controller/openclash.lua b/luci-app-openclash/luasrc/controller/openclash.lua index ff7131865d..ff25ad6c94 100644 --- a/luci-app-openclash/luasrc/controller/openclash.lua +++ b/luci-app-openclash/luasrc/controller/openclash.lua @@ -875,7 +875,7 @@ function action_toolbar_show() if not daip or not cn_port then return end traffic = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/traffic', dase, daip, cn_port))) connections = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', dase, daip, cn_port))) - if traffic and connections then + if traffic and connections and connections.connections then connection = #(connections.connections) up = s(traffic.up) down = s(traffic.down) diff --git a/luci-app-openclash/root/etc/init.d/openclash b/luci-app-openclash/root/etc/init.d/openclash index 9959ecab43..b0e8caf9e3 100644 --- a/luci-app-openclash/root/etc/init.d/openclash +++ b/luci-app-openclash/root/etc/init.d/openclash @@ -3281,6 +3281,22 @@ reload() SLOG_CLEAN del_lock fi + if pidof clash >/dev/null && [ "$enable" == "1" ] && [ "$1" == "revert" ]; then + set_lock + revert_firewall 2>/dev/null + /etc/init.d/dnsmasq restart >/dev/null 2>&1 + SLOG_CLEAN + del_lock + fi + if pidof clash >/dev/null && [ "$enable" == "1" ] && [ "$1" == "restore" ]; then + set_lock + do_run_mode 2>/dev/null + get_config 2>/dev/null + set_firewall 2>/dev/null + /etc/init.d/dnsmasq restart >/dev/null 2>&1 + SLOG_CLEAN + del_lock + fi } boot() diff --git a/luci-app-openclash/root/usr/share/openclash/openclash.sh b/luci-app-openclash/root/usr/share/openclash/openclash.sh index a9b6b2dace..4894af7034 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash.sh @@ -20,27 +20,10 @@ CFG_FILE="/tmp/yaml_sub_tmp_config.yaml" CRON_FILE="/etc/crontabs/root" CONFIG_PATH=$(uci -q get openclash.config.config_path) servers_update=$(uci -q get openclash.config.servers_update) -dns_port=$(uci -q get openclash.config.dns_port) -enable_redirect_dns=$(uci -q get openclash.config.enable_redirect_dns) -disable_masq_cache=$(uci -q get openclash.config.disable_masq_cache) -default_resolvfile=$(uci -q get openclash.config.default_resolvfile) -en_mode=$(uci -q get openclash.config.en_mode) -china_ip_route=$(uci -q get openclash.config.china_ip_route) -disable_udp_quic=$(uci -q get openclash.config.disable_udp_quic) -ipv6_enable=$(uci -q get openclash.config.ipv6_enable) router_self_proxy=$(uci -q get openclash.config.router_self_proxy || echo 1) -DNSPORT=$(uci -q get dhcp.@dnsmasq[0].port) -DNSMASQ_CONF_DIR=$(uci -q get dhcp.@dnsmasq[0].confdir || echo '/tmp/dnsmasq.d') -DNSMASQ_CONF_DIR=${DNSMASQ_CONF_DIR%*/} -custom_china_domain_dns_server=$(uci -q get openclash.config.custom_china_domain_dns_server || echo "114.114.114.114") FW4=$(command -v fw4) CLASH="/etc/openclash/clash" CLASH_CONFIG="/tmp" - - -if [ -z "$DNSPORT" ]; then - DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo 53) -fi restart=0 only_download=0 set_lock @@ -247,117 +230,7 @@ config_error() change_dns() { if pidof clash >/dev/null; then - if [ "$enable_redirect_dns" = "1" ]; then - uci -q del dhcp.@dnsmasq[-1].server - uci -q add_list dhcp.@dnsmasq[0].server=127.0.0.1#"$dns_port" - uci -q delete dhcp.@dnsmasq[0].resolvfile - uci -q set dhcp.@dnsmasq[0].noresolv=1 - [ "$disable_masq_cache" -eq 1 ] && { - uci -q set dhcp.@dnsmasq[0].cachesize=0 - } - uci commit dhcp - fi - - if [ -z "$(echo "$en_mode" |grep "redir-host")" ] && [ "$china_ip_route" -eq 1 ] && [ "$enable_redirect_dns" != "2" ]; then - cat "/etc/openclash/accelerated-domains.china.conf" |awk -v dns="${custom_china_domain_dns_server}" -F '/' '!/^$/&&!/^#/{print $1"/"$2"/"dns}' >${DNSMASQ_CONF_DIR}/dnsmasq_accelerated-domains.china.conf 2>/dev/null - for i in `awk '!/^$/&&!/^#/&&!/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf("%s\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list` - do - sed -i "/server=\/${i}\//d" ${DNSMASQ_CONF_DIR}/dnsmasq_accelerated-domains.china.conf 2>/dev/null - done 2>/dev/null - fi - - /etc/init.d/dnsmasq restart >/dev/null 2>&1 - - if [ -n "$FW4" ]; then - for nft in "nat_output" "mangle_output"; do - local handles=$(nft -a list chain inet fw4 ${nft} |grep -E "openclash|OpenClash" |grep -v "OpenClash DNS Hijack" |awk -F '# handle ' '{print$2}') - for handle in $handles; do - nft delete rule inet fw4 ${nft} handle ${handle} - done - done >/dev/null 2>&1 - echo "$nat_output_rules" |while read line - do - if [ -n "$(echo "$line" |grep "OpenClash DNS Hijack")" ]; then - continue - fi - nft add rule inet fw4 nat_output ${line} - done >/dev/null 2>&1 - echo "$mangle_output_rules" |while read line - do - if [ -n "$(echo "$line" |grep "OpenClash DNS Hijack")" ]; then - continue - fi - nft add rule inet fw4 mangle_output ${line} - done >/dev/null 2>&1 - - if [ "$enable_redirect_dns" = "2" ]; then - if [ "$router_self_proxy" = 1 ]; then - nft add rule inet fw4 nat_output position 0 tcp dport 53 ip daddr {127.0.0.1} meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 udp dport 53 ip daddr {127.0.0.1} meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - fi - if [ "$ipv6_enable" -eq 1 ]; then - if [ "$router_self_proxy" = 1 ]; then - nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 53 ip daddr {::/0} meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 53 ip daddr {::/0} meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - fi - fi - fi - if [ -z "$(echo "$en_mode" |grep "redir-host")" ] && [ "$china_ip_route" -eq 1 ] && [ "$enable_redirect_dns" != "2" ]; then - LOG_OUT "Tip: Bypass the China IP May Cause the Dnsmasq Load For a Long Time After Restart in FAKE-IP Mode, Hijack the DNS to Core Untill the Dnsmasq Works Well..." - nft insert rule inet fw4 dstnat position 0 tcp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft insert rule inet fw4 dstnat position 0 udp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }' 2>/dev/null - nft add rule inet fw4 nat_output position 0 tcp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 udp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 tcp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 udp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null - if [ "$ipv6_enable" -eq 1 ]; then - nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} tcp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} udp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }' 2>/dev/null - nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null - nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null - fi - fi - else - iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 - ip6tables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t nat -A OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t mangle -A OUTPUT -j openclash_output >/dev/null 2>&1 - ip6tables -t mangle -A OUTPUT -j openclash_output >/dev/null 2>&1 - if [ "$enable_redirect_dns" = "2" ]; then - if [ "$router_self_proxy" = 1 ]; then - iptables -t nat -I OUTPUT -p udp --dport 53 -d 127.0.0.1 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - iptables -t nat -I OUTPUT -p tcp --dport 53 -d 127.0.0.1 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - fi - if [ "$ipv6_enable" -eq 1 ]; then - if [ "$router_self_proxy" = 1 ]; then - ip6tables -t nat -I OUTPUT -p udp --dport 53 -d ::/0 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - ip6tables -t nat -I OUTPUT -p tcp --dport 53 -d ::/0 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - fi - fi - fi - if [ -z "$(echo "$en_mode" |grep "redir-host")" ] && [ "$china_ip_route" -eq 1 ] && [ "$enable_redirect_dns" != "2" ]; then - LOG_OUT "Tip: Bypass the China IP May Cause the Dnsmasq Load For a Long Time After Restart in FAKE-IP Mode, Hijack the DNS to Core Untill the Dnsmasq Works Well..." - iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - iptables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - iptables -t nat -I OUTPUT -p udp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - iptables -t nat -I OUTPUT -p tcp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - iptables -t nat -I OUTPUT -p udp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - iptables -t nat -I OUTPUT -p tcp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - if [ "$ipv6_enable" -eq 1 ]; then - ip6tables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - ip6tables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - ip6tables -t nat -I OUTPUT -p udp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - ip6tables -t nat -I OUTPUT -p tcp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - ip6tables -t nat -I OUTPUT -p udp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - ip6tables -t nat -I OUTPUT -p tcp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null - fi - fi - fi + /etc/init.d/openclash reload "restore" >/dev/null 2>&1 [ "$(unify_ps_status "openclash_watchdog.sh")" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && nohup /usr/share/openclash/openclash_watchdog.sh & fi } @@ -397,55 +270,7 @@ config_download_direct() { if pidof clash >/dev/null && [ "$router_self_proxy" = 1 ]; then kill_watchdog - if [ "$enable_redirect_dns" -eq 1 ]; then - uci -q del_list dhcp.@dnsmasq[0].server=127.0.0.1#"$dns_port" - if [ -n "$default_resolvfile" ]; then - uci -q set dhcp.@dnsmasq[0].resolvfile="$default_resolvfile" - elif [ -s "/tmp/resolv.conf.d/resolv.conf.auto" ] && [ -n "$(grep "nameserver" /tmp/resolv.conf.d/resolv.conf.auto)" ]; then - uci -q set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto - elif [ -s "/tmp/resolv.conf.auto" ] && [ -n "$(grep "nameserver" /tmp/resolv.conf.auto)" ]; then - uci -q set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto - else - rm -rf /tmp/resolv.conf.auto 2>/dev/null - touch /tmp/resolv.conf.auto 2>/dev/null - cat >> "/tmp/resolv.conf.auto" <<-EOF -# Interface lan -nameserver 114.114.114.114 -nameserver 119.29.29.29 -EOF - uci -q set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto - fi - uci -q set dhcp.@dnsmasq[0].noresolv=0 - uci -q delete dhcp.@dnsmasq[0].cachesize - uci commit dhcp - rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_accelerated-domains.china.conf >/dev/null 2>&1 - /etc/init.d/dnsmasq restart >/dev/null 2>&1 - fi - if [ -n "$FW4" ]; then - nat_output_rules=$(nft -a list chain inet fw4 nat_output |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$1}' |sed 's/^[ \t]*//g') - mangle_output_rules=$(nft -a list chain inet fw4 mangle_output |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$1}' |sed 's/^[ \t]*//g') - for nft in "nat_output" "mangle_output"; do - local handles=$(nft -a list chain inet fw4 ${nft} |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$2}') - for handle in $handles; do - nft delete rule inet fw4 ${nft} handle ${handle} - done - done >/dev/null 2>&1 - else - iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 - ip6tables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 - for ipt in "iptables -nvL OUTPUT -t nat" "iptables -nvL OUTPUT -t mangle" "ip6tables -nvL OUTPUT -t mangle" "ip6tables -nvL OUTPUT -t nat"; do - for comment in "OpenClash DNS Hijack"; do - local lines=$($ipt |sed 1,2d |sed -n "/${comment}/=" 2>/dev/null |sort -rn) - if [ -n "$lines" ]; then - for line in $lines; do - $(echo "$ipt" |awk -v OFS=" " '{print $1,$4,$5}' |sed 's/[ ]*$//g') -D $(echo "$ipt" |awk '{print $3}') $line - done - fi - done - done >/dev/null 2>&1 - fi - + /etc/init.d/openclash reload "revert" >/dev/null 2>&1 sleep 3 config_download diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_dler_checkin.lua b/luci-app-openclash/root/usr/share/openclash/openclash_dler_checkin.lua index 8e89dbfc03..3c27d0d2b2 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_dler_checkin.lua +++ b/luci-app-openclash/root/usr/share/openclash/openclash_dler_checkin.lua @@ -18,19 +18,19 @@ local function dler_checkin() path = "/tmp/dler_checkin" if token and email and passwd and enable == "1" then checkin = string.format("curl -sL -H 'Content-Type: application/json' -d '{\"email\":\"%s\", \"passwd\":\"%s\", \"multiple\":\"%s\"}' -X POST https://dler.cloud/api/v1/checkin -o %s", email, passwd, multiple, path) - if not nixio.fs.access(path) then + if fs.readfile(path) == "" or not fs.readfile(path) then luci.sys.exec(checkin) else - if fs.readfile(path) == "" or not fs.readfile(path) then + if (os.time() - fs.mtime(path) > interval*3600+1) then + fs.unlink(path) luci.sys.exec(checkin) else - if (os.time() - fs.mtime(path) > interval*3600+1) then - luci.sys.exec(checkin) - else - os.exit(0) - end + os.exit(0) end end + if fs.readfile(path) == "" or not fs.readfile(path) then + fs.writefile(path, " ") + end info = fs.readfile(path) if info then info = json.parse(info) From ef5ce1902bc0d66316c90ecfa28f3d49ffe04b41 Mon Sep 17 00:00:00 2001 From: Simon Shi <9512067+simonsmh@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:09:41 +0800 Subject: [PATCH 12/41] feat: add mixed stack (#3599) * feat: add lwip & mixed stack * https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/constant/tun.go#L69 * delete lwip --------- Co-authored-by: vernesong <42875168+vernesong@users.noreply.github.com> --- luci-app-openclash/luasrc/model/cbi/openclash/settings.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua index ac8ec056d5..814c85d538 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua @@ -79,7 +79,8 @@ o:depends("en_mode", "fake-ip-tun") o:depends("en_mode", "redir-host-mix") o:depends("en_mode", "fake-ip-mix") o:value("system", translate("System ")) -o:value("gvisor", translate("Gvisor")) +o:value("gvisor", translate("gVisor")) +o:value("mixed", translate("Mixed")..translate("(Only Meta Core)")) o.default = "system" o = s:taboption("op_mode", ListValue, "proxy_mode", translate("Proxy Mode")) @@ -1131,7 +1132,8 @@ o.description = translate("Select Stack Type For TUN Mode, According To The Runn o:depends({ipv6_mode= "2", en_mode = "redir-host"}) o:depends({ipv6_mode= "2", en_mode = "fake-ip"}) o:value("system", translate("System ")) -o:value("gvisor", translate("Gvisor")) +o:value("gvisor", translate("gVisor")) +o:value("mixed", translate("Mixed")..translate("(Only Meta Core)")) o.default = "system" o = s:taboption("ipv6", Flag, "enable_v6_udp_proxy", translate("Proxy UDP Traffics")) From 55a8ccfb1fe420c74f149a3b4a63654eff54d47c Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:42:11 +0800 Subject: [PATCH 13/41] 0.45.160 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index eee611cff6..7c7cb14d8b 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.159 +PKG_VERSION:=0.45.160 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From e92d5531aa1374964f09db77a97b771314876eda Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 16 Dec 2023 18:23:14 +0800 Subject: [PATCH 14/41] chore: refine --- .../luasrc/view/openclash/status.htm | 39 ++++++++++++++++--- .../root/usr/share/openclash/openclash.sh | 1 + 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index 03bfa68f3c..a5ff1e9178 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -645,15 +645,40 @@ function ws_tmessage(event) { var data = JSON.parse(event.data) - document.getElementById("upload_").innerHTML = ""+bytesToSize(data.up)+"/S"; - document.getElementById("download_").innerHTML = ""+bytesToSize(data.down)+"/S"; + if (data.up) { + document.getElementById("upload_").innerHTML = ""+bytesToSize(data.up)+"/S"; + } + else { + document.getElementById("upload_").innerHTML = "0 B/S"; + } + if (data.down) { + document.getElementById("download_").innerHTML = ""+bytesToSize(data.down)+"/S"; + } + else { + document.getElementById("download_").innerHTML = "0 B/S"; + } }; function ws_cmessage(event) { var data = JSON.parse(event.data) - document.getElementById("uploadtotal_").innerHTML = ""+bytesToSize(data.uploadTotal)+""; - document.getElementById("downloadtotal_").innerHTML = ""+bytesToSize(data.downloadTotal)+""; - document.getElementById("connect_t").innerHTML = ""+Object.keys(data.connections).length+""; + if (data.uploadTotal) { + document.getElementById("uploadtotal_").innerHTML = ""+bytesToSize(data.uploadTotal)+""; + } + else { + document.getElementById("uploadtotal_").innerHTML = "0 KB"; + } + if (data.downloadTotal) { + document.getElementById("downloadtotal_").innerHTML = ""+bytesToSize(data.downloadTotal)+""; + } + else { + document.getElementById("downloadtotal_").innerHTML = "0 KB"; + } + if (data.connections) { + document.getElementById("connect_t").innerHTML = ""+Object.keys(data.connections).length+""; + } + else { + document.getElementById("connect_t").innerHTML = "0"; + } show_sys(); }; @@ -921,6 +946,7 @@ newimg.src = imgNewSrc; newimg.onload = function() { imgobj.src = imgNewSrc; + imgobj.loading = "lazy"; imgobj.onload = function() {}; }; newimg.onerror = function() { @@ -953,7 +979,8 @@ function imgerrorfuns(imgobj,imgSrc){ setTimeout(function(){ - imgobj.src=imgSrc; + imgobj.src = imgSrc; + imgobj.loading = "lazy"; },1000*10); }; diff --git a/luci-app-openclash/root/usr/share/openclash/openclash.sh b/luci-app-openclash/root/usr/share/openclash/openclash.sh index 4894af7034..6a0084df84 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash.sh @@ -475,6 +475,7 @@ sub_info_get() config_test if [ $? -ne 0 ]; then LOG_OUT "Error: Config File Tested Faild, Please Check The Log Infos!" + LOG_OUT "Error: Config File【$name】Subscribed Failed, Trying to Download Without Agent..." config_download_direct return fi From cfd3c0055b7cfeaea9fbe03f3fc9b4ce4aa428c2 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sun, 17 Dec 2023 01:34:34 +0800 Subject: [PATCH 15/41] feat: skip proxies address --- .../po/zh-cn/openclash.zh-cn.po | 3 + .../share/openclash/openclash_debug_dns.lua | 12 ++- .../usr/share/openclash/openclash_watchdog.sh | 92 ++++++++++++++++++- 3 files changed, 105 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po index 084b53b886..bbe89adc60 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -3461,3 +3461,6 @@ msgstr "TCP Keep-alive 间隔(s)" msgid "Used for Downloading Subscriptions, Defaults to Clash" msgstr "用于下载订阅时指定 UA,默认为 Clash" + +msgid "Error: Set Proxies Address Skip Failed," +msgstr "错误:绕过代理服务器地址设置失败," \ No newline at end of file diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_debug_dns.lua b/luci-app-openclash/root/usr/share/openclash/openclash_debug_dns.lua index 06b0addebe..b567fb6450 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_debug_dns.lua +++ b/luci-app-openclash/root/usr/share/openclash/openclash_debug_dns.lua @@ -7,6 +7,7 @@ local uci = require("luci.model.uci").cursor() local json = require "luci.jsonc" local datatype = require "luci.cbi.datatypes" local addr = arg[1] +local resolve = arg[2] local function debug_dns() local info, ip, host @@ -25,7 +26,7 @@ local function debug_dns() if info then info = json.parse(info) end - if info then + if info and not resolve then print("Status: "..(info.Status)) print("TC: "..tostring(info.TC)) print("RD: "..tostring(info.RD)) @@ -71,6 +72,15 @@ local function debug_dns() end end end + if info and resolve then + if info.Answer then + for _, v in pairs(info.Answer) do + if v.type == 1 then + print(v.data) + end + end + end + end end os.exit(0) end diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh index c584a9892c..56db745a90 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh @@ -112,7 +112,6 @@ do stream_auto_select_google_not_cn=$(uci -q get openclash.config.stream_auto_select_google_not_cn || echo 0) stream_auto_select_openai=$(uci -q get openclash.config.stream_auto_select_openai || echo 0) upnp_lease_file=$(uci -q get upnpd.config.upnp_lease_file) - enable=$(uci -q get openclash.config.enable) if [ "$enable" -eq 1 ]; then @@ -271,6 +270,97 @@ fi fi fi +## Skip Proxies Address + ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e " + begin + Value = YAML.load_file('$CONFIG_FILE'); + rescue Exception => e + puts '${LOGTIME} Error: Load File Failed,【' + e.message + '】'; + end; + begin + Thread.new{ + reg = /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/; + reg6 = /^(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))|\[(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))\](?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/i; + if Value.key?('proxies') or Value.key?('proxy-providers') then + firewall_v = '$FW4'; + if firewall_v.empty? then + firewall_v = 'ipt' + else + firewall_v = 'nft' + end; + ips = Array.new; + servers = Array.new; + if Value.key?('proxies') then + Value['proxies'].each do + |i| + if not i['server'] =~ reg and not i['server'] =~ reg6 and not servers.include?(i['server']) then + servers = servers.push(i['server']).uniq + syscall = '/usr/share/openclash/openclash_debug_dns.lua 2>/dev/null \"' + i['server'] + '\" \"true\"' + if IO.popen(syscall).read.split(/\n+/) then + ips = ips | IO.popen(syscall).read.split(/\n+/) + end; + else + ips = ips.push(i['server']).uniq + end; + end; + end; + if Value.key?('proxy-providers') then + Value['proxy-providers'].values.each do + |i,path| + if not i['path'].empty? then + if i['path'].split('/')[0] == '.' then + path = '/etc/openclash/'+i['path'].split('./')[1] + else + path = i['path'] + end + if File::exist?(path) then + if YAML.load_file(path).key?('proxies') then + YAML.load_file(path)['proxies'].each do + |j| + if not j['server'] =~ reg and not j['server'] =~ reg6 and not servers.include?(j['server']) then + servers = servers.push(j['server']).uniq + syscall = '/usr/share/openclash/openclash_debug_dns.lua 2>/dev/null \"' + j['server'] + '\" \"true\"' + if IO.popen(syscall).read.split(/\n+/) then + ips = ips | IO.popen(syscall).read.split(/\n+/) + end; + else + ips = ips.push(j['server']).uniq + end; + end; + end; + end; + end; + end; + end; + #Add ip skip + if ips then + ips.each do + |ip| + if ip and ip =~ reg then + if firewall_v == 'nft' then + syscall = 'nft add element inet fw4 localnetwork { \"' + ip + '\" } 2>/dev/null' + system(syscall) + else + syscall = 'ipset add localnetwork \"' + ip + '\" 2>/dev/null' + system(syscall) + end; + elsif ip and ip =~ reg6 then + if firewall_v == 'nft' then + syscall = 'nft add element inet fw4 localnetwork6 { \"' + ip + '\" } 2>/dev/null' + system(syscall) + else + syscall = 'ipset add localnetwork6 \"' + ip + '\" 2>/dev/null' + system(syscall) + end; + end; + end; + end; + end; + }.join; + rescue Exception => e + puts '${LOGTIME} Error: Set Proxies Address Skip Failed,【' + e.message + '】'; + end" >> $LOG_FILE + ## DNS转发劫持 if [ "$enable_redirect_dns" = "1" ]; then if [ -z "$(uci -q get dhcp.@dnsmasq[0].server |grep "$dns_port")" ] || [ ! -z "$(uci -q get dhcp.@dnsmasq[0].server |awk -F ' ' '{print $2}')" ]; then From aad104e0275f69481613cc72bdc0fce72f6ce5c0 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sun, 17 Dec 2023 01:35:48 +0800 Subject: [PATCH 16/41] 0.45.161 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 7c7cb14d8b..e7a39da9ef 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.160 +PKG_VERSION:=0.45.161 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From 5e3902f906d95bbae38e079aabe6bb4728d53c26 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Mon, 18 Dec 2023 12:32:09 +0800 Subject: [PATCH 17/41] chore: refine --- .../root/usr/share/openclash/openclash_watchdog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh index 56db745a90..e4f29505be 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh @@ -307,7 +307,7 @@ fi if Value.key?('proxy-providers') then Value['proxy-providers'].values.each do |i,path| - if not i['path'].empty? then + if i['path'] and not i['path'].empty? then if i['path'].split('/')[0] == '.' then path = '/etc/openclash/'+i['path'].split('./')[1] else From c4333fb4998d7f35dce7dd856e1c86779cc74d9d Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Tue, 19 Dec 2023 18:51:43 +0800 Subject: [PATCH 18/41] chore: #3688 --- .../usr/share/openclash/openclash_watchdog.sh | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh index e4f29505be..691113a3dc 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh @@ -290,21 +290,23 @@ fi end; ips = Array.new; servers = Array.new; - if Value.key?('proxies') then + if Value.key?('proxies') and not Value['proxies'].nil? then Value['proxies'].each do |i| - if not i['server'] =~ reg and not i['server'] =~ reg6 and not servers.include?(i['server']) then - servers = servers.push(i['server']).uniq - syscall = '/usr/share/openclash/openclash_debug_dns.lua 2>/dev/null \"' + i['server'] + '\" \"true\"' - if IO.popen(syscall).read.split(/\n+/) then - ips = ips | IO.popen(syscall).read.split(/\n+/) + if i['server'] then + if not i['server'] =~ reg and not i['server'] =~ reg6 and not servers.include?(i['server']) then + servers = servers.push(i['server']).uniq + syscall = '/usr/share/openclash/openclash_debug_dns.lua 2>/dev/null \"' + i['server'] + '\" \"true\"' + if IO.popen(syscall).read.split(/\n+/) then + ips = ips | IO.popen(syscall).read.split(/\n+/) + end; + else + ips = ips.push(i['server']).uniq end; - else - ips = ips.push(i['server']).uniq end; end; end; - if Value.key?('proxy-providers') then + if Value.key?('proxy-providers') and not Value['proxy-providers'].nil? then Value['proxy-providers'].values.each do |i,path| if i['path'] and not i['path'].empty? then @@ -312,19 +314,21 @@ fi path = '/etc/openclash/'+i['path'].split('./')[1] else path = i['path'] - end + end; if File::exist?(path) then - if YAML.load_file(path).key?('proxies') then + if YAML.load_file(path).key?('proxies') and not YAML.load_file(path)['proxies'].nil? then YAML.load_file(path)['proxies'].each do |j| - if not j['server'] =~ reg and not j['server'] =~ reg6 and not servers.include?(j['server']) then - servers = servers.push(j['server']).uniq - syscall = '/usr/share/openclash/openclash_debug_dns.lua 2>/dev/null \"' + j['server'] + '\" \"true\"' - if IO.popen(syscall).read.split(/\n+/) then - ips = ips | IO.popen(syscall).read.split(/\n+/) + if j['server'] then + if not j['server'] =~ reg and not j['server'] =~ reg6 and not servers.include?(j['server']) then + servers = servers.push(j['server']).uniq + syscall = '/usr/share/openclash/openclash_debug_dns.lua 2>/dev/null \"' + j['server'] + '\" \"true\"' + if IO.popen(syscall).read.split(/\n+/) then + ips = ips | IO.popen(syscall).read.split(/\n+/) + end; + else + ips = ips.push(j['server']).uniq end; - else - ips = ips.push(j['server']).uniq end; end; end; @@ -333,7 +337,7 @@ fi end; end; #Add ip skip - if ips then + if ips and not ips.empty? then ips.each do |ip| if ip and ip =~ reg then From 37d260cd29895946c61a1e1ab4113466512d3b4e Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 23 Dec 2023 07:59:22 +0800 Subject: [PATCH 19/41] 0.45.162 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index e7a39da9ef..c9b5d78d11 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.161 +PKG_VERSION:=0.45.162 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From dbfe8dff199440894a7d4116182f0cefb2c7f311 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sun, 24 Dec 2023 19:19:54 +0800 Subject: [PATCH 20/41] chore: default dns overwrite --- luci-app-openclash/root/etc/config/openclash | 24 +++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/luci-app-openclash/root/etc/config/openclash b/luci-app-openclash/root/etc/config/openclash index 8210dc88e0..1dd0fd7f64 100644 --- a/luci-app-openclash/root/etc/config/openclash +++ b/luci-app-openclash/root/etc/config/openclash @@ -68,12 +68,30 @@ config openclash 'config' option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt' option cndomain_custom_url 'https://testingcf.jsdelivr.net/gh/felixonmars/dnsmasq-china-list@master/accelerated-domains.china.conf' +config dns_servers + option type 'udp' + option ip '114.114.114.114' + option enabled '1' + option group 'default' + +config dns_servers + option type 'udp' + option ip '119.29.29.29' + option enabled '1' + option group 'default' + config dns_servers option group 'nameserver' option type 'udp' option ip '114.114.114.114' option enabled '1' +config dns_servers + option type 'udp' + option ip '223.5.5.5' + option enabled '1' + option group 'default' + config dns_servers option group 'nameserver' option type 'udp' @@ -108,7 +126,7 @@ config dns_servers option type 'https' option group 'fallback' option ip 'dns.cloudflare.com/dns-query' - option enabled '1' + option enabled '0' config dns_servers option group 'fallback' @@ -162,7 +180,7 @@ config dns_servers option group 'fallback' option type 'https' option ip 'public.dns.iij.jp/dns-query' - option enabled '1' + option enabled '0' config dns_servers option group 'fallback' @@ -201,7 +219,7 @@ config dns_servers option type 'https' config dns_servers - option enabled '1' + option enabled '0' option group 'fallback' option ip 'dns.oszx.co/dns-query' option type 'https' From 41b564ac91a115c77ffac1da82b4cefe1ad15a63 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sun, 24 Dec 2023 19:24:39 +0800 Subject: [PATCH 21/41] chore: #3695 --- .../luasrc/model/cbi/openclash/config-subscribe-edit.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua index 2fb0ed32ea..3acbbe3493 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua @@ -106,6 +106,7 @@ o:value("https://v.id9.cc/sub", translate("v.id9.cc")..translate("(Support Vless o:value("https://sub.id9.cc/sub", translate("sub.id9.cc")) o:value("https://api.wcc.best/sub", translate("api.wcc.best")) o.default = "https://api.dler.io/sub" +o.placeholder = "https://api.dler.io/sub" ---- Template o = s:option(ListValue, "template", translate("Template Name")) From 374c628a0093da1166b9d983e7297417b835d7b0 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 4 Jan 2024 06:30:05 +0800 Subject: [PATCH 22/41] fix #3702 --- .../usr/share/openclash/yml_groups_get.sh | 1 + .../usr/share/openclash/yml_groups_name_ch.sh | 19 ++++++++------ .../usr/share/openclash/yml_groups_set.sh | 25 +++++++++++-------- .../usr/share/openclash/yml_proxys_get.sh | 5 +++- .../usr/share/openclash/yml_proxys_set.sh | 10 ++++++-- 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/luci-app-openclash/root/usr/share/openclash/yml_groups_get.sh b/luci-app-openclash/root/usr/share/openclash/yml_groups_get.sh index 00bd68eee4..58856ccb00 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_groups_get.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_groups_get.sh @@ -81,6 +81,7 @@ fi cfg_group_name() { local section="$1" + local config config_get "config" "$section" "config" "" if [ -z "$config" ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/yml_groups_name_ch.sh b/luci-app-openclash/root/usr/share/openclash/yml_groups_name_ch.sh index 6473f4e943..b8fc1f61bd 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_groups_name_ch.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_groups_name_ch.sh @@ -16,6 +16,7 @@ cfg_groups_set() CFG_FILE="/etc/config/openclash" local section="$1" + local name old_name_cfg old_name config_get "name" "$section" "name" "" config_get "old_name_cfg" "$section" "old_name_cfg" "" config_get "old_name" "$section" "old_name" "" @@ -36,17 +37,19 @@ cfg_groups_set() #名字变化时处理配置文件 if [ "$name" != "$old_name_cfg" ] && [ ! -z "$old_name_cfg" ]; then - sed -i "s/old_name_cfg \'${old_name_cfg}\'/old_name_cfg \'${name}\'/g" $CFG_FILE 2>/dev/null - sed -i "s/groups \'${old_name_cfg}\'/groups \'${name}\'/g" $CFG_FILE 2>/dev/null - sed -i "s/option group \'${old_name_cfg}\'/option group \'${name}\'/g" $CFG_FILE 2>/dev/null - sed -i "s/option specific_group \'${old_name_cfg}\'/option specific_group \'${name}\'/g" $CFG_FILE 2>/dev/null - sed -i "s/other_group \'${old_name_cfg}\'/other_group \'${name}\'/g" $CFG_FILE 2>/dev/null - sed -i "s/new_servers_group \'${old_name_cfg}\'/new_servers_group \'${name}\'/g" $CFG_FILE 2>/dev/null - sed -i "s/relay_groups \'${old_name_cfg}\'/relay_groups \'${name}\'/g" $CFG_FILE 2>/dev/null + convert_name=$(echo "$name" | sed 's/\//\\\//g' 2>/dev/null) + convert_old_name_cfg=$(echo "$old_name_cfg" | sed 's/\//\\\//g' 2>/dev/null) + sed -i "s/old_name_cfg \'${convert_old_name_cfg}\'/old_name_cfg \'${convert_name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/groups \'${convert_old_name_cfg}\'/groups \'${convert_name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/option group \'${convert_old_name_cfg}\'/option group \'${convert_name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/option specific_group \'${convert_old_name_cfg}\'/option specific_group \'${convert_name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/other_group \'${convert_old_name_cfg}\'/other_group \'${convert_name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/new_servers_group \'${convert_old_name_cfg}\'/new_servers_group \'${convert_name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/relay_groups \'${convert_old_name_cfg}\'/relay_groups \'${convert_name}\'/g" $CFG_FILE 2>/dev/null #第三方规则处理 OTHER_RULE_NAMES=("GlobalTV" "AsianTV" "Proxy" "Youtube" "Bilibili" "Bahamut" "HBOGo" "HBOMax" "Pornhub" "Apple" "GoogleFCM" "Scholar" "Microsoft" "Netflix" "Disney" "Spotify" "Steam" "Speedtest" "Telegram" "PayPal" "Netease_Music" "AdBlock" "Domestic" "Others" "miHoYo" "OpenAI" "AppleTV" "Crypto" "Discord" "Anti IP") for i in ${OTHER_RULE_NAMES[@]}; do - sed -i "s/option ${i} \'${old_name_cfg}\'/option ${i} \'${name}\'/g" $CFG_FILE 2>/dev/null + sed -i "s/option ${i} \'${convert_old_name_cfg}\'/option ${i} \'${convert_name}\'/g" $CFG_FILE 2>/dev/null done 2>/dev/null config_load "openclash" fi diff --git a/luci-app-openclash/root/usr/share/openclash/yml_groups_set.sh b/luci-app-openclash/root/usr/share/openclash/yml_groups_set.sh index 87c2f7df7b..a4e8e13ea1 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_groups_set.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_groups_set.sh @@ -89,6 +89,7 @@ yml_servers_add() { local section="$1" + local enabled config name relay_groups add_for_this=0 config_get_bool "enabled" "$section" "enabled" "1" config_get "config" "$section" "config" "" @@ -165,6 +166,7 @@ set_other_groups() set_proxy_provider() { local section="$1" + local enabled config name add_for_this=0 config_get_bool "enabled" "$section" "enabled" "1" config_get "config" "$section" "config" "" @@ -210,6 +212,7 @@ yml_groups_set() { local section="$1" + local enabled config type name disable_udp strategy old_name test_url test_interval tolerance interface_name routing_mark policy_filter config_get_bool "enabled" "$section" "enabled" "1" config_get "config" "$section" "config" "" config_get "type" "$section" "type" "" @@ -251,7 +254,7 @@ yml_groups_set() #游戏策略组存在时判断节点是否存在 if [ -n "$if_game_group" ] && [ -n "$(grep "^$if_game_group$" /tmp/Proxy_Group)" ]; then config_foreach yml_servers_add "servers" "$name" "$type" "check" #加入服务器节点 - config_foreach set_proxy_provider "proxy-provider" "$group_name" "check" #加入代理集 + config_foreach set_proxy_provider "proxy-provider" "$name" "check" #加入代理集 return fi @@ -267,8 +270,8 @@ yml_groups_set() [ -n "$disable_udp" ] && { echo " disable-udp: $disable_udp" >>$GROUP_FILE } - group_name="$name" - echo " proxies: $group_name" >>$GROUP_FILE + + echo " proxies: $name" >>$GROUP_FILE #名字变化时处理规则部分 if [ "$name" != "$old_name" ] && [ -n "$old_name" ]; then @@ -287,24 +290,26 @@ yml_groups_set() if [ "$type" = "relay" ] && [ -s "/tmp/relay_server" ]; then cat /tmp/relay_server |sort -k 1 |awk -F '#' '{print $2}' > /tmp/relay_server.list 2>/dev/null - sed -i "/^ \{0,\}proxies: ${group_name}/r/tmp/relay_server.list" "$GROUP_FILE" 2>/dev/null + sed -i "/^ \{0,\}proxies: ${name}/r/tmp/relay_server.list" "$GROUP_FILE" 2>/dev/null rm -rf /tmp/relay_server 2>/dev/null fi - echo " use: $group_name" >>$GROUP_FILE + echo " use: $name" >>$GROUP_FILE - config_foreach set_proxy_provider "proxy-provider" "$group_name" #加入代理集 + config_foreach set_proxy_provider "proxy-provider" "$name" #加入代理集 + #Prevent the un support symbol name + name=$(echo "$name" |sed 's/\//\\\//g' 2>/dev/null) if [ "$set_group" -eq 1 ]; then - sed -i "/^ \{0,\}proxies: ${group_name}/c\ proxies:" $GROUP_FILE + sed -i "/^ \{0,\}proxies: ${name}/c\ proxies:" $GROUP_FILE else - sed -i "/proxies: ${group_name}/d" $GROUP_FILE 2>/dev/null + sed -i "/proxies: ${name}/d" $GROUP_FILE 2>/dev/null fi if [ "$set_proxy_provider" -eq 1 ]; then - sed -i "/^ \{0,\}use: ${group_name}/c\ use:" $GROUP_FILE + sed -i "/^ \{0,\}use: ${name}/c\ use:" $GROUP_FILE else - sed -i "/use: ${group_name}/d" $GROUP_FILE 2>/dev/null + sed -i "/use: ${name}/d" $GROUP_FILE 2>/dev/null fi [ -n "$test_url" ] && { diff --git a/luci-app-openclash/root/usr/share/openclash/yml_proxys_get.sh b/luci-app-openclash/root/usr/share/openclash/yml_proxys_get.sh index 9c7c9a4f01..0cfe1a8b53 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_proxys_get.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_proxys_get.sh @@ -107,6 +107,7 @@ cfg_new_servers_groups_check() cfg_group_name() { local section="$1" + local name config config_get "name" "$section" "name" "" config_get "config" "$section" "config" "" @@ -149,6 +150,7 @@ LOG_OUT "Start Getting【$CONFIG_NAME】Proxy-providers Setting..." yml_provider_name_get() { local section="$1" + local name config config_get "name" "$section" "name" "" config_get "config" "$section" "config" "" if [ -n "$name" ] && [ "$config" = "$CONFIG_NAME" ]; then @@ -342,7 +344,8 @@ fi yml_servers_name_get() { - local section="$1" + local section="$1" + local name config config_get "name" "$section" "name" "" config_get "config" "$section" "config" "" if [ -n "$name" ] && [ "$config" = "$CONFIG_NAME" ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh b/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh index e0fc9e8ca1..2da4b1c9e4 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh @@ -68,6 +68,7 @@ yml_other_rules_del() yml_proxy_provider_set() { local section="$1" + local enabled config type name path provider_filter provider_url provider_interval health_check health_check_url health_check_interval config_get_bool "enabled" "$section" "enabled" "1" config_get "config" "$section" "config" "" config_get "type" "$section" "type" "" @@ -115,7 +116,8 @@ yml_proxy_provider_set() if [ -n "$(grep -w "path: $path" "$PROXY_PROVIDER_FILE" 2>/dev/null)" ]; then return elif [ "$(grep -w "^$name$" "$proxy_provider_name" |wc -l 2>/dev/null)" -ge 2 ] && [ -z "$(grep -w "path: $path" "$PROXY_PROVIDER_FILE" 2>/dev/null)" ]; then - sed -i "1,/^${name}$/{//d}" "$proxy_provider_name" 2>/dev/null + convert_name=$(echo "$name" |sed 's/\//\\\//g' 2>/dev/null) + sed -i "1,/^${convert_name}$/{//d}" "$proxy_provider_name" 2>/dev/null return fi fi @@ -349,7 +351,8 @@ yml_servers_set() if [ -n "$(grep -w "name: \"$name\"" "$SERVER_FILE" 2>/dev/null)" ]; then return elif [ "$(grep -w "^$name$" "$servers_name" |wc -l 2>/dev/null)" -ge 2 ] && [ -z "$(grep -w "name: \"$name\"" "$SERVER_FILE" 2>/dev/null)" ]; then - sed -i "1,/^${name}$/{//d}" "$servers_name" 2>/dev/null + convert_name=$(echo "$name" |sed 's/\//\\\//g' 2>/dev/null) + sed -i "1,/^${convert_name}$/{//d}" "$servers_name" 2>/dev/null return fi fi @@ -1352,6 +1355,7 @@ EOF new_servers_group_set() { local section="$1" + local enabled name config_get_bool "enabled" "$section" "enabled" "1" config_get "name" "$section" "name" "" @@ -1370,6 +1374,7 @@ new_servers_group_set() yml_servers_name_get() { local section="$1" + local name config_get "name" "$section" "name" "" [ ! -z "$name" ] && { echo "$name" >>"$servers_name" @@ -1379,6 +1384,7 @@ yml_servers_name_get() yml_proxy_provider_name_get() { local section="$1" + local name config_get "name" "$section" "name" "" [ ! -z "$name" ] && { echo "$name" >>"$proxy_provider_name" From cf91df1756f3e933ff3922633448f74dbaba390b Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 4 Jan 2024 07:10:59 +0800 Subject: [PATCH 23/41] chore: refine --- .../usr/share/openclash/openclash_watchdog.sh | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh index 691113a3dc..0eeb7f863c 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh @@ -33,11 +33,50 @@ FW4=$(command -v fw4) check_dnsmasq() { if [ -z "$(echo "$en_mode" |grep "redir-host")" ] && [ "$china_ip_route" -eq 1 ] && [ "$enable_redirect_dns" != "2" ]; then - if [ "$(nslookup www.baidu.com 127.0.0.1:12353 >/dev/null 2>&1 || echo $?)" != "1" ]; then - DNSPORT=$(uci -q get dhcp.@dnsmasq[0].port) - if [ -z "$DNSPORT" ]; then - DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo 53) + DNSPORT=$(uci -q get dhcp.@dnsmasq[0].port) + if [ -z "$DNSPORT" ]; then + DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo 53) + fi + if [ "$(nslookup www.baidu.com 127.0.0.1:12353 >/dev/null 2>&1 || echo $?)" = "1" ]; then + if [ -n "$FW4" ]; then + if [ -z "$(nft list chain inet fw4 nat_output |grep 'OpenClash DNS Hijack')" ]; then + nft insert rule inet fw4 dstnat position 0 tcp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 udp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }' 2>/dev/null + nft insert rule inet fw4 nat_output position 0 tcp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 nat_output position 0 udp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 nat_output position 0 tcp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 nat_output position 0 udp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + if [ "$ipv6_enable" -eq 1 ]; then + nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} tcp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} udp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }' 2>/dev/null + nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + fi + fi + else + if [ -z "$(iptables -t nat -nL OUTPUT --line-number |grep 'OpenClash DNS Hijack')" ]; then + iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + iptables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + iptables -t nat -I OUTPUT -p udp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + iptables -t nat -I OUTPUT -p tcp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + iptables -t nat -I OUTPUT -p udp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + iptables -t nat -I OUTPUT -p tcp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + if [ "$ipv6_enable" -eq 1 ]; then + ip6tables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + ip6tables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + ip6tables -t nat -I OUTPUT -p udp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + ip6tables -t nat -I OUTPUT -p tcp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + ip6tables -t nat -I OUTPUT -p udp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + ip6tables -t nat -I OUTPUT -p tcp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null + fi + fi fi + fi + if [ "$(nslookup www.baidu.com 127.0.0.1:12353 >/dev/null 2>&1 || echo $?)" != "1" ]; then if [ -n "$FW4" ]; then if [ -n "$(nft list chain inet fw4 nat_output |grep 'OpenClash DNS Hijack')" ]; then LOG_OUT "Tip: Dnsmasq Work is Normal, Restore The Firewall DNS Hijacking Rules..." From 006ff7655e3dae1fd0bdd2f96a923db066d9f0b9 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 4 Jan 2024 07:11:36 +0800 Subject: [PATCH 24/41] 0.45.163 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index c9b5d78d11..7bb50e4947 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.162 +PKG_VERSION:=0.45.163 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From aaaab0b808c39248454a2b3639c1c918b7ee4144 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 4 Jan 2024 08:06:39 +0800 Subject: [PATCH 25/41] chore: fix typo --- luci-app-openclash/po/zh-cn/openclash.zh-cn.po | 11 ++++++++++- .../root/usr/share/openclash/openclash_watchdog.sh | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po index bbe89adc60..c2549dca88 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -3463,4 +3463,13 @@ msgid "Used for Downloading Subscriptions, Defaults to Clash" msgstr "用于下载订阅时指定 UA,默认为 Clash" msgid "Error: Set Proxies Address Skip Failed," -msgstr "错误:绕过代理服务器地址设置失败," \ No newline at end of file +msgstr "错误:绕过代理服务器地址设置失败," + +msgid "Flush Failed" +msgstr "清理失败" + +msgid "Flush Successful" +msgstr "清理成功" + +msgid "Flush Timeout" +msgstr "清理超时" \ No newline at end of file diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh index 0eeb7f863c..16f75da469 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh @@ -37,9 +37,9 @@ check_dnsmasq() { if [ -z "$DNSPORT" ]; then DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo 53) fi - if [ "$(nslookup www.baidu.com 127.0.0.1:12353 >/dev/null 2>&1 || echo $?)" = "1" ]; then + if [ "$(nslookup www.baidu.com 127.0.0.1:"$DNSPORT" >/dev/null 2>&1 || echo $?)" = "1" ]; then if [ -n "$FW4" ]; then - if [ -z "$(nft list chain inet fw4 nat_output |grep 'OpenClash DNS Hijack')" ]; then + if [ -z "$(nft list chain inet fw4 nat_output |grep '12353')" ]; then nft insert rule inet fw4 dstnat position 0 tcp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null nft insert rule inet fw4 dstnat position 0 udp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\" 2>/dev/null nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }' 2>/dev/null @@ -58,7 +58,7 @@ check_dnsmasq() { fi fi else - if [ -z "$(iptables -t nat -nL OUTPUT --line-number |grep 'OpenClash DNS Hijack')" ]; then + if [ -z "$(iptables -t nat -nL OUTPUT --line-number |grep '12353')" ]; then iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null iptables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null iptables -t nat -I OUTPUT -p udp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack" 2>/dev/null From 0515d04bddfc03b4091ab5d1f96e6a047f3e8a7e Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 4 Jan 2024 08:07:41 +0800 Subject: [PATCH 26/41] 0.45.164 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 7bb50e4947..a81b59443d 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.163 +PKG_VERSION:=0.45.164 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From 00833c80370773e1990c1a92f447c999ebb4a081 Mon Sep 17 00:00:00 2001 From: Izumi Date: Fri, 5 Jan 2024 08:12:24 +0800 Subject: [PATCH 27/41] Update game_rules.list (#3712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 整理并修改 ISSUE_TEMPLATE (#3697) * Update game_rules.list * Update game_rules.list * Update game_rules.list --------- Co-authored-by: sangyishuje1123 <152784766+sangyishuje1123@users.noreply.github.com> Co-authored-by: vernesong <42875168+vernesong@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 75 +++++++--- .github/ISSUE_TEMPLATE/config.yml | 47 +++++- .github/ISSUE_TEMPLATE/feature_request.yml | 33 ++--- .../usr/share/openclash/res/game_rules.list | 139 ++++++++++-------- 4 files changed, 185 insertions(+), 109 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a2e40da75f..1015061429 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,36 +1,41 @@ name: Bug报告 -description: Create a report to help us improve +description: Create a Bug report to help us improve title: "[Bug] " labels: ["bug"] body: - - type: markdown - attributes: - value: | - 如果你可以自己 Debug 并解决的话, 建议您直接提交 PR 或 描述解决方法, 非常感谢! + - type: checkboxes id: verify_step attributes: label: Verify Steps description: | - 在提交之前, 请确认 / Please verify that you've followed these steps. + 在提交之前,请确认 / Please verify that you've followed these steps. options: - label: Tracker 我已经在 [Issue Tracker](……/) 中找过我要提出的问题 required: true - - label: Latest 我已经使用最新 Dev 版本测试过,问题依旧存在 + - label: Branch 我知道 OpenClash 的 Dev 分支切换开关位于插件设置-版本更新中,或者我会手动下载并安装 Dev 分支的 OpenClash + required: true + - label: Latest 我已经**使用最新 Dev 版本**测试过,问题依旧存在 required: true - - label: Core 这是 OpenClash 存在的问题,并非我所使用的 Clash 或 Meta 等内核的特定问题 + - label: Relevant 我知道 OpenClash 与 内核(Core)、控制面板(Dashboard)、在线订阅转换(Subconverter)等项目之间**无直接关系**,仅相互调用 required: true - - label: Meaningful 我提交的不是无意义的 催促更新或修复 请求 + - label: Definite 这确实是 OpenClash 出现的问题 required: true + - label: Contributors 我有能力协助 OpenClash 开发并解决此问题 + required: false + - label: Meaningless 我提交的**是无意义的**催促更新或修复请求 + required: false + - type: input id: openclash_version attributes: label: OpenClash Version description: | OpenClash 版本号 - placeholder: "v0.45.16-beta" + placeholder: "v0.0.0-beta" validations: required: true + - type: dropdown id: bug_os attributes: @@ -41,10 +46,23 @@ body: options: - Official OpenWrt - Lean + - Immortalwrt + - Istoreos - Docker - Other validations: required: true + + - type: input + id: openwrt_version + attributes: + label: OpenWrt Version + description: | + Openwrt 固件版本 + placeholder: "OpenWrt 0.0.0 r0-0" + validations: + required: true + - type: dropdown id: bug_platform attributes: @@ -60,50 +78,62 @@ body: - Linux-armv6 - Linux-armv7 - Linux-arm64 + - Linux-loong64 - Linux-mips-hardfloat - Linux-mips-softfloat - Linux-mips64 - Linux-mips64le - - Linux-mipsle-softfloat - Linux-mipsle-hardfloat + - Linux-mipsle-softfloat + - Linux-riscv64 - Other - All validations: required: true + - type: textarea - id: reproduce_bug + id: describe_bug attributes: - label: To Reproduce + label: Describe the Bug description: | - 复现此Bug的步骤 / How to reproduce? + 对 Bug 本身清晰而简洁的描述 / Describe the Bug validations: required: true + - type: textarea - id: describe_bug + id: reproduce_bug attributes: - label: Describe the Bug + label: To Reproduce description: | - 对Bug本身清晰而简洁的描述 / Describe the Bug + 复现此 Bug 的步骤 / How to reproduce? validations: required: true + - type: textarea id: openclash_log attributes: label: OpenClash Log description: | 在下方附上 OpenClash 调试日志 / OpenClash Debug Log - 隐私提示: 上传此日志前请注意检查、屏蔽公网IP、节点、密码等相关敏感信息 + 调试日志在插件设置-调试日志中生成,**并非只有运行日志**,如调试日志过长,可作为附件在最下方上传 + **隐私提示: 上传此日志前请注意检查、屏蔽公网IP、节点、密码等相关敏感信息** + placeholder: "我已知晓缺失日志可能会导致开发者无法了解我的情况并降低本issue的处理优先级" + render: log validations: required: true + - type: textarea id: openclash_config attributes: label: OpenClash Config description: | - 在下方附上与Bug相关的系统配置、防火墙规则或环境变量 / System config + 在下方附上与 Bug 相关的系统配置、防火墙规则或环境变量 / System config + 非 Clash Yaml 文件 + **非必填项** render: shell validations: required: false + - type: textarea id: excepted_behavior attributes: @@ -112,11 +142,12 @@ body: 对预期修复后情况的清晰明了的描述 / Expected behavior validations: required: true + - type: textarea - id: screenshots + id: additional_context attributes: - label: Screenshots + label: Additional Context description: | - 添加屏幕截图以帮助解释您的问题 / Screenshots + 在此处添加其它信息或屏幕截图 / Additional Context validations: required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0d876fe638..d9c8c78ca6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,6 +1,47 @@ blank_issues_enabled: false contact_links: - - name: Get help in GitHub Discussions - url: https://github.com/vernesong/OpenClash/discussions - about: Have a question? Not sure if your issue affects everyone reproducibly? The quickest way to get help is on OpenClash's GitHub Discussions! + + - name: 发表Issue前请先在Issues与Discussions中搜索相关内容 + url: https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md#在提问之前 + about: 请有意义且描述明确的描述问题症状而非你的猜测 问题解决后加个简短的补充说明 + + - name: 启动成功后无法访问个别网站 | 启动成功后个别网站不想走代理流量 + url: https://www.bing.com/search?q=clash+rule+写+教&ensearch=1 + about: 想要了解clash规则编写相关的问题 + + - name: CLASH CORE | PERIUM CORE & 内核问题 | 节点协议加密方式 | 规则 | 内核功能建议 + url: https://github.com/Dreamacro/clash/issues/new/choose + about: 原版内核 | P核 + + - name: META CORE | MIHOMO CORE & 内核问题 | 节点协议加密方式 | 规则 | 内核功能建议 + url: https://github.com/MetaCubeX/mihomo/issues/new/choose + about: M核 + + - name: 在线订阅转换问题 | 在线订阅转换增加节点协议加密方式 | 在线订阅转换功能建议 + url: https://github.com/tindy2013/subconverter/issues/new/choose + about: 提供并增加预设订阅转换服务地址请通过上方 功能请求 发表 + + - name: DASHBOARD & 控制面板问题 | 面板功能建议 + url: https://github.com/Dreamacro/clash-dashboard/issues/new/choose + about: 面板问题先请尝试 更换近期未使用过面板设备 或 使用浏览器隐私匿名无痕...模式 访问 + + - name: YACD & 控制面板问题 | 面板功能建议 + url: https://github.com/haishanh/yacd/issues/new/choose + about: 面板问题先请尝试 更换近期未使用过面板设备 或 使用浏览器隐私匿名无痕...模式 访问 + + - name: METACUBEXD & 控制面板问题 | 面板功能建议 + url: https://github.com/MetaCubeX/metacubexd/issues/new/choose + about: 面板问题先请尝试 更换近期未使用过面板设备 或 使用浏览器隐私匿名无痕...模式 访问 + + - name: YACD-META & 控制面板问题 | 面板功能建议 + url: https://github.com/MetaCubeX/Yacd-meta/issues/new/choose + about: 面板问题先请尝试 更换近期未使用过面板设备 或 使用浏览器隐私匿名无痕...模式 访问 + + - name: DASHBOARD-META & 控制面板问题 | 面板功能建议 + url: https://github.com/MetaCubeX/Razord-meta/issues/new/choose + about: 面板问题先请尝试 更换近期未使用过面板设备 或 使用浏览器隐私匿名无痕...模式 访问 + + - name: 我想讨论OpenClash的某个功能 | 我不确定是什么问题 | 我的问题不属于上述选项 | 我的问题无法得到原作者原仓库的帮助 + url: https://github.com/vernesong/OpenClash/discussions/new/choose + about: 礼多人不怪 而且有时还很有帮助 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 3cb4222686..7ffa993529 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -3,10 +3,7 @@ description: Suggest an idea for this project title: "[Feature] " labels: [enhancement] body: - - type: markdown - attributes: - value: | - 如果你可以自己 编程实现 的话, 建议您直接提交 PR 或 描述解决方法, 非常感谢! + - type: checkboxes id: verify_step attributes: @@ -15,26 +12,25 @@ body: options: - label: Tracker 我已经在 [Issue Tracker](……/) 中找过我要提出的问题 required: true - - label: Need 当前 OpenClash 并不包含该功能特性或者还不完善 + - label: Latest 我已经**使用最新 Dev 版本**查看过,并不包含该功能特性或者还不完善 required: true - - label: Framework 这是 OpenClash 应包含的特性, 并非 Clash 特性 + - label: Relevant 我知道 OpenClash 与 内核(Core)、控制面板(Dashboard)、在线订阅转换(Subconverter)等项目之间**无直接关系**,仅相互调用 required: true - - label: Meaningful 我提交的不是无意义的 催促更新或修复 请求 + - label: Definite 这确实是 OpenClash 应包含的特性 required: true + - label: Contributors 我有能力协助 OpenClash 开发或完善此功能特性 + required: false + - label: Meaningless 我提交的**是无意义的**催促更新或修复请求 + required: false + - type: textarea attributes: label: Describe the Feature description: | - 对问题本身清晰而简洁的描述. 例如这个问题如何影响到你? 目前 OpenClash 的行为是什么? - validations: - required: true - - type: textarea - attributes: - label: Describe the Solution - description: | - 清晰明了地描述您的解决方案. 例如你想实现什么 Feature 特性或功能? 如何实现该功能? + 清晰明了地描述您的想法. 例如你想实现什么 Feature 特性或功能? 如何实现该功能? 目前 OpenClash 的行为是什么? validations: required: true + - type: textarea attributes: label: Describe Alternatives @@ -42,10 +38,3 @@ body: 对您考虑过的任何替代解决方案或备选功能进行清晰、简洁的描述. validations: required: false - - type: textarea - attributes: - label: Additional Context - description: | - 在此处添加关于功能请求的任何其他描述或屏幕截图. - validations: - required: false diff --git a/luci-app-openclash/root/usr/share/openclash/res/game_rules.list b/luci-app-openclash/root/usr/share/openclash/res/game_rules.list index eaabf84f1a..9ffd5df093 100644 --- a/luci-app-openclash/root/usr/share/openclash/res/game_rules.list +++ b/luci-app-openclash/root/usr/share/openclash/res/game_rules.list @@ -1,100 +1,107 @@ 300英雄,300hero-cn.rules +方舟:生存进化,ARK--Survival-Evolved.rules 永恒之塔-台服,Aion-TW.rules 美国卡车模拟国际服,American-Truck-Simulator.rules 太空狼人杀,Among Us.rules 圣歌,Anthem.rules +Apex-uu,Apex-uu.rules Apex英雄,Apex.rules -Apex英雄-uu策略,Apex-uu.rules -方舟:生存进化,ARK--Survival-Evolved.rules -武装突袭(Codefourgaming和官服),Arma3.rules +武装突袭3,Arma3.rules 刺客信条:奥德赛,Assassin's-Creed-Odyssey.rules,Assassins-Creed-Odyssey.rules 刺客信条:起源,Assassin's-Creed-Origins.rules,Assassins-Creed-Origins.rules Atlas-全区,Atlas.rules -战地1,Battlefield-1.rules +战网,Battle-net-tw.rules 战地4,BattleField-4.rules -战地5,Battlefield-Ⅴ.rules,Battlefield-5.rules +战地1,Battlefield-1.rules +戰地5,Battlefield-Ⅴ.rules,Battlefield-5.rules 黑色沙漠,Black-Desert.rules 黑色幸存者,BlackSurvivor.rules -剑灵台服,Blade&Soul TW.rules +灵剑台服,Blade&Soul TW.rules 剑灵-日服,Blade-&-Soul-jp.rules -剑灵-国服全部区服(UU规则),Blood-&-Soul-CN.rules 剑灵-国服-南天国(测试版),Blood-&-Soul-CN-TestServer-NantianGuo-Alpha.rules +剑灵-国服全部区服(UU规则),Blood-&-Soul-CN.rules 无主之地3,Borderlands3-asia.rules 泡泡战士-跑跑卡丁车-韩服,BubbleFighter-KartRider-KR.rules -使命召唤4:现代战争重置版,Call-Of-Duty-4-Modern-Warfare.rules -使命召唤15亚服,Call-Of-Duty15-Asia.rules -使命召唤16&19:现代战争I&II,Call-Of-Duty-Modern-Warfare.rules -使命召唤17:冷战,Call-Of-Duty17-ColdWar.rules -英雄连2,Company-Of-Heroes-2.rules +绕过大陆和局域网,BypassCNandLan.rules +绕过大陆和局域网someip,BypassCNandLan_someip.rules 反恐精英:全球攻势,CS-GO.rules -反恐精英:全球攻势-港服(uu),CSGO-HKuu.rules 反恐精英:全球攻势-港服(tx),CSGO-HKtx.rules +反恐精英:全球攻势-港服(uu),CSGO-HKuu.rules 反恐精英:全球攻势-日服(tx),CSGO-JPtx.rules 反恐精英:全球攻势-美服(tx),CSGO-UStx.rules +使命召唤4:现代战争重置版,Call-Of-Duty-4-Modern-Warfare.rules +使命召唤16&19:现代战争I&II,Call-Of-Duty-Modern-Warfare.rules +使命召唤15亚服,Call-Of-Duty15-Asia.rules +使命召唤17:冷战,Call-Of-Duty17-ColdWar.rules +仅代理中国IP,China-IP-only.rules +英雄连2,Company-Of-Heroes-2.rules 黑暗之魂3,Dark-Souls-3.rules 不屈不挠,Dauntless.rules -DayZ-steam,DayZ.rules +DayZ steam,DayZ.rules 黎明杀机,Dead-by-Daylight.rules 命运2-全服(tx),Destiny2-Alltx.rules 命运2-全服(uu),Destiny2-Alluu.rules 天命2-亚服/命运2-亚服,Destiny2-Asia.rules 天命2-欧服/命运2-欧服,Destiny2-EU.rules -命运2-steam,Destiny2-steam.rules 天命2-美服/命运2-美服,Destiny2-US.rules -暗黑破坏神2:重制版-亚服,Diablo-2-Resurrected.rules +命运2-steam,Destiny2-steam.rules +暗黑破坏神2:重制版,Diablo-2-Resurrected.rules 暗黑破坏神3-亚服,Diablo3-Asia.rules 暗黑破坏神3-美服,Diablo3-US.rules -暗黑破坏神4-亚服,DiabloIV-HK.rules +暗黑破坏神4-港服,DiabloIV-HK.rules 脏弹-Steam,Dirty-Bomb.rules -Discord,Discord-All.rules -饥荒-steam,Don't-Starve-steam.rules,Dont-Starve-steam.rules -DOTA2-日服,Dota2-jp.rules +Discord语音,Discord-All.rules +饥荒-steam,Don't-Starve-steam.rules 刀塔霸业,Dota-Underlords.rules +DOTA2-日服,Dota2-jp.rules 逃离塔科夫,Escape-from-Tarkov.rules 欧卡2所有分区-UU,Euro-Truck-Simulator-2.rules Eve-online欧服,Eve-online.rules -FIFA19,FiFa19-INT.rules FIFA20,FIFA20.rules +最终幻想14国服,FINAL-FANTASY-XIV-cn.rules 糖豆人,Fall-Guys.rules +FIFA19,FiFa19-INT.rules 最终幻想14,Final-Fantasy-XIV.rules -最终幻想14国服,FINAL-FANTASY-XIV-cn.rules 荣耀战魂,For-Honour.rules -堡垒之夜-亚服,Fortnite-AS.rules +堡垒之夜亚服,Fortnite-AS.rules 堡垒之夜-国服,Fortnite-cn.rules 极限竞速地平线4,Forza-Horizon-4.rules 极限竞速地平线5,Forza-Horizon-5.rules 极限竞速7,Forza-Motorsport-7.rules -基佬大乱斗Gang-Beasts,Gang-Beasts.rules -鹅鸭杀-港服,Goose-Goose-Duck-HK.rules -Grand Theft Auto V(GTA5),Grand Theft Auto V.rules +基佬大乱斗Gang Beasts,Gang-Beasts.rules +鹅鸭杀,Goose-Goose-Duck-HK.rules +Grand Theft Auto V,Grand Theft Auto V.rules 激战2,Guild-Wars-2.rules 巫师昆特牌国际服,Gwent_The-Witcher-Card-game.rules 杀手2外服,HITMAN2.rules 光环:士官长合集,Halo-The-Master-Chief-Collection.rules 荒野行动PC版-国服,HuangYeXingDong-cn.rules +猎杀对决,Hunt-Showdown-Asia.rules 叛乱:沙漠风暴,Insurgency-Sandstorm.rules Jump大乱斗,Jump-Force.rules 跑跑卡丁车(韩服),KartRider.rules +酷狗回国,KuGou-cn.rules Kurtzpel,Kurtzpel.rules 求生之路2-Test,L4D2-Test.rules +英雄联盟PBE,League-of-Legends-PBE.rules 英雄联盟-日服,League-of-Legends-jp.rules 英雄联盟-韩服,League-of-Legends-kr.rules -英雄联盟PBE,League-of-Legends-PBE.rules -英雄联盟-台服,League-of-Legends-tw+Garena(2018-12-19).rules -英雄联盟-台服+Garena平台(2018-12-19更新),League-of-Legends-tw.rules +英雄联盟-台服+Garena平台(2018-12-19更新),League-of-Legends-tw+Garena(2018-12-19).rules +英雄联盟-台服,League-of-Legends-tw.rules 英雄联盟-美服,League-of-Legends-us.rules +致命公司,Lethal Company.rules 失落的方舟韩服,Lost-Ark.rules 失落的方舟俄服,Lostark-RU.rules +传奇4-亚服,MIR4-asia.rules +万智牌:竞技场-国际服,MTG-Arena.rules +奇迹传奇MU2,MU2.rules 冒险岛,Maplestory-us.rules 心灵终结,MentalOmega.rules 微软模拟飞行年度版,Microsoft-Flight-Simulator-Game-Of-The-Year-Edition.rules -微软商店,Microsoft-Srote.rules +巨硬商店,Microsoft-Srote.rules 我的世界-地下城,Minecraft-Dungeons.rules -传奇4,MIR4-asia.rules 误造,Miscreated.rules 怪兽世界猎人steam版,Monster-Hunter-World.rules -万智牌:竞技场-国际服,MTG-Arena.rules -奇迹传奇MU2,MU2.rules NBA-2K19,NBA-2K19.rules NBA2K20,NBA2K20.rules 仁王,NIOH.rules @@ -102,66 +109,74 @@ NBA2K20,NBA2K20.rules Osu!,Osu!.rules 守望先锋-亚服,Overwatch-Asia.rules 守望先锋-美服,Overwatch-US.rules +梦幻之星2-日服(tx),PHANTASY STAR ONLINE2-JPtx.rules +绝地求生亚服&东南亚服,PUBG-Asia&-Southeast-Asia.rules +绝地求生国际服,PUBG-INT.rules +绝地求生韩服,PUBG-kakao.rules +绝地求生轻量版-WEB客户端,PUBGLITE-WEB.rules +绝地求生低配版-Garena,PUBGLite-Garena.rules 流亡黯道-国际服,Path Of Exile.rules 流放之路,PathOfexile.rules -梦幻之星2-日服(tx),PHANTASY STAR ONLINE2-JPtx.rules 行星边际2,PlanetSide-2.rules -绝地求生大逃杀,PlayerUnknown's-Battlegrounds-update.rules,PlayerUnknowns-Battlegrounds-update.rules +绝地求生大逃杀,PlayerUnknown's-Battlegrounds-update.rules 实况足球-2018,Pro-Evolution-Soccer-2018.rules 实况足球-2019,Pro-Evolution-Soccer-2019.rules -绝地求生亚服-东南亚服,PUBG-Asia&-Southeast-Asia.rules -绝地求生国际服,PUBG-INT.rules -绝地求生韩服,PUBG-kakao.rules -绝地求生低配版-Garena,PUBGLite-Garena.rules -绝地求生轻量版-WEB客户端,PUBGLITE-WEB.rules R2竞技场服,R2Arena.rules R2俄服官服,R2RU.rules R2美服,R2US.rules -仙境传说OL美国,Ragnarok-Online-2-us.rules +仙境传说2-us,Ragnarok-Online-2-us.rules 仙境传说OL台湾,Ragnarok-Online-tw.rules 荒野大镖客2,Red-dead-redemption2.rules 无限法则,Ring-of-Elysium-asia.rules Roblox,Roblox.rules +Scum人渣-全球服,Scum.rules 影之诗,Shadowverse.rules +不代理中国IP且绕过局域网(精简版CNIP表),Skip-all-China-IP-mini-and-LAN.rules 灵魂行者-台服,Soul-Worker.rules 星际公民,Star-Citizen.rules 星球大战2前线,Star-Wars-BattlefrontII.rules -StarCraft-亚服,StarCraft-2-asia.rules -星际争霸2-国服,StarCraftⅡ-cn.rules,StarCraft2-cn.rules -Steam-社区,Steam.rules +StarCraft 2 亚服,StarCraft-2-asia.rules +星际争霸2国服,StarCraftⅡ-cn.rules +星露谷物语,Stardew Valley.rules +Steam-社区(Beta),Steam.rules 极限巅峰,Steep.rules 街头霸王5,Street-Fighter-V.rules 神谕之战,TERA.rules +新枫之谷,TMS.rules +仅代理Telegram,Telegram.rules 飙酷车神,The-Crew.rules 飙酷车神2,The-Crew2.rules 上古卷轴OL,The-Elder-Scrolls-Online.rules -天涯明月刀-台服,TianYaMingYueDao-tw.rules 泰坦陨落2,TiTanFall2.rules -新枫之谷,TMS.rules -幽灵行动:荒野,Tom-Clancy's-Ghost-Recon-Wildlands.rules,Tom-Clancys-Ghost-Recon-Wildlands.rules -彩虹六号-围攻-全部,Tom-Clancy's-Rainbow-Six-Siege-all.rules,Tom-Clancys-Rainbow-Six-Siege-all.rules -彩虹六号-围攻-EAS,Tom-Clancy's-Rainbow-Six-Siege-EAS.rules,Tom-Clancys-Rainbow-Six-Siege-EAS.rules -彩虹六号-异种-全部,Tom-Clancy's-Rainbow-Six-Extraction-all.rules,Tom-Clancys-Rainbow-Six-Extraction-all.rules -全境封锁,Tom-clancy's-The-Division-2.rules,Tom-clancys-The-Division-2.rules -全境封锁2,Tom-clancy's-The-Division.rules,Tom-clancys-The-Division.rules +天涯明月刀-台服,TianYaMingYueDao-tw.rules +幽灵行动:荒野,Tom-Clancy's-Ghost-Recon-Wildlands.rules +彩虹六号-异种-全部,Tom-Clancy's-Rainbow-Six-Extraction-all.rules +彩虹六号-围攻-EAS,Tom-Clancy's-Rainbow-Six-Siege-EAS.rules +彩虹六号-围攻-全部,Tom-Clancy's-Rainbow-Six-Siege-all.rules +全境封锁2,Tom-clancy's-The-Division-2.rules +全境封锁,Tom-clancy's-The-Division.rules +Twitch直播,Twitch.rules 未转变者Unturned,Unturned.rules +VRchat,VRchat.rules 无畏契约,Valorant.rules -战争雷霆,War-thunder-steam.rules -战争前线-steam,Warface.rules +战争雷霆-steam,War-thunder-steam.rules +战争前线,Warface.rules +星际战甲,Warframe.rules 看门狗,Watch-Dogs.rules 看门狗2,Watch-Dogs2.rules 求生意志OL,Will-To-Live-Online.rules -第三次世界大战-欧服,World-War-3.rules +魔兽世界-欧服,WoW-EU.rules +World War 3,World-War-3.rules 坦克世界-亚服,World-of-Tanks-Asia.rules +坦克世界闪电战,World-of-Tanks-Blitz.rules 坦克世界-国服,World-of-Tanks-cn.rules -坦克世界闪电战,World-of-Tanks-Blitz.rules -魔兽世界台服,World-of-warcraft-tw.rules -战舰世界-亚服,World-of-Warships-US.rules -战舰世界-欧服,World-of-warships-EU.rules -战舰世界-美服,World-of-Warships.rules 战舰世界国服UU,World-of-Warships-CN.rules +战舰世界-美服,World-of-Warships-US.rules +战舰世界-亚服,World-of-Warships.rules +魔兽世界台服,World-of-warcraft-tw.rules +战舰世界欧服,World-of-warships-EU.rules 僵尸世界大战,Worldwar-Z.rules -魔兽世界-欧服,WoW-EU.rules 游戏王决斗链接,YO-GI-HO delulinks.rules +YY语音,YY-cn.rules 游侠对战平台,YouXiaDuiZhanPingTai.rules -YY语音平台,YY-cn.rules +风暴英雄,heros of the storm-kr.rules From b49006193082ea6675e17311dbf7817f3ca3b0d4 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 6 Jan 2024 13:45:00 +0800 Subject: [PATCH 28/41] chore: update fake filter list --- .../etc/openclash/custom/openclash_custom_fake_filter.list | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list b/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list index 025af88c0b..eec6abe2e4 100644 --- a/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list +++ b/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list @@ -74,6 +74,7 @@ localhost.sec.qq.com #Nintendo Switch +.srv.nintendo.net *.n.n.srv.nintendo.net ++.cdn.nintendo.net #Sony PlayStation +.stun.playstation.net #Microsoft Xbox @@ -137,3 +138,6 @@ local.adguard.org #迅雷 +.sandai.net +.n0808.com +#UU Plugin ++.uu.163.com +ps.res.netease.com \ No newline at end of file From dbedf409c328dda2045a796f918c7606945f0905 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 20 Jan 2024 20:41:35 +0800 Subject: [PATCH 29/41] chore: #3729 --- luci-app-openclash/root/usr/share/openclash/openclash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash.sh b/luci-app-openclash/root/usr/share/openclash/openclash.sh index 6a0084df84..7cb2f8ce8d 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash.sh @@ -23,7 +23,7 @@ servers_update=$(uci -q get openclash.config.servers_update) router_self_proxy=$(uci -q get openclash.config.router_self_proxy || echo 1) FW4=$(command -v fw4) CLASH="/etc/openclash/clash" -CLASH_CONFIG="/tmp" +CLASH_CONFIG="/etc/openclash" restart=0 only_download=0 set_lock From ec64649d1b7d4bbee8bf412b30395422f4adab86 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Mon, 22 Jan 2024 12:17:41 +0800 Subject: [PATCH 30/41] fix typo --- luci-app-openclash/root/etc/init.d/openclash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/root/etc/init.d/openclash b/luci-app-openclash/root/etc/init.d/openclash index b0e8caf9e3..893db585c7 100644 --- a/luci-app-openclash/root/etc/init.d/openclash +++ b/luci-app-openclash/root/etc/init.d/openclash @@ -2898,7 +2898,7 @@ if [ -z "$FW4" ]; then if [ "$bypass_gateway_compatible" -eq 1 ]; then ip6tables -t nat -N openclash_post ip6tables -t nat -F openclash_post - ip6tables -t nat -A openclash_post -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN >/dev/null 2>&1 + ip6tables -t nat -A openclash_post -m set --match-set localnetwork6 src -m set --match-set lan_ac_black_ports src -j RETURN >/dev/null 2>&1 ip6tables -t nat -A openclash_post -m mark --mark "$PROXY_FWMARK" -j ACCEPT ip6tables -t nat -A openclash_post -m set --match-set localnetwork6 dst -j RETURN ip6tables -t nat -A openclash_post -m addrtype ! --src-type LOCAL -m owner ! --uid-owner 65534 -j MASQUERADE From 33f0a0c0107316000bd5439223fbc945bf005e8c Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:04:38 +0800 Subject: [PATCH 31/41] chore: add Fallback DNS Proxy Group option --- .../model/cbi/openclash/config-overwrite.lua | 16 +++++++++ .../po/zh-cn/openclash.zh-cn.po | 11 ++++++- luci-app-openclash/root/etc/init.d/openclash | 3 +- .../root/usr/share/openclash/yml_change.sh | 33 +++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua index fab2997b32..d9c17d9527 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua @@ -135,6 +135,22 @@ o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate(" o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off o.default = 0 +---- Fallback DNS Proxy Group +o = s:taboption("dns", Value, "proxy_dns_group", font_red..bold_on..translate("Fallback DNS Proxy Group (Support Regex)")..bold_off..font_off) +o.description = translate("Group Use For Proxy The Fallback DNS, Preventing DNS Lookup Failures")..translate("(Only Meta Core)") +local groupnames,filename +filename = m.uci:get("openclash", "config", "config_path") +if filename then + groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename)) + if groupnames then + for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do + if groupname ~= nil and groupname ~= "" then + o:value(groupname) + end + end + end +end + o = s:taboption("dns", Flag, "append_wan_dns", translate("Append Upstream DNS")) o.description = translate("Append The Upstream Assigned DNS And Gateway IP To The Nameserver") o.default = 1 diff --git a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po index c2549dca88..c783cebce9 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -3472,4 +3472,13 @@ msgid "Flush Successful" msgstr "清理成功" msgid "Flush Timeout" -msgstr "清理超时" \ No newline at end of file +msgstr "清理超时" + +msgid "Fallback DNS Proxy Group (Support Regex)" +msgstr "Fallback DNS 代理组 (支持正则匹配)" + +msgid "Group Use For Proxy The Fallback DNS, Preventing DNS Lookup Failures" +msgstr "为所有 Fallback DNS 设置代理策略组,防止 DNS 查询失败" + +msgid "Error: Set Fallback DNS Proxy Group Failed," +msgstr "错误:Fallback DNS 代理策略组设置失败," \ No newline at end of file diff --git a/luci-app-openclash/root/etc/init.d/openclash b/luci-app-openclash/root/etc/init.d/openclash index 893db585c7..b54031ed1f 100644 --- a/luci-app-openclash/root/etc/init.d/openclash +++ b/luci-app-openclash/root/etc/init.d/openclash @@ -3100,6 +3100,7 @@ get_config() global_client_fingerprint=$(uci -q get openclash.config.global_client_fingerprint || echo "0") enable_unified_delay=$(uci -q get openclash.config.enable_unified_delay || echo "0") keep_alive_interval=$(uci -q get openclash.config.keep_alive_interval || echo "0") + proxy_dns_group=$(uci -q get openclash.config.proxy_dns_group || echo "Disable") [ -z "$dns_port" ] && dns_port=7874 && uci -q set openclash.config.dns_port=7874 uci -q set openclash.config.restricted_mode=0 && uci -q commit openclash } @@ -3127,7 +3128,7 @@ start() if ! $quick_start; then LOG_OUT "Step 3: Modify The Config File..." config_check - /usr/share/openclash/yml_change.sh 2>/dev/null "$en_mode" "$da_password" "$cn_port" "$proxy_port" "$TMP_CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$log_level" "$proxy_mode" "$en_mode_tun" "$stack_type" "$dns_port" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$stream_domains_prefetch" "$enable_meta_core" "$enable_meta_sniffer" "$enable_geoip_dat" "$geodata_loader" "$enable_meta_sniffer_custom" "$interface_name" "$enable_tcp_concurrent" "$core_type" "$append_default_dns" "$enable_meta_sniffer_pure_ip" "$find_process_mode" "$fakeip_range" "$global_client_fingerprint" "$ipv6_mode" "$stack_type_v6" "$enable_unified_delay" "$keep_alive_interval" + /usr/share/openclash/yml_change.sh 2>/dev/null "$en_mode" "$da_password" "$cn_port" "$proxy_port" "$TMP_CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$log_level" "$proxy_mode" "$en_mode_tun" "$stack_type" "$dns_port" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$stream_domains_prefetch" "$enable_meta_core" "$enable_meta_sniffer" "$enable_geoip_dat" "$geodata_loader" "$enable_meta_sniffer_custom" "$interface_name" "$enable_tcp_concurrent" "$core_type" "$append_default_dns" "$enable_meta_sniffer_pure_ip" "$find_process_mode" "$fakeip_range" "$global_client_fingerprint" "$ipv6_mode" "$stack_type_v6" "$enable_unified_delay" "$keep_alive_interval" "$proxy_dns_group" /usr/share/openclash/yml_rules_change.sh 2>/dev/null "$rule_source" "$enable_custom_clash_rules" "$TMP_CONFIG_FILE" "$enable_rule_proxy" "$CONFIG_NAME" "$router_self_proxy" "$lan_ip" "$proxy_port" "$tproxy_port" "$enable_meta_core" "$enable_redirect_dns" "$fakeip_range" "$en_mode" /usr/share/openclash/openclash_custom_domain_dns.sh >/dev/null 2>&1 #Custom overwrite diff --git a/luci-app-openclash/root/usr/share/openclash/yml_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_change.sh index d9f12ffda0..3074f73531 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_change.sh @@ -14,6 +14,7 @@ append_wan_dns=$(uci -q get openclash.config.append_wan_dns || echo 0) custom_fallback_filter=$(uci -q get openclash.config.custom_fallback_filter || echo 0) enable_meta_core=$(uci -q get openclash.config.enable_meta_core || echo 0) china_ip_route=$(uci -q get openclash.config.china_ip_route || echo 0) +proxy_dns_group=${36} lan_block_google_dns=$(uci -q get openclash.config.lan_block_google_dns_ips || uci -q get openclash.config.lan_block_google_dns_macs || echo 0) @@ -239,6 +240,8 @@ yml_dns_get() if [ "$group_check" != "return" ] && [ -n "$group_check" ]; then specific_group="#$group_check" + elif [ "$proxy_dns_group" != "Disable" ] && [ -n "$proxy_dns_group" ] && [ "$group" = "fallback" ]; then + specific_group="#$proxy_dns_group" else specific_group="" fi @@ -556,6 +559,36 @@ Thread.new{ }.join; end; +# proxy fallback dns +begin +Thread.new{ + if '${proxy_dns_group}' == 'Disable' or '${proxy_dns_group}'.nil? then + return; + end; + if Value.key?('proxy-groups') then + Value['proxy-groups'].each{|x,y| + if x['name'] =~ /${proxy_dns_group}/ then + y = x['name']; + if Value['dns'].has_key?('fallback') then + Value['dns']['fallback'].each{|z| + if z =~ /#h3/ then + z.gsub!(/#h3/, '#' + y + '&h3'); + elsif z =~ /#/ then + next; + else + z << '#' + y; + end; + }; + end; + break; + end; + }; + end; +}.join; +rescue Exception => e + puts '${LOGTIME} Error: Set Fallback DNS Proxy Group Failed,【' + e.message + '】'; +end; + #default-nameserver begin Thread.new{ From 04ac7de296098fff932b316a97b67886759754f7 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:05:12 +0800 Subject: [PATCH 32/41] 0.45.165 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index a81b59443d..b992797d61 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.164 +PKG_VERSION:=0.45.165 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From b393a9458537a62cbfc25b4db9f3e66dc8ed9cf4 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:19:28 +0800 Subject: [PATCH 33/41] chore: fix typo --- .../luasrc/model/cbi/openclash/config-overwrite.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua index d9c17d9527..1e40e19d41 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua @@ -151,6 +151,11 @@ if filename then end end +o:value("DIRECT") +o:value("Disable", translate("Disable")) +o.default = "Disable" +o.rempty = false + o = s:taboption("dns", Flag, "append_wan_dns", translate("Append Upstream DNS")) o.description = translate("Append The Upstream Assigned DNS And Gateway IP To The Nameserver") o.default = 1 From 85c3a7b2b163b9fadefada86cd45fca28a675b83 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:19:56 +0800 Subject: [PATCH 34/41] 0.45.166 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index b992797d61..5dbda30f9c 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.165 +PKG_VERSION:=0.45.166 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From 91888bdd53dd5e530a0db8b03900fed9e9891d22 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Wed, 7 Feb 2024 00:33:41 +0800 Subject: [PATCH 35/41] chore: add meta check --- luci-app-openclash/root/usr/share/openclash/yml_change.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/root/usr/share/openclash/yml_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_change.sh index 3074f73531..45d2b3e6cb 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_change.sh @@ -562,7 +562,7 @@ end; # proxy fallback dns begin Thread.new{ - if '${proxy_dns_group}' == 'Disable' or '${proxy_dns_group}'.nil? then + if '${proxy_dns_group}' == 'Disable' or '${proxy_dns_group}'.nil? or ${19} != 1 then return; end; if Value.key?('proxy-groups') then From c2569dd94f44c23578be4d3b372a29df75448804 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Wed, 7 Feb 2024 00:44:16 +0800 Subject: [PATCH 36/41] fix: ruby unexpected error --- luci-app-openclash/root/usr/share/openclash/yml_change.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/root/usr/share/openclash/yml_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_change.sh index 45d2b3e6cb..6c400f7160 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_change.sh @@ -563,7 +563,7 @@ end; begin Thread.new{ if '${proxy_dns_group}' == 'Disable' or '${proxy_dns_group}'.nil? or ${19} != 1 then - return; + Thread.exit; end; if Value.key?('proxy-groups') then Value['proxy-groups'].each{|x,y| From 98b39c062d49637115010749b62be31006b26961 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Wed, 7 Feb 2024 00:48:28 +0800 Subject: [PATCH 37/41] 0.45.167 --- luci-app-openclash/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 5dbda30f9c..6a6d75256a 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.166 +PKG_VERSION:=0.45.167 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From a7563de1a0afee0c7a2d485f438d7a64e6085e67 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:23:39 +0800 Subject: [PATCH 38/41] workflow: go 1.22 --- .github/workflows/compile_meta_core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile_meta_core.yml b/.github/workflows/compile_meta_core.yml index a350c8dcd6..35b23ff8f4 100644 --- a/.github/workflows/compile_meta_core.yml +++ b/.github/workflows/compile_meta_core.yml @@ -77,7 +77,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: "1.21" + go-version: "1.22" check-latest: true - name: Clone Clash Meta Repository From 8f3ea6e27353fa1de41ca8037c88ce7746f80904 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 10 Feb 2024 13:05:53 +0800 Subject: [PATCH 39/41] chore: refine --- luci-app-openclash/root/usr/share/openclash/yml_change.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openclash/root/usr/share/openclash/yml_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_change.sh index 6c400f7160..5fd34e1f62 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_change.sh @@ -569,7 +569,7 @@ Thread.new{ Value['proxy-groups'].each{|x,y| if x['name'] =~ /${proxy_dns_group}/ then y = x['name']; - if Value['dns'].has_key?('fallback') then + if Value['dns'].has_key?('fallback') and not Value['dns']['fallback'].to_a.empty? then Value['dns']['fallback'].each{|z| if z =~ /#h3/ then z.gsub!(/#h3/, '#' + y + '&h3'); From 207cc4e40c8c2099fec21cd26b48a866ad552f6f Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 10 Feb 2024 16:28:17 +0800 Subject: [PATCH 40/41] chore: refine --- .../luasrc/controller/openclash.lua | 36 +- .../luasrc/model/cbi/openclash/settings.lua | 1 + .../luasrc/view/openclash/status.htm | 58 +- .../luasrc/view/openclash/update.htm | 2 +- .../po/zh-cn/openclash.zh-cn.po | 10 +- .../usr/share/openclash/ui/metacubexd/CNAME | 1 + .../ui/metacubexd/assets/Config-8226e777.js | 1 - .../ui/metacubexd/assets/Config-FN-Wqjyv.js | 1 + .../metacubexd/assets/ConfigTitle-_jKUZ02Y.js | 1 + .../metacubexd/assets/ConfigTitle-dd5fc83b.js | 1 - .../metacubexd/assets/Connections-02d8e92b.js | 1 - .../metacubexd/assets/Connections-G3NKrw3N.js | 1 + .../ui/metacubexd/assets/Logs-2575e4f0.js | 1 - .../ui/metacubexd/assets/Logs-2lK8RJqA.js | 1 + .../ui/metacubexd/assets/Overview-51176cc0.js | 700 ----------------- .../ui/metacubexd/assets/Overview-5_c_esIi.js | 703 ++++++++++++++++++ .../ui/metacubexd/assets/Proxies-99da7d66.js | 1 - .../ui/metacubexd/assets/Proxies-Tt9GNuSW.js | 1 + .../ui/metacubexd/assets/Rules-3b098996.js | 40 - .../ui/metacubexd/assets/Rules-hglfpXzR.js | 45 ++ .../ui/metacubexd/assets/Setup-a0db2f96.js | 1 - .../ui/metacubexd/assets/Setup-mkV79sjj.js | 1 + ...0152e.ttf => Twemoji.Mozilla-UkCiemhT.ttf} | Bin ...ra-sans-cyrillic-400-normal-17346ce4.woff2 | Bin 10228 -> 0 bytes ...ira-sans-cyrillic-400-normal-2fc74b92.woff | Bin 8260 -> 0 bytes ...ira-sans-cyrillic-400-normal-4ryKXlYU.woff | Bin 0 -> 8860 bytes ...ra-sans-cyrillic-400-normal-PYrWRMJ5.woff2 | Bin 0 -> 10768 bytes ...ns-cyrillic-ext-400-normal-1RYie3E0.woff2} | Bin ...sans-cyrillic-ext-400-normal-ed6525e5.woff | Bin 15188 -> 0 bytes ...sans-cyrillic-ext-400-normal-rf3f-Kaw.woff | Bin 0 -> 15180 bytes .../fira-sans-greek-400-normal-5f8c46dc.woff | Bin 10884 -> 0 bytes ...fira-sans-greek-400-normal-Mc4iyeKH.woff2} | Bin .../fira-sans-greek-400-normal-eCSWGL47.woff | Bin 0 -> 10892 bytes ...ra-sans-greek-ext-400-normal-278932e4.woff | Bin 6948 -> 0 bytes ...ra-sans-greek-ext-400-normal-QOf54KGx.woff | Bin 0 -> 6964 bytes ...-sans-greek-ext-400-normal-wxqRhc-I.woff2} | Bin .../fira-sans-latin-400-normal-6cb3f720.woff | Bin 20408 -> 0 bytes .../fira-sans-latin-400-normal-6lFYBE6Z.woff2 | Bin 0 -> 23880 bytes .../fira-sans-latin-400-normal-ea03bd5d.woff2 | Bin 22592 -> 0 bytes .../fira-sans-latin-400-normal-ka9-J3LG.woff | Bin 0 -> 21900 bytes ...ra-sans-latin-ext-400-normal-9ba2512f.woff | Bin 27152 -> 0 bytes ...a-sans-latin-ext-400-normal-a47436ee.woff2 | Bin 30564 -> 0 bytes ...a-sans-latin-ext-400-normal-bFWruaeo.woff2 | Bin 0 -> 42736 bytes ...ra-sans-latin-ext-400-normal-moeor6ib.woff | Bin 0 -> 38424 bytes ...-sans-vietnamese-400-normal--U_MOZBq.woff2 | Bin 0 -> 8424 bytes ...a-sans-vietnamese-400-normal-2424aed1.woff | Bin 5584 -> 0 bytes ...-sans-vietnamese-400-normal-69e40dcc.woff2 | Bin 7372 -> 0 bytes ...a-sans-vietnamese-400-normal-ois6Ns-t.woff | Bin 0 -> 6796 bytes .../ui/metacubexd/assets/global-9f47a568.js | 1 - .../ui/metacubexd/assets/global-MCJ9PAgv.js | 1 + .../ui/metacubexd/assets/index-5ivcdObt.css | 1 + .../ui/metacubexd/assets/index-788b021a.css | 1 - .../ui/metacubexd/assets/index-83f95c10.js | 36 - .../ui/metacubexd/assets/index-IZ7lrjtp.js | 36 + .../ui/metacubexd/assets/index-bd53d7c8.js | 1 - .../ui/metacubexd/assets/index-k-FO5KmN.js | 7 + .../ui/metacubexd/assets/vendor-5507c805.js | 28 - .../ui/metacubexd/assets/vendor-TCjgV7Sn.js | 28 + .../share/openclash/ui/metacubexd/index.html | 7 +- .../usr/share/openclash/ui/metacubexd/sw.js | 2 +- ...orkbox-56a10583.js => workbox-3e911b1d.js} | 0 .../usr/share/openclash/ui/yacd/.nojekyll | 0 .../ui/yacd/assets/Config-35023b66.css | 1 - .../ui/yacd/assets/Config-4a6335ea.js | 1 - .../ui/yacd/assets/Config-5a241eed.js | 1 + .../ui/yacd/assets/Config-cf41b8ef.css | 1 + .../ui/yacd/assets/Connections-0bb3d584.js | 1 - .../ui/yacd/assets/Connections-a9e050f3.js | 22 + .../ui/yacd/assets/Connections-ddae4f70.css | 1 + .../ui/yacd/assets/Connections-fb8ea59b.css | 1 - .../{Fab-82e79c68.js => Fab-6279b0bb.js} | 2 +- .../openclash/ui/yacd/assets/Fab-a0a7e573.css | 1 - .../openclash/ui/yacd/assets/Fab-a434d836.css | 1 + .../ui/yacd/assets/Input-505b5fdb.css | 1 + .../ui/yacd/assets/Input-6985be35.js | 1 + .../ui/yacd/assets/Logs-4b8e75d1.css | 1 - .../ui/yacd/assets/Logs-5e5ee0ad.css | 1 + .../openclash/ui/yacd/assets/Logs-a4be0f66.js | 1 + .../openclash/ui/yacd/assets/Logs-f594acee.js | 1 - .../ui/yacd/assets/Modal-86bce5c3.css | 1 + .../ui/yacd/assets/Modal.module-c406ff95.js | 1 + .../ui/yacd/assets/Proxies-40f80166.css | 1 + .../ui/yacd/assets/Proxies-420aa72b.js | 1 + .../ui/yacd/assets/Proxies-96538b21.js | 1 - .../ui/yacd/assets/Proxies-bee4beaa.css | 1 - .../ui/yacd/assets/Rules-04c64a3e.js | 1 + .../ui/yacd/assets/Rules-2c6b2a7c.js | 1 - ...{Select-81600379.js => Select-dda18c57.js} | 2 +- .../ui/yacd/assets/StyleGuide-255b125c.css | 1 + .../ui/yacd/assets/StyleGuide-409386d8.js | 1 + .../ui/yacd/assets/TextFilter-9fe1cd81.js | 1 - .../ui/yacd/assets/TextFilter-b21c0577.css | 1 - .../ui/yacd/assets/TextFilter-ced87fc6.css | 1 + .../ui/yacd/assets/TextFilter-ea8f9266.js | 1 + .../ui/yacd/assets/Toggle-4f572f6c.css | 1 + .../ui/yacd/assets/Toggle-cc905705.js | 1 + .../ui/yacd/assets/ZapAnimated-6c3cdb8c.css | 1 + .../ui/yacd/assets/ZapAnimated-d32c4141.js | 1 + .../ui/yacd/assets/chart-lib-236f0953.js | 16 - .../ui/yacd/assets/chart-lib-da3c73a9.js | 16 + .../ui/yacd/assets/chevron-down-0a0d4fcd.js | 1 - .../assets/{en-0b55644c.js => en-89e30f54.js} | 2 +- .../ui/yacd/assets/index-08f400cf.js | 9 + .../ui/yacd/assets/index-58e8cd5b.css | 1 - .../ui/yacd/assets/index-8cf47a1c.js | 147 ++++ .../ui/yacd/assets/index-aa3f8ed9.js | 129 ---- .../ui/yacd/assets/index-d22d76cf.js | 9 - .../{index-b418964b.js => index-d26de9ee.js} | 2 +- .../ui/yacd/assets/index-d5e38ae4.css | 1 + ....esm-9774ed4d.js => index.esm-eb217302.js} | 2 +- .../{logs-253cb530.js => logs-281e0071.js} | 4 +- .../{play-0c8e26e5.js => play-85de9511.js} | 2 +- .../ui/yacd/assets/useMutation-4610ee00.js | 1 + ...=> useRemainingViewPortHeight-b3800ff0.js} | 2 +- .../assets/{zh-972d6106.js => zh-019c0297.js} | 2 +- .../usr/share/openclash/ui/yacd/index.html | 4 +- .../root/usr/share/openclash/ui/yacd/sw.js | 2 +- 117 files changed, 1145 insertions(+), 1023 deletions(-) create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/CNAME delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-8226e777.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-FN-Wqjyv.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/ConfigTitle-_jKUZ02Y.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/ConfigTitle-dd5fc83b.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Connections-02d8e92b.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Connections-G3NKrw3N.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Logs-2575e4f0.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Logs-2lK8RJqA.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Overview-51176cc0.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Overview-5_c_esIi.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Proxies-99da7d66.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Proxies-Tt9GNuSW.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Rules-3b098996.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Rules-hglfpXzR.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Setup-a0db2f96.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Setup-mkV79sjj.js rename luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/{Twemoji.Mozilla-6d90152e.ttf => Twemoji.Mozilla-UkCiemhT.ttf} (100%) delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-cyrillic-400-normal-17346ce4.woff2 delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-cyrillic-400-normal-2fc74b92.woff create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-cyrillic-400-normal-4ryKXlYU.woff create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-cyrillic-400-normal-PYrWRMJ5.woff2 rename luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/{fira-sans-cyrillic-ext-400-normal-61d002d2.woff2 => fira-sans-cyrillic-ext-400-normal-1RYie3E0.woff2} (100%) delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-cyrillic-ext-400-normal-ed6525e5.woff create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-cyrillic-ext-400-normal-rf3f-Kaw.woff delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-greek-400-normal-5f8c46dc.woff rename luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/{fira-sans-greek-400-normal-86edeee5.woff2 => fira-sans-greek-400-normal-Mc4iyeKH.woff2} (100%) create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-greek-400-normal-eCSWGL47.woff delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-greek-ext-400-normal-278932e4.woff create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-greek-ext-400-normal-QOf54KGx.woff rename luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/{fira-sans-greek-ext-400-normal-e48378b0.woff2 => fira-sans-greek-ext-400-normal-wxqRhc-I.woff2} (100%) delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-400-normal-6cb3f720.woff create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-400-normal-6lFYBE6Z.woff2 delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-400-normal-ea03bd5d.woff2 create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-400-normal-ka9-J3LG.woff delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-ext-400-normal-9ba2512f.woff delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-ext-400-normal-a47436ee.woff2 create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-ext-400-normal-bFWruaeo.woff2 create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-latin-ext-400-normal-moeor6ib.woff create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-vietnamese-400-normal--U_MOZBq.woff2 delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-vietnamese-400-normal-2424aed1.woff delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-vietnamese-400-normal-69e40dcc.woff2 create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/fira-sans-vietnamese-400-normal-ois6Ns-t.woff delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/global-9f47a568.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/global-MCJ9PAgv.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/index-5ivcdObt.css delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/index-788b021a.css delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/index-83f95c10.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/index-IZ7lrjtp.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/index-bd53d7c8.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/index-k-FO5KmN.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/vendor-5507c805.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/vendor-TCjgV7Sn.js rename luci-app-openclash/root/usr/share/openclash/ui/metacubexd/{workbox-56a10583.js => workbox-3e911b1d.js} (100%) delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/.nojekyll delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config-35023b66.css delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config-4a6335ea.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config-5a241eed.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config-cf41b8ef.css delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections-0bb3d584.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections-a9e050f3.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections-ddae4f70.css delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections-fb8ea59b.css rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{Fab-82e79c68.js => Fab-6279b0bb.js} (96%) delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab-a0a7e573.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab-a434d836.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Input-505b5fdb.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Input-6985be35.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs-4b8e75d1.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs-5e5ee0ad.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs-a4be0f66.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs-f594acee.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Modal-86bce5c3.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Modal.module-c406ff95.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies-40f80166.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies-420aa72b.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies-96538b21.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies-bee4beaa.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules-04c64a3e.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules-2c6b2a7c.js rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{Select-81600379.js => Select-dda18c57.js} (76%) create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/StyleGuide-255b125c.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/StyleGuide-409386d8.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFilter-9fe1cd81.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFilter-b21c0577.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFilter-ced87fc6.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFilter-ea8f9266.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Toggle-4f572f6c.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Toggle-cc905705.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/ZapAnimated-6c3cdb8c.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/ZapAnimated-d32c4141.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chart-lib-236f0953.js create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chart-lib-da3c73a9.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chevron-down-0a0d4fcd.js rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{en-0b55644c.js => en-89e30f54.js} (92%) create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index-08f400cf.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index-58e8cd5b.css create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index-8cf47a1c.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index-aa3f8ed9.js delete mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index-d22d76cf.js rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{index-b418964b.js => index-d26de9ee.js} (98%) create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index-d5e38ae4.css rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{index.esm-9774ed4d.js => index.esm-eb217302.js} (94%) rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{logs-253cb530.js => logs-281e0071.js} (73%) rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{play-0c8e26e5.js => play-85de9511.js} (97%) create mode 100644 luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useMutation-4610ee00.js rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{useRemainingViewPortHeight-8f8ae068.js => useRemainingViewPortHeight-b3800ff0.js} (81%) rename luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/{zh-972d6106.js => zh-019c0297.js} (89%) diff --git a/luci-app-openclash/luasrc/controller/openclash.lua b/luci-app-openclash/luasrc/controller/openclash.lua index ff25ad6c94..207907b334 100644 --- a/luci-app-openclash/luasrc/controller/openclash.lua +++ b/luci-app-openclash/luasrc/controller/openclash.lua @@ -74,6 +74,8 @@ function index() entry({"admin", "services", "openclash", "manual_stream_unlock_test"}, call("manual_stream_unlock_test")) entry({"admin", "services", "openclash", "all_proxies_stream_test"}, call("all_proxies_stream_test")) entry({"admin", "services", "openclash", "set_subinfo_url"}, call("set_subinfo_url")) + entry({"admin", "services", "openclash", "check_core"}, call("action_check_core")) + entry({"admin", "services", "openclash", "core_download"}, call("core_download")) entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Plugin Settings"), 30).leaf = true entry({"admin", "services", "openclash", "config-overwrite"},cbi("openclash/config-overwrite"),_("Overwrite Settings"), 40).leaf = true entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),_("Onekey Create"), 50).leaf = true @@ -229,6 +231,14 @@ local function coremodel() end end +local function check_core() + if not nixio.fs.access(dev_core_path) and not nixio.fs.access(tun_core_path) and not nixio.fs.access(meta_core_path) then + return "0" + else + return "1" + end +end + local function corecv() if not nixio.fs.access(dev_core_path) then return "0" @@ -334,6 +344,24 @@ local function historychecktime() end end +function core_download() + if uci:get("openclash", "config", "github_address_mod") == "0" or not uci:get("openclash", "config", "github_address_mod") then + uci:set("openclash", "config", "github_address_mod", "https://testingcf.jsdelivr.net/") + uci:commit("openclash") + luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1") + luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Dev' >/dev/null 2>&1 &") + luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'TUN' >/dev/null 2>&1 &") + luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &") + uci:set("openclash", "config", "github_address_mod", "0") + uci:commit("openclash") + else + luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1") + luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Dev' >/dev/null 2>&1 &") + luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'TUN' >/dev/null 2>&1 &") + luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &") + end +end + function download_rule() local filename = luci.http.formvalue("filename") local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_rule_list.sh "%s" >/dev/null 2>&1',filename)) @@ -375,7 +403,6 @@ function action_restore_config() luci.sys.call("cp /usr/share/openclash/backup/openclash_sniffing* /etc/openclash/custom/ >/dev/null 2>&1 &") luci.sys.call("cp /usr/share/openclash/backup/yml_change.sh /usr/share/openclash/yml_change.sh >/dev/null 2>&1 &") luci.sys.call("rm -rf /etc/openclash/history/* >/dev/null 2>&1 &") - luci.http.redirect(luci.dispatcher.build_url('admin/services/openclash/settings')) end function action_remove_all_core() @@ -1114,6 +1141,13 @@ function action_opupdate() }) end +function action_check_core() + luci.http.prepare_content("application/json") + luci.http.write_json({ + core_status = check_core(); + }) +end + function action_coreupdate() luci.http.prepare_content("application/json") luci.http.write_json({ diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua index 814c85d538..b6979260f1 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua @@ -164,6 +164,7 @@ end ---- Access Control o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("LAN Access Control Mode")) +o.description = font_red..bold_on..translate("To Use in Fake-IP Mode, Please Switch The Dns Redirect Mode To Firewall Forwarding")..bold_off..font_off o:value("0", translate("Black List Mode")) o:value("1", translate("White List Mode")) o.default = "0" diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index a5ff1e9178..8f732d4c3f 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -451,6 +451,7 @@ get_run_mode(); state_get(); clashversion_check(); + check_core(); function get_rule_mode() { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "rule_mode")%>', null, function(x, status) { @@ -693,28 +694,26 @@ { btn.value = '<%:Check All Components Update%>'; btn.disabled = true; - var r = confirm("<%:Check and update all Cores and plug-ins?%>") + var r = confirm("<%:Check and Update all Cores and OpenClash?%>") if (r == true) { - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) { - if ( x && x.status == 200 ) { - if ( status.corever != "0" ) { - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', null, function(x, status) { - if ( x && x.status != 200 ) { - alert('<%:Check failed, Please try again later!%>') - } - }); - } - else { - alert('<%:No compiled version is selected. Please configure it in the General Settings tab!%>') - } - } - else { - alert('<%:Check failed, Please try again later!%>') - } - }); + XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) { + if ( x && x.status == 200 ) { + if ( status.corever != "0" ) { + XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', null, function(x, status) { + if ( x && x.status != 200 ) { + alert('<%:Check failed, Please try again later!%>') + } + }); + } + else { + alert('<%:No compiled version is selected. Please configure it in the General Settings tab!%>') + } } else { - } + alert('<%:Check failed, Please try again later!%>') + } + }); + } btn.disabled = false; return false; }; @@ -730,7 +729,7 @@ } else { btn.disabled = false; - btn.value = '<%:Check Third Party Rules Update%>'; + btn.value = '<%:Check Third Party Rules Update%>'; } return false; }); @@ -989,5 +988,24 @@ url4='https://github.com/vernesong/OpenClash/releases'; winOpen(url4); }; + + function check_core() + { + XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "check_core")%>', null, function(x, status) { + if ( x && x.status == 200 ) { + if ( status.core_status != "1" ) + { + var r = confirm("<%:You have not installed the core yet, do you want to download and install it now?%>") + if (r == true) { + XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "core_download")%>', null, function(x, status) { + if ( x && x.status == 200 ) { + window.location.href='<%="'+window.location.protocol+'//'+window.location.hostname+'/cgi-bin/luci/admin/services/openclash/log"%>'; + } + }); + } + } + } + }); + }; //]]> diff --git a/luci-app-openclash/luasrc/view/openclash/update.htm b/luci-app-openclash/luasrc/view/openclash/update.htm index 84214976e8..d532a126fc 100644 --- a/luci-app-openclash/luasrc/view/openclash/update.htm +++ b/luci-app-openclash/luasrc/view/openclash/update.htm @@ -513,7 +513,7 @@ if (x && x.status == 200) { btn.value = '<%:One Click Check Update%>'; btn.disabled = true; - var r = confirm("<%:Check and update all Cores and plug-ins?%>") + var r = confirm("<%:Check and Update all Cores and OpenClash?%>") if (r == true) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) { if ( x && x.status == 200 ) { diff --git a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po index c783cebce9..d27fe7fa46 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -1260,9 +1260,12 @@ msgstr "GEOIP 数据库检查更新" msgid "Check GeoSite Data Update" msgstr "GeoSite 数据库检查更新" -msgid "Check and update all Cores and plug-ins?" +msgid "Check and Update all Cores and OpenClash?" msgstr "确定要一键检查并更新所有内核及插件吗?" +msgid "You have not installed the core yet, do you want to download and install it now?" +msgstr "您还未安装内核,是否立即下载安装?" + msgid "Check failed, Please try again later!" msgstr "一键检查更新失败,请稍后再试!" @@ -3481,4 +3484,7 @@ msgid "Group Use For Proxy The Fallback DNS, Preventing DNS Lookup Failures" msgstr "为所有 Fallback DNS 设置代理策略组,防止 DNS 查询失败" msgid "Error: Set Fallback DNS Proxy Group Failed," -msgstr "错误:Fallback DNS 代理策略组设置失败," \ No newline at end of file +msgstr "错误:Fallback DNS 代理策略组设置失败," + +msgid "To Use in Fake-IP Mode, Please Switch The Dns Redirect Mode To Firewall Forwarding" +msgstr "要在 Fake-IP 模式下使用,请将 Dns 重定向模式切换为防火墙转发模式" \ No newline at end of file diff --git a/luci-app-openclash/root/usr/share/openclash/ui/metacubexd/CNAME b/luci-app-openclash/root/usr/share/openclash/ui/metacubexd/CNAME new file mode 100644 index 0000000000..82221cbe3a --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/metacubexd/CNAME @@ -0,0 +1 @@ +d.metacubex.one diff --git a/luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-8226e777.js b/luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-8226e777.js deleted file mode 100644 index 650064292a..0000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-8226e777.js +++ /dev/null @@ -1 +0,0 @@ -import{k as Q,a4 as le,i as e,c as t,S as T,d as v,a5 as y,a2 as W,N as Z,F,a1 as ae,ay as ne,p as J,P as se,b as p,D as R,a3 as K,v as re}from"./vendor-5507c805.js";import{u as j,ad as ie,ae as M,af as ce,B as E,ag as k,ah as oe,ai as de,aj as ue,ak as ge,al as pe,am as he,an as fe,ao as ve,ap as be,aq as me,b as _e,ar as $e,as as O,at as z,au as xe,av as H,aw as Ce,ax as X,ay as ke,az as ye,aA as Se,aB as we,aC as De,ac as Ee,aD as Te,aE as Ne,aF as Pe,aG as Ae}from"./index-bd53d7c8.js";import{C as S}from"./ConfigTitle-dd5fc83b.js";const Ie=v('
'),Fe=v('
'),je=v('
'),Oe=v('
'),Ge=v('
'),Me=f('
'),Qe=f('
'),Ue=f('
'),G=f("