From 888975a9c82c017af0bd318a51d1d08f76ef471b Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 18 Feb 2020 17:27:15 +0800 Subject: [PATCH] luci-app-unblockneteasemusic: bump to 2.7-6 --- .../luci-app-unblockneteasemusic/Makefile | 2 +- .../luasrc/model/cbi/unblockneteasemusic.lua | 39 +++++++++---------- .../root/etc/config/unblockneteasemusic | 6 +-- .../root/etc/init.d/unblockneteasemusic | 6 +-- .../root/etc/ppp/ip-up.d/unblockneteasemusic | 5 --- 5 files changed, 26 insertions(+), 32 deletions(-) delete mode 100755 package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/Makefile b/package/ctcgfw/luci-app-unblockneteasemusic/Makefile index 99387d886c..074d39bbd6 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/Makefile +++ b/package/ctcgfw/luci-app-unblockneteasemusic/Makefile @@ -12,7 +12,7 @@ LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +ipset +libope LUCI_PKGARCH:=all PKG_NAME:=luci-app-unblockneteasemusic PKG_VERSION:=2.7 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua b/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua index 115ebbf14e..e4be651c2d 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua +++ b/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua @@ -37,21 +37,6 @@ youtube_key.description = translate("API Key申请地址:https://developers.go youtube_key.datatype = "string" youtube_key:depends("music_source", "youtube") -endpoint_url = s:option(Value, "endpoint_url", translate("EndPoint")) -endpoint_url.description = translate("具体说明参见:https://github.com/nondanee/UnblockNeteaseMusic") -endpoint_url.default = "http://music.163.com" -endpoint_url.placeholder = "http://music.163.com" -endpoint_url.datatype = "string" -endpoint_url.rmempty = false - -hijack = s:option(ListValue, "hijack_ways", translate("劫持方法")) -hijack:value("dont_hijack", translate("不开启劫持")) -hijack:value("use_ipset", translate("使用IPSet劫持")) -hijack:value("use_hosts", translate("使用Hosts劫持")) -hijack.description = translate("如果使用Hosts劫持,程序监听的HTTP/HTTPS端口将被锁定为80/443") -hijack.default = "dont_hijack" -hijack.rmempty = false - auto_update = s:option(Flag, "auto_update", translate("启用自动更新")) auto_update.description = translate("启用后,每天将定时自动检查最新版本并更新") auto_update.default = 0 @@ -65,6 +50,11 @@ update_time.default = "3" update_time.description = translate("设定每天自动检查更新时间") update_time:depends("auto_update", 1) +daemon_enable = s:option(Flag, "daemon_enable", translate("启用进程守护")) +daemon_enable.description = translate("开启后,附属程序会自动检测主程序运行状态,在主程序退出时自动重启") +daemon_enable.default = 0 +daemon_enable.rmempty = false + advanced_mode = s:option(Flag, "advanced_mode", translate("启用进阶设置")) advanced_mode.description = translate("仅推荐高级玩家使用") advanced_mode.default = 0 @@ -84,11 +74,20 @@ https_port.default = "5201" https_port.datatype = "port" https_port:depends("advanced_mode", 1) -daemon_enable = s:option(Flag, "daemon_enable", translate("启用进程守护")) -daemon_enable.description = translate("开启后,附属程序会自动检测主程序运行状态,在主程序退出时自动重启") -daemon_enable.default = 0 -daemon_enable.rmempty = false -daemon_enable:depends("advanced_mode", 1) +endpoint_url = s:option(Value, "endpoint_url", translate("EndPoint")) +endpoint_url.description = translate("具体说明参见:https://github.com/nondanee/UnblockNeteaseMusic") +endpoint_url.default = "http://music.163.com" +endpoint_url.placeholder = "http://music.163.com" +endpoint_url.datatype = "string" +endpoint_url:depends("advanced_mode", 1) + +hijack = s:option(ListValue, "hijack_ways", translate("劫持方法")) +hijack:value("dont_hijack", translate("不开启劫持")) +hijack:value("use_ipset", translate("使用IPSet劫持")) +hijack:value("use_hosts", translate("使用Hosts劫持")) +hijack.description = translate("如果使用Hosts劫持,程序监听的HTTP/HTTPS端口将被锁定为80/443") +hijack.default = "dont_hijack" +hijack:depends("advanced_mode", 1) keep_core_when_upgrade = s:option(Flag, "keep_core_when_upgrade", translate("升级时保留核心程序")) keep_core_when_upgrade.description = translate("默认情况下,在OpenWrt升级后会导致核心程序丢失,开启此选项后会保留当前下载的核心程序") diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic index af64d919db..b34cf906f6 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic @@ -4,14 +4,14 @@ config unblockneteasemusic option music_source 'default' option qq_cookie '' option youtube_key '' - option endpoint_url 'http://music.163.com' - option hijack_ways 'use_ipset' option auto_update '1' option update_time '3' + option daemon_enable '1' option advanced_mode '0' option http_port '5200' option https_port '5201' - option daemon_enable '0' + option endpoint_url 'http://music.163.com' + option hijack_ways 'use_ipset' option keep_core_when_upgrade '0' option pub_access '0' option strict_mode '0' diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic index ad49c034fe..edf106fb8d 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/init.d/unblockneteasemusic @@ -13,8 +13,8 @@ music_source="$(uci get unblockneteasemusic.@unblockneteasemusic[0].music_source qq_cookie="$(uci get unblockneteasemusic.@unblockneteasemusic[0].qq_cookie 2>"/dev/null")" youtube_key="$(uci get unblockneteasemusic.@unblockneteasemusic[0].youtube_key 2>"/dev/null")" -endpoint_url="$(uci get unblockneteasemusic.@unblockneteasemusic[0].endpoint_url)" -hijack_ways="$(uci get unblockneteasemusic.@unblockneteasemusic[0].hijack_ways)" +endpoint_url="$(uci get unblockneteasemusic.@unblockneteasemusic[0].endpoint_url || echo "http://music.163.com")" +hijack_ways="$(uci get unblockneteasemusic.@unblockneteasemusic[0].hijack_ways || echo "use_ipset")" auto_update="$(uci get unblockneteasemusic.@unblockneteasemusic[0].auto_update)" update_time="$(uci get unblockneteasemusic.@unblockneteasemusic[0].update_time)" @@ -51,7 +51,7 @@ ipset=/clientlog3.music.163.com/neteasemusic /etc/init.d/dnsmasq reload > "/dev/null" 2>&1 if ! ipset list "neteasemusic" > "/dev/null"; then ipset create "neteasemusic" hash:ip; fi - curl -s "http://httpdns.n.netease.com/httpdns/v2/d?domain=music.163.com,interface.music.163.com,interface3.music.163.com,apm.music.163.com,apm3.music.163.com,clientlog.music.163.com,clientlog3.music.163.com" |grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' |sort |uniq |awk '{print "ipset add neteasemusic "$1}' |bash > "/dev/null" 2>&1 + curl --retry "5" --retry-delay "3" -s "http://httpdns.n.netease.com/httpdns/v2/d?domain=music.163.com,interface.music.163.com,interface3.music.163.com,apm.music.163.com,apm3.music.163.com,clientlog.music.163.com,clientlog3.music.163.com" |grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' |sort |uniq |awk '{print "ipset add neteasemusic "$1}' |bash > "/dev/null" 2>&1 iptables -t nat -N "netease_cloud_music" iptables -t nat -A "netease_cloud_music" -d "0.0.0.0/8" -j RETURN iptables -t nat -A "netease_cloud_music" -d "10.0.0.0/8" -j RETURN diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic deleted file mode 100755 index f48a3ec715..0000000000 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/ppp/ip-up.d/unblockneteasemusic +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -sleep 10 -if ! ipset list "neteasemusic" > "/dev/null"; then ipset create "neteasemusic" hash:ip; fi -curl -s "http://httpdns.n.netease.com/httpdns/v2/d?domain=music.163.com,interface.music.163.com,interface3.music.163.com,apm.music.163.com,apm3.music.163.com,clientlog.music.163.com,clientlog3.music.163.com" |grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' |sort |uniq |awk '{print "ipset add neteasemusic "$1}' |bash > "/dev/null" 2>&1