MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.91k stars 2.67k forks source link

[Bug] DOMAIN-REGEX无法正确匹配域名 #1508

Closed LittleRey closed 2 months ago

LittleRey commented 2 months ago

Verify steps

操作系统

No response

系统版本

hyperos 1.0.3 android 13

Mihomo 版本

mihomo-android-arm64-v8-alpha-e33d4a4

配置文件

mixed-port: 7890
#tproxy-port: 9898
#redir-port: 9797
mode: rule
allow-lan: true
unified-delay: true
bind-address: "*"
log-level: silent
# 日志等级 silent/error/warning/info/debug
ipv6: true

#  TCP keep alive interval
disable-keep-alive: false #目前在android端强制为true
keep-alive-idle: 5
#设置TCP KEEP IDLE选项,值为5秒,代表如果TCP连接上有五秒钟没有任何数据包传输,则启动保活机制,发送TCP Keep-alive机制
keep-alive-interval: 30

ntp:
  enable: true
  write-to-system: false
  server: ntp.aliyun.com
  port: 123
  interval: 1800

geodata-mode: false
# geodata-loader: memconservative

#skip-auth-prefixes: # 设置跳过验证的IP段
#  - 127.0.0.1/8
#  - ::1/128

external-controller: 0.0.0.0:9090 # RESTful API 监听地址
# external-controller-tls: 0.0.0.0:9443 # RESTful API HTTPS 监听地址,需要配置 tls 部分配置文件
secret: ""
external-ui: ./metacubexd-gh-pages
#external-ui-name: MetaCubeXD
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"

#tls:
#  certificate: ./cer/cert.pem # 证书 PEM 格式,或者 证书的路径
#  private-key: ./cer/private.key # 证书对应的私钥 PEM 格式,或者私钥路径

tcp-concurrent: true
geodata-loader: standard
# standard:标准加载器
# memconservative:专为内存受限(小内存)设备优化的加载器(默认值)
enable-process: true
#  find-process-mode has 3 values: always, strict, off
#  - always, 开启,强制匹配所有进程
#  - strict, 默认,由clash判断是否开启
#  - off, 不匹配进程,推荐在路由器上使用此模式
find-process-mode: always

# global-client-fingerprint: chrome
# interface-name: ""
# routing-mark: 233
geox-url:

#full 
  geoip: "https://cors.buildtest.site/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat"
  geosite: "https://cors.buildtest.site/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
  mmdb: "https://cors.buildtest.site/https://github.com/Masaiki/GeoIP2-CN/raw/release/Country.mmdb"

#  mmdb: "https://cors.buildtest.site/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb"
#Geolite2
#  mmdb: "https://cors.buildtest.site/https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb"
geo-auto-update: true # 是否自动更新 geodata
geo-update-interval: 24 # 更新间隔,单位:小时

profile:
  store-selected: true
  # 持久化 fake-ip
  store-fake-ip: true

# 嗅探域名 可选配置
sniffer:
  enable: true
  ## 对 redir-host 类型识别的流量进行强制嗅探
  ## 如:Tun、Redir 和 TProxy 并 DNS 为 redir-host 皆属于
  force-dns-mapping: true
  ## 对所有未获取到域名的流量进行强制嗅探
  parse-pure-ip: false
  # 是否使用嗅探结果作为实际访问,默认 true
  # 全局配置,优先级低于 sniffer.sniff 实际配置
  override-destination: true
  sniff: # TLS 和 QUIC 默认如果不配置 ports 默认嗅探 443
    QUIC:
      ports: [443, 784]
#      ports: [0]
    TLS:
      ports: [443, 8443, 8853]
#      ports: [0]
    # 默认嗅探 80
    HTTP: # 需要嗅探的端口
      ports: [80, 5222, 8080-8880]
#      ports: [0]
      # 可覆盖 sniffer.override-destination
      override-destination: true
  force-domain:
    - +.v2ex.com
  ## 对嗅探结果进行跳过
  # skip-domain:
  #   - Mijia Cloud
  # 需要嗅探协议
  # 已废弃,若 sniffer.sniff 配置则此项无效
  sniffing:
    - tls
    - http
  # 强制对此域名进行嗅探

  # 仅对白名单中的端口进行嗅探,默认为 443,80
  # 已废弃,若 sniffer.sniff 配置则此项无效
  port-whitelist:
    - "80"
    - "443"
    # - 8000-9999

tun:
  enable: false
  stack: system
  # gvisor / lwip / system
  auto-route: true
  auto-detect-interface: true
  dns-hijack:
    - any:53
    - tcp://any:53
#  device: utun
  # mtu: 9000
#  strict-route: true
  # inet4-route-address:
  # - 0.0.0.0/1
  # - 128.0.0.0/1
  # inet6-route-address:
  # - "::/1"
  # - "8000::/1"
#  endpoint-independent-nat: true
  # include-uid:
  # - 0
  # include-uid-range:
  # - 1000-99999
