diff --git a/UnblockNeteaseMusic/Makefile b/UnblockNeteaseMusic/Makefile index 5b9ee85e1..0b216d606 100644 --- a/UnblockNeteaseMusic/Makefile +++ b/UnblockNeteaseMusic/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=UnblockNeteaseMusic PKG_BASE_VERSION:=0.27.0-rc.4 -PKG_RELEASE:=77 +PKG_RELEASE:=78 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git PKG_SOURCE_DATE:=2021-12-21 -PKG_SOURCE_VERSION:=535db726923072cfbce1fa976a77e9e8ae560769 +PKG_SOURCE_VERSION:=692ec794a95860aaf68671fcb3a8b5d56af4808e PKG_MIRROR_HASH:=skip PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION)) diff --git a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua index f81e2cad7..62bd284f3 100644 --- a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua +++ b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua @@ -69,4 +69,19 @@ function config.write(self, section, value) nixio.fs.writefile("/etc/mosdns/cus_config.yaml", value) end +config = s:option(TextValue, "whitelist") +config.description = translate("ADblock whitelist.") +config.template = "cbi/tvalue" +config.rows = 25 +config:depends( "configfile", "./def_config.yaml") + +function config.cfgvalue(self, section) + return nixio.fs.readfile("/etc/mosdns/whitelist.txt") +end + +function config.write(self, section, value) + value = value:gsub("\r\n?", "\n") + nixio.fs.writefile("/etc/mosdns/whitelist.txt", value) +end + return m diff --git a/luci-app-mosdns/po/zh-cn/mosdns.po b/luci-app-mosdns/po/zh-cn/mosdns.po index 0db4f7dda..b4623b325 100644 --- a/luci-app-mosdns/po/zh-cn/mosdns.po +++ b/luci-app-mosdns/po/zh-cn/mosdns.po @@ -28,6 +28,9 @@ msgstr "启用 DNS 广告过滤" msgid "View the Custom YAML Configuration file used by this MosDNS. You can edit it as you own need." msgstr "注意!此页的更改仅当 'MosDNS 配置文件选择' 为 '自定义配置' 时才会生效" +msgid "ADblock whitelist." +msgstr "广告过滤白名单" + msgid "Geodata Update" msgstr "数据库更新" diff --git a/luci-app-mosdns/root/etc/mosdns/def_config.yaml b/luci-app-mosdns/root/etc/mosdns/def_config.yaml index 3af87de65..898604ac6 100644 --- a/luci-app-mosdns/root/etc/mosdns/def_config.yaml +++ b/luci-app-mosdns/root/etc/mosdns/def_config.yaml @@ -28,6 +28,7 @@ plugin: - _block_with_nxdomain - _end - if: + - query_is_whitelist_domain - query_is_local_domain - '!_query_is_common' exec: @@ -56,6 +57,11 @@ plugin: - addr: ${{ ./dns0.sh }} - addr: ${{ ./dns1.sh }} + - tag: query_is_whitelist_domain + type: query_matcher + args: + domain: + - 'ext:./whitelist.txt' - tag: forward_remote type: fast_forward diff --git a/luci-app-mosdns/root/etc/mosdns/whitelist.txt b/luci-app-mosdns/root/etc/mosdns/whitelist.txt new file mode 100644 index 000000000..ceb5c2477 --- /dev/null +++ b/luci-app-mosdns/root/etc/mosdns/whitelist.txt @@ -0,0 +1 @@ +example.example \ No newline at end of file