Compare commits

..

3 Commits

Author SHA1 Message Date
MkQtS
6b16be4020 category-social-media-!cn: add some mastodon domains (#3318) 2026-03-02 14:48:30 +08:00
MkQtS
42aafe324e main.go: optimize attr filter (#3317)
[skip ci]
2026-03-02 14:15:40 +08:00
0-Kutya-0
882f48e486 category-ip-geo-detect: add check-host.net (#3316) 2026-03-02 13:53:25 +08:00
3 changed files with 13 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
2ip.ua 2ip.ua
abstractapi.com abstractapi.com
bigdatacloud.net bigdatacloud.net
check-host.net
db-ip.com db-ip.com
extreme-ip-lookup.com extreme-ip-lookup.com
fraudguard.io fraudguard.io

View File

@@ -13,3 +13,12 @@ include:twitter
include:vk include:vk
truthsocial.com truthsocial.com
# Mastodon
# * We can not make a comprehensive domain list of all Mastodon instances.
# * Many more dynamic/random instance domains are not listed here.
# * geosite:mastodon is not provided to avoid creating excessive expectations among users.
joinmastodon.org
mastodon.online
mastodon.social
pawoo.net

View File

@@ -263,9 +263,6 @@ func (p *Processor) loadData(listName string, path string) error {
} }
func isMatchAttrFilters(entry *Entry, incFilter *Inclusion) bool { func isMatchAttrFilters(entry *Entry, incFilter *Inclusion) bool {
if len(incFilter.MustAttrs) == 0 && len(incFilter.BanAttrs) == 0 {
return true
}
if len(entry.Attrs) == 0 { if len(entry.Attrs) == 0 {
return len(incFilter.MustAttrs) == 0 return len(incFilter.MustAttrs) == 0
} }
@@ -352,12 +349,13 @@ func (p *Processor) resolveList(plname string) error {
for _, dentry := range pl.Entries { // Add direct entries for _, dentry := range pl.Entries { // Add direct entries
roughMap[dentry.Plain] = dentry roughMap[dentry.Plain] = dentry
} }
for _, inc := range pl.Inclusions { for _, inc := range pl.Inclusions { // Add included entries
if err := p.resolveList(inc.Source); err != nil { if err := p.resolveList(inc.Source); err != nil {
return fmt.Errorf("failed to resolve inclusion %q: %w", inc.Source, err) return fmt.Errorf("failed to resolve inclusion %q: %w", inc.Source, err)
} }
isFullInc := len(inc.MustAttrs) == 0 && len(inc.BanAttrs) == 0
for _, ientry := range p.finalMap[inc.Source] { for _, ientry := range p.finalMap[inc.Source] {
if isMatchAttrFilters(ientry, inc) { // Add included entries if isFullInc || isMatchAttrFilters(ientry, inc) {
roughMap[ientry.Plain] = ientry roughMap[ientry.Plain] = ientry
} }
} }