# exclude-uid:
  #- 1000
  # exclude-uid-range:
  # - 1000-99999
  # include-android-user:
  # - 0
  # - 10
  # include-package:
  # - com.android.chrome
  exclude-package: # 排除被路由的 Android 应用包名
    - com.xiaomi.mirror
    - com.tencent.mm
    - com.realtech.xiaocan
    - com.hpbr.bosszhipin
#    - com.ss.android.ugc.aweme
    - com.sdu.didi.psnger
    - com.xiaomi.market
    - org.kde.kdeconnect_tp

hosts:
#   '*.clash.dev': 127.0.0.1
#   '.dev': 127.0.0.1
#   'alpha.clash.dev': '::1'
#MyDomain
#   '+.workers.dev': 162.159.36.1
#   '+.buildtest.site': 162.159.36.1
   'blog.buildtest.site': 162.159.36.1
   'googledrive.buildtest.site': 162.159.36.1
   'node.buildtest.site': 162.159.36.1
   'proxy.buildtest.site': 162.159.36.1
   'cproxy.buildtest.site': 162.159.36.1
#   'zfc.windowsupdate1.com': 162.159.36.5

#   'google.ns.buildtest.site': 162.159.36.1
#   'CloudFlareWarp.ns.buildtest.site': 162.159.36.1
#   'adguard.ns.buildtest.site': 162.159.36.1
#DNS Stamps
#   'dns.alidns.com': 223.5.5.5
#   'dns.tuna.tsinghua.edu.cn': 101.6.6.6
   'anexia-hkg-1.edge.nextdns.io': 37.252.249.233
   'zepto-hkg-1.edge.nextdns.io': 45.11.104.186
   'zepto-tpe-1.edge.nextdns.io': 45.150.242.161
   'zepto-sel-1.edge.nextdns.io': 103.127.124.46

#{"hostname":"zepto-sel-1.edge.nextdns.io","ips":["103.127.124.46"]},

#{"hostname":"zepto-tpe-1.edge.nextdns.io","ips":["45.150.242.161","2407:b9c0:b001:2e8:5054:ff:fe80:b1c3"]},

#{"hostname":"zepto-hkg-1.edge.nextdns.io","ips":["45.11.104.186","2a0b:4341:509:186:5054:ff:fe0e:98d3"]},

#   'www.gov.ua': cfcn.9sep.org
#   'jp.supernike.com': cfcn.9sep.org
#   'jpfree1.supernike.com': cfcn.9sep.org
#   'sgfree4.supernike.com': cfcn.9sep.org

############################################## DNS ##############################################

dns:
  cache-algorithm: arc
  enable: true
  perfer-h3: false
  ipv6: true
  ipv6-timeout: 100
  listen: 0.0.0.0:1053
  use-hosts: true
  enhanced-mode: fake-ip
  # 配置后面的nameserver、fallback和nameserver-policy向dns服务器的连接过程是否遵守遵守rules规则
  # 如果为false(默认值)则这三部分的dns服务器在未特别指定的情况下会直连
  # 如果为true,将会按照rules的规则匹配链接方式(走代理或直连),如果有特别指定则任然以指定值为准
  # 仅当proxy-server-nameserver非空时可以开启此选项, 强烈不建议和prefer-h3一起使用
  # 此外,这三者配置中的dns服务器如果出现域名会采用default-nameserver配置项解析,也请确保正确配置default-nameserver
  respect-rules: false
# fake-ip
# redir-host
###################### fake ip######################
  fake-ip-range: 192.18.0.1/16
  fake-ip-filter: 
    - rule-set:FakeIP-Filter

    - '*.connect.rom.miui.com'
    - '*.miui.com'
    - '*.*.miui.com'
    - '*.*.*.miui.com'
    - '*.lan'
    - '*.local'
    - 'stun.parsec.app'
    - 'stun.*.*.*'
    - 'stun.*.*'
    - 'localhost.ptlogin2.qq.com'
    - '*.msftncsi.com'
    - '*.msftconnecttest.com'
    - 'localhost.*.qq.com'
    - 'localhost.*.weixin.qq.com'
    - '*.weixin.qq.com'
    - '*.*.weixin.qq.com'
    - '*.*.*.weixin.qq.com'
    - '*.wechatpay.cn'
    - '*.*.wechatpay.cn'
    - '*.*.*.wechatpay.cn'
    - '*.wechatpay.com'
    - '*.*.wechatpay.com'
    - '*.*.*.wechatpay.com'
    - '*.pay.wechat.com'
    - '*.*.pay.wechat.com'
    - '*.*.*.pay.wechat.com'

  default-nameserver:
#    - 'dhcp://wlan0'
#    - 'dhcp://ccmni0'
#    - 'dhcp://ccmni1'
#    - 'dhcp://ccmni2'

#CN UDP DNS
    - 'tls://47.122.8.11:853'
    - 'tls://47.103.166.57:853'
