From d5f25ea11110bf96edb421700fd4395eb338a687 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 00:55:31 +0800 Subject: [PATCH 01/10] naiveproxy: bump to 85.0.4183.83-3 --- package/ctcgfw/naiveproxy/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/ctcgfw/naiveproxy/Makefile b/package/ctcgfw/naiveproxy/Makefile index 7e3660740f..f3cf2d291e 100644 --- a/package/ctcgfw/naiveproxy/Makefile +++ b/package/ctcgfw/naiveproxy/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=naiveproxy -PKG_VERSION:=85.0.4183.83-2 +PKG_VERSION:=85.0.4183.83-3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=620ca571615ee15d5de4c7723beb1fd3eb806413bbb992c3abcb3972d1a68cae +PKG_HASH:=66a8f275a9aa0fa04649062fb141a10add9bd76855f32ee65e6ee60a7fc4649c PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_LICENSE:=BSD 3-Clause From 82527995c04da0682834ec27f8f47f60f6d36751 Mon Sep 17 00:00:00 2001 From: Teaffanie <70811472+Teaffanie@users.noreply.github.com> Date: Sat, 12 Sep 2020 17:34:00 +0800 Subject: [PATCH 02/10] luci-app-passwall: bump to 3.9-57 (#201) --- package/lienol/luci-app-passwall/Makefile | 4 +- .../model/cbi/passwall/client/node_list.lua | 21 +-- .../view/passwall/node_list/node_list.htm | 20 +-- .../root/usr/share/passwall/app.sh | 135 +++++++++++------- 4 files changed, 96 insertions(+), 84 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 1a912550e5..4aa6200392 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.9 -PKG_RELEASE:=56 -PKG_DATE:=20200907 +PKG_RELEASE:=57 +PKG_DATE:=20200912 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua index adea9a3e40..1348658d48 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_list.lua @@ -55,12 +55,14 @@ s.sortable = true if nodes_display:find("compact_display_nodes") then if show_group then show_group.width = "25%" end o = s:option(DummyValue, "remarks", translate("Remarks")) + o.rawhtml = true o.cfgvalue = function(t, n) local str = "" local is_sub = m:get(n, "is_sub") or "" local group = m:get(n, "group") or "" local remarks = m:get(n, "remarks") or "" local type = m:get(n, "type") or "" + str = str .. string.format("", appname, n, type) if type == "V2ray" then local protocol = m:get(n, "protocol") if protocol == "_balancing" then @@ -73,8 +75,9 @@ if nodes_display:find("compact_display_nodes") then local port = m:get(n, "port") or "" str = str .. translate(type) .. ":" .. remarks if address ~= "" and port ~= "" then - local s = " (" .. address .. ":" .. port .. ")" - str = str .. s + str = str .. string.format("(%s:%s)", address, port) + str = str .. string.format("", appname, n, address) + str = str .. string.format("", appname, n, port) end return str end @@ -89,7 +92,6 @@ else else return '手动' end - return str end end @@ -130,23 +132,12 @@ end ---- Ping o = s:option(DummyValue, "ping", translate("Latency")) -o.width = "6%" +o.width = "8%" if not nodes_ping:find("auto_ping") then o.template = appname .. "/node_list/ping" else o.template = appname .. "/node_list/auto_ping" end ---[[ -o.cfgvalue = function(t, n) - local type = m:get(n, "type") or "" - if type == "V2ray" then - local protocol = m:get(n, "protocol","") - if protocol == "_balancing" or protocol == "_shunt" then - return "---" - end - end -end ---]] m:append(Template(appname .. "/node_list/node_list")) diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index a111c35950..8eae27d1ab 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -197,21 +197,11 @@ table td, .table .td { } function get_address_full(id) { - <% if nodes_display:find("compact_display_nodes") then %> - var remarks = document.getElementById("cbid.passwall." + id + ".remarks").value; - var result = remarks.match("\\((.+?)\\)"); - if (result != null) { - var full = result[1]; - var address = full.substring(0, full.lastIndexOf(":")); - var port = full.substring(full.lastIndexOf(":") + 1); - } - <% else %> - try { - var address = document.getElementById("cbid.passwall." + id + ".address").value; - var port = document.getElementById("cbid.passwall." + id + ".port").value; - } - catch(err){} - <% end %> + try { + var address = document.getElementById("cbid.passwall." + id + ".address").value; + var port = document.getElementById("cbid.passwall." + id + ".port").value; + } + catch(err){} //判断是否含有汉字 var reg = new RegExp("[\\u4E00-\\u9FFF]+","g"); if ((address != null && address != "") && (port != null && port != "") && reg.test(address) == false && (address.indexOf(".") != -1 && address.charAt(address.address - 1) != ".")) { diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh index 4dead042fe..be61d495f0 100755 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh @@ -323,6 +323,10 @@ run_socks() { else msg="某种原因,此 Socks 服务的相关配置已失联,启动中止!" fi + + if [ "$type" == "v2ray" ] && ([ -n "$(config_n_get $node balancing_node)" ] || [ "$(config_n_get $node default_node)" != "nil" ]); then + unset msg + fi [ -n "${msg}" ] && { echolog " - ${msg}" @@ -330,34 +334,43 @@ run_socks() { } echolog " - 节点:$remarks,${server_host}:${port}" - if [ "$type" == "socks" ]; then - echolog " - 不能使用 Socks 类型的代理节点" - elif [ "$type" == "v2ray" ]; then + case "$type" in + socks) + local _username=$(config_n_get $node username) + local _password=$(config_n_get $node password) + [ -n "$_username" ] && [ -n "$_password" ] && local _auth="--uname $_username --passwd $_password" + ln_start_bin "$(first_type ssocks)" ssocks_SOCKS_$5 --listen $local_port --socks $server_host:$port $_auth + unset _username _password _auth + ;; + v2ray) lua $API_GEN_V2RAY $node nil nil $local_port > $config_file ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file" - elif [ "$type" == "trojan" ]; then - lua $API_GEN_TROJAN $node client $bind $local_port > $config_file - ln_start_bin "$(first_type trojan trojan-plus)" trojan -c "$config_file" - elif [ "$type" == "trojan-plus" ]; then - lua $API_GEN_TROJAN $node client $bind $local_port > $config_file - ln_start_bin "$(first_type trojan-plus trojan)" trojan-plus -c "$config_file" - elif [ "$type" == "trojan-go" ]; then + ;; + trojan-go) lua $API_GEN_TROJAN $node client $bind $local_port > $config_file ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file" - elif [ "$type" == "naiveproxy" ]; then + ;; + trojan*) + lua $API_GEN_TROJAN $node client $bind $local_port > $config_file + ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file" + ;; + naiveproxy) lua $API_GEN_NAIVE $node socks $bind $local_port > $config_file ln_start_bin "$(first_type naive)" naive "$config_file" - elif [ "$type" == "brook" ]; then + ;; + brook) local protocol=$(config_n_get $node protocol client) local brook_tls=$(config_n_get $node brook_tls 0) [ "$protocol" == "wsclient" ] && { [ "$brook_tls" == "1" ] && server_host="wss://${server_host}" || server_host="ws://${server_host}" } - ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_socks_$5" "$protocol" --socks5 "$bind:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" - elif [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then + ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_SOCKS_$5" "$protocol" --socks5 "$bind:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" + ;; + ss|ssr) lua $API_GEN_SS $node $local_port > $config_file ln_start_bin "$(first_type ${type}-local)" "${type}-local" -c "$config_file" -b "$bind" -u - fi + ;; + esac } run_redir() { @@ -379,47 +392,54 @@ run_redir() { echolog "$remarks节点,非法的服务器地址,无法启动!" return 1 } + [ "$server_host" == "127.0.0.1" ] && process=1 [ "$bind" != "127.0.0.1" ] && echolog "${redir_type}_${6}节点:$remarks,节点:${server_host}:${port},监听端口:$local_port" } eval ${redir_type}_NODE${6}_PORT=$port - - if [ "$redir_type" == "UDP" ]; then - if [ "$type" == "socks" ]; then + + case "$redir_type" in + UDP) + case "$type" in + socks) local node_address=$(config_n_get $node address) local node_port=$(config_n_get $node port) local server_username=$(config_n_get $node username) local server_password=$(config_n_get $node password) eval port=\$UDP_REDIR_PORT$6 ln_start_bin "$(first_type ipt2socks)" "ipt2socks_udp_$6" -U -l "$port" -b 0.0.0.0 -s "$node_address" -p "$node_port" -R - elif [ "$type" == "v2ray" ]; then + ;; + v2ray) lua $API_GEN_V2RAY $node udp $local_port nil > $config_file ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file" - elif [ "$type" == "trojan" ]; then - lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file - ln_start_bin "$(first_type trojan trojan-plus)" trojan -c "$config_file" - elif [ "$type" == "trojan-plus" ]; then - lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file - ln_start_bin "$(first_type trojan-plus trojan)" trojan-plus -c "$config_file" - elif [ "$type" == "trojan-go" ]; then + ;; + trojan-go) lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file" - elif [ "$type" == "naiveproxy" ]; then + ;; + trojan*) + lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port >$config_file + ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file" + ;; + naiveproxy) echolog "Naiveproxy不支持UDP转发!" - elif [ "$type" == "brook" ]; then + ;; + brook) local protocol=$(config_n_get $node protocol client) if [ "$protocol" == "wsclient" ]; then echolog "Brook的WebSocket不支持UDP转发!" else ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" fi - elif [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then + ;; + ss|ssr) lua $API_GEN_SS $node $local_port > $config_file ln_start_bin "$(first_type ${type}-redir)" "${type}-redir" -c "$config_file" -U - fi - fi - - if [ "$redir_type" == "TCP" ]; then - if [ "$type" == "socks" ]; then + ;; + esac + ;; + TCP) + case "$type" in + socks) local node_address=$(config_n_get $node address) local node_port=$(config_n_get $node port) local server_username=$(config_n_get $node username) @@ -428,28 +448,36 @@ run_redir() { local extra_param="-T" [ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="" ln_start_bin "$(first_type ipt2socks)" "ipt2socks_tcp_$6" -l "$port" -b 0.0.0.0 -s "$node_address" -p "$node_port" -R $extra_param - elif [ "$type" == "v2ray" ]; then + ;; + v2ray) local extra_param="tcp" [ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="tcp,udp" lua $API_GEN_V2RAY $node $extra_param $local_port nil > $config_file ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray -config="$config_file" - elif [ "$type" == "trojan" ]; then - lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file - for k in $(seq 1 $process); do - ln_start_bin "$(first_type trojan trojan-plus)" trojan -c "$config_file" - done - elif [ "$type" == "trojan-plus" ]; then - lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file - for k in $(seq 1 $process); do - ln_start_bin "$(first_type trojan-plus trojan)" trojan-plus -c "$config_file" - done - elif [ "$type" == "trojan-go" ]; then + ;; + trojan-go) lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go -config "$config_file" - elif [ "$type" == "naiveproxy" ]; then + ;; + trojan*) + lua $API_GEN_TROJAN $node nat "0.0.0.0" $local_port > $config_file + for k in $(seq 1 $process); do + ln_start_bin "$(first_type ${type})" "${type}" -c "$config_file" + done + ;; + naiveproxy) lua $API_GEN_NAIVE $node redir "0.0.0.0" $local_port > $config_file ln_start_bin "$(first_type naive)" naive "$config_file" - else + ;; + brook) + local protocol=$(config_n_get $node protocol client) + if [ "$protocol" == "wsclient" ]; then + echolog "Brook的WebSocket不支持UDP转发!" + else + ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" + fi + ;; + *) local kcptun_use=$(config_n_get $node use_kcp 0) if [ "$kcptun_use" == "1" ]; then local kcptun_server_host=$(config_n_get $node kcp_server) @@ -499,8 +527,10 @@ run_redir() { ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)" fi fi - fi - fi + ;; + esac + ;; + esac return 0 } @@ -751,6 +781,7 @@ start_dns() { if [ -n "$(echo ${DNS_MODE} | grep 'https-dns-proxy')" ]; then up_trust_doh=$(config_t_get global up_trust_doh "https://dns.google/dns-query,8.8.8.8,8.8.4.4") _doh_url=$(echo $up_trust_doh | awk -F ',' '{print $1}') + _doh_port=$(echo $_doh_url | sed "s/:\/\///g" | awk -F ':' '{print $2}'| awk -F '/' '{print $1}') _doh_bootstrap=$(echo $up_trust_doh | cut -d ',' -sf 2-) up_trust_doh_dns=$(config_t_get global up_trust_doh_dns "tcp") @@ -761,13 +792,13 @@ start_dns() { DNS_FORWARD="" _doh_bootstrap_dns=$(echo $_doh_bootstrap | sed "s/,/ /g") for _dns in $_doh_bootstrap_dns; do - _dns=$(echo $_dns | awk -F ':' '{print $1}'):443 + _dns=$(echo $_dns | awk -F ':' '{print $1}'):${_doh_port:-443} [ -n "$DNS_FORWARD" ] && DNS_FORWARD=${DNS_FORWARD},${_dns} || DNS_FORWARD=${_dns} done ln_start_bin "$(first_type https-dns-proxy)" https-dns-proxy -a 127.0.0.1 -p "${dns_listen_port}" -b "${_doh_bootstrap}" -r "${_doh_url}" -4 unset _dns _doh_bootstrap_dns fi - unset _doh_url _doh_bootstrap + unset _doh_url _doh_port _doh_bootstrap fi if [ -n "$(echo ${DNS_MODE}${up_trust_pdnsd_dns} | grep dns2socks)" ]; then local dns2socks_socks_server=$(echo $(config_t_get global socks_server 127.0.0.1:9050) | sed "s/#/:/g") From 4d1a9d49b747a5d69cc5547986faa47332bf45c6 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 17:57:42 +0800 Subject: [PATCH 03/10] syncthing: bump to 1.9.0 --- package/zxlhhyccc/syncthing/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/zxlhhyccc/syncthing/Makefile b/package/zxlhhyccc/syncthing/Makefile index c43609e70b..da4d5a383c 100644 --- a/package/zxlhhyccc/syncthing/Makefile +++ b/package/zxlhhyccc/syncthing/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=syncthing -PKG_VERSION:=1.7.0 +PKG_VERSION:=1.9.0 PKG_RELEASE:=1 PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION) -PKG_HASH:=aee7ee49b65cb614711b9d8a7d468766adbb687fa5ba8f273eef495e4a8e9435 +PKG_HASH:=a4e3e5997b2c4c76512ed9b32a067b2a90e26c0d445f8c3c62af65d2b93d4d8b PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME) From 590ef6f3b0a0f511a9f18f89888c3f4bcd421954 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 18:05:53 +0800 Subject: [PATCH 04/10] luci-app-openclash: sync with upstream source --- .../files/etc/openclash/game_rules.list | 22 +- .../files/etc/openclash/rule_providers.list | 54 +++- .../cbi/openclash/rule-providers-manage.lua | 19 +- .../usr/share/openclash/openclash_chnroute.sh | 0 .../openclash/openclash_download_rule_list.sh | 22 +- .../files/usr/share/openclash/openclash_ps.sh | 0 .../usr/share/openclash/yml_rules_change.sh | 241 +++++++++--------- .../i18n/zh-cn/openclash.zh-cn.po | 2 +- 8 files changed, 212 insertions(+), 148 deletions(-) mode change 100644 => 100755 package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh mode change 100644 => 100755 package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list b/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list index 7ef328cdbf..7a87cbbcfa 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/game_rules.list @@ -11,12 +11,12 @@ Atlas-全区,Atlas.rules 战地1,Battlefield-1.rules 战地4,BattleField-4.rules 战地5,Battlefield-Ⅴ.rules,Battlefield-5.rules -黑色沙漠-steam,BlackDesert-steam.rules +黑色沙漠,Black-Desert.rules 黑色幸存者,BlackSurvivor.rules -剑灵台服,Blade%26Soul%20TW.rules -剑灵-日服,Blade-%26-Soul-jp.rules -剑灵-国服全部区服(UU规则),Blood-%26-Soul-CN-TestServer-NantianGuo-Alpha.rules -剑灵-国服-南天国(测试版),Blood-%26-Soul-CN.rules +剑灵台服,Blade%26Soul%20TW.rules,Blade&Soul TW.rules +剑灵-日服,Blade-%26-Soul-jp.rules,Blade-&-Soul-jp.rules +剑灵-国服全部区服(UU规则),Blood-%26-Soul-CN-TestServer-NantianGuo-Alpha.rules,Blood-&-Soul-CN-TestServer-NantianGuo-Alpha.rules +剑灵-国服-南天国(测试版),Blood-%26-Soul-CN.rules,Blood-&-Soul-CN.rules 无主之地3,Borderlands3-asia.rules 使命召唤4:现代战争重置版,Call-Of-Duty-4-Modern-Warfare.rules 使命召唤15亚服,Call-Of-Duty15-Asia.rules @@ -59,6 +59,7 @@ GTA5,GTA-5.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 叛乱:沙漠风暴,Insurgency-Sandstorm.rules Jump大乱斗,Jump-Force.rules @@ -85,9 +86,9 @@ NBA2K20,NBA2K20.rules Osu!,Osu!.rules 守望先锋-亚服,Overwatch-Asia.rules 守望先锋-美服,Overwatch-US.rules -流亡黯道-国际服,Path%20Of%20Exile.rules +流亡黯道-国际服,Path%20Of%20Exile.rules,Path Of Exile.rules 流放之路,PathOfexile.rules -梦幻之星2-日服(tx),PHANTASY%20STAR%20ONLINE2-JPtx.rules +梦幻之星2-日服(tx),PHANTASY%20STAR%20ONLINE2-JPtx.rules,PHANTASY STAR ONLINE2-JPtx.rules 行星边际2,PlanetSide-2.rules 绝地求生大逃杀,PlayerUnknown's-Battlegrounds-update.rules,PlayerUnknowns-Battlegrounds-update.rules 实况足球-2018,Pro-Evolution-Soccer-2018.rules @@ -100,7 +101,8 @@ Osu!,Osu!.rules R2竞技场服,R2Arena.rules R2俄服官服,R2RU.rules R2美服,R2US.rules -仙境传说OL台湾,RagnarokOnlineTW.rules +仙境传说OL美国,Ragnarok-Online-2-us.rules +仙境传说OL台湾,Ragnarok-Online-tw.rules 荒野大镖客2,Red-dead-redemption2.rules 无限法则,Ring-of-Elysium-asia.rules Roblox,Roblox.rules @@ -126,6 +128,7 @@ Steam-社区(Beta),Steam.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 未转变者Unturned,Unturned.rules +无畏契约,Valorant.rules 战争前线,War-thunder-steam.rules 战争雷霆-steam,Warface.rules 看门狗,Watch-Dogs.rules @@ -133,10 +136,11 @@ Steam-社区(Beta),Steam.rules 求生意志OL,Will-To-Live-Online.rules 坦克世界-亚服,World-of-Tanks-Asia.rules 坦克世界-国服,World-of-Tanks-cn.rules +坦克世界闪电战,World-of-Tanks-Blitz.rules 魔兽世界台服,World-of-warcraft-tw.rules 战舰世界-亚服,World-of-Warships-US.rules 战舰世界-美服,World-of-Warships.rules 僵尸世界大战,Worldwar-Z.rules 魔兽世界-欧服,WoW-EU.rules -游戏王决斗链接,YO-GI-HO%20delulinks.rules +游戏王决斗链接,YO-GI-HO%20delulinks.rules,YO-GI-HO delulinks.rules 游侠对战平台,YouXiaDuiZhanPingTai.rules \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list b/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list index 4faf1334b3..118f4124bd 100644 --- a/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list +++ b/package/ctcgfw/luci-app-openclash/files/etc/openclash/rule_providers.list @@ -1,70 +1,118 @@ 反劫持规则,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Guard/,Hijacking.yaml 国内IP白名单,ConnersHua,ipcidr,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,ChinaIP.yaml +国内IP白名单(By lhie1),lhie1,ipcidr,lhie1/Rules/master/Clash/Provider/,Domestic%20IPs.yaml,Domestic IPs.yaml 国内域名白名单,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/,China.yaml +国内域名白名单(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Domestic.yaml 国内流媒体合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/,StreamingCN.yaml 国内流媒体国际版合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/,StreamingSE.yaml 国外常用网站合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/,Global.yaml +国外常用网站合集(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Proxy.yaml 国外流媒体合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/,Streaming.yaml 学术网站,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,Scholar.yaml +审计规则(建议直连),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Special.yaml 广告规则,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Guard/,Advertising.yaml +广告规则(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Reject.yaml +微软服务,lhie1,classical,lhie1/Rules/master/Clash/Provider/,Microsoft.yaml 隐私规则合集,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Guard/,Privacy.yaml +ABC,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,ABC.yaml +Abema TV,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Abema%20TV.yaml,Abema TV.yaml AbemaTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,AbemaTV.yaml All-4,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,All-4.yaml +Amazon,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Amazon.yaml AppStore,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,AppStore.yaml AppStoreConnect,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,AppStoreConnect.yaml Apple FindMy,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,FindMy.yaml Apple Music,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Music.yaml Apple News,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,News.yaml -Apple SoftwareUpdate,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,SoftwareUpdate.list,SoftwareUpdate.yaml +Apple News(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Apple%20News.yaml,Apple News.yaml +Apple SoftwareUpdate,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,SoftwareUpdate.yaml Apple TV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,TV.yaml +Apple TV(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Apple%20TV.yaml,Apple TV.yaml Apple TestFlight,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,TestFlight.yaml Apple iCloud,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,iCloud.yaml Apple,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Apple.yaml +Apple(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Apple.yaml,Apple-lhie1.yaml +BBC iPlayer,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,BBC iPlayer.yaml BBC-iPlayer,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,BBC-iPlayer.yaml Bahamut,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Bahamut.yaml +Bahamut(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Bahamut.yaml,Bahamut-lhie1.yaml +Bilibili,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Bilibili.yaml DAZN,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,DAZN.yaml +DAZN(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,DAZN.yaml,DAZN-lhie1.yaml Deezer,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Deezer.yaml +Disney Plus,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Disney%20Plus.yaml,Disney Plus.yaml DisneyPlus,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,DisneyPlus.yaml FOX,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,FOX.yaml +Fox Now,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Fox%20Now.yaml,Fox Now.yaml +Fox+,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Fox+.yaml GFW地址,ConnersHua,ipcidr,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,IP-Blackhole.yaml GoogleDrive,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Google/,GoogleDrive.yaml GoogleSearch,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Google/,GoogleSearch.yaml HBO,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,HBO.yaml +HBO(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,HBO.yaml,HBO-lhie1.yaml HBO-GO-HKG,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,HBO-GO-HKG.yaml HWTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,HWTV.yaml -Himalaya,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Podcast/,Himalaya.list,Himalaya.yaml +Himalaya,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Podcast/,Himalaya.yaml +Hulu Japan,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Hulu Japan.yaml Hulu,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Hulu.yaml +Hulu(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Hulu.yaml,Hulu-lhie1.yaml Hulu-JPN,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Hulu-JPN.yaml ITV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,ITV.yaml Instagram,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Instagram.yaml JOOX,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,JOOX.yaml +JOOX(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,JOOX.yaml,JOOX-lhie1.yaml +Japonx,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Japonx.yaml KKBOX,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,KKBOX.yaml +KKBOX(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,KKBOX.yaml,KKBOX-lhie1.yaml KKTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,KKTV.yaml +KKTV(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,KKTV.yaml,KKTV-lhie1.yaml LINE-TV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,LINE-TV.yaml +Letv,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Letv.yaml LiTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,LiTV.yaml +Line TV,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Line%20TV.yaml,Line TV.yaml +MOO,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,MOO.yaml My5,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,My5.yaml +Netease Music,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Netease%20Music.yaml,Netease Music.yaml Netflix,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Netflix.yaml +Netflix(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Netflix.yaml,Netflix-lhie1.yaml Now-E,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Now-E.yaml OneDrive,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Microsoft/,OneDrive.yaml PBS,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,PBS.yaml +PBS(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,PBS.yaml,PBS-lhie1.yaml Pandora,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Pandora.yaml +Pandora(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Pandora.yaml,Pandora-lhie1.yaml PayPal,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/,PayPal.yaml +PayPal(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,PayPal.yaml,PayPal-lhie1.yaml Pornhub,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Pornhub.yaml +Pornhub(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Pornhub.yaml,Pornhub-lhie1.yaml Prime-Video,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,Prime-Video.yaml Siri,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Siri.yaml SoundCloud,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,SoundCloud.yaml +Soundcloud(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Soundcloud.yaml,Soundcloud-lhie1.yaml +Speedtest,lhie1,classical,lhie1/Rules/master/Clash/Provider/,Speedtest.yaml Spotify,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,Spotify.yaml +Spotify(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Spotify.yaml,Spotify-lhie1.yaml +Steam,lhie1,classical,lhie1/Rules/master/Clash/Provider/,Steam.yaml TIDAL,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Music/,TIDAL.yaml TaiwanGood,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,TaiwanGood.yaml Telegram,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,Telegram.yaml +Telegram(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/,Telegram.yaml,Telegram-lhie1.yaml TelegramNL,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,TelegramNL.yaml TelegramSG,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,TelegramSG.yaml TelegramUS,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/,TelegramUS.yaml +Tencent Video,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Tencent%20Video.yaml,Tencent Video.yaml TikTok,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,TikTok.yaml -Twitch,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Live/,Twitch.list,Twitch.yaml +Twitch,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Live/,Twitch.yaml ViuTV,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,ViuTV.yaml +ViuTV(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,ViuTV.yaml,ViuTV-lhie1.yaml +YouTube Music,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,YouTube%20Music.yaml,YouTube Music.yaml YouTube,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,YouTube.yaml +YouTube(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,YouTube.yaml,YouTube-lhie1.yaml +Youku,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,Youku.yaml encoreTVB,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,encoreTVB.yaml +encoreTVB(By lhie1),lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,encoreTVB.yaml,encoreTVB-lhie1.yaml iCloud-email,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/Extra/Apple/,Mail.yaml +iQiyi,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,iQiyi.yaml +myTV SUPER,lhie1,classical,lhie1/Rules/master/Clash/Provider/Media/,myTV%20SUPER.yaml,myTV SUPER.yaml myTV-SUPER,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,myTV-SUPER.yaml niconico,ConnersHua,classical,DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Video/,niconico.yaml \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua index 50dbdaa65c..df0f155b9d 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/rule-providers-manage.lua @@ -35,7 +35,7 @@ o.write = function() end if not NXFS.access("/tmp/rule_providers_name") then - SYS.call("awk -F ',' '{print $5}' /etc/openclash/rule_providers.list > /tmp/rule_providers_name 2>/dev/null") + SYS.call("awk -v d=',' -F ',' '{print $4d$5}' /etc/openclash/rule_providers.list > /tmp/rule_providers_name 2>/dev/null") end file = io.open("/tmp/rule_providers_name", "r"); @@ -58,14 +58,15 @@ end for t,o in ipairs(e) do e[t]={} e[t].num=string.format(t) -e[t].name=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2) -e[t].filename=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2) -if e[t].filename == "" then -e[t].filename=o +e[t].name=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2) +e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2) +if e[t].lfilename == "" then +e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $5}' 2>/dev/null",o)),1,-2) end -e[t].author=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2) -e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F ',%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2) -RULE_FILE="/etc/openclash/rule_provider/".. e[t].filename +e[t].filename=o +e[t].author=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2) +e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F '%s' /etc/openclash/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2) +RULE_FILE="/etc/openclash/rule_provider/".. e[t].lfilename if fs.mtime(RULE_FILE) then e[t].size=i(fs.stat(RULE_FILE).size) e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE)) @@ -93,7 +94,7 @@ st.template="openclash/cfg_check" tp=tb:option(DummyValue,"rule_type",translate("Rule Type")) nm=tb:option(DummyValue,"name",translate("Rule Name")) au=tb:option(DummyValue,"author",translate("Rule Author")) -fm=tb:option(DummyValue,"filename",translate("File Name")) +fm=tb:option(DummyValue,"lfilename",translate("File Name")) sz=tb:option(DummyValue,"size",translate("Size")) mt=tb:option(DummyValue,"mtime",translate("Update Time")) diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_chnroute.sh old mode 100644 new mode 100755 diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh index ba9510315a..9b883eae5f 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_download_rule_list.sh @@ -1,15 +1,21 @@ #!/bin/sh RULE_FILE_NAME="$1" - if [ -z "$(grep ",$RULE_FILE_NAME" /etc/openclash/rule_providers.list 2>/dev/null)" ]; then - DOWNLOAD_PATH=$(grep -F $RULE_FILE_NAME /etc/openclash/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null) + if [ -z "$(grep "$RULE_FILE_NAME" /etc/openclash/rule_providers.list 2>/dev/null)" ]; then + DOWNLOAD_PATH=$(grep -F "$RULE_FILE_NAME" /etc/openclash/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null) RULE_FILE_DIR="/etc/openclash/game_rules/$RULE_FILE_NAME" RULE_TYPE="game" else - DOWNLOAD_PATH=$(grep -F ",$RULE_FILE_NAME" /etc/openclash/rule_providers.list |awk -F ',' '{print $4$5}' 2>/dev/null) + DOWNLOAD_PATH=$(echo "$RULE_FILE_NAME" |awk -F ',' '{print $1$2}' 2>/dev/null) + RULE_FILE_NAME=$(grep -F "$RULE_FILE_NAME" /etc/openclash/rule_providers.list |awk -F ',' '{print $NF}' 2>/dev/null) RULE_FILE_DIR="/etc/openclash/rule_provider/$RULE_FILE_NAME" RULE_TYPE="provider" fi + if [ -z "$DOWNLOAD_PATH" ]; then + echo "${LOGTIME} Rule File【$RULE_FILE_NAME】 Download Error" >>$LOG_FILE + return 0 + fi + TMP_RULE_DIR="/tmp/$RULE_FILE_NAME" LOGTIME=$(date "+%Y-%m-%d %H:%M:%S") LOG_FILE="/tmp/openclash.log" @@ -33,19 +39,19 @@ fi if [ "$?" -eq "0" ] && [ -s "$TMP_RULE_DIR" ] && [ -z "$(grep "404: Not Found" "$TMP_RULE_DIR")" ]; then - cmp -s $TMP_RULE_DIR $RULE_FILE_DIR + cmp -s "$TMP_RULE_DIR" "$RULE_FILE_DIR" if [ "$?" -ne "0" ]; then - mv $TMP_RULE_DIR $RULE_FILE_DIR >/dev/null 2>&1\ - && rm -rf $TMP_RULE_DIR >/dev/null 2>&1 + mv "$TMP_RULE_DIR" "$RULE_FILE_DIR" >/dev/null 2>&1\ + && rm -rf "$TMP_RULE_DIR" >/dev/null 2>&1 echo "${LOGTIME} Rule File【$RULE_FILE_NAME】 Download Successful" >>$LOG_FILE return 1 else echo "${LOGTIME} Updated Rule File【$RULE_FILE_NAME】 No Change, Do Nothing" >>$LOG_FILE - rm -rf $TMP_RULE_DIR >/dev/null 2>&1 + rm -rf "$TMP_RULE_DIR" >/dev/null 2>&1 return 2 fi else - rm -rf $TMP_RULE_DIR >/dev/null 2>&1 + rm -rf "$TMP_RULE_DIR" >/dev/null 2>&1 echo "${LOGTIME} Rule File【$RULE_FILE_NAME】 Download Error" >>$LOG_FILE return 0 fi \ No newline at end of file diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_ps.sh old mode 100644 new mode 100755 diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh index 5c226e2137..addd21bed3 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh @@ -1,6 +1,10 @@ #!/bin/bash +SCRIPT_FILE="/tmp/yaml_script.yaml" +OTHER_RULE_PROVIDER_FILE="/tmp/other_rule_provider.yaml" +OTHER_RULE_FILE="/tmp/other_rule.yaml" check_def=0 + /usr/share/openclash/yml_groups_name_get.sh yml_other_set() @@ -209,82 +213,83 @@ if [ "$2" != 0 ]; then sed -i '/##Other-rule-providers##/,/##Other-rule-providers-end##/d' "$9" 2>/dev/null if [ "$2" = "lhie1" ]; then #删除原有的script部分,防止冲突 - rm -rf /tmp/yaml_script.yaml 2>/dev/null - cp /etc/openclash/lhie1.yaml /tmp/other_rule_provider.yaml - sed -n '/^ \{0,\}rules:/,$p' /tmp/other_rule_provider.yaml > /tmp/other_rule.yaml 2>/dev/null - sed -i '/^ \{0,\}rules:/,$d' /tmp/other_rule_provider.yaml 2>/dev/null - sed -n '/^ \{0,\}script:/,$p' /tmp/other_rule_provider.yaml > /tmp/yaml_script.yaml 2>/dev/null - sed -i '/^ \{0,\}script:/,$d' /tmp/other_rule_provider.yaml 2>/dev/null - sed -i "/^ \{0,\}script:/c\script:" /tmp/other_rule.yaml 2>/dev/null - sed -i "/^ \{0,\}rules:/c\rules:" /tmp/other_rule.yaml 2>/dev/null - sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" /tmp/other_rule_provider.yaml 2>/dev/null - echo "##Other-rule-providers-end##" >> /tmp/other_rule_provider.yaml + rm -rf "$SCRIPT_FILE" 2>/dev/null + cp /etc/openclash/lhie1.yaml "$OTHER_RULE_PROVIDER_FILE" + sed -n '/^ \{0,\}rules:/,$p' "$OTHER_RULE_PROVIDER_FILE" > "$OTHER_RULE_FILE" 2>/dev/null + sed -i '/^ \{0,\}rules:/,$d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + sed -n '/^ \{0,\}script:/,$p' "$OTHER_RULE_PROVIDER_FILE" > "$SCRIPT_FILE" 2>/dev/null + sed -i '/^ \{0,\}script:/,$d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + sed -i "/^ \{0,\}script:/c\script:" "$SCRIPT_FILE" 2>/dev/null + sed -i "/^ \{0,\}rules:/c\rules:" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + echo "##Other-rule-providers-end##" >> "$OTHER_RULE_PROVIDER_FILE" if [ -z "$(sed -n '/^ \{0,\}rule-providers:/=' "$9" 2>/dev/null)" ]; then - sed -i "s/,GlobalTV$/,${GlobalTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"GlobalTV\"/: \"${GlobalTV}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,GlobalTV,no-resolve$/,${GlobalTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,AsianTV$/,${AsianTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"AsianTV\"/: \"${AsianTV}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,AsianTV,no-resolve$/,${AsianTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##AsianTV:${AsianTV}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Proxy$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Proxy\"/: \"${Proxy}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Proxy,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Proxy:${Proxy}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,YouTube$/,${Youtube}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"YouTube\"/: \"${Youtube}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,YouTube,no-resolve$/,${Youtube},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Youtube:${Youtube}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Apple$/,${Apple}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Apple\"/: \"${Apple}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Apple,no-resolve$/,${Apple},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Apple:${Apple}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Netflix$/,${Netflix}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Netflix\"/: \"${Netflix}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Netflix,no-resolve$/,${Netflix},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Netflix:${Netflix}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Spotify$/,${Spotify}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Spotify\"/: \"${Spotify}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Spotify,no-resolve$/,${Spotify},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Spotify:${Spotify}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Steam$/,${Steam}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Steam\"/: \"${Steam}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Steam,no-resolve$/,${Steam},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Steam:${Steam}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,AdBlock$/,${AdBlock}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"AdBlock\"/: \"${AdBlock}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,AdBlock,no-resolve$/,${AdBlock},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##AdBlock:${AdBlock}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Speedtest$/,${Speedtest}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Speedtest\"/: \"${Speedtest}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Speedtest$/,${Speedtest},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Speedtest:${Speedtest}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Telegram$/,${Telegram}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Telegram\"/: \"${Telegram}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Telegram$/,${Telegram},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Telegram:${Telegram}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Microsoft$/,${Microsoft}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Microsoft\"/: \"${Microsoft}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Microsoft$/,${Microsoft},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Microsoft:${Microsoft}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,PayPal$/,${PayPal}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"PayPal\"/: \"${PayPal}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,PayPal$/,${PayPal},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##PayPal:${PayPal}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Domestic$/,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Domestic\"/: \"${Domestic}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/return \"Domestic\"$/return \"${Domestic}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Domestic$/,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Domestic:${Domestic}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Others$/,${Others}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/: \"Others\"/: \"${Others}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/return \"Others\"$/return \"${Others}\"#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Others$/,${Others},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Others:${Others}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/#d//g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" /tmp/other_rule_provider.yaml 2>/dev/null - cat /tmp/other_rule_provider.yaml >> "$9" 2>/dev/null + sed -i "s/,GlobalTV$/,${GlobalTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"GlobalTV\"/: \"${GlobalTV}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,GlobalTV,no-resolve$/,${GlobalTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,AsianTV$/,${AsianTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"AsianTV\"/: \"${AsianTV}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,AsianTV,no-resolve$/,${AsianTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##AsianTV:${AsianTV}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Proxy$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Proxy\"/: \"${Proxy}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Proxy,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Proxy:${Proxy}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,YouTube$/,${Youtube}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"YouTube\"/: \"${Youtube}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,YouTube,no-resolve$/,${Youtube},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Youtube:${Youtube}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Apple$/,${Apple}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Apple\"/: \"${Apple}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Apple,no-resolve$/,${Apple},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Apple:${Apple}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Netflix$/,${Netflix}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Netflix\"/: \"${Netflix}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Netflix,no-resolve$/,${Netflix},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Netflix:${Netflix}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Spotify$/,${Spotify}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Spotify\"/: \"${Spotify}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Spotify,no-resolve$/,${Spotify},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Spotify:${Spotify}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Steam$/,${Steam}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Steam\"/: \"${Steam}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Steam,no-resolve$/,${Steam},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Steam:${Steam}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,AdBlock$/,${AdBlock}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"AdBlock\"/: \"${AdBlock}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,AdBlock,no-resolve$/,${AdBlock},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##AdBlock:${AdBlock}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Speedtest$/,${Speedtest}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Speedtest\"/: \"${Speedtest}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Speedtest$/,${Speedtest},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Speedtest:${Speedtest}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Telegram$/,${Telegram}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Telegram\"/: \"${Telegram}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Telegram$/,${Telegram},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Telegram:${Telegram}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Microsoft$/,${Microsoft}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Microsoft\"/: \"${Microsoft}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Microsoft$/,${Microsoft},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Microsoft:${Microsoft}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,PayPal$/,${PayPal}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"PayPal\"/: \"${PayPal}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,PayPal$/,${PayPal},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##PayPal:${PayPal}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Domestic$/,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Domestic\"/: \"${Domestic}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/return \"Domestic\"$/return \"${Domestic}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Domestic$/,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Domestic:${Domestic}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Others$/,${Others}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/: \"Others\"/: \"${Others}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/return \"Others\"$/return \"${Others}#d\"/g" "$SCRIPT_FILE" 2>/dev/null + sed -i "s/,Others$/,${Others},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Others:${Others}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/#d//g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/#d//g" "$SCRIPT_FILE" 2>/dev/null + sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + cat "$OTHER_RULE_PROVIDER_FILE" >> "$9" 2>/dev/null else #处理缩进 sed -i '/^ *$/d' "$9" 2>/dev/null @@ -298,41 +303,41 @@ if [ "$2" != 0 ]; then sed -i 's/^ \{1,\}interval:/ interval:/g' "$9" 2>/dev/null sed -i 's/^ \{1,\}rule-providers:/rule-providers:/g' "$9" 2>/dev/null - sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' /tmp/other_rule_provider.yaml 2>/dev/null - sed -i '/^ \{0,\}rule-providers:/d' "/tmp/other_rule_provider.yaml" 2>/dev/null + sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + sed -i '/^ \{0,\}rule-providers:/d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null sed -i '/rule-providers:/r/tmp/other_rule_provider.yaml' "$9" 2>/dev/null fi elif [ "$2" = "ConnersHua" ]; then - cp /etc/openclash/ConnersHua.yaml /tmp/other_rule_provider.yaml - sed -n '/^rules:/,$p' /tmp/other_rule_provider.yaml > /tmp/other_rule.yaml 2>/dev/null - sed -i '/^rules:/,$d' /tmp/other_rule_provider.yaml 2>/dev/null - sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" /tmp/other_rule_provider.yaml 2>/dev/null - echo "##Other-rule-providers-end##" >> /tmp/other_rule_provider.yaml + cp /etc/openclash/ConnersHua.yaml "$OTHER_RULE_PROVIDER_FILE" + sed -n '/^rules:/,$p' "$OTHER_RULE_PROVIDER_FILE" > "$OTHER_RULE_FILE" 2>/dev/null + sed -i '/^rules:/,$d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + sed -i "/^ \{0,\}rule-providers:/c\rule-providers:" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + echo "##Other-rule-providers-end##" >> "$OTHER_RULE_PROVIDER_FILE" if [ -z "$(sed -n '/^ \{0,\}rule-providers:/=' "$9" 2>/dev/null)" ]; then - sed -i "s/,Streaming$/,${GlobalTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,Streaming,no-resolve$/,${GlobalTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,StreamingSE$/,${AsianTV}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,StreamingSE,no-resolve$/,${AsianTV},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##AsianTV:${AsianTV}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,PROXY$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,IP-Blackhole$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,IP-Blackhole,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Proxy:${Proxy}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,China,DIRECT$/,China,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,China,DIRECT,no-resolve$/,China,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,ChinaIP,DIRECT$/,ChinaIP,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,ChinaIP,DIRECT,no-resolve$/,ChinaIP,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,CN,DIRECT$/,CN,${Domestic}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,CN,DIRECT,no-resolve$/,CN,${Domestic},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Domestic:${Domestic}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,MATCH$/,${Others}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,MATCH,no-resolve$/,${Others},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Others:${Others}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/#d//g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" /tmp/other_rule_provider.yaml 2>/dev/null - cat /tmp/other_rule_provider.yaml >> "$9" 2>/dev/null + sed -i "s/,Streaming$/,${GlobalTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,Streaming,no-resolve$/,${GlobalTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##GlobalTV:${GlobalTV}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,StreamingSE$/,${AsianTV}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,StreamingSE,no-resolve$/,${AsianTV},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##AsianTV:${AsianTV}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,PROXY$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,IP-Blackhole$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,IP-Blackhole,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Proxy:${Proxy}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,China,DIRECT$/,China,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,China,DIRECT,no-resolve$/,China,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,ChinaIP,DIRECT$/,ChinaIP,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,ChinaIP,DIRECT,no-resolve$/,ChinaIP,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,CN,DIRECT$/,CN,${Domestic}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,CN,DIRECT,no-resolve$/,CN,${Domestic},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Domestic:${Domestic}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,MATCH$/,${Others}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,MATCH,no-resolve$/,${Others},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Others:${Others}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/#d//g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/^rule-providers:/c\rule-providers: ##Other-rule-providers##" "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + cat "$OTHER_RULE_PROVIDER_FILE" >> "$9" 2>/dev/null else #处理缩进 sed -i '/^ *$/d' "$9" 2>/dev/null @@ -346,21 +351,21 @@ if [ "$2" != 0 ]; then sed -i 's/^ \{1,\}interval:/ interval:/g' "$9" 2>/dev/null sed -i 's/^ \{1,\}rule-providers:/rule-providers:/g' "$9" 2>/dev/null - sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' /tmp/other_rule_provider.yaml 2>/dev/null - sed -i '/^ \{0,\}rule-providers:/d' "/tmp/other_rule_provider.yaml" 2>/dev/null + sed -i '/^ \{0,\}rule-providers:/a\##Other-rule-providers##' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null + sed -i '/^ \{0,\}rule-providers:/d' "$OTHER_RULE_PROVIDER_FILE" 2>/dev/null sed -i '/rule-providers:/r/tmp/other_rule_provider.yaml' "$9" 2>/dev/null fi else - cp /etc/openclash/ConnersHua_return.yaml /tmp/other_rule.yaml - sed -i "s/,PROXY$/,${Proxy}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Proxy:${Proxy}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,DIRECT$/,${Others}#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/,DIRECT,no-resolve$/,${Others},no-resolve#d/g" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "/rules:/a\##Others:${Others}" "/tmp/other_rule.yaml" 2>/dev/null - sed -i "s/#d//g" "/tmp/other_rule.yaml" 2>/dev/null + cp /etc/openclash/ConnersHua_return.yaml "$OTHER_RULE_FILE" + sed -i "s/,PROXY$/,${Proxy}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,PROXY,no-resolve$/,${Proxy},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Proxy:${Proxy}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,DIRECT$/,${Others}#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/,DIRECT,no-resolve$/,${Others},no-resolve#d/g" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "/rules:/a\##Others:${Others}" "$OTHER_RULE_FILE" 2>/dev/null + sed -i "s/#d//g" "$OTHER_RULE_FILE" 2>/dev/null fi - cat /tmp/other_rule.yaml >> "$4" 2>/dev/null + cat "$OTHER_RULE_FILE" >> "$4" 2>/dev/null rm -rf /tmp/other_rule* 2>/dev/null fi fi @@ -370,7 +375,7 @@ elif [ "$2" = 0 ]; then if [ "$?" -eq "0" ]; then sed -i '/^rules:/,$d' "$4" 2>/dev/null rm -rf /tmp/yaml_rule_provider.yaml 2>/dev/null - rm -rf /tmp/yaml_script.yaml 2>/dev/null + rm -rf "$SCRIPT_FILE" 2>/dev/null cat "/tmp/yaml_rule_provider_bak.yaml" >> "$4" 2>/dev/null cat "/tmp/yaml_script_bak.yaml" >> "$4" 2>/dev/null cat "/tmp/yaml_rules_bak.yaml" >> "$4" 2>/dev/null diff --git a/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po b/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po index 87b78355c3..53e3c8a8f6 100644 --- a/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po +++ b/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po @@ -934,7 +934,7 @@ msgid "Order Number" msgstr "序号" msgid "Game Rules Manage" -msgstr "管理游戏规则" +msgstr "管理第三方游戏规则" msgid "Other Rule Provider Manage" msgstr "管理第三方规则集" From d4f8b14e53a0f962f0f4fec569f6ac8b24d6cc7f Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 18:11:17 +0800 Subject: [PATCH 05/10] UnblockNeteaseMusic-Go: bump to 0.2.6 --- package/lean/UnblockNeteaseMusic-Go/Makefile | 4 ++-- package/lean/luci-app-unblockneteasemusic-go/Makefile | 4 ++-- .../luasrc/model/cbi/unblockneteasemusic.lua | 4 ++++ .../root/etc/init.d/unblockneteasemusic | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package/lean/UnblockNeteaseMusic-Go/Makefile b/package/lean/UnblockNeteaseMusic-Go/Makefile index adb249026f..3c3a285512 100644 --- a/package/lean/UnblockNeteaseMusic-Go/Makefile +++ b/package/lean/UnblockNeteaseMusic-Go/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=UnblockNeteaseMusic-Go -PKG_VERSION:=0.2.5 +PKG_VERSION:=0.2.6 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/cnsilvan/UnblockNeteaseMusic.git -PKG_SOURCE_VERSION:=aa1eb0186206671de9a6b4fa27d933bb306d4e25 +PKG_SOURCE_VERSION:=7ff431267eb2b2683ea25e1b3860447aa7b482e9 PKG_MAINTAINER:=Silvan PKG_SOURCE_SUBDIR:=$(PKG_NAME) diff --git a/package/lean/luci-app-unblockneteasemusic-go/Makefile b/package/lean/luci-app-unblockneteasemusic-go/Makefile index c90cbd8fe7..8b11c61c59 100644 --- a/package/lean/luci-app-unblockneteasemusic-go/Makefile +++ b/package/lean/luci-app-unblockneteasemusic-go/Makefile @@ -2,10 +2,10 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for UnblockNeteaseMusic Go -LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +openssl-util +ipset +UnblockNeteaseMusic-Go +LUCI_DEPENDS:=+bash +busybox +coreutils +coreutils-nohup +curl +dnsmasq-full +openssl-util +ipset +UnblockNeteaseMusic-Go LUCI_PKGARCH:=all PKG_NAME:=luci-app-unblockneteasemusic-go -PKG_VERSION:=1.8 +PKG_VERSION:=1.9 PKG_RELEASE:=1 PKG_MAINTAINER:=https://github.com/cnsilvan/luci-app-unblockneteasemusic diff --git a/package/lean/luci-app-unblockneteasemusic-go/luasrc/model/cbi/unblockneteasemusic.lua b/package/lean/luci-app-unblockneteasemusic-go/luasrc/model/cbi/unblockneteasemusic.lua index 010bd4329a..c5a4e9ccaf 100644 --- a/package/lean/luci-app-unblockneteasemusic-go/luasrc/model/cbi/unblockneteasemusic.lua +++ b/package/lean/luci-app-unblockneteasemusic-go/luasrc/model/cbi/unblockneteasemusic.lua @@ -48,6 +48,10 @@ hijack.description = translate("如果使用Hosts劫持,请将HTTP/HTTPS端口 hijack.default = "dont_hijack" hijack.rmempty = false +search_limit = s:option(Value, "search_limit", translate("搜索结果限制")) +search_limit.description = translate("在搜索页面显示其他平台搜索结果个数,可填(0-3)") +search_limit.default = "0" +search_limit.rmempty = false daemon_enable = s:option(Flag, "daemon_enable", translate("启用进程守护")) daemon_enable.description = translate("开启后,附属程序会自动检测主程序运行状态,在主程序退出时自动重启") diff --git a/package/lean/luci-app-unblockneteasemusic-go/root/etc/init.d/unblockneteasemusic b/package/lean/luci-app-unblockneteasemusic-go/root/etc/init.d/unblockneteasemusic index 88987f0ec4..657774c049 100755 --- a/package/lean/luci-app-unblockneteasemusic-go/root/etc/init.d/unblockneteasemusic +++ b/package/lean/luci-app-unblockneteasemusic-go/root/etc/init.d/unblockneteasemusic @@ -140,9 +140,9 @@ start() { exArgs="${exArgs} -b" fi if [ "${music_source}" = "default" ]; then - nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o kuwo -m 0 -c "${serverCrt}" -k "${serverKey}" ${exArgs} >>"${logFile}" 2>&1 & + nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o kuwo -m 0 -c "${serverCrt}" -k "${serverKey}" -l "${logFile}" -sl "${search_limit}" ${exArgs} >>"${logFile}" 2>&1 & else - nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o "${music_customize_source}" -m 0 -c "${serverCrt}" -k "${serverKey}" ${exArgs} >>"${logFile}" 2>&1 & + nohup UnblockNeteaseMusic -p "${http_port}" -sp "${https_port}" -o "${music_customize_source}" -m 0 -c "${serverCrt}" -k "${serverKey}" -l "${logFile}" -sl "${search_limit}" ${exArgs} >>"${logFile}" 2>&1 & fi set_type="start" if [ "${hijack_ways}" = "use_ipset" ]; then From fdcf353bdb56e994be8b55bef69596c9b92753cc Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 18:48:56 +0800 Subject: [PATCH 06/10] kernel: bump 4.9 to 4.9.236 Refreshed all patches. Signed-off-by: CN_SZTL --- include/kernel-version.mk | 4 ++-- .../680-NET-skip-GRO-for-foreign-MAC-addresses.patch | 8 ++++---- .../linux/generic/pending-4.9/834-ledtrig-libata.patch | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index a80ef44a92..8e25563b20 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,11 +6,11 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .235 +LINUX_VERSION-4.9 = .236 LINUX_VERSION-4.14 = .196 LINUX_VERSION-4.19 = .143 -LINUX_KERNEL_HASH-4.9.235 = e625a6212695efe5deeab5844e47404841fb1bf755f85eba818614c2ff580cc3 +LINUX_KERNEL_HASH-4.9.236 = e7e26082c17a2a9ca5cfcc4c69c9a1966e0e1c12aaef117ff798f8b52df842d5 LINUX_KERNEL_HASH-4.14.196 = 5e61b2f58d4c930c3567821aeeb6f688554dca61454646d54711bfc9abc7b09a LINUX_KERNEL_HASH-4.19.143 = 2a4335c66f0ea8cc49d89ab25e5e00d75fcb33fe638d5584855598b4b8f3038d diff --git a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index d0d2d15b4c..ae66804e67 100644 --- a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5873,6 +5876,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5874,6 +5877,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -5945,6 +5990,7 @@ static int __netdev_upper_dev_link(struc +@@ -5946,6 +5991,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -6071,6 +6117,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6072,6 +6118,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -109,7 +109,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6674,6 +6721,7 @@ int dev_set_mac_address(struct net_devic +@@ -6675,6 +6722,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch index a369c7166e..062e9fac72 100644 --- a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -4997,6 +5010,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -4996,6 +5009,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; -@@ -5898,6 +5914,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -5897,6 +5913,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5919,6 +5938,12 @@ static void ata_host_release(struct devi +@@ -5918,6 +5937,12 @@ static void ata_host_release(struct devi kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6365,7 +6390,23 @@ int ata_host_register(struct ata_host *h +@@ -6364,7 +6389,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -887,6 +890,12 @@ struct ata_port { +@@ -888,6 +891,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif From 7e2d892441c7fde30e2d48c6877e6b4ce8ef0ff0 Mon Sep 17 00:00:00 2001 From: Buhtige <71141650+Buhtige@users.noreply.github.com> Date: Sat, 12 Sep 2020 19:02:00 +0800 Subject: [PATCH 07/10] luci-app-argon-config: add package (#198) --- package/ctcgfw/luci-app-argon-config/Makefile | 46 ++++ .../luasrc/controller/argon-config.lua | 12 + .../model/cbi/argon-config/configuration.lua | 216 ++++++++++++++++++ .../luasrc/view/argon-config/other_button.htm | 7 + .../luasrc/view/argon-config/other_dvalue.htm | 8 + .../luasrc/view/argon-config/other_upload.htm | 5 + .../po/zh-cn/argon-config.po | 124 ++++++++++ .../root/etc/config/argon | 8 + .../root/etc/uci-defaults/luci-argon-config | 6 + 9 files changed, 432 insertions(+) create mode 100644 package/ctcgfw/luci-app-argon-config/Makefile create mode 100644 package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua create mode 100644 package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua create mode 100644 package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm create mode 100644 package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm create mode 100644 package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm create mode 100644 package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po create mode 100644 package/ctcgfw/luci-app-argon-config/root/etc/config/argon create mode 100644 package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config diff --git a/package/ctcgfw/luci-app-argon-config/Makefile b/package/ctcgfw/luci-app-argon-config/Makefile new file mode 100644 index 0000000000..1333d89ed1 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2008-2014 The LuCI Team +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-argon-config +LUCI_PKGARCH:=all +PKG_VERSION:=0.7 +PKG_RELEASE:=beta + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-argon-config + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LuCI page for Argon Config + PKGARCH:=all + DEPENDS:= +endef + +define Build/Prepare +endef + +define Build/Compile +endef + + +define Package/luci-app-argon-config/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci + cp -pR ./luasrc/* $(1)/usr/lib/lua/luci + $(INSTALL_DIR) $(1)/ + cp -pR ./root/* $(1)/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + po2lmo ./po/zh-cn/argon-config.po $(1)/usr/lib/lua/luci/i18n/argon-config.zh-cn.lmo +endef + + +$(eval $(call BuildPackage,luci-app-argon-config)) + +# call BuildPackage - OpenWrt buildroot signature + + diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua b/package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua new file mode 100644 index 0000000000..8810e37f25 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/controller/argon-config.lua @@ -0,0 +1,12 @@ +--[[ +luci-app-argon-config +]]-- + +module("luci.controller.argon-config", package.seeall) + +function index() + if not nixio.fs.access('/www/luci-static/argon/css/cascade.css') then + return + end + entry({"admin", "system", "argon-config"}, form("argon-config/configuration"), _("Argon Config"),90) +end diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua b/package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua new file mode 100644 index 0000000000..5af5374521 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/model/cbi/argon-config/configuration.lua @@ -0,0 +1,216 @@ +local nxfs = require 'nixio.fs' +local wa = require 'luci.tools.webadmin' +local opkg = require 'luci.model.ipkg' +local sys = require 'luci.sys' +local http = require 'luci.http' +local nutil = require 'nixio.util' +local name = 'argon' +local uci = require 'luci.model.uci'.cursor() + +local fstat = nxfs.statvfs(opkg.overlay_root()) +local space_total = fstat and fstat.blocks or 0 +local space_free = fstat and fstat.bfree or 0 +local space_used = space_total - space_free + +local free_byte = space_free * fstat.frsize + +local primary, dark_primary, blur_radius, blur_radius_dark, blur_opacity, mode +if nxfs.access('/etc/config/argon') then + primary = uci:get_first('argon', 'global', 'primary') + dark_primary = uci:get_first('argon', 'global', 'dark_primary') + blur_radius = uci:get_first('argon', 'global', 'blur') + blur_radius_dark = uci:get_first('argon', 'global', 'blur_dark') + blur_opacity = uci:get_first('argon', 'global', 'transparency') + blur_opacity_dark = uci:get_first('argon', 'global', 'transparency_dark') + mode = uci:get_first('argon', 'global', 'mode') +end + +function glob(...) + local iter, code, msg = nxfs.glob(...) + if iter then + return nutil.consume(iter) + else + return nil, code, msg + end +end + +local transparency_sets = { + 0, + 0.1, + 0.2, + 0.3, + 0.4, + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1 +} + +-- [[ 模糊设置 ]]-- +br = SimpleForm('config', translate('Argon Config'), translate('Here you can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos.')) +br.reset = false +br.submit = false +s = br:section(SimpleSection) + +o = s:option(ListValue, 'mode', translate('Theme mode')) +o:value('normal', translate('Follow System')) +o:value('light', translate('Force Light')) +o:value('dark', translate('Force Dark')) +o.default = mode +o.rmempty = false +o.description = translate('You can choose Theme color mode here') + +o = s:option(Value, 'primary', translate('[Light mode] Primary Color'), translate('A HEX Color ; ( Default: #5e72e4 )')) +o.value = primary +o.datatype = ufloat +o.rmempty = false + + + +o = s:option(ListValue, 'transparency', translate('[Light mode] Transparency'), translate('0 transparent - 1 opaque ; ( Suggest: transparent: 0 or translucent preset: 0.5 )')) +for _, v in ipairs(transparency_sets) do + o:value(v) +end +o.default = blur_opacity +o.datatype = ufloat +o.rmempty = false + +o = s:option(Value, 'blur', translate('[Light mode] Frosted Glass Radius'), translate('Larger value will more blurred ; ( Suggest: clear: 1 or blur preset: 10 )')) +o.value = blur_radius +o.datatype = ufloat +o.rmempty = false + +o = s:option(Value, 'dark_primary', translate('[Dark mode] Primary Color'), translate('A HEX Color ; ( Default: #483d8b )')) +o.value = dark_primary +o.datatype = ufloat +o.rmempty = false + +o = s:option(ListValue, 'transparency_dark', translate('[Dark mode] Transparency'), translate('0 transparent - 1 opaque ; ( Suggest: Black translucent preset: 0.5 )')) +for _, v in ipairs(transparency_sets) do + o:value(v) +end +o.default = blur_opacity_dark +o.datatype = ufloat +o.rmempty = false + +o = s:option(Value, 'blur_dark', translate('[Dark mode] Frosted Glass Radius'), translate('Larger value will more blurred ; ( Suggest: clear: 1 or blur preset: 10 )')) +o.value = blur_radius_dark +o.datatype = ufloat +o.rmempty = false + +o = s:option(Button, 'save', translate('Save Changes')) +o.inputstyle = 'reload' + +function br.handle(self, state, data) + if (state == FORM_VALID and data.blur ~= nil and data.blur_dark ~= nil and data.transparency ~= nil and data.transparency_dark ~= nil and data.mode ~= nil) then + nxfs.writefile('/tmp/aaa', data) + for key, value in pairs(data) do + uci:set('argon','@global[0]',key,value) + end + uci:commit('argon') + end + return true +end + +ful = SimpleForm('upload', translate('Upload (Free: ') .. wa.byte_format(free_byte) .. ')', translate("You can upload files such as jpg,png,gif,mp4 files, To change the login page background.")) +ful.reset = false +ful.submit = false + +sul = ful:section(SimpleSection, '', translate("Upload file to '/www/luci-static/argon/background/'")) +fu = sul:option(FileUpload, '') +fu.template = 'argon-config/other_upload' +um = sul:option(DummyValue, '', nil) +um.template = 'argon-config/other_dvalue' + +local dir, fd +dir = '/www/luci-static/argon/background/' +nxfs.mkdir(dir) +http.setfilehandler( + function(meta, chunk, eof) + if not fd then + if not meta then + return + end + + if meta and chunk then + fd = nixio.open(dir .. meta.file, 'w') + end + + if not fd then + um.value = translate('Create upload file error.') + return + end + end + if chunk and fd then + fd:write(chunk) + end + if eof and fd then + fd:close() + fd = nil + um.value = translate('File saved to') .. ' "/www/luci-static/argon/background/' .. meta.file .. '"' + end + end +) + +if http.formvalue('upload') then + local f = http.formvalue('ulfile') + if #f <= 0 then + um.value = translate('No specify upload file.') + end +end + +local function getSizeStr(size) + local i = 0 + local byteUnits = {' kB', ' MB', ' GB', ' TB'} + repeat + size = size / 1024 + i = i + 1 + until (size <= 1024) + return string.format('%.1f', size) .. byteUnits[i] +end + +local inits, attr = {} +for i, f in ipairs(glob(dir .. '*')) do + attr = nxfs.stat(f) + if attr then + inits[i] = {} + inits[i].name = nxfs.basename(f) + inits[i].mtime = os.date('%Y-%m-%d %H:%M:%S', attr.mtime) + inits[i].modestr = attr.modestr + inits[i].size = getSizeStr(attr.size) + inits[i].remove = 0 + inits[i].install = false + end +end + +form = SimpleForm('filelist', translate('Background file list'), nil) +form.reset = false +form.submit = false + +tb = form:section(Table, inits) +nm = tb:option(DummyValue, 'name', translate('File name')) +mt = tb:option(DummyValue, 'mtime', translate('Modify time')) +sz = tb:option(DummyValue, 'size', translate('Size')) +btnrm = tb:option(Button, 'remove', translate('Remove')) +btnrm.render = function(self, section, scope) + self.inputstyle = 'remove' + Button.render(self, section, scope) +end + +btnrm.write = function(self, section) + local v = nxfs.unlink(dir .. nxfs.basename(inits[section].name)) + if v then + table.remove(inits, section) + end + return v +end + +function IsIpkFile(name) + name = name or '' + local ext = string.lower(string.sub(name, -4, -1)) + return ext == '.ipk' +end + +return br, ful, form diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm new file mode 100644 index 0000000000..1c391ad984 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_button.htm @@ -0,0 +1,7 @@ +<%+cbi/valueheader%> + <% if self:cfgvalue(section) ~= false then %> + " style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> /> + <% else %> + - + <% end %> +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm new file mode 100644 index 0000000000..296c61e4d6 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_dvalue.htm @@ -0,0 +1,8 @@ +<%+cbi/valueheader%> + +<% + local val = self:cfgvalue(section) or self.default or "" + write(pcdata(val)) +%> + +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm new file mode 100644 index 0000000000..ceb518ee7e --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/luasrc/view/argon-config/other_upload.htm @@ -0,0 +1,5 @@ +<%+cbi/valueheader%> + + + +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po b/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po new file mode 100644 index 0000000000..0976e9444b --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po @@ -0,0 +1,124 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: dingpengyu \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: zh_CN\n" +"X-Generator: Poedit 2.3.1\n" + +msgid "Argon Config" +msgstr "Argon 主题设置" + +msgid "Here you can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos." +msgstr "在这里你可以设置argon 主题的登录页面的模糊和透明度,并管理背景图片与视频。" + +msgid "Theme mode" +msgstr "主题模式" + +msgid "Follow System" +msgstr "跟随系统" + +msgid "Force Light" +msgstr "强制亮色" + +msgid "Force Dark" +msgstr "强制暗色" + +msgid "You can choose Theme color mode here" +msgstr "你可以选择喜欢的主题模式" + +msgid "[Light mode] Primary Color" +msgstr "[亮色模式] 主色调" + +msgid "[Dark mode] Primary Color" +msgstr "[暗色模式] 主色调" + +msgid "A HEX Color ; ( Default: #5e72e4 )" +msgstr "十六进制颜色值 ( 预设为:#5e72e4 )" + +msgid "A HEX Color ; ( Default: #483d8b )" +msgstr "十六进制颜色值 ( 预设为:#483d8b )" + +msgid "[Light mode] Transparency" +msgstr "[亮色模式] 透明度" + +msgid "[Light mode] Transparency" +msgstr "[亮色模式] 透明度" + +msgid "[Dark mode] Transparency" +msgstr "[暗色模式] 透明度" + +msgid "0 transparent - 1 opaque ; ( Suggest: transparent: 0 or translucent preset: 0.5 )" +msgstr "0最透明 - 1不透明 ; ( 建议: 透明 0 或 半透明预设 0.5 )" + +msgid "0 transparent - 1 opaque ; ( Suggest: Black translucent preset: 0.5 )" +msgstr "0最透明 - 1不透明 ; ( 建议: 黑色半透明 0.5 )" + +msgid "[Light mode] Frosted Glass Radius" +msgstr "[亮色模式] 毛玻璃模糊半径" + +msgid "[Dark mode] Frosted Glass Radius" +msgstr "[暗色模式] 毛玻璃模糊半径" + +msgid "Larger value will more blurred ; ( Suggest: clear: 1 or blur preset: 10 )" +msgstr "值越大越模糊; ( 建议: 清透 1 或 模糊预设 10 )" + +msgid "You can upload files such as jpg,png,gif,mp4 files, To change the login page background." +msgstr "你可以上传jpg、png、gif或mp4文件,以创建自己喜欢的登录界面" + +msgid "Save Changes" +msgstr "保存更改" + +msgid "Choose local file:" +msgstr "选择本地文件:" + +msgid "Couldn't open file:" +msgstr "无法打开文件:" + +msgid "Create upload file error." +msgstr "创建上传文件失败。" + + +msgid "File name" +msgstr "文件名" + +msgid "File saved to" +msgstr "文件保存到" + +msgid "FileTransfer" +msgstr "文件传输" + +msgid "Install" +msgstr "安装" + +msgid "Attributes" +msgstr "属性" + +msgid "Modify time" +msgstr "修改时间" + +msgid "No specify upload file." +msgstr "未指定上传文件。" + +msgid "Path on Route:" +msgstr "路由根目录:" + +msgid "Remove" +msgstr "移除" + +msgid "Size" +msgstr "大小" + +msgid "Upload (Free:" +msgstr "上传 (剩余空间:" + +msgid "Background file list" +msgstr "背景文件列表" + +msgid "Upload file to '/www/luci-static/argon/background/'" +msgstr "文件将上传到'/www/luci-static/argon/background/'" diff --git a/package/ctcgfw/luci-app-argon-config/root/etc/config/argon b/package/ctcgfw/luci-app-argon-config/root/etc/config/argon new file mode 100644 index 0000000000..11fb00f5b9 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/root/etc/config/argon @@ -0,0 +1,8 @@ +config global + option primary '#5e72e4' + option dark_primary '#483d8b' + option blur '10' + option blur_dark '10' + option transparency '0.5' + option transparency_dark '0.5' + option mode 'normal' \ No newline at end of file diff --git a/package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config b/package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config new file mode 100644 index 0000000000..935d7c8be5 --- /dev/null +++ b/package/ctcgfw/luci-app-argon-config/root/etc/uci-defaults/luci-argon-config @@ -0,0 +1,6 @@ +#!/bin/sh + +sed -i 's/cbi.submit\"] = true/cbi.submit\"] = \"1\"/g' /usr/lib/lua/luci/dispatcher.lua + +rm -f /tmp/luci-indexcache +exit 0 From 55f6b0795680b73a3a6417679e885ad62980fedd Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 19:06:19 +0800 Subject: [PATCH 08/10] luci-app-argon-config: tidy up Makefile --- package/ctcgfw/luci-app-argon-config/Makefile | 34 ++----------------- .../po/zh-cn/argon-config.po | 2 +- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/package/ctcgfw/luci-app-argon-config/Makefile b/package/ctcgfw/luci-app-argon-config/Makefile index 1333d89ed1..90cdef65b6 100644 --- a/package/ctcgfw/luci-app-argon-config/Makefile +++ b/package/ctcgfw/luci-app-argon-config/Makefile @@ -7,40 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-argon-config -LUCI_PKGARCH:=all PKG_VERSION:=0.7 PKG_RELEASE:=beta -include $(INCLUDE_DIR)/package.mk +LUCI_TITLE:=LuCI page for Argon Config +LUCI_PKGARCH:=all -define Package/luci-app-argon-config - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=LuCI page for Argon Config - PKGARCH:=all - DEPENDS:= -endef - -define Build/Prepare -endef - -define Build/Compile -endef - - -define Package/luci-app-argon-config/install - $(INSTALL_DIR) $(1)/usr/lib/lua/luci - cp -pR ./luasrc/* $(1)/usr/lib/lua/luci - $(INSTALL_DIR) $(1)/ - cp -pR ./root/* $(1)/ - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n - po2lmo ./po/zh-cn/argon-config.po $(1)/usr/lib/lua/luci/i18n/argon-config.zh-cn.lmo -endef - - -$(eval $(call BuildPackage,luci-app-argon-config)) +include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature - - diff --git a/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po b/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po index 0976e9444b..1ba67fcff4 100644 --- a/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po +++ b/package/ctcgfw/luci-app-argon-config/po/zh-cn/argon-config.po @@ -15,7 +15,7 @@ msgid "Argon Config" msgstr "Argon 主题设置" msgid "Here you can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos." -msgstr "在这里你可以设置argon 主题的登录页面的模糊和透明度,并管理背景图片与视频。" +msgstr "在这里你可以设置 argon 主题的登录页面的模糊和透明度,并管理背景图片与视频。" msgid "Theme mode" msgstr "主题模式" From 7bd43a44e69f9254301294b0b155c9c0adbf22de Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 19:11:11 +0800 Subject: [PATCH 09/10] luci-app-argon-config: depend on theme package --- package/ctcgfw/luci-app-argon-config/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/ctcgfw/luci-app-argon-config/Makefile b/package/ctcgfw/luci-app-argon-config/Makefile index 90cdef65b6..1c94acc93c 100644 --- a/package/ctcgfw/luci-app-argon-config/Makefile +++ b/package/ctcgfw/luci-app-argon-config/Makefile @@ -11,6 +11,7 @@ PKG_VERSION:=0.7 PKG_RELEASE:=beta LUCI_TITLE:=LuCI page for Argon Config +LUCI_DEPENDS:=+luci-theme-argonv3 LUCI_PKGARCH:=all include $(TOPDIR)/feeds/luci/luci.mk From 3f4b8ab3d791d0249eee4c133afb33efe9efb8e8 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 12 Sep 2020 19:18:51 +0800 Subject: [PATCH 10/10] luci-app-ssocks: move to services --- package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua | 4 ++-- .../luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua b/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua index b040778d0a..4fc9995c90 100644 --- a/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua +++ b/package/ctcgfw/luci-app-ssocks/luasrc/controller/ssocks.lua @@ -9,10 +9,10 @@ function index() return end local page - page = entry({"admin", "vpn", "ssocks"}, cbi("ssocks"), _("sSocks Server"), 100) + page = entry({"admin", "services", "ssocks"}, cbi("ssocks"), _("sSocks Server"), 100) page.i18n = "ssocks" page.dependent = true - entry({"admin", "vpn", "ssocks", "status"},call("act_status")).leaf=true + entry({"admin", "services", "ssocks", "status"},call("act_status")).leaf=true end function act_status() diff --git a/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm b/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm index 37c7ec8695..6c319de5db 100644 --- a/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm +++ b/package/ctcgfw/luci-app-ssocks/luasrc/view/ssocks/ssocks_status.htm @@ -1,5 +1,5 @@