From ba9d8eb98369d3160a38079e126b912ccd0ae4a1 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Mon, 20 May 2024 11:26:04 +0800 Subject: [PATCH 01/12] chore: fix typo --- .../usr/share/openclash/openclash_streaming_unlock.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua b/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua index bf72b317c7..7c8f24e782 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua +++ b/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua @@ -646,8 +646,13 @@ end function get_auth_info() port = UCI:get("openclash", "config", "cn_port") passwd = UCI:get("openclash", "config", "dashboard_password") or "" - ip = SYS.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n'") - + local lan_int_name = UCI:get("openclash", "config", "lan_interface_name") or "0" + if lan_int_name == "0" then + ip = SYS.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n'") + else + ip = SYS.exec(string.format("ip address show %s | grep -w 'inet' 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | tr -d '\n'", lan_int_name)) + end + if not ip or ip == "" then ip = SYS.exec("ip address show $(uci -q -p /tmp/state get network.lan.ifname || uci -q -p /tmp/state get network.lan.device) | grep -w 'inet' 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | tr -d '\n'") end From d9c6709912c24afa8299b029ce977e67ac3bb722 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Mon, 20 May 2024 16:15:39 +0800 Subject: [PATCH 02/12] chore: retry for ipk update --- .../root/usr/share/openclash/openclash_update.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 f4f707635d..bfb1f8f541 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_update.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_update.sh @@ -113,7 +113,10 @@ uci -q commit openclash opkg remove --force-depends --force-remove luci-app-openclash LOG_OUT "Installing The New Version, Please Do Not Refresh The Page or Do Other Operations..." opkg install /tmp/openclash.ipk -if [ "$?" == "0" ]; then +if [ "$?" != "0" ] || [ -z "$(opkg info *openclash |grep Installed-Time)" ]; then + opkg install /tmp/openclash.ipk +fi +if [ "$?" == "0" ] && [ -n "$(opkg info *openclash |grep Installed-Time)" ]; then rm -rf /tmp/openclash.ipk >/dev/null 2>&1 LOG_OUT "OpenClash Update Successful, About To Restart!" uci -q set openclash.config.enable=1 From 11d776ef4ebdec9b16e1f793275761f39a716931 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 23 May 2024 18:52:06 +0800 Subject: [PATCH 03/12] chore: fix error --- .../luasrc/model/cbi/openclash/other-rules-edit.lua | 11 ----------- .../root/usr/share/openclash/openclash_rule.sh | 10 +++++++++- .../root/usr/share/openclash/yml_groups_name_ch.sh | 2 +- .../root/usr/share/openclash/yml_proxys_set.sh | 7 ------- .../root/usr/share/openclash/yml_rules_change.sh | 2 -- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua index 2ffc96e705..ab2c24ed73 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua @@ -387,17 +387,6 @@ end o:value("DIRECT") o:value("REJECT") -o = s:option(ListValue, "AntiIP", translate("Anti IP")) -o:depends("rule_name", "lhie1") -o.rmempty = true -for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do - if groupname ~= nil and groupname ~= "" then - o:value(groupname) - end -end -o:value("DIRECT") -o:value("REJECT") - o = s:option(ListValue, "Domestic", translate("Domestic")) o:depends("rule_name", "lhie1") o:depends("rule_name", "ConnersHua") 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 c649a7cc45..8e9008299d 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_rule.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_rule.sh @@ -107,7 +107,15 @@ Value_1 = YAML.load_file('/tmp/rules.yaml'); OLD_GROUP = Value['rules'].collect{|x| x.split(',')[2] or x.split(',')[1]}.uniq; NEW_GROUP = Value_1['rules'].collect{|x| x.split(',')[2] or x.split(',')[1]}.uniq; - puts (OLD_GROUP | NEW_GROUP).eql?(OLD_GROUP) + if (OLD_GROUP | NEW_GROUP).eql?(OLD_GROUP) then + if (OLD_GROUP | NEW_GROUP).eql?(NEW_GROUP) then + puts true + else + puts false + end + else + puts false + end ")" && [ -f "/usr/share/openclash/res/${rule_name}.yaml" ]; then LOG_OUT "Error: Updated Others Rules【$rule_name】Has Incompatible Proxy-Group, Update Exit, Please Wait For OpenClash Update To Adapt..." rm -rf /tmp/rules.yaml >/dev/null 2>&1 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 b8fc1f61bd..6e26e503f6 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 @@ -47,7 +47,7 @@ cfg_groups_set() 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") + 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") for i in ${OTHER_RULE_NAMES[@]}; do sed -i "s/option ${i} \'${convert_old_name_cfg}\'/option ${i} \'${convert_name}\'/g" $CFG_FILE 2>/dev/null done 2>/dev/null 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 149cdce7f1..5179d41920 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 @@ -1856,11 +1856,6 @@ cat >> "$SERVER_FILE" <<-EOF - REJECT - DIRECT - Proxy - - name: Anti IP - type: select - proxies: - - DIRECT - - Proxy EOF cat /tmp/Proxy_Server >> $SERVER_FILE 2>/dev/null if [ -f "/tmp/Proxy_Provider" ]; then @@ -1998,7 +1993,6 @@ ${uci_set}Spotify="Spotify" ${uci_set}Steam="Steam" ${uci_set}miHoYo="miHoYo" ${uci_set}AdBlock="AdBlock" -${uci_set}AntiIP="Anti IP" ${uci_set}Speedtest="Speedtest" ${uci_set}Telegram="Telegram" ${uci_set}Crypto="Crypto" @@ -2036,7 +2030,6 @@ ${uci_set}Others="Others" ${UCI_DEL_LIST}="Discord" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Discord" >/dev/null 2>&1 ${UCI_DEL_LIST}="PayPal" >/dev/null 2>&1 && ${UCI_ADD_LIST}="PayPal" >/dev/null 2>&1 ${UCI_DEL_LIST}="Speedtest" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Speedtest" >/dev/null 2>&1 - ${UCI_DEL_LIST}="Anti IP" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Anti IP" >/dev/null 2>&1 ${UCI_DEL_LIST}="Others" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Others" >/dev/null 2>&1 } elif [ "$rule_sources" = "ConnersHua_return" ] && [ "$servers_if_update" != "1" ] && [ -z "$if_game_proxy" ]; then diff --git a/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh index 3581cf901b..e65ab6de0a 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh @@ -1035,7 +1035,6 @@ if [ "$1" != "0" ]; then .gsub(/,[\s]?Discovery Plus,[\s]?Global TV$/, ', Discovery Plus, $Discovery#delete_') .gsub(/,[\s]?DAZN,[\s]?Global TV$/, ', DAZN, $DAZN#delete_') .gsub(/,[\s]?Pornhub,[\s]?Global TV$/, ', Pornhub, $Pornhub#delete_') - .gsub(/,[\s]?Anti IP$/, ', $AntiIP#delete_') .gsub(/,[\s]?Global TV$/, ', $GlobalTV#delete_') .gsub(/,[\s]?Asian TV$/, ', $AsianTV#delete_') .gsub(/,[\s]?Proxy$/, ', $Proxy#delete_') @@ -1090,7 +1089,6 @@ if [ "$1" != "0" ]; then .gsub!(/: \'PayPal\'/,': \'$PayPal#delete_\'') .gsub!(/: \'Domestic\'/,': \'$Domestic#delete_\'') .gsub!(/: \'Google FCM\'/,': \'$GoogleFCM#delete_\'') - .gsub!(/: \'Anti IP\'/,': \'$AntiIP#delete_\'') .gsub!(/return \'Domestic\'$/, 'return \'$Domestic#delete_\'') .gsub!(/return \'Others\'$/, 'return \'$Others#delete_\'') .gsub!(/#delete_/, ''); From 932d8dd70442863707d62d962706b29ad16c8732 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 23 May 2024 18:54:48 +0800 Subject: [PATCH 04/12] chore: update rules --- .../po/zh-cn/openclash.zh-cn.po | 2 +- .../root/usr/share/openclash/res/lhie1.yaml | 128 ++++++++---------- 2 files changed, 61 insertions(+), 69 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 7feecee524..f94cdd9e0d 100644 --- a/luci-app-openclash/po/zh-cn/openclash.zh-cn.po +++ b/luci-app-openclash/po/zh-cn/openclash.zh-cn.po @@ -1702,7 +1702,7 @@ msgid "Has No Rules Field, Update Exit..." msgstr "规则部分校验失败,请稍后再试..." msgid "Has Incompatible Proxy-Group, Update Exit, Please Wait For OpenClash Update To Adapt..." -msgstr "含有未支持的新策略组,更新停止,请等待 OpenClash 版本更新适配..." +msgstr "含有未支持的策略组,更新停止,请等待 OpenClash 版本更新适配..." msgid "Check The Downloaded Rule File For Updates..." msgstr "检查下载的规则文件是否有更新..." diff --git a/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml b/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml index 5eaee12b02..838486f801 100644 --- a/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml +++ b/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml @@ -1,7 +1,6 @@ rules: - RULE-SET, Reject, AdBlock - RULE-SET, Special, DIRECT -- RULE-SET, Anti IP, Anti IP - RULE-SET, Netflix, Netflix - RULE-SET, Disney Plus, Disney - RULE-SET, YouTube, YouTube @@ -68,7 +67,6 @@ script: ruleset_action = { 'Reject': 'AdBlock', 'Special': 'DIRECT', - 'Anti IP': 'Anti IP', 'Netflix': 'Netflix', 'Disney Plus': 'Disney', 'YouTube': 'YouTube', @@ -159,366 +157,360 @@ rule-providers: Reject: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Reject.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Reject.yaml path: "./Rules/Reject" interval: 86400 Special: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Special.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Special.yaml path: "./Rules/Special" interval: 86400 PROXY: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Proxy.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Proxy.yaml path: "./Rules/Proxy" interval: 86400 Domestic: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Domestic.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Domestic.yaml path: "./Rules/Domestic" interval: 86400 Domestic IPs: type: http behavior: ipcidr - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Domestic%20IPs.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Domestic%20IPs.yaml path: "./Rules/Domestic_IPs" interval: 86400 LAN: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/LAN.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/LAN.yaml path: "./Rules/LAN" interval: 86400 - Anti IP: - type: http - behavior: classical - url: https://raw.githubusercontent.com/lwd-temp/anti-ip-attribution/main/generated/rule-provider.yaml - path: "./Rules/Anti_IP" - interval: 86400 Netflix: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Netflix.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Netflix.yaml path: "./Rules/Media/Netflix" interval: 86400 Spotify: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Spotify.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Spotify.yaml path: "./Rules/Media/Spotify" interval: 86400 YouTube: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/YouTube.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/YouTube.yaml path: "./Rules/Media/YouTube" interval: 86400 Bilibili: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Bilibili.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Bilibili.yaml path: "./Rules/Media/Bilibili" interval: 86400 IQ: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/IQ.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/IQ.yaml path: "./Rules/Media/IQI" interval: 86400 IQIYI: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/IQIYI.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/IQIYI.yaml path: "./Rules/Media/IQYI" interval: 86400 Letv: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Letv.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Letv.yaml path: "./Rules/Media/Letv" interval: 86400 Netease Music: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Netease%20Music.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Netease%20Music.yaml path: "./Rules/Media/Netease_Music" interval: 86400 Tencent Video: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Tencent%20Video.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Tencent%20Video.yaml path: "./Rules/Media/Tencent_Video" interval: 86400 Youku: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Youku.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Youku.yaml path: "./Rules/Media/Youku" interval: 86400 WeTV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/WeTV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/WeTV.yaml path: "./Rules/Media/WeTV" interval: 86400 ABC: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/ABC.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/ABC.yaml path: "./Rules/Media/ABC" interval: 86400 Abema TV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Abema%20TV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Abema%20TV.yaml path: "./Rules/Media/Abema_TV" interval: 86400 Amazon: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Amazon.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Amazon.yaml path: "./Rules/Media/Amazon" interval: 86400 Apple Music: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Apple%20Music.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20Music.yaml path: "./Rules/Media/Apple_Music" interval: 86400 Apple News: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Apple%20News.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20News.yaml path: "./Rules/Media/Apple_News" interval: 86400 Apple TV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Apple%20TV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20TV.yaml path: "./Rules/Media/Apple_TV" interval: 86400 Bahamut: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Bahamut.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Bahamut.yaml path: "./Rules/Media/Bahamut" interval: 86400 BBC iPlayer: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/BBC%20iPlayer.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/BBC%20iPlayer.yaml path: "./Rules/Media/BBC_iPlayer" interval: 86400 DAZN: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/DAZN.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/DAZN.yaml path: "./Rules/Media/DAZN" interval: 86400 Discovery Plus: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Discovery%20Plus.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Discovery%20Plus.yaml path: "./Rules/Media/Discovery_Plus" interval: 86400 Disney Plus: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Disney%20Plus.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Disney%20Plus.yaml path: "./Rules/Media/Disney_Plus" interval: 86400 encoreTVB: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/encoreTVB.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/encoreTVB.yaml path: "./Rules/Media/encoreTVB" interval: 86400 F1 TV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/F1%20TV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/F1%20TV.yaml path: "./Rules/Media/F1_TV" interval: 86400 Fox Now: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Fox%20Now.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Fox%20Now.yaml path: "./Rules/Media/Fox_Now" interval: 86400 Fox+: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Fox%2B.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Fox%2B.yaml path: "./Rules/Media/Fox+" interval: 86400 HBO Go: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/HBO%20Go.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/HBO%20Go.yaml path: "./Rules/Media/HBO_Go" interval: 86400 HBO Max: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/HBO%20Max.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/HBO%20Max.yaml path: "./Rules/Media/HBO_Max" interval: 86400 Hulu Japan: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Hulu%20Japan.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Hulu%20Japan.yaml path: "./Rules/Media/Hulu_Japan" interval: 86400 Hulu: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Hulu.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Hulu.yaml path: "./Rules/Media/Hulu" interval: 86400 Japonx: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Japonx.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Japonx.yaml path: "./Rules/Media/Japonx" interval: 86400 JOOX: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/JOOX.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/JOOX.yaml path: "./Rules/Media/JOOX" interval: 86400 KKBOX: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/KKBOX.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/KKBOX.yaml path: "./Rules/Media/KKBOX" interval: 86400 KKTV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/KKTV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/KKTV.yaml path: "./Rules/Media/KKTV" interval: 86400 Line TV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Line%20TV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Line%20TV.yaml path: "./Rules/Media/Line_TV" interval: 86400 myTV SUPER: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/myTV%20SUPER.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/myTV%20SUPER.yaml path: "./Rules/Media/myTV_SUPER" interval: 86400 Niconico: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Niconico.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Niconico.yaml path: "./Rules/Media/Niconico" interval: 86400 Pandora: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Pandora.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Pandora.yaml path: "./Rules/Media/Pandora" interval: 86400 PBS: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/PBS.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/PBS.yaml path: "./Rules/Media/PBS" interval: 86400 Pornhub: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Pornhub.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Pornhub.yaml path: "./Rules/Media/Pornhub" interval: 86400 Soundcloud: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/Soundcloud.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Soundcloud.yaml path: "./Rules/Media/Soundcloud" interval: 86400 ViuTV: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Media/ViuTV.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/ViuTV.yaml path: "./Rules/Media/ViuTV" interval: 86400 Telegram: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Telegram.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Telegram.yaml path: "./Rules/Telegram" interval: 86400 Crypto: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Crypto.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Crypto.yaml path: "./Rules/Crypto" interval: 86400 Discord: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Discord.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Discord.yaml path: "./Rules/Discord" interval: 86400 Steam: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Steam.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Steam.yaml path: "./Rules/Steam" interval: 86400 Speedtest: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Speedtest.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Speedtest.yaml path: "./Rules/Speedtest" interval: 86400 PayPal: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/PayPal.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/PayPal.yaml path: "./Rules/PayPal" interval: 86400 Microsoft: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Microsoft.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Microsoft.yaml path: "./Rules/Microsoft" interval: 86400 OpenAI: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/OpenAI.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/OpenAI.yaml path: "./Rules/OpenAI" interval: 86400 Apple: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Apple.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Apple.yaml path: "./Rules/Apple" interval: 86400 Google FCM: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Google%20FCM.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Google%20FCM.yaml path: "./Rules/Google FCM" interval: 86400 Scholar: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/Scholar.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Scholar.yaml path: "./Rules/Scholar" interval: 86400 miHoYo: type: http behavior: classical - url: https://raw.githubusercontent.com/dler-io/Rules/main/Clash/Provider/miHoYo.yaml + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/miHoYo.yaml path: "./Rules/miHoYo" interval: 86400 From f55578f7882153fa21125b1ccf45f4f46a23f137 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 23 May 2024 18:55:16 +0800 Subject: [PATCH 05/12] 0.46.012 --- 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 e755bec70f..a1730b7d70 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.46.011 +PKG_VERSION:=0.46.012 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From 3a5506fbf47cd77b006db0f5b9ee16e004813667 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 31 May 2024 10:56:20 +0800 Subject: [PATCH 06/12] fix typo --- luci-app-openclash/root/etc/init.d/openclash | 32 ++++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/luci-app-openclash/root/etc/init.d/openclash b/luci-app-openclash/root/etc/init.d/openclash index 45a30435f9..e0f6b45d7f 100644 --- a/luci-app-openclash/root/etc/init.d/openclash +++ b/luci-app-openclash/root/etc/init.d/openclash @@ -3118,6 +3118,7 @@ revert_firewall() get_config() { + enable=$(uci -q get openclash.config.enable) rule_source=$(uci -q get openclash.config.rule_source) enable_custom_clash_rules=$(uci -q get openclash.config.enable_custom_clash_rules) da_password=$(uci -q get openclash.config.dashboard_password) @@ -3295,17 +3296,7 @@ stop() fi LOG_OUT "Step 5: Restart Dnsmasq..." - redirect_dns=$(uci -q get openclash.config.redirect_dns) - dnsmasq_server=$(uci -q get openclash.config.dnsmasq_server) - dnsmasq_noresolv=$(uci -q get openclash.config.dnsmasq_noresolv) - dnsmasq_resolvfile=$(uci -q get openclash.config.dnsmasq_resolvfile) - cachesize_dns=$(uci -q get openclash.config.cachesize_dns) - dnsmasq_cachesize=$(uci -q get openclash.config.dnsmasq_cachesize) - filter_aaaa_dns=$(uci -q get openclash.config.filter_aaaa_dns) - dnsmasq_filter_aaaa=$(uci -q get openclash.config.dnsmasq_filter_aaaa) - default_resolvfile=$(uci -q get openclash.config.default_resolvfile) - revert_dns "$redirect_dns" "$enable" "$default_resolvfile" "$dnsmasq_noresolv" "$dnsmasq_resolvfile" "$cachesize_dns" "$dnsmasq_cachesize" "$filter_aaaa_dns" "$dnsmasq_filter_aaaa" "$dnsmasq_server" - /etc/init.d/dnsmasq restart >/dev/null 2>&1 + revert_dnsmasq LOG_OUT "Step 6: Delete OpenClash Residue File..." if [ "$enable" != "1" ]; then @@ -3334,6 +3325,21 @@ stop() echo "OpenClash Already Stop!" } +revert_dnsmasq() +{ + get_config + redirect_dns=$(uci -q get openclash.config.redirect_dns) + dnsmasq_server=$(uci -q get openclash.config.dnsmasq_server) + dnsmasq_noresolv=$(uci -q get openclash.config.dnsmasq_noresolv) + dnsmasq_resolvfile=$(uci -q get openclash.config.dnsmasq_resolvfile) + cachesize_dns=$(uci -q get openclash.config.cachesize_dns) + dnsmasq_cachesize=$(uci -q get openclash.config.dnsmasq_cachesize) + filter_aaaa_dns=$(uci -q get openclash.config.filter_aaaa_dns) + dnsmasq_filter_aaaa=$(uci -q get openclash.config.dnsmasq_filter_aaaa) + default_resolvfile=$(uci -q get openclash.config.default_resolvfile) + revert_dns "$redirect_dns" "$enable" "$default_resolvfile" "$dnsmasq_noresolv" "$dnsmasq_resolvfile" "$cachesize_dns" "$dnsmasq_cachesize" "$filter_aaaa_dns" "$dnsmasq_filter_aaaa" "$dnsmasq_server" + /etc/init.d/dnsmasq restart >/dev/null 2>&1 +} restart() { @@ -3368,7 +3374,7 @@ reload() 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 + revert_dnsmasq 2>/dev/null SLOG_CLEAN del_lock fi @@ -3377,7 +3383,7 @@ reload() 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 + change_dns "$enable_redirect_dns" "$disable_masq_cache" SLOG_CLEAN del_lock fi From 2513ee1b78731768387895cf0e6cc09424ccec7c Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Fri, 31 May 2024 10:59:28 +0800 Subject: [PATCH 07/12] 0.46.013 --- 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 a1730b7d70..2544765acd 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.46.012 +PKG_VERSION:=0.46.013 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong From 6f8233ec1bfa678aa0101b763673c13fc6743d64 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:54:13 +0800 Subject: [PATCH 08/12] chore: refine --- luci-app-openclash/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 2544765acd..7a55d9172e 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -100,7 +100,6 @@ endef define Package/$(PKG_NAME)/postinst #!/bin/sh sed -i "s/v0.00.00-beta/v$(PKG_VERSION)-beta/g" /www/luci-static/resources/openclash/img/version.svg >/dev/null 2>&1 - /etc/init.d/network restart >/dev/null 2>&1 & exit 0 endef From 4359f3d7991281526a45d24748c02bd820fba9a9 Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Mon, 10 Jun 2024 09:53:37 +0800 Subject: [PATCH 09/12] chore: refine --- .../luasrc/view/openclash/select_git_cdn.htm | 73 ++++++++++++++++++- .../luasrc/view/openclash/update.htm | 2 +- .../openclash/openclash_download_dashboard.sh | 2 +- 3 files changed, 71 insertions(+), 6 deletions(-) diff --git a/luci-app-openclash/luasrc/view/openclash/select_git_cdn.htm b/luci-app-openclash/luasrc/view/openclash/select_git_cdn.htm index 8e5e1de187..3acbaf9e34 100644 --- a/luci-app-openclash/luasrc/view/openclash/select_git_cdn.htm +++ b/luci-app-openclash/luasrc/view/openclash/select_git_cdn.htm @@ -50,6 +50,34 @@