#    - system
#Tuna DNS(Filter ?/log ?/Edns)
#    - 'tls://101.6.6.6:8853'
#    - 'https://101.6.6.6:8443/dns-query'
#V6
#    - 'tls://[2402:f000:1:416:101:6:6:6]:8853'
#    - 'https://[2402:f000:1:416:101:6:6:6]:8443/dns-query'

#Adg
#    - 'quic://94.140.14.140:784'
#    - 'tls://94.140.14.140:853'
#    - 'https://94.140.14.140/dns-query'
#    - 'quic://94.140.14.141:784'
#    - 'tls://94.140.14.141:853'
#    - 'https://94.140.14.141/dns-query'
#    - 'quic://[2a10:50c0::1:ff]:784'
#    - 'tls://[2a10:50c0::1:ff]:853'
#    - 'https://[2a10:50c0::1:ff]/dns-query'
#    - 'quic://[2a10:50c0::2:ff]:784'
#    - 'tls://[2a10:50c0::2:ff]:853'
#    - 'https://[2a10:50c0::2:ff]/dns-query'

#Alidns
#

#    - 'tls://223.6.6.6:853'
#    - 'tls://[2400:3200:baba::1]:853'
#    - 'https://223.6.6.6/dns-query'
#    - 'https://[2400:3200:baba::1]/dns-query'
#    - 'tls://223.5.5.5:853'
#    - 'https://223.5.5.5/dns-query'
#    - 'tls://223.6.6.6:853'
#    - 'https://223.6.6.6/dns-query'
#    - 'tls://[2400:3200::1]:853'
#    - 'https://[2400:3200::1]/dns-query'
#    - 'tls://[2400:3200:baba::1]:853'
#    - 'https://[2400:3200:baba::1]/dns-query'

#Tencent
#    - 'tls://120.53.53.53:853'
#    - 'tls://1.12.12.12:853'
#    - 'https://120.53.53.53/dns-query'
#    - 'https://1.12.12.12/dns-query'

#google
#    - 'tls://8.8.8.8:853'
#    - 'https://8.8.8.8/dns-query'
#    - 'tls://8.8.4.4:853'
#    - 'https://8.8.4.4/dns-query'
#    - 'tls://[2001:4860:4860::8844]:853'
#    - 'https://[2001:4860:4860::8844]/dns-query'
#    - 'tls://[2001:4860:4860::8888]:853'
#    - 'https://[2001:4860:4860::8888]/dns-query'

  # 配置查询域名使用的 DNS 服务器

#  proxy-server-nameserver:          
#【Meta专属】解析国外流量服务器域名的dns
# 不写时用nameserver解析
#    - '8.8.8.8'

#Google Doh(No Filter/loging/Anycast/Edns)
#    - 'tls://[2001:4860:4860::8844]:853#国内流量'
#    - 'tls://[2001:4860:4860::8888]:853#国内流量'
#    - 'tls://dns.google:853#国内流量'
#    - 'https://dns.google/dns-query'

#V6
#    - 'tls://[2402:f000:1:416:101:6:6:6]:8853#国内流量'
#    - 'https://[2402:f000:1:416:101:6:6:6]:8443/dns-query#国内流量'

#    - 'https://zepto-sel-1.edge.nextdns.io/dns-query'

##    - 'https://zepto-sel-1.edge.nextdns.io/dns-query#国内流量'

##    - 'https://zepto-tpe-1.edge.nextdns.io/dns-query#国内流量'
##    - 'https://zepto-hkg-1.edge.nextdns.io/dns-query#国内流量'

#    - 'https://1.1.1.1/dns-query#故障自动依序切换'
#    - 'tls://cf.cloudflare-gateway.com:853#国内流量'

#    - 'https://8.8.8.8/dns-query#国外代理'
#    - 'tls://8.8.8.8:853#国内流量'
#    - 'tls://[2001:4860:4860::8888]:853#国内流量'
#    - 'tls://dns64.dns.google:853#国内流量'

#Tuna DNS(Filter ?/log ?/Edns)
#    - 'tls://dns.tuna.tsinghua.edu.cn:853#国内流量'
#    - 'tls://dns.tuna.tsinghua.edu.cn:8853#国内流量'
#    - 'https://dns.tuna.tsinghua.edu.cn:8443/dns-query#国内流量'
#Tuna DNS(Filter ?/log ?/Edns)
#    - 'tls://101.6.6.6:8853#国内流量'
#    - 'https://101.6.6.6:8443/dns-query#国内流量'
#V6
#    - 'tls://[2402:f000:1:416:101:6:6:6]:8853#国内流量'
#    - 'https://[2402:f000:1:416:101:6:6:6]:8443/dns-query'

#    - 'https://8.8.8.8/dns-query#国外代理'

