From 3bcd5fcdf4605a0e15406e9d506817b8dc3d5cc5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 16 Aug 2026 20:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B6=20Sync=202026-08-16=2020:31:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mosdns/Makefile | 2 +- ...-default-to-domain-match-and-support.patch | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 mosdns/patches/210-feat-adblock_set-default-to-domain-match-and-support.patch diff --git a/mosdns/Makefile b/mosdns/Makefile index 0f6f9752..5083c145 100644 --- a/mosdns/Makefile +++ b/mosdns/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mosdns PKG_VERSION:=5.3.4 -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/IrineSistiana/mosdns/tar.gz/v$(PKG_VERSION)? diff --git a/mosdns/patches/210-feat-adblock_set-default-to-domain-match-and-support.patch b/mosdns/patches/210-feat-adblock_set-default-to-domain-match-and-support.patch new file mode 100644 index 00000000..3325f417 --- /dev/null +++ b/mosdns/patches/210-feat-adblock_set-default-to-domain-match-and-support.patch @@ -0,0 +1,48 @@ +From d72e16dc78d881c537b9216c46f8b3c1572c98d4 Mon Sep 17 00:00:00 2001 +From: sbwml +Date: Sun, 16 Aug 2026 20:06:55 +0800 +Subject: [PATCH] feat(adblock_set): default to domain match and support prefix + '^' for full match + +Signed-off-by: sbwml +--- + plugin/data_provider/adblock_set/adblock_set_test.go | 4 ++++ + plugin/data_provider/adblock_set/parser.go | 9 +++++---- + 2 files changed, 9 insertions(+), 4 deletions(-) + +--- a/plugin/data_provider/adblock_set/adblock_set_test.go ++++ b/plugin/data_provider/adblock_set/adblock_set_test.go +@@ -40,6 +40,7 @@ func TestParseAndMatch(t *testing.T) { + *keyword* + @@*white-keyword* + blocked.com ++^full-blocked.com + domain:ntp.org + full:metrics.icloud.com + 0.0.0.0 singlehotmilf.online +@@ -72,6 +73,9 @@ full:metrics.icloud.com + {"somekeywordhere", true}, + {"some-white-keyword-here", false}, + {"blocked.com", true}, ++ {"sub.blocked.com", true}, // default is now domain:blocked.com ++ {"full-blocked.com", true}, ++ {"sub.full-blocked.com", false}, // ^full-blocked.com is full match + {"other.com", false}, + {"ntp.org", true}, // matched by domain:ntp.org + {"sub.ntp.org", true}, // matched by domain:ntp.org +--- a/plugin/data_provider/adblock_set/parser.go ++++ b/plugin/data_provider/adblock_set/parser.go +@@ -120,8 +120,9 @@ func parseAndAddRule(rule string, m *dom + return m.Add("keyword:"+rule[1:len(rule)-1], struct{}{}) + } + +- // 5. Default: treat as exact match if it looks like a domain +- // Many lists are just a list of domains. +- // AdGuard Home treats rules without || or ^ as exact matches. +- return m.Add("full:"+rule, struct{}{}) ++ // 5. Default: ++ if strings.HasPrefix(rule, "^") { ++ return m.Add("full:"+strings.TrimPrefix(rule, "^"), struct{}{}) ++ } ++ return m.Add("domain:"+rule, struct{}{}) + }