mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 04:23:56 +08:00
🐶 Sync 2026-08-16 20:31:01
This commit is contained in:
1 parent
33f965503c
commit
3bcd5fcdf4
2 files changed
+49
-1
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=mosdns
|
PKG_NAME:=mosdns
|
||||||
PKG_VERSION:=5.3.4
|
PKG_VERSION:=5.3.4
|
||||||
PKG_RELEASE:=13
|
PKG_RELEASE:=14
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/IrineSistiana/mosdns/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/IrineSistiana/mosdns/tar.gz/v$(PKG_VERSION)?
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
From d72e16dc78d881c537b9216c46f8b3c1572c98d4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: sbwml <admin@cooluc.com>
|
||||||
|
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 <admin@cooluc.com>
|
||||||
|
---
|
||||||
|
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{}{})
|
||||||
|
}
|
||||||
Reference in new issue
Block a user