#Adg
#    - 'quic://94.140.14.140:784#国内流量'
#    - 'tls://94.140.14.140:853'
#    - 'https://94.140.14.140/dns-query'
#    - 'quic://94.140.14.141:784'
#    - 'tls://94.140.14.141:853'
#    - 'https://94.140.14.141/dns-query'
#    - 'quic://[2a10:50c0::1:ff]:784#国内流量'
#    - 'tls://[2a10:50c0::1:ff]:853'
#    - 'https://[2a10:50c0::1:ff]/dns-query'
#    - 'quic://[2a10:50c0::2:ff]:784'
#    - 'tls://[2a10:50c0::2:ff]:853'
#    - 'https://[2a10:50c0::2:ff]/dns-query'

#Adguard(No Filter/No log/Anycast)
#    - 'quic://unfiltered.adguard-dns.com:8853'
#    - 'quic://unfiltered.adguard-dns.com:784#国内流量'
#    - 'tls://unfiltered.adguard-dns.com:853'
#    - 'https://unfiltered.adguard-dns.com/dns-query'

#IBM Doh(No Filter/No log/Anycast/Edns)
#    - 'tls://dns-nosec.quad9.net:853'
#    - 'tls://dns10.quad9.net:853'
#    - 'https://dns10.quad9.net:5053/dns-query'
#    - 'https://dns10.quad9.net/dns-query'

  nameserver:

#Apad DNS(Filter ?/log ?/Edns)#分流DNS{TsingHua&Google&CF}
#    - 'tls://edns.apad.pro:853'
#    - 'https://edns.apad.pro:3306/dns-query'
#    - 'tls://h2o.apad.pro:853'
#    - 'https://h2o.apad.pro/dns-query#h3=true'
#    - 'https://doh.apad.pro/dns-query'
#Apad DNS CN
#    - 'https://doh.apad.pro/cn-query'

#Cfiec DNS(Filtering/loging/Warning!)
#    - 'tls://dns.ipv6dns.com:853#国内流量'
#    - 'https://dns.ipv6dns.com/dns-query#国内流量'
#    - 'dhcp://en0'
#    - 'dhcp://wlan0'
#    - 'dhcp://ccmni0'
#    - 'dhcp://ccmni1'
#    - 'dhcp://ccmni2'
# dns from dhcp

#AliDNS(Filtering/loging/Edns/Warning!)
#    - 'udp://47.122.8.11:53'
#    - 'udp://47.103.166.57:53'
#    - 'tls://47.122.8.11:853'
#    - 'tls://47.103.166.57:853'
    - 'https://47.122.8.11/dns-query#h3=true#国内流量'
    - 'https://47.103.166.57/dns-query#h3=true#国内流量'
#    - 'tls://223.6.6.6:853'
#    - 'tls://[2400:3200:baba::1]:853#国内流量'
#    - 'https://[2400:3200::1]/dns-query#国内流量'
#    - 'tls://223.5.5.5:853#国内流量'
#    - 'https://223.5.5.5/dns-query#国内流量'
#    - 'tls://[2400:3200::1]:853#国内流量'
#    - 'https://223.6.6.6/dns-query#国内流量'
#    - 'https://223.5.5.5/dns-query'

#    - 'tls://dns.alidns.com:853#国内流量'
#    - 'https://dns.alidns.com/dns-query#h3=true#国内流量'
#    - 'https://dns.alidns.com/dns-query#国内流量'

#Tencent DnsPod(Filtering/loging/Warning!)
#    - 'tls://dns.pub:853#国内流量'
#    - 'https://dns.pub/dns-query#国内流量'
#    - 'tls://1.12.12.12:853'
#    - 'https://1.12.12.12/dns-query#国内流量'

#    - '223.5.5.5:53'
#    - '119.29.29.29:53'
#    - '223.5.5.5'
#    - '223.6.6.6'
#    - system

#360DNS(Filtering/loging/Warning!)
#    - 'https://doh.360.cn/dns-query'
#    - 'tls://dot.360.cn:853'

#18bit
#    - 'https://doh.18bit.cn/dns-query'

#Moe Dns
#    - 'https://dns.itxe.net/dns-query'
#    - 'tls://dns.itxe.net:853'
#    - 'quic://dns.itxe.net:853'

#Tuna DNS(Filter ?/log ?/Edns)
#    - 'tls://dns.tuna.tsinghua.edu.cn:8853'
#    - 'https://dns.tuna.tsinghua.edu.cn:8443/dns-query'

  fallback: 
#CF&Google UDP DNS
#    - 'tls://1.1.1.1:853'

#    - '8.8.8.8:53'
#    - '1.1.1.1'
#UN-CN Dot NO 853'(Filter ?/log ?)
#    - 'tls://dns.cmrg.net:53053'
#    - 'tls://dns.cmrg.net:443'

#CF
#    - 'tls://162.159.46.1:853'
#    - 'tls://[2606:4700:4700::64]:853#国内流量'
#    - 'tls://[2606:4700:4700::1111]:853#国内流量'
#Adg
#    - 'quic://94.140.14.140:784#国内流量'
#    - 'quic://[2a10:50c0::1:ff]:784#国内流量'    

#common.dot.dns.yandex.net
#    - 'tls://1.1.1.1:853#故障自动依序切换'
    - 'https://1dot1dot1dot1.cloudflare-dns.com/dns-query#h3=true#国内流量'
#    - 'https://[2606:4700:4700::1111]/dns-query#h3=true#国内流量'
    - 'https://162.159.46.1/dns-query#一线-最佳延迟'
    - 'https://162.159.46.1/dns-query#二线-最佳延迟'
    - 'https://162.159.46.1/dns-query#三线-最佳延迟'
#    - 'https://162.159.46.1/dns-query'
#Http3
#    - 'https://1.1.1.1/dns-query#h3=true#国内流量'
#    - 'https://[2606:4700:4700::1111]/dns-query#国内流量'
#    - 'https://[2606:4700:4700::1001]/dns-query#h3=true#国内流量'

#    - 'tls://1.1.1.1:853#国外流量-代理'

#    - 'tls://162.159.36.20:853'
#    - 'https://162.159.36.20/dns-query'

#google
#    - 'tls://dns.google:853#国内流量'
#    - 'tls://dns64.dns.google:853#国内流量'
#    - 'https://dns.google/dns-query'
#    - 'https://dns64.dns.google/dns-query'

#    - 'https://8.8.8.8/dns-query#故障自动依序切换'
#    - 'https://8.8.4.4/dns-query'
#    - 'tls://[2001:4860:4860::8844]:853#国内流量'
#    - 'tls://[2001:4860:4860::8888]:853#国内流量'
#    - 'tls://8.8.8.8:853#国内流量'
#    - 'tls://8.8.4.4:853#国内流量'

#    - 'https://[2001:4860:4860::8844]/dns-query'
#    - 'https://[2001:4860:4860::8888]/dns-query#国外流量'

#Adg
#    - 'quic://94.140.14.140:784#国内流量'
#    - 'tls://94.140.14.140:853'
#    - 'https://94.140.14.140/dns-query'
#    - 'quic://94.140.14.141:784'
#    - 'tls://94.140.14.141:853'
#    - 'https://94.140.14.141/dns-query'
#IPV6
#    - 'quic://[2a10:50c0::1:ff]:784#国内流量'
#    - 'tls://[2a10:50c0::1:ff]:853'
#    - 'https://[2a10:50c0::1:ff]/dns-query'
#    - 'quic://[2a10:50c0::2:ff]:784'
#    - 'tls://[2a10:50c0::2:ff]:853'
#    - 'https://[2a10:50c0::2:ff]/dns-query'

#Adguard(No Filter/No log/Anycast)
#    - 'quic://unfiltered.adguard-dns.com:8853#国内流量'
#    - 'quic://unfiltered.adguard-dns.com:784#国内流量'
#    - 'tls://unfiltered.adguard-dns.com:853'
#    - 'https://unfiltered.adguard-dns.com/dns-query'

#Google Doh(No Filter/loging/Anycast/Edns)
#    - 'tls://dns.google:853'
#    - 'https://dns.google/dns-query'

#CloudFlare Doh(No Filter/No log/Anycast/Edns)
#    - 'tls://1dot1dot1dot1.cloudflare-dns.com:853#故障自动依序切换'
#    - 'https://1.1.1.1/dns-query#故障自动依序切换'

#    - 'https://1dot1dot1dot1.cloudflare-dns.com/dns-query#h3=true#国内流量'
#    - 'tls://dns64.cloudflare-dns.com:853#国内流量'
#    - 'https://dns64.cloudflare-dns.com/dns-query#h3=true#国内流量'
#    - 'https://162.159.36.1/dns-query#国内流量'
#    - 'https://162.159.46.1/dns-query#国内流量'
#    - 'https://[2606:4700:4700::64]/dns-query#国内流量'
#    - 'https://[2606:4700:4700::6400]/dns-query#国内流量'

#CF-Mirror-DNS
#    - 'https://google.cloudflare-dns.com/dns-query'
#    - 'https://119dot29dot29dot29.cloudflare-dns.com/dns-query'
#    - 'https://rubyfish.cn.cloudflare-dns.com/dns-query'

#CF-GateWay
#    - 'tls://162.159.36.20:853#国内流量'
#    - 'tls://[2606:4700:5c::a29f:2e07]:853#国内流量'
#    - 'tls://cf.cloudflare-gateway.com:853#国内流量'
#    - 'https://cf.cloudflare-gateway.com/dns-query'

#Nextdns(No Filter/No log/Anycast)Dual Stack
#    - 'quic://doh3.dns.nextdns.io:853'
#    - 'tls://doh3.dns.nextdns.io:853'
#    - 'https://doh3.dns.nextdns.io/dns-query'

  fallback-filter:
    geoip: true
    geoip-code: CN
    geosite:                         
#    【Meta专属】设定geosite某分类使用fallback返回结果
#     - bytedance
#     - youtube
#     - bilibili
     - gfw
#     - google@cn
#     - cn
#     - geolocation-!cn
#     - tld-opennic
#     - tld-cn
#     - tld-!cn
    ipcidr:
     - 0.0.0.0/8
     - 10.0.0.0/8
     - 100.64.0.0/10
     - 127.0.0.0/8
     - 169.254.0.0/16
     - 172.16.0.0/12
     - 192.0.0.0/24
     - 192.0.2.0/24
     - 192.88.99.0/24
     - 192.168.0.0/16
     - 198.18.0.0/16
     - 198.51.100.0/24
     - 203.0.113.0/24
     - 224.0.0.0/4
     - 240.0.0.0/4
     - 255.255.255.255/32
     - ::1/128
     - fc00::/7
     - fe80::/10
#反诈 拦截
#反诈 拦截
     - 101.35.177.86/32
     - 106.74.25.198/32
     - 111.28.0.32/32
     - 111.31.192.110/32
     - 111.56.127.216/32
     - 111.63.132.170/32
     - 112.54.50.50/32
     - 117.156.25.11/32
     - 120.204.204.201/32
     - 120.209.204.204/32
     - 120.222.19.204/32
     - 182.43.124.6/32
     - 183.203.36.36/32
     - 183.220.145.129/32
     - 183.252.183.9/32
     - 211.137.117.149/32
     - 211.137.54.227/32
     - 211.138.218.190/32
     - 211.139.145.129/32
     - 218.201.25.129/32
     - 218.203.122.98/32
     - 221.130.39.3/32
     - 221.180.160.221/32
     - 221.181.13.25/32
     - 36.135.82.110/32
     - 36.138.129.47/32
     - 39.102.194.95/32
     - 39.130.181.72/32
     - 47.92.198.202/32
#Geoip-CN 污染解析
#     - 116.89.243.8/32
#     - 119.28.87.227/32
#Adg拦截
#     - 94.140.14.35/32
    domain:
     - '+.xincache.com'
#vedio
#     - '+.bilibili.tv'
#     - '+.bilibili.com'
#     - '+.douyin.com'
#     - '+.youtube.com'
#google
#     - 'www.gstatic.com'
#     - '+.ampproject.org'
#     - '+.appspot.com'
#     - '+.blogger.com'
#     - '+.google.com'
#     - '+.google.cn'
#     - '+.googleusercontent.com'
#     - '+.ggpht.com'
#     - '+.gmail.com'
#     - '+.gvt0.com'
#     - '+.gvt1.com'
#     - '+.gvt2.com'
#     - '+.gvt3.com'
#     - '+.youtu.be'
#     - '+.yt.be'
#     - '+.ytimg.com'
#     - '+.googlevideo.com'
#     - '+.xn--ngstr-lra8j.com'
#     - '+.xn--flw351e.com'
#     - '+.xn--9kr7l.com'
#     - '+.xn--ggle-55da.com'
#     - '+.xn--gogl-0nd52e.com'
#     - '+.xn--gogl-1nd42e.com'
#Google 定位
     - '+.googleapis.com'
     - '+.googleapis.cn'
     - '+.gstatic.com'
     - '+.gstatic.cn'
#     - '+.services.googleapis.cn'
#     - '+.services.googleapis.com'
#     - '+.connectivitycheck.gstatic.cn'
#     - '+.connectivitycheck.gstatic.com'

  nameserver-policy:

#    "rule-set:AWAvenue-Ads": rcode://success
    "rule-set:Regex-Ads,Cats-Team-AdRules,AWAvenue-Ads": rcode://success
    "geosite:category-ads-all,bytedance@ads,tracker,category-public-tracker": rcode://success

rule-providers:
  Regex-Ads:
    type: file
    behavior: classical
    path: ./Rule-Providers/Regex-Ads.list
    interval: 3600

(Regex-Ads.list规则集如下)
payload:
   - DOMAIN-REGEX,"*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"*\.[a-zA-Z0-9-]{0,63}skwai\.com$"
   - DOMAIN-REGEX,"*\.a\.market\.xiaomi\.com$"
   - DOMAIN-REGEX,"*\.data\.hicloud\.com$"
   - DOMAIN-REGEX,"*\.log\.aliyuncs\.com$"
   - DOMAIN-REGEX,"*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-ad\-[a-zA-Z0-9-]{0,63}\.byteimg\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-ad\.sm\.cn"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-ad\.video\.yximgs\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-ad\.wtzw\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-be\-pack\-sign\.pglstatp\-toutiao\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-lm\.adkwai\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-normal\-[a-zA-Z0-9-]{0,63}\.zijieapi\.com$"
   - DOMAIN-REGEX,"[a-zA-Z0-9-]{0,63}\-normal\.zijieapi\.com$"
   - DOMAIN-REGEX,"cloudinject[a-zA-Z0-9-]{0,63}\-dev\.[a-zA-Z0-9-]{0,63}\.[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\.amazonaws\.com$"

rule:

 - RULE-SET,Regex-Ads,REJECT
 - RULE-SET,Proxy,国外流量
## block udp/quic YouTube
# - AND,((NETWORK,udp),(DST-PORT,443),),REJECT
 - AND,((NETWORK,udp),(DST-PORT,443),(DOMAIN-SUFFIX,googlevideo.com)),REJECT
# - AND,((NETWORK,udp),(GEOSITE,youtube)),REJECT

# - AND,((DOMAIN-SUFFIX,googlevideo.com),(DOMAIN-KEYWORD,---),(GEOIP,CN)),DIRECT
# - DOMAIN-SUFFIX,googlevideo.com,REJECT

# - AND,((RULE-SET,CN-App),(IP-CIDR6,0::0/32)),REJECT

# - RULE-SET,Android-Game,安卓游戏
# - RULE-SET,BanAD,AD
# - RULE-SET,BanPrivacy,AD
# - RULE-SET,BanProgramAD,AD
# - AND,((NETWORK,TCP),(GEOIP,CN)),TCP百度国内流量
# - GEOSITE,category-games@cn,国内流量
# - GEOSITE,category-companies@cn,国内流量
 - PROCESS-NAME,com.openai.chatgpt,OpenAI
 - GEOSITE,openai,OpenAI
 - RULE-SET,OpenAI,OpenAI
 - RULE-SET,Spotify,OpenAI
 - DOMAIN-SUFFIX,sentry.io,OpenAI
 - DOMAIN-SUFFIX,intercom.io,OpenAI
 - DOMAIN-SUFFIX,featuregates.org,OpenAI
 - DOMAIN-SUFFIX,statsigapi.net,OpenAI
# - RULE-SET,DouYin,OpenAI
# - AND,((RULE-SET,NeteaseMusic),(RULE-SET,NeteaseMusicClient)),网易云音乐
 - RULE-SET,NeteaseMusic,网易云音乐
# - RULE-SET,CN-App,国内流量
# - GEOSITE,gfw,国外流量
# - GEOSITE,geolocation-!cn,国外流量
# - AND,((NOT,((GEOSITE,gfw))),(GEOIP,CN)),国内流量

# - AND,((NOT,((GEOIP,HK))),(NOT,((GEOIP,MO))),(NOT,((GEOIP,TW))),(GEOIP,CN)),国内流量
# - AND,((GEOSITE,cn),(GEOIP,CN)),国内流量
# - GEOSITE,cn,国内流量
 - AND,((NOT,((GEOIP,CN))),(GEOSITE,gfw)),国外流量
 - NOT,((GEOIP,CN)),国外流量

描述

Regex-Ads规则集走REJECT Regex-Ads规则集中 -DOMAIN-REGEX,'[a-zA-Z0-9-]{0,63}-normal-[a-zA-Z0-9-]{0,63}.zijieapi.com$'

无法匹配xxxxx-normal-xxx.zijieapi.com(抖音广告域名), 但是用正则测试网站regex101测试结果是可以匹配的(具体测试截图见下面👇)

例如polaris5-normal-lf.zijieapi.com 访问polaris5-normal-lf.zijieapi.com 无法匹配到规则走REJECT,走直连

重现方式

日志

LittleRey commented 2 months ago

Screenshot_2024-09-13-11-36-34-623_com kiwibrowser browser

xishang0128 commented 2 months ago

去掉引号

LittleRey commented 2 months ago

去掉引号

-DOMAIN-REGEX,'[a-zA-Z0-9-]{0,63}-normal-[a-zA-Z0-9-]{0,63}.zijieapi.com$' 这条规则是一个规则集rule-providers里面的其中一条,

用于匹配polaris5-normal-lf.zijieapi.com, 具体的详细规则集我更新在上方的issue里面的配置文件中 rule-providers部分,

我尝试了在rule-provider中去掉引号,结果依旧无法生效

vernlau commented 2 months ago

这样写 {3BF89A23-91C2-49AB-BC0D-55B286ADA571}

LittleRey commented 2 months ago

这样写 {3BF89A23-91C2-49AB-BC0D-55B286ADA571}

更改后变动的部分配置文件

rule-providers:
  Regex-Ads:
    type: file
    behavior: classical
    path: ./Rule-Providers/Regex-Ads.list
    interval: 3600

Regex-Ads.list规则集如下
payload:
   - DOMAIN-REGEX,"^*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"^*\.[a-zA-Z0-9-]{0,63}skwai\.com$"
   - DOMAIN-REGEX,"^*\.a\.market\.xiaomi\.com$"
   - DOMAIN-REGEX,"^*\.data\.hicloud\.com$"
   - DOMAIN-REGEX,"^*\.log\.aliyuncs\.com$"
   - DOMAIN-REGEX,"^*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\-[a-zA-Z0-9-]{0,63}\.byteimg\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.sm\.cn"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.video\.yximgs\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.wtzw\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-be\-pack\-sign\.pglstatp\-toutiao\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-lm\.adkwai\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-normal\-[a-zA-Z0-9-]{0,63}\.zijieapi\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-normal\.zijieapi\.com$"
   - DOMAIN-REGEX,"^cloudinject[a-zA-Z0-9-]{0,63}\-dev\.[a-zA-Z0-9-]{0,63}\.[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\.amazonaws\.com$"

rule:

 - RULE-SET,Regex-Ads,REJECT

尝试增加^无用 更改后的规则依旧无法匹配polaris5-normal-lf.zijieapi.com 访问polaris5-normal-lf.zijieapi.com不走策略REJECT

Skyxim commented 2 months ago

去掉引号

如果不喜欢看别人回答可以不用发 issue

LittleRey commented 2 months ago

去掉引号

如果不喜欢看别人回答可以不用发 issue

我当然是遇到了问题,想找到解决方式的

vernlau commented 2 months ago

这样写{3BF89A23-91C2-49AB-BC0D​​-55B286ADA571}

更改后续活动的部分配置文件

rule-providers:
  Regex-Ads:
    type: file
    behavior: classical
    path: ./Rule-Providers/Regex-Ads.list
    interval: 3600

Regex-Ads.list规则集如下
payload:
   - DOMAIN-REGEX,"^*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"^*\.[a-zA-Z0-9-]{0,63}skwai\.com$"
   - DOMAIN-REGEX,"^*\.a\.market\.xiaomi\.com$"
   - DOMAIN-REGEX,"^*\.data\.hicloud\.com$"
   - DOMAIN-REGEX,"^*\.log\.aliyuncs\.com$"
   - DOMAIN-REGEX,"^*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\-[a-zA-Z0-9-]{0,63}\.byteimg\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.sm\.cn"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.video\.yximgs\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.wtzw\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-be\-pack\-sign\.pglstatp\-toutiao\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-lm\.adkwai\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-normal\-[a-zA-Z0-9-]{0,63}\.zijieapi\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-normal\.zijieapi\.com$"
   - DOMAIN-REGEX,"^cloudinject[a-zA-Z0-9-]{0,63}\-dev\.[a-zA-Z0-9-]{0,63}\.[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\.amazonaws\.com$"

rule:

 - RULE-SET,Regex-Ads,REJECT

尝试增加^无用 更改后的规则未能匹配polaris5-normal-lf.zijieapi.com 访问polaris5-normal-lf.zijieapi.com不走策略REJECT

规则集和直接写规则,我都测过了,是有效的哦,你的写法不正确 {26FFDCA5-E2F6-4A79-BAB1-280BDB2EDDB6} image

LittleRey commented 2 months ago

这样写{3BF89A23-91C2-49AB-BC0D​​-55B286ADA571}

更改后续活动的部分配置文件

rule-providers:
  Regex-Ads:
    type: file
    behavior: classical
    path: ./Rule-Providers/Regex-Ads.list
    interval: 3600

Regex-Ads.list规则集如下
payload:
   - DOMAIN-REGEX,"^*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"^*\.[a-zA-Z0-9-]{0,63}skwai\.com$"
   - DOMAIN-REGEX,"^*\.a\.market\.xiaomi\.com$"
   - DOMAIN-REGEX,"^*\.data\.hicloud\.com$"
   - DOMAIN-REGEX,"^*\.log\.aliyuncs\.com$"
   - DOMAIN-REGEX,"^*\.shouji\.sogou\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\-[a-zA-Z0-9-]{0,63}\.byteimg\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.sm\.cn"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.video\.yximgs\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-ad\.wtzw\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-be\-pack\-sign\.pglstatp\-toutiao\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-lm\.adkwai\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-normal\-[a-zA-Z0-9-]{0,63}\.zijieapi\.com$"
   - DOMAIN-REGEX,"^[a-zA-Z0-9-]{0,63}\-normal\.zijieapi\.com$"
   - DOMAIN-REGEX,"^cloudinject[a-zA-Z0-9-]{0,63}\-dev\.[a-zA-Z0-9-]{0,63}\.[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\-[a-zA-Z0-9-]{0,63}\.amazonaws\.com$"

rule:

 - RULE-SET,Regex-Ads,REJECT

尝试增加^无用 更改后的规则未能匹配polaris5-normal-lf.zijieapi.com 访问polaris5-normal-lf.zijieapi.com不走策略REJECT

规则集和直接写规则,我都测过了,是有效的哦,你的写法不正确 {26FFDCA5-E2F6-4A79-BAB1-280BDB2EDDB6} image

已测试,规则前加^,末尾加$,去掉引号,可以生效,感谢