Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: service install failure on windows, and lua runner misorder due to mihomo limitation #1866

Merged
merged 12 commits into from
Oct 26, 2024

Conversation

MNDIA
Copy link
Contributor

@MNDIA MNDIA commented Oct 23, 2024

[1]#1862 Fix DNS policy order for mihomo

  1. Just don't touch lua for mihomo core. JS processing can maintain dictionary order.
    This way, at least for now, it works fine when users are not using their own lua for processing.
  2. Preserve todo for lua defects

[2]#1819 Support group hidden display for mihomo

  1. hidden wasn't working.
  2. The hidden decision should be present at all times, so fixed the logic hole

[3]#1864 Fix one-click installation service on windows

  1. wmic utility may be deprecated or not installed in newer versions of Windows

Solved some very critical usage issues, it's time to update a release. Please point out if anything is inappropriate

@MNDIA MNDIA changed the title Fix collection dictionary disorder: Ditch lua's default processing, switch to js Fix mihomo DNS policy order for mihomo, Fix one-click installation service on windows, Support group hidden display for mihomo Oct 23, 2024
@MNDIA MNDIA changed the title Fix mihomo DNS policy order for mihomo, Fix one-click installation service on windows, Support group hidden display for mihomo Fix DNS policy order for mihomo, Fix one-click installation service on windows, Support group hidden display for mihomo Oct 23, 2024
@greenhat616
Copy link
Collaborator

I have experimentally added a resort call in lua runner.

Can you test it whether it works as expected?

Thank you

@greenhat616 greenhat616 changed the title Fix DNS policy order for mihomo, Fix one-click installation service on windows, Support group hidden display for mihomo fix: service install failure on windows, and lua runner misorder due to mihomo limitation Oct 26, 2024
@greenhat616 greenhat616 merged commit 8c53beb into libnyanpasu:main Oct 26, 2024
3 checks passed
@MNDIA
Copy link
Contributor Author

MNDIA commented Oct 28, 2024

I have experimentally added a resort call in lua runner.

Can you test it whether it works as expected?

Thank you

pnpm install
......
pnpm dev:diff
......
Compiling hyper-util v0.1.9
error: failed to run custom build command for `clash-nyanpasu v0.1.0 (F:\GITGITGIT\clash-nyanpasu\backend\tauri)`

Caused by:
  process didn't exit successfully: `F:\GITGITGIT\clash-nyanpasu\backend\target\debug\build\clash-nyanpasu-35bc53a420edfa90\build-script-build` (exit code: 1)
  --- stdout
  cargo:rustc-env=NYANPASU_VERSION=2.0.0
  cargo:rustc-env=COMMIT_HASH=1a10607fdaf8fee2bda61d92a80bb492d8185a40
  cargo:rustc-env=COMMIT_AUTHOR=GitHub
  cargo:rustc-env=COMMIT_DATE=2024-10-26T07:16:01.000Z
  cargo:rustc-env=BUILD_DATE=2024-10-26T09:46:04.951Z
  cargo:rustc-env=BUILD_PROFILE=Debug
  cargo:rustc-env=BUILD_PLATFORM=x86_64-pc-windows-msvc
  cargo:rustc-env=RUSTC_VERSION=rustc 1.84.0-nightly (86d69c705 2024-10-22)
  cargo:rustc-env=LLVM_VERSION=19.1
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rerun-if-changed=tauri.conf.json
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-cfg=desktop
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rerun-if-changed=F:\GITGITGIT\clash-nyanpasu\backend\tauri\tauri.windows.conf.json
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=nyanpasu
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=moe_elaina_clash
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev
  cargo:PERMISSION_FILES_PATH=F:\GITGITGIT\clash-nyanpasu\backend\target\debug\build\clash-nyanpasu-7a1869a0e3f3ca5c\out\app-manifest\__app__-permission-files
  cargo:rerun-if-changed=capabilities
  cargo:rustc-env=TAURI_ENV_TARGET_TRIPLE=x86_64-pc-windows-msvc
  resource path `sidecar\clash-x86_64-pc-windows-msvc.exe` doesn't exist
warning: build failed, waiting for other jobs to finish...

未经处理的异常:  System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
   在 System.Management.Automation.AmsiUtils.AmsiNativeMethods.AmsiScanBuffer(IntPtr amsiContext, IntPtr buffer, UInt32 length, String contentName, IntPtr amsiSession, AMSI_RESULT& result)
......
 ELIFECYCLE  Command failed with exit code 101.
ERROR: "tauri:diff" exited with 101.
 ELIFECYCLE  Command failed with exit code 1.

After re-cloning the repository, my pnpm dev is broken and I don't know why I can't build the dev. Can you help build a pre-release? The test only needs a config file containing the DNS policy, A sample test is as follows @greenhat616

######### 锚点 start #######
TroxyInPort: &TroxyInPort 65535
ShareInPort: &ShareInPort 65534
# TailscaleOutPort: &TailscaleOutPort 65528
ReqableOutPort: &ReqableOutPort 9000
DNSSocket: &DNSSocket 127.0.0.1:65533
UISocket: &UISocket 127.0.0.1:65532
direct_dns: &direct_dns
  - 114.114.114.114#直连DNS
  - https://doh.pub/dns-query#直连DNS
  - https://dns.alidns.com/dns-query#直连DNS
  - system
cn_dns: &cn_dns
  - 114.114.114.114#中国DNS
  - https://doh.pub/dns-query#中国DNS
  - https://dns.alidns.com/dns-query#中国DNS
  - system
international_dns: &international_dns
  - "https://dns.cloudflare.com/dns-query#国际DNS"
  - "https://doh.opendns.com/dns-query#国际DNS"
  - "https://dns.w3ctag.org/dns-query#国际DNS"
  - "https://dns.google/dns-query#国际DNS"
us_dns: &us_dns
  - "https://dns.koala.us.to/dns-query#美国"
  - "https://dns.dns-53.us/dns-query#美国" 
  - "https://cloudflare-dns.com/dns-query#美国"
  - "https://doh.opendns.com/dns-query#美国"
  - "https://dns.google/dns-query#美国"
uk_dns: &uk_dns
  - "https://dns.aa.net.uk/dns-query#英国"
  - "https://princez.uk/dns-query#英国" 
  - "https://dns.dns-53.uk/dns-query#英国"
de_dns: &de_dns
  - "https://doh.ffmuc.net/dns-query#德国"
  - "https://dns.dnshome.de/dns-query#德国"
  - "https://dnsforge.de/dns-query#德国"
  - "https://bahopir188.dnshome.de/dns-query#德国"
  - "https://dns.csa-rz.de/dns-query#德国"
  - "https://dns.datenquark.de/dns-query#德国"
  - "https://doh-de.blahdns.com/dns-query#德国" 
  - "https://dns.telekom.de/dns-query#德国"
  - "https://dns.csaonline.de/dns-query#德国"  
fr_dns: &fr_dns
  - "https://ns0.fdn.fr/dns-query#法国"
  - "https://qlf-doh.inria.fr/dns-query#法国"
  - "https://dns.k3nny.fr/dns-query#法国"
  - "https://doh.ffmuc.net/dns-query#法国" 
jp_dns: &jp_dns
  - "https://public.dns.iij.jp/dns-query#日本"
  - "https://dns.google/dns-query#日本"
hk_dns: &hk_dns
  - "https://dns.cloudflare.com/dns-query#香港"
  - "https://doh.opendns.com/dns-query#香港"
  - "https://dns.w3ctag.org/dns-query#香港"
  - "https://dns.google/dns-query#香港"
mo_dns: &mo_dns
  - "https://dns.cloudflare.com/dns-query#澳门"
  - "https://doh.opendns.com/dns-query#澳门"
  - "https://dns.w3ctag.org/dns-query#澳门"
  - "https://dns.google/dns-query#澳门"
tw_dns: &tw_dns
  - "https://dns.cloudflare.com/dns-query#台湾"
  - "https://doh.opendns.com/dns-query#台湾"
  - "https://dns.w3ctag.org/dns-query#台湾"
  - "https://dns.google/dns-query#台湾"
sg_dns: &sg_dns
  - "https://dns.cloudflare.com/dns-query#新加坡"
  - "https://doh.opendns.com/dns-query#新加坡"
  - "https://dns.w3ctag.org/dns-query#新加坡"
  - "https://dns.google/dns-query#新加坡"
ru_dns: &ru_dns
  - "https://dns.ch295.ru/dns-query#俄国"
  - "https://dns.yandex.com/dns-query#俄国"
  - "https://unfiltered.adguard-dns.com/dns-query#俄国"
in_dns: &in_dns
  - "https://dns.gutwe.in/dns-query#印度"
  - "https://dns.brahma.world/dns-query#印度"
br_dns: &br_dns
  - "https://adguard.frutuozo.com.br/dns-query#巴西"
  - "https://dns.google/dns-query#巴西"
ca_dns: &ca_dns
  - "https://dns1.dnscrypt.ca/dns-query#加拿大"
  - "https://dns.cloudflare.com/dns-query#加拿大"
au_dns: &au_dns
  - "https://dns.netraptor.com.au/dns-query#澳大利亚"
  - "https://dns.quad9.net/dns-query#澳大利亚"
it_dns: &it_dns
  - "https://doh.libredns.gr/dns-query#意大利"
nl_dns: &nl_dns
  - "https://doh.nl.ahadns.net/dns-query#荷兰"
  - "https://dns.melvin2204.nl/dns-query#荷兰"
  - "https://dns.quad9.net/dns-query#荷兰"
se_dns: &se_dns
  - "https://dns.mullvad.net/dns-query#瑞典"
  - "https://resolver.sunet.se/dns-query#瑞典"
  - "https://dns.haka.se/dns-query#瑞典"
ch_dns: &ch_dns
  - "https://dns10.quad9.net/dns-query#瑞士"
  - "https://doh.immerda.ch/dns-query#瑞士"
  - "https://c.cicitt.ch/dns-query#瑞士"
  - "https://dns.digitale-gesellschaft.ch/dns-query#瑞士"
  - "https://doh.li/dns-query#瑞士"


######### 锚点 end #########
######### 说明 start #########
# windows平台配合JS预处理
# ```javascript
# // Clash Nyanpasu JavaScript Template
# // Documentation on https://nyanpasu.elaina.moe/

# /** @type {config} */
# export default function main(config) {
#   // 删除 auto-redirect 属性
#   if (config.tun && config.tun['auto-redirect'] !== undefined) {
#     delete config.tun['auto-redirect'];
#   }
#   return config;
# }
# ```
######### 说明 end #########

Bproxy-provider: &Bproxy-provider {type: http, interval: 3600, health-check: {enable: true, url: "https://www.gstatic.com/generate_204", interval: 300}}
#提供商代理
proxy-providers:
  BINGO:
    <<: *Bproxy-provider
    url: ""

  RunFly:
    <<: *Bproxy-provider
    url: ""


#自代理
proxies:
  - name: 日本无限
    type: socks5
    server: 127.0.0.1
    port: 7891
    username: "somename"
    password: "PASSWD"
    udp: false
    tfo: false
    mptcp: false
  
  - name: 桥接7890
    type: socks5
    server: 127.0.0.1
    port: 7890
    udp: true
    tfo: false
    mptcp: false

  - name: 德国无限
    type: hysteria2
    server: somename
    port: 443
    password: "PASSWD"
    up: "30 Mbps"
    down: "200 Mbps"

  - name: 美国无限
    type: socks5
    server: 127.0.0.1
    port: 7893
    username: "somename"
    password: "PASSWD"
    udp: false

  - name: Reqable
    type: socks5
    server: 127.0.0.1
    port: *ReqableOutPort
    udp: true

listeners:
- name: AllIn-tproxy
  type: tproxy
  port: *TroxyInPort
  listen: 127.0.0.1
  udp: true

tun:
  enable: false
  stack: gvisor
  dns-hijack:
    - "any:53"          # UDP DNS
    - "tcp://any:53"    # TCP DNS
    - "tls://any:853"   # DNS over TLS (DoT)
    - "tcp://any:443"   # DNS over HTTPS (DoH)
    - "quic://any:443"  # DNS over QUIC (DoQ)
  strict-route: true
  auto-route: true
  auto-redirect: true #flag:WindowsDelete
  auto-detect-interface: true
  device: TUNNAME

log-level: warning
keep-alive-interval: 30
ipv6: true

unified-delay: true
tcp-concurrent: true
external-controller: *UISocket
secret: "PASSWD"
geodata-mode: true
geo-auto-update: true
geo-update-interval: 24
geox-url:
  geoip: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat"
  geosite: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
  mmdb: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb"
  asn: "https://github.com/xishang0128/geoip/releases/download/latest/GeoLite2-ASN.mmdb"

find-process-mode: always
global-client-fingerprint: chrome

profile:
  store-selected: true
  store-fake-ip: true

dns:
  enable: true
  listen: *DNSSocket
  ipv6: true
  enhanced-mode: redir-host
  default-nameserver: # proxy-server-nameserver,nameserver-policy,nameserver、fallback域名的解析
    - 223.5.5.5#DNSDNS
    - 114.114.114.114#DNSDNS
    - 8.8.8.8#DNSDNS
    - https://120.53.53.53/dns-query#DNSDNS
    - https://223.5.5.5/dns-query#DNSDNS
    - https://1.12.12.12/dns-query#DNSDNS
    - system

  proxy-server-nameserver: # 节点域名的解析
    - https://120.53.53.53/dns-query#节点直连DNS
    - https://223.5.5.5/dns-query#节点直连DNS
    - https://1.1.1.1/dns-query#节点直连DNS
    - https://dns.google/dns-query#节点直连DNS
    - https://1.1.1.1/dns-query#节点国际DNS
    - https://dns.google/dns-query#节点国际DNS

  prefer-h3: false

  direct-nameserver-follow-policy: false
  direct-nameserver: # [动态回环出口:direct,中国:direct出站]时
    *direct_dns

  respect-rules: true # [中国非direct,其他地区,不出站]时,依据[nameserver-policy,nameserver、fallback]分类,使用不同dns
  nameserver-policy: 
    "rule-set:loopback_classical": *direct_dns #动态回环出口
    "rule-set:firewall_classical": rcode://success #个人文件
    "rule-set:international_classical": *international_dns #个人文件
    "rule-set:domestic_classical": *cn_dns #个人文件
    "rule-set:category-ads-all_classical": rcode://success #广告拦截
    "rule-set:download_domain,bing_domain,openai_domain,github_domain,twitter_domain,instagram_domain,facebook_domain,youtube_domain,netflix_domain,spotify_domain,apple_domain,adobe_domain,telegram_domain,discord_domain,reddit_domain,biliintl_domain,bahamut_domain,ehentai_domain,pixiv_domain,steam_domain,epic_domain,microsoft_domain,google_domain":
      *international_dns
  #中国
    "+.cn": *cn_dns
  #美国
    "+.us": *us_dns
  #英国
    "+.uk": *uk_dns
  #德国
    "+.de,+.eu": *de_dns
  #法国
    "+.fr": *fr_dns
  #日本
    "+.jp,+.nico": *jp_dns
  #香港
    "+.hk": *hk_dns
  #澳门
    "+.mo": *mo_dns
  #台湾
    "+.tw": *tw_dns
  #新加坡
    "+.sg": *sg_dns
  #俄罗斯
    "+.ru": *ru_dns
  #印度
    "+.in": *in_dns
  #巴西
    "+.br": *br_dns
  #加拿大
    "+.ca": *ca_dns
  #澳大利亚
    "+.au": *au_dns
  #意大利
    "+.it": *it_dns
  #荷兰
    "+.nl": *nl_dns
  #瑞典
    "+.se": *se_dns
  #瑞士
    "+.ch": *ch_dns
  #国际
    "rule-set:geolocation-!cn,tld-!cn": *international_dns
    "rule-set:cn_domain,private_domain": *cn_dns
  nameserver: 
    - "https://dns.cloudflare.com/dns-query#国际DNS"
    - "https://doh.opendns.com/dns-query#国际DNS"
    - "https://dns.w3ctag.org/dns-query#国际DNS"
    - "https://dns.google/dns-query#国际DNS"
    - https://doh.pub/dns-query#中国DNS
    - https://dns.alidns.com/dns-query#中国DNS
    - system
 
sniffer:
  enable: true
  force-dns-mapping: true
  parse-pure-ip: true
  override-destination: true
  sniff:
    HTTP:
      ports: [80, 8080-8880]
      override-destination: true
    TLS:
      ports: [443, 8443]
    QUIC:
      ports: [443, 8443]
  force-domain:
    - +.v2ex.com
  skip-domain:
    - "+.push.apple.com"

Bproxy-group : &Bproxy-group {type: select, proxies: [无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区,REJECT,REJECT-DROP]}
proxy-groups:
- {name: 入站桥接 , proxies: [PASS,Reqable,桥接7890,无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区,REJECT,REJECT-DROP], <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Drill.png"}

# 动态分组
- {name: Google, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Google_Search.png"}
- {name: Apple, <<: *Bproxy-group, icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Apple.png}
- {name: Telegram, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Telegram.png"}
- {name: Discord, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Game.png"}
- {name: Reddit, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Game.png"}
- {name: Twitter, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Twitter.png"}
- {name: Instagram, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Instagram.png"}
- {name: Facebook, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Facebook.png"}
- {name: ehentai, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Panda.png"}
- {name: 哔哩哔哩, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/bilibili.png"}
- {name: 哔哩东南亚, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/bilibili.png"}
- {name: 巴哈姆特, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Bahamut.png"}
- {name: YouTube, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/YouTube.png"}
- {name: NETFLIX, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Netflix.png"}
- {name: Spotify, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Spotify.png"}
- {name: Github, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Cat.png"}
- {name: Pixiv, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Peacock_P.png"}
- {name: 微软, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Microsoft.png"}
- {name: Bing, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/BosLife_1.png"}
- {name: Steam, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Siri.png"}
- {name: Adobe, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Magic.png"}
- {name: Epic, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Game.png"}
- {name: OpenAI, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/CrossWall.png"}
- {name: 广告拦截, type: select, proxies: [DIRECT,国际,REJECT,REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Advertising.png"}
- {name: 防火墙, type: select, proxies: [DIRECT,国际,REJECT,REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Advertising.png"}
- {name: 动态回环出口, type: select, proxies: [DIRECT,REJECT,REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Bypass.png"}
# - {name: 未分组, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Available.png"}
- {name: 测试:保留功能, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Available.png"}

- {name: -------------------------分界线,  type: select, proxies: [REJECT-DROP]}

  ##分隔,下面是静态分组: 地理位置和节点功能永远固定
- {name: 国际, type: select, proxies: [无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Proxy.png"}
  # 互相独立分组[无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区]
- {name: 无限, type: select, include-all: true, filter: "(?i)无限|infinite", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Final.png"}
- {name: 中国, type: select, include-all: true, filter: "(?i)cn|china|中国|大陆|内地|北京|天津|河北|山西|内蒙古|辽宁|吉林|黑龙江|上海|江苏|浙江|安徽|福建|江西|山东|河南|湖北|湖南|广东|广西|海南|重庆|四川|贵州|云南|西藏|陕西|甘肃|青海|宁夏|新疆", proxies: [DIRECT,REJECT-DROP,香港,澳门,台湾], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/China_Map.png"}
- {name: 美国, type: select, include-all: true, filter: "(?i)美|us|unitedstates|united states", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/US.png"}
- {name: 英国, type: select, include-all: true, filter: "(?i)英|uk|unitedkingdom|united kingdom", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/UK.png"}
- {name: 德国, type: select, include-all: true, filter: "(?i)德|de|germany", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/DE.png"}
- {name: 法国, type: select, include-all: true, filter: "(?i)法|fr|france", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/FR.png"}
- {name: 日本, type: select, include-all: true, filter: "(?i)日|jp|japan", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/JP.png"}
- {name: 香港, type: select, include-all: true, filter: "(?i)港|hk|hongkong|hong kong", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/HK.png"}
- {name: 澳门, type: select, include-all: true, filter: "(?i)澳门|mo", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/MO.png"}
- {name: 台湾, type: select, include-all: true, filter: "(?i)台|tw|taiwan", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/TW.png"}
- {name: 新加坡, type: select, include-all: true, filter: "(?i)(新|sg|singapore)", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/SG.png"}
- {name: 俄罗斯, type: select, include-all: true, filter: "(?i)俄|ru|russia", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/RU.png"}
- {name: 印度, type: select, include-all: true, filter: "(?i)印|in|india", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/IN.png"}
- {name: 巴西, type: select, include-all: true, filter: "(?i)巴西|br|brazil", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/BR.png"}
- {name: 加拿大, type: select, include-all: true, filter: "(?i)加拿大|ca|canada", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/CA.png"}
- {name: 澳大利亚, type: select, include-all: true, filter: "(?i)澳大|au|australia", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/AU.png"}
- {name: 意大利, type: select, include-all: true, filter: "(?i)意|it|italy", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/IT.png"}
- {name: 荷兰, type: select, include-all: true, filter: "(?i)荷|nl|netherlands", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/NL.png"}
- {name: 瑞典, type: select, include-all: true, filter: "(?i)瑞典|se|sweden", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/SE.png"}
- {name: 瑞士, type: select, include-all: true, filter: "(?i)瑞士|ch|switzerland", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/CH.png"}
- {name: 其它地区, type: select, include-all: true, filter: "(?i)^(?!.*(?:cn|china|中国|大陆|内地|北京|天津|河北|山西|内蒙古|辽宁|吉林|黑龙江|上海|江苏|浙江|安徽|福建|江西|山东|河南|湖北|湖南|广东|广西|海南|重庆|四川|贵州|云南|西藏|陕西|甘肃|青海|宁夏|新疆|无限|infinite|美|us|unitedstates|united states|英|uk|unitedkingdom|united kingdom|德|de|germany|法|fr|france|日|jp|japan|港|hk|hongkong|hong kong|台|tw|taiwan|新|sg|singapore|俄|ru|russia|印|in|india|巴西|br|brazil|加拿大|ca|canada|澳大|au|australia|意|it|italy|荷|nl|netherlands|瑞典|se|sweden|瑞士|ch|switzerland)).*", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Available.png"}

- {name: UDP捡漏,type: select, include-all: true,proxies: [DIRECT]}
- {name: 中国DNS,type: select, include-all: true,proxies: [DIRECT]}
- {name: 国际DNS,type: select, include-all: true,proxies: [DIRECT]}

- {name: DNSDNS,type: select, proxies: [DIRECT], hidden: true}
- {name: 直连DNS,type: select, proxies: [DIRECT], hidden: true}
- {name: 节点直连DNS,type: select, proxies: [DIRECT], hidden: true}
- {name: 节点国际DNS,type: select, proxies: [国际DNS], hidden: true}


rules:
- RULE-SET,loopback_classical,动态回环出口 ##个人文件
- RULE-SET,private_ip,DIRECT,no-resolve   #静态回环出口
- MATCH,入站桥接
# - IN-NAME,AllIn-tproxy,入站桥接
# - IN-TYPE,Tun,入站桥接
- RULE-SET,test_classical,测试:保留功能   ##个人文件
- RULE-SET,firewall_classical,防火墙      ##个人文件
- RULE-SET,international_classical,国际   ##个人文件
- RULE-SET,domestic_classical,中国        ##个人文件

- RULE-SET,category-ads-all_classical,广告拦截
- RULE-SET,download_domain,国际
- RULE-SET,bing_domain,Bing
- DOMAIN-SUFFIX,microsoftonline.com,Bing
- DOMAIN-SUFFIX,events.data.microsoft.com,Bing
- RULE-SET,openai_domain,OpenAI
- RULE-SET,github_domain,Github
- RULE-SET,twitter_domain,Twitter
- RULE-SET,instagram_domain,Instagram
- RULE-SET,facebook_domain,Facebook
- RULE-SET,youtube_domain,YouTube
- RULE-SET,netflix_domain,NETFLIX
- RULE-SET,spotify_domain,Spotify
- RULE-SET,apple_domain,Apple
- RULE-SET,adobe_domain,Adobe
- RULE-SET,telegram_domain,Telegram
- RULE-SET,discord_domain,Discord
- RULE-SET,reddit_domain,Reddit
- RULE-SET,biliintl_domain,哔哩东南亚
- RULE-SET,bilibili_domain,哔哩哔哩
- RULE-SET,bahamut_domain,巴哈姆特
- RULE-SET,ehentai_domain,ehentai
- RULE-SET,pixiv_domain,Pixiv
- RULE-SET,steam_domain,Steam
- RULE-SET,epic_domain,Epic
- RULE-SET,microsoft_domain,微软
- RULE-SET,google_domain,Google
- RULE-SET,google_ip,Google
- RULE-SET,netflix_ip,NETFLIX
- RULE-SET,telegram_ip,Telegram
- RULE-SET,twitter_ip,Twitter


- DOMAIN-SUFFIX,.us,美国
- DOMAIN-SUFFIX,.uk,英国
- DOMAIN-SUFFIX,.de,德国
- DOMAIN-SUFFIX,.fr,法国
- DOMAIN-SUFFIX,.jp,日本
- DOMAIN-SUFFIX,.nico,日本
- DOMAIN-SUFFIX,.ru,俄罗斯
- DOMAIN-SUFFIX,.in,印度
- DOMAIN-SUFFIX,.br,巴西
- DOMAIN-SUFFIX,.ca,加拿大
- DOMAIN-SUFFIX,.au,澳大利亚
- DOMAIN-SUFFIX,.it,意大利
- DOMAIN-SUFFIX,.nl,荷兰
- DOMAIN-SUFFIX,.se,瑞典
- DOMAIN-SUFFIX,.ch,瑞士
- DOMAIN-SUFFIX,.eu,德国
- DOMAIN-SUFFIX,.hk,香港
- DOMAIN-SUFFIX,.mo,澳门
- DOMAIN-SUFFIX,.tw,台湾
- DOMAIN-SUFFIX,.sg,新加坡
- DOMAIN-SUFFIX,.org,国际
- DOMAIN-SUFFIX,.io,国际
- DOMAIN-SUFFIX,.dev,国际
- DOMAIN-SUFFIX,.cn,中国
- RULE-SET,geolocation-!cn,国际
- RULE-SET,cn_domain,中国



- RULE-SET,cn_ip,中国
# - DOMAIN-KEYWORD,-cn,中国
- MATCH,国际
- MATCH,UDP捡漏

rule-anchor:
  ip: &ip {type: http, interval: 86400, behavior: ipcidr, format: text, proxy: 国际}
  domain: &domain {type: http, interval: 86400, behavior: domain, format: text, proxy: 国际}
  classical: &classical {type: http, interval: 86400, behavior: classical, format: text, proxy: 国际}
rule-providers:
  loopback_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/loopback_classical.list"
  test_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/test_classical.list"
  firewall_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/firewall_classical.list"
  international_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/international_classical.list"
  domestic_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/domestic_classical.list"


  category-ads-all_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/classical/category-ads-all.list"

  private_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/private.list"
  cn_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.list"
  biliintl_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/biliintl.list"
  ehentai_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/ehentai.list"
  github_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/github.list"
  twitter_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/twitter.list"
  instagram_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/instagram.list"
  facebook_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/facebook.list"
  youtube_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/youtube.list"
  google_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/google.list"
  apple_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/apple.list"
  adobe_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/adobe.list"
  telegram_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/telegram.list"
  discord_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/discord.list"
  reddit_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/reddit.list"
  netflix_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/netflix.list"
  bilibili_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bilibili.list"
  bahamut_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bahamut.list"
  spotify_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/spotify.list"
  pixiv_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/pixiv.list"
  microsoft_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/microsoft.list"
  bing_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bing.list"
  steam_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/steam.list"
  epic_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/epicgames.list"
  openai_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/openai.list"
  download_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/category-android-app-download.list"
  geolocation-!cn:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/geolocation-!cn.list"
  tld-!cn:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/tld-!cn.list"

  private_ip:
   <<: *ip
   url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/private.list"
  cn_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/cn.list"
  google_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/google.list"
  netflix_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/netflix.list"
  twitter_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/twitter.list"
  telegram_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/telegram.list"
  hk_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/hk.list"
  mo_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/mo.list"
  tw_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/tw.list"
  sg_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/sg.list"
  jp_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/jp.list"
  ru_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/ru.list"
  us_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/us.list"
  de_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/de.list"
  fr_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/fr.list"
  in_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/in.list"
  br_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/br.list"
  ca_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/ca.list"
  au_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/au.list"
  it_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/it.list"
  nl_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/nl.list"
  se_ip: 
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/se.list"
  ch_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/ch.list"


ntp:
  enable: false
  write-to-system: true
  server: time.apple.com
  port: PASSWD
  interval: 43200

external-ui: "/ui"
external-ui-name: xd
external-ui-url: "https://github.com/MetaCubeX/metacubexd/releases/latest/download/compressed-dist.tgz"

allow-lan: false
mixed-port: *ShareInPort
bind-address: "*" # 绑定地址,仅允许其他设备通过这个地址访问"*" 绑定所有 IP 地址192.168.31.31 绑定单个 IPV4 地址 [aaaa::a8aa:ff:fe09:57d8] 绑定单个 IPV6 地址
# lan-allowed-ips: # 允许连接的IP地址段,仅作用于 allow-lan 为 true 默认值为 0.0.0.0/0和 ::/0
# - 0.0.0.0/0
# - ::/0
# lan-disallowed-ips: # 禁止连接的IP地址段,黑名单优先级高于白名单,默认值为空
authentication: # http(s)/socks/mixed代理的用户验证
  - "somename:PASSWD"
# skip-auth-prefixes: # 设置允许跳过验证的IP段
#   - 127.0.0.1/8
#   - ::1/128

@greenhat616
Copy link
Collaborator

I have experimentally added a resort call in lua runner.
Can you test it whether it works as expected?
Thank you

pnpm install
......
pnpm dev:diff
......
Compiling hyper-util v0.1.9
error: failed to run custom build command for `clash-nyanpasu v0.1.0 (F:\GITGITGIT\clash-nyanpasu\backend\tauri)`

Caused by:
  process didn't exit successfully: `F:\GITGITGIT\clash-nyanpasu\backend\target\debug\build\clash-nyanpasu-35bc53a420edfa90\build-script-build` (exit code: 1)
  --- stdout
  cargo:rustc-env=NYANPASU_VERSION=2.0.0
  cargo:rustc-env=COMMIT_HASH=1a10607fdaf8fee2bda61d92a80bb492d8185a40
  cargo:rustc-env=COMMIT_AUTHOR=GitHub
  cargo:rustc-env=COMMIT_DATE=2024-10-26T07:16:01.000Z
  cargo:rustc-env=BUILD_DATE=2024-10-26T09:46:04.951Z
  cargo:rustc-env=BUILD_PROFILE=Debug
  cargo:rustc-env=BUILD_PLATFORM=x86_64-pc-windows-msvc
  cargo:rustc-env=RUSTC_VERSION=rustc 1.84.0-nightly (86d69c705 2024-10-22)
  cargo:rustc-env=LLVM_VERSION=19.1
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rerun-if-changed=tauri.conf.json
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-cfg=desktop
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rerun-if-changed=F:\GITGITGIT\clash-nyanpasu\backend\tauri\tauri.windows.conf.json
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=nyanpasu
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=moe_elaina_clash
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev
  cargo:PERMISSION_FILES_PATH=F:\GITGITGIT\clash-nyanpasu\backend\target\debug\build\clash-nyanpasu-7a1869a0e3f3ca5c\out\app-manifest\__app__-permission-files
  cargo:rerun-if-changed=capabilities
  cargo:rustc-env=TAURI_ENV_TARGET_TRIPLE=x86_64-pc-windows-msvc
  resource path `sidecar\clash-x86_64-pc-windows-msvc.exe` doesn't exist
warning: build failed, waiting for other jobs to finish...

未经处理的异常:  System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
   在 System.Management.Automation.AmsiUtils.AmsiNativeMethods.AmsiScanBuffer(IntPtr amsiContext, IntPtr buffer, UInt32 length, String contentName, IntPtr amsiSession, AMSI_RESULT& result)
......
 ELIFECYCLE  Command failed with exit code 101.
ERROR: "tauri:diff" exited with 101.
 ELIFECYCLE  Command failed with exit code 1.

After re-cloning the repository, my pnpm dev is broken and I don't know why I can't build the dev. Can you help build a pre-release? The test only needs a config file containing the DNS policy, A sample test is as follows @greenhat616

######### 锚点 start #######
TroxyInPort: &TroxyInPort 65535
ShareInPort: &ShareInPort 65534
# TailscaleOutPort: &TailscaleOutPort 65528
ReqableOutPort: &ReqableOutPort 9000
DNSSocket: &DNSSocket 127.0.0.1:65533
UISocket: &UISocket 127.0.0.1:65532
direct_dns: &direct_dns
  - 114.114.114.114#直连DNS
  - https://doh.pub/dns-query#直连DNS
  - https://dns.alidns.com/dns-query#直连DNS
  - system
cn_dns: &cn_dns
  - 114.114.114.114#中国DNS
  - https://doh.pub/dns-query#中国DNS
  - https://dns.alidns.com/dns-query#中国DNS
  - system
international_dns: &international_dns
  - "https://dns.cloudflare.com/dns-query#国际DNS"
  - "https://doh.opendns.com/dns-query#国际DNS"
  - "https://dns.w3ctag.org/dns-query#国际DNS"
  - "https://dns.google/dns-query#国际DNS"
us_dns: &us_dns
  - "https://dns.koala.us.to/dns-query#美国"
  - "https://dns.dns-53.us/dns-query#美国" 
  - "https://cloudflare-dns.com/dns-query#美国"
  - "https://doh.opendns.com/dns-query#美国"
  - "https://dns.google/dns-query#美国"
uk_dns: &uk_dns
  - "https://dns.aa.net.uk/dns-query#英国"
  - "https://princez.uk/dns-query#英国" 
  - "https://dns.dns-53.uk/dns-query#英国"
de_dns: &de_dns
  - "https://doh.ffmuc.net/dns-query#德国"
  - "https://dns.dnshome.de/dns-query#德国"
  - "https://dnsforge.de/dns-query#德国"
  - "https://bahopir188.dnshome.de/dns-query#德国"
  - "https://dns.csa-rz.de/dns-query#德国"
  - "https://dns.datenquark.de/dns-query#德国"
  - "https://doh-de.blahdns.com/dns-query#德国" 
  - "https://dns.telekom.de/dns-query#德国"
  - "https://dns.csaonline.de/dns-query#德国"  
fr_dns: &fr_dns
  - "https://ns0.fdn.fr/dns-query#法国"
  - "https://qlf-doh.inria.fr/dns-query#法国"
  - "https://dns.k3nny.fr/dns-query#法国"
  - "https://doh.ffmuc.net/dns-query#法国" 
jp_dns: &jp_dns
  - "https://public.dns.iij.jp/dns-query#日本"
  - "https://dns.google/dns-query#日本"
hk_dns: &hk_dns
  - "https://dns.cloudflare.com/dns-query#香港"
  - "https://doh.opendns.com/dns-query#香港"
  - "https://dns.w3ctag.org/dns-query#香港"
  - "https://dns.google/dns-query#香港"
mo_dns: &mo_dns
  - "https://dns.cloudflare.com/dns-query#澳门"
  - "https://doh.opendns.com/dns-query#澳门"
  - "https://dns.w3ctag.org/dns-query#澳门"
  - "https://dns.google/dns-query#澳门"
tw_dns: &tw_dns
  - "https://dns.cloudflare.com/dns-query#台湾"
  - "https://doh.opendns.com/dns-query#台湾"
  - "https://dns.w3ctag.org/dns-query#台湾"
  - "https://dns.google/dns-query#台湾"
sg_dns: &sg_dns
  - "https://dns.cloudflare.com/dns-query#新加坡"
  - "https://doh.opendns.com/dns-query#新加坡"
  - "https://dns.w3ctag.org/dns-query#新加坡"
  - "https://dns.google/dns-query#新加坡"
ru_dns: &ru_dns
  - "https://dns.ch295.ru/dns-query#俄国"
  - "https://dns.yandex.com/dns-query#俄国"
  - "https://unfiltered.adguard-dns.com/dns-query#俄国"
in_dns: &in_dns
  - "https://dns.gutwe.in/dns-query#印度"
  - "https://dns.brahma.world/dns-query#印度"
br_dns: &br_dns
  - "https://adguard.frutuozo.com.br/dns-query#巴西"
  - "https://dns.google/dns-query#巴西"
ca_dns: &ca_dns
  - "https://dns1.dnscrypt.ca/dns-query#加拿大"
  - "https://dns.cloudflare.com/dns-query#加拿大"
au_dns: &au_dns
  - "https://dns.netraptor.com.au/dns-query#澳大利亚"
  - "https://dns.quad9.net/dns-query#澳大利亚"
it_dns: &it_dns
  - "https://doh.libredns.gr/dns-query#意大利"
nl_dns: &nl_dns
  - "https://doh.nl.ahadns.net/dns-query#荷兰"
  - "https://dns.melvin2204.nl/dns-query#荷兰"
  - "https://dns.quad9.net/dns-query#荷兰"
se_dns: &se_dns
  - "https://dns.mullvad.net/dns-query#瑞典"
  - "https://resolver.sunet.se/dns-query#瑞典"
  - "https://dns.haka.se/dns-query#瑞典"
ch_dns: &ch_dns
  - "https://dns10.quad9.net/dns-query#瑞士"
  - "https://doh.immerda.ch/dns-query#瑞士"
  - "https://c.cicitt.ch/dns-query#瑞士"
  - "https://dns.digitale-gesellschaft.ch/dns-query#瑞士"
  - "https://doh.li/dns-query#瑞士"


######### 锚点 end #########
######### 说明 start #########
# windows平台配合JS预处理
# ```javascript
# // Clash Nyanpasu JavaScript Template
# // Documentation on https://nyanpasu.elaina.moe/

# /** @type {config} */
# export default function main(config) {
#   // 删除 auto-redirect 属性
#   if (config.tun && config.tun['auto-redirect'] !== undefined) {
#     delete config.tun['auto-redirect'];
#   }
#   return config;
# }
# ```
######### 说明 end #########

Bproxy-provider: &Bproxy-provider {type: http, interval: 3600, health-check: {enable: true, url: "https://www.gstatic.com/generate_204", interval: 300}}
#提供商代理
proxy-providers:
  BINGO:
    <<: *Bproxy-provider
    url: ""

  RunFly:
    <<: *Bproxy-provider
    url: ""


#自代理
proxies:
  - name: 日本无限
    type: socks5
    server: 127.0.0.1
    port: 7891
    username: "somename"
    password: "PASSWD"
    udp: false
    tfo: false
    mptcp: false
  
  - name: 桥接7890
    type: socks5
    server: 127.0.0.1
    port: 7890
    udp: true
    tfo: false
    mptcp: false

  - name: 德国无限
    type: hysteria2
    server: somename
    port: 443
    password: "PASSWD"
    up: "30 Mbps"
    down: "200 Mbps"

  - name: 美国无限
    type: socks5
    server: 127.0.0.1
    port: 7893
    username: "somename"
    password: "PASSWD"
    udp: false

  - name: Reqable
    type: socks5
    server: 127.0.0.1
    port: *ReqableOutPort
    udp: true

listeners:
- name: AllIn-tproxy
  type: tproxy
  port: *TroxyInPort
  listen: 127.0.0.1
  udp: true

tun:
  enable: false
  stack: gvisor
  dns-hijack:
    - "any:53"          # UDP DNS
    - "tcp://any:53"    # TCP DNS
    - "tls://any:853"   # DNS over TLS (DoT)
    - "tcp://any:443"   # DNS over HTTPS (DoH)
    - "quic://any:443"  # DNS over QUIC (DoQ)
  strict-route: true
  auto-route: true
  auto-redirect: true #flag:WindowsDelete
  auto-detect-interface: true
  device: TUNNAME

log-level: warning
keep-alive-interval: 30
ipv6: true

unified-delay: true
tcp-concurrent: true
external-controller: *UISocket
secret: "PASSWD"
geodata-mode: true
geo-auto-update: true
geo-update-interval: 24
geox-url:
  geoip: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat"
  geosite: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
  mmdb: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb"
  asn: "https://github.com/xishang0128/geoip/releases/download/latest/GeoLite2-ASN.mmdb"

find-process-mode: always
global-client-fingerprint: chrome

profile:
  store-selected: true
  store-fake-ip: true

dns:
  enable: true
  listen: *DNSSocket
  ipv6: true
  enhanced-mode: redir-host
  default-nameserver: # proxy-server-nameserver,nameserver-policy,nameserver、fallback域名的解析
    - 223.5.5.5#DNSDNS
    - 114.114.114.114#DNSDNS
    - 8.8.8.8#DNSDNS
    - https://120.53.53.53/dns-query#DNSDNS
    - https://223.5.5.5/dns-query#DNSDNS
    - https://1.12.12.12/dns-query#DNSDNS
    - system

  proxy-server-nameserver: # 节点域名的解析
    - https://120.53.53.53/dns-query#节点直连DNS
    - https://223.5.5.5/dns-query#节点直连DNS
    - https://1.1.1.1/dns-query#节点直连DNS
    - https://dns.google/dns-query#节点直连DNS
    - https://1.1.1.1/dns-query#节点国际DNS
    - https://dns.google/dns-query#节点国际DNS

  prefer-h3: false

  direct-nameserver-follow-policy: false
  direct-nameserver: # [动态回环出口:direct,中国:direct出站]时
    *direct_dns

  respect-rules: true # [中国非direct,其他地区,不出站]时,依据[nameserver-policy,nameserver、fallback]分类,使用不同dns
  nameserver-policy: 
    "rule-set:loopback_classical": *direct_dns #动态回环出口
    "rule-set:firewall_classical": rcode://success #个人文件
    "rule-set:international_classical": *international_dns #个人文件
    "rule-set:domestic_classical": *cn_dns #个人文件
    "rule-set:category-ads-all_classical": rcode://success #广告拦截
    "rule-set:download_domain,bing_domain,openai_domain,github_domain,twitter_domain,instagram_domain,facebook_domain,youtube_domain,netflix_domain,spotify_domain,apple_domain,adobe_domain,telegram_domain,discord_domain,reddit_domain,biliintl_domain,bahamut_domain,ehentai_domain,pixiv_domain,steam_domain,epic_domain,microsoft_domain,google_domain":
      *international_dns
  #中国
    "+.cn": *cn_dns
  #美国
    "+.us": *us_dns
  #英国
    "+.uk": *uk_dns
  #德国
    "+.de,+.eu": *de_dns
  #法国
    "+.fr": *fr_dns
  #日本
    "+.jp,+.nico": *jp_dns
  #香港
    "+.hk": *hk_dns
  #澳门
    "+.mo": *mo_dns
  #台湾
    "+.tw": *tw_dns
  #新加坡
    "+.sg": *sg_dns
  #俄罗斯
    "+.ru": *ru_dns
  #印度
    "+.in": *in_dns
  #巴西
    "+.br": *br_dns
  #加拿大
    "+.ca": *ca_dns
  #澳大利亚
    "+.au": *au_dns
  #意大利
    "+.it": *it_dns
  #荷兰
    "+.nl": *nl_dns
  #瑞典
    "+.se": *se_dns
  #瑞士
    "+.ch": *ch_dns
  #国际
    "rule-set:geolocation-!cn,tld-!cn": *international_dns
    "rule-set:cn_domain,private_domain": *cn_dns
  nameserver: 
    - "https://dns.cloudflare.com/dns-query#国际DNS"
    - "https://doh.opendns.com/dns-query#国际DNS"
    - "https://dns.w3ctag.org/dns-query#国际DNS"
    - "https://dns.google/dns-query#国际DNS"
    - https://doh.pub/dns-query#中国DNS
    - https://dns.alidns.com/dns-query#中国DNS
    - system
 
sniffer:
  enable: true
  force-dns-mapping: true
  parse-pure-ip: true
  override-destination: true
  sniff:
    HTTP:
      ports: [80, 8080-8880]
      override-destination: true
    TLS:
      ports: [443, 8443]
    QUIC:
      ports: [443, 8443]
  force-domain:
    - +.v2ex.com
  skip-domain:
    - "+.push.apple.com"

Bproxy-group : &Bproxy-group {type: select, proxies: [无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区,REJECT,REJECT-DROP]}
proxy-groups:
- {name: 入站桥接 , proxies: [PASS,Reqable,桥接7890,无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区,REJECT,REJECT-DROP], <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Drill.png"}

# 动态分组
- {name: Google, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Google_Search.png"}
- {name: Apple, <<: *Bproxy-group, icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Apple.png}
- {name: Telegram, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Telegram.png"}
- {name: Discord, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Game.png"}
- {name: Reddit, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Game.png"}
- {name: Twitter, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Twitter.png"}
- {name: Instagram, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Instagram.png"}
- {name: Facebook, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Facebook.png"}
- {name: ehentai, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Panda.png"}
- {name: 哔哩哔哩, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/bilibili.png"}
- {name: 哔哩东南亚, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/bilibili.png"}
- {name: 巴哈姆特, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Bahamut.png"}
- {name: YouTube, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/YouTube.png"}
- {name: NETFLIX, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Netflix.png"}
- {name: Spotify, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Spotify.png"}
- {name: Github, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Cat.png"}
- {name: Pixiv, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Peacock_P.png"}
- {name: 微软, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Microsoft.png"}
- {name: Bing, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/BosLife_1.png"}
- {name: Steam, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Siri.png"}
- {name: Adobe, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Magic.png"}
- {name: Epic, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Game.png"}
- {name: OpenAI, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/CrossWall.png"}
- {name: 广告拦截, type: select, proxies: [DIRECT,国际,REJECT,REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Advertising.png"}
- {name: 防火墙, type: select, proxies: [DIRECT,国际,REJECT,REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Advertising.png"}
- {name: 动态回环出口, type: select, proxies: [DIRECT,REJECT,REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Bypass.png"}
# - {name: 未分组, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Available.png"}
- {name: 测试:保留功能, <<: *Bproxy-group, icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Available.png"}

- {name: -------------------------分界线,  type: select, proxies: [REJECT-DROP]}

  ##分隔,下面是静态分组: 地理位置和节点功能永远固定
- {name: 国际, type: select, proxies: [无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Proxy.png"}
  # 互相独立分组[无限,中国,美国,英国,德国,法国,日本,香港,澳门,台湾,新加坡,俄罗斯,印度,巴西,加拿大,澳大利亚,意大利,荷兰,瑞典,瑞士,其它地区]
- {name: 无限, type: select, include-all: true, filter: "(?i)无限|infinite", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Final.png"}
- {name: 中国, type: select, include-all: true, filter: "(?i)cn|china|中国|大陆|内地|北京|天津|河北|山西|内蒙古|辽宁|吉林|黑龙江|上海|江苏|浙江|安徽|福建|江西|山东|河南|湖北|湖南|广东|广西|海南|重庆|四川|贵州|云南|西藏|陕西|甘肃|青海|宁夏|新疆", proxies: [DIRECT,REJECT-DROP,香港,澳门,台湾], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/China_Map.png"}
- {name: 美国, type: select, include-all: true, filter: "(?i)美|us|unitedstates|united states", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/US.png"}
- {name: 英国, type: select, include-all: true, filter: "(?i)英|uk|unitedkingdom|united kingdom", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/UK.png"}
- {name: 德国, type: select, include-all: true, filter: "(?i)德|de|germany", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/DE.png"}
- {name: 法国, type: select, include-all: true, filter: "(?i)法|fr|france", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/FR.png"}
- {name: 日本, type: select, include-all: true, filter: "(?i)日|jp|japan", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/JP.png"}
- {name: 香港, type: select, include-all: true, filter: "(?i)港|hk|hongkong|hong kong", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/HK.png"}
- {name: 澳门, type: select, include-all: true, filter: "(?i)澳门|mo", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/MO.png"}
- {name: 台湾, type: select, include-all: true, filter: "(?i)台|tw|taiwan", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/TW.png"}
- {name: 新加坡, type: select, include-all: true, filter: "(?i)(新|sg|singapore)", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/SG.png"}
- {name: 俄罗斯, type: select, include-all: true, filter: "(?i)俄|ru|russia", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/RU.png"}
- {name: 印度, type: select, include-all: true, filter: "(?i)印|in|india", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/IN.png"}
- {name: 巴西, type: select, include-all: true, filter: "(?i)巴西|br|brazil", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/BR.png"}
- {name: 加拿大, type: select, include-all: true, filter: "(?i)加拿大|ca|canada", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/CA.png"}
- {name: 澳大利亚, type: select, include-all: true, filter: "(?i)澳大|au|australia", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/AU.png"}
- {name: 意大利, type: select, include-all: true, filter: "(?i)意|it|italy", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/IT.png"}
- {name: 荷兰, type: select, include-all: true, filter: "(?i)荷|nl|netherlands", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/NL.png"}
- {name: 瑞典, type: select, include-all: true, filter: "(?i)瑞典|se|sweden", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/SE.png"}
- {name: 瑞士, type: select, include-all: true, filter: "(?i)瑞士|ch|switzerland", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/CH.png"}
- {name: 其它地区, type: select, include-all: true, filter: "(?i)^(?!.*(?:cn|china|中国|大陆|内地|北京|天津|河北|山西|内蒙古|辽宁|吉林|黑龙江|上海|江苏|浙江|安徽|福建|江西|山东|河南|湖北|湖南|广东|广西|海南|重庆|四川|贵州|云南|西藏|陕西|甘肃|青海|宁夏|新疆|无限|infinite|美|us|unitedstates|united states|英|uk|unitedkingdom|united kingdom|德|de|germany|法|fr|france|日|jp|japan|港|hk|hongkong|hong kong|台|tw|taiwan|新|sg|singapore|俄|ru|russia|印|in|india|巴西|br|brazil|加拿大|ca|canada|澳大|au|australia|意|it|italy|荷|nl|netherlands|瑞典|se|sweden|瑞士|ch|switzerland)).*", proxies: [REJECT-DROP], icon: "https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/mini/Available.png"}

- {name: UDP捡漏,type: select, include-all: true,proxies: [DIRECT]}
- {name: 中国DNS,type: select, include-all: true,proxies: [DIRECT]}
- {name: 国际DNS,type: select, include-all: true,proxies: [DIRECT]}

- {name: DNSDNS,type: select, proxies: [DIRECT], hidden: true}
- {name: 直连DNS,type: select, proxies: [DIRECT], hidden: true}
- {name: 节点直连DNS,type: select, proxies: [DIRECT], hidden: true}
- {name: 节点国际DNS,type: select, proxies: [国际DNS], hidden: true}


rules:
- RULE-SET,loopback_classical,动态回环出口 ##个人文件
- RULE-SET,private_ip,DIRECT,no-resolve   #静态回环出口
- MATCH,入站桥接
# - IN-NAME,AllIn-tproxy,入站桥接
# - IN-TYPE,Tun,入站桥接
- RULE-SET,test_classical,测试:保留功能   ##个人文件
- RULE-SET,firewall_classical,防火墙      ##个人文件
- RULE-SET,international_classical,国际   ##个人文件
- RULE-SET,domestic_classical,中国        ##个人文件

- RULE-SET,category-ads-all_classical,广告拦截
- RULE-SET,download_domain,国际
- RULE-SET,bing_domain,Bing
- DOMAIN-SUFFIX,microsoftonline.com,Bing
- DOMAIN-SUFFIX,events.data.microsoft.com,Bing
- RULE-SET,openai_domain,OpenAI
- RULE-SET,github_domain,Github
- RULE-SET,twitter_domain,Twitter
- RULE-SET,instagram_domain,Instagram
- RULE-SET,facebook_domain,Facebook
- RULE-SET,youtube_domain,YouTube
- RULE-SET,netflix_domain,NETFLIX
- RULE-SET,spotify_domain,Spotify
- RULE-SET,apple_domain,Apple
- RULE-SET,adobe_domain,Adobe
- RULE-SET,telegram_domain,Telegram
- RULE-SET,discord_domain,Discord
- RULE-SET,reddit_domain,Reddit
- RULE-SET,biliintl_domain,哔哩东南亚
- RULE-SET,bilibili_domain,哔哩哔哩
- RULE-SET,bahamut_domain,巴哈姆特
- RULE-SET,ehentai_domain,ehentai
- RULE-SET,pixiv_domain,Pixiv
- RULE-SET,steam_domain,Steam
- RULE-SET,epic_domain,Epic
- RULE-SET,microsoft_domain,微软
- RULE-SET,google_domain,Google
- RULE-SET,google_ip,Google
- RULE-SET,netflix_ip,NETFLIX
- RULE-SET,telegram_ip,Telegram
- RULE-SET,twitter_ip,Twitter


- DOMAIN-SUFFIX,.us,美国
- DOMAIN-SUFFIX,.uk,英国
- DOMAIN-SUFFIX,.de,德国
- DOMAIN-SUFFIX,.fr,法国
- DOMAIN-SUFFIX,.jp,日本
- DOMAIN-SUFFIX,.nico,日本
- DOMAIN-SUFFIX,.ru,俄罗斯
- DOMAIN-SUFFIX,.in,印度
- DOMAIN-SUFFIX,.br,巴西
- DOMAIN-SUFFIX,.ca,加拿大
- DOMAIN-SUFFIX,.au,澳大利亚
- DOMAIN-SUFFIX,.it,意大利
- DOMAIN-SUFFIX,.nl,荷兰
- DOMAIN-SUFFIX,.se,瑞典
- DOMAIN-SUFFIX,.ch,瑞士
- DOMAIN-SUFFIX,.eu,德国
- DOMAIN-SUFFIX,.hk,香港
- DOMAIN-SUFFIX,.mo,澳门
- DOMAIN-SUFFIX,.tw,台湾
- DOMAIN-SUFFIX,.sg,新加坡
- DOMAIN-SUFFIX,.org,国际
- DOMAIN-SUFFIX,.io,国际
- DOMAIN-SUFFIX,.dev,国际
- DOMAIN-SUFFIX,.cn,中国
- RULE-SET,geolocation-!cn,国际
- RULE-SET,cn_domain,中国



- RULE-SET,cn_ip,中国
# - DOMAIN-KEYWORD,-cn,中国
- MATCH,国际
- MATCH,UDP捡漏

rule-anchor:
  ip: &ip {type: http, interval: 86400, behavior: ipcidr, format: text, proxy: 国际}
  domain: &domain {type: http, interval: 86400, behavior: domain, format: text, proxy: 国际}
  classical: &classical {type: http, interval: 86400, behavior: classical, format: text, proxy: 国际}
rule-providers:
  loopback_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/loopback_classical.list"
  test_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/test_classical.list"
  firewall_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/firewall_classical.list"
  international_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/international_classical.list"
  domestic_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/somename/TEMP/refs/heads/main/meta/rule/domestic_classical.list"


  category-ads-all_classical:
    <<: *classical
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/classical/category-ads-all.list"

  private_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/private.list"
  cn_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.list"
  biliintl_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/biliintl.list"
  ehentai_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/ehentai.list"
  github_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/github.list"
  twitter_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/twitter.list"
  instagram_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/instagram.list"
  facebook_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/facebook.list"
  youtube_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/youtube.list"
  google_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/google.list"
  apple_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/apple.list"
  adobe_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/adobe.list"
  telegram_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/telegram.list"
  discord_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/discord.list"
  reddit_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/reddit.list"
  netflix_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/netflix.list"
  bilibili_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bilibili.list"
  bahamut_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bahamut.list"
  spotify_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/spotify.list"
  pixiv_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/pixiv.list"
  microsoft_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/microsoft.list"
  bing_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/bing.list"
  steam_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/steam.list"
  epic_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/epicgames.list"
  openai_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/openai.list"
  download_domain:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/category-android-app-download.list"
  geolocation-!cn:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/geolocation-!cn.list"
  tld-!cn:
    <<: *domain
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/tld-!cn.list"

  private_ip:
   <<: *ip
   url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/private.list"
  cn_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/cn.list"
  google_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/google.list"
  netflix_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/netflix.list"
  twitter_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/twitter.list"
  telegram_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/telegram.list"
  hk_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/hk.list"
  mo_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/mo.list"
  tw_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/tw.list"
  sg_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/sg.list"
  jp_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/jp.list"
  ru_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/ru.list"
  us_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/us.list"
  de_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/de.list"
  fr_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/fr.list"
  in_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/in.list"
  br_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/br.list"
  ca_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/ca.list"
  au_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/au.list"
  it_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/it.list"
  nl_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/nl.list"
  se_ip: 
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/se.list"
  ch_ip:
    <<: *ip
    url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/ch.list"


ntp:
  enable: false
  write-to-system: true
  server: time.apple.com
  port: PASSWD
  interval: 43200

external-ui: "/ui"
external-ui-name: xd
external-ui-url: "https://github.com/MetaCubeX/metacubexd/releases/latest/download/compressed-dist.tgz"

allow-lan: false
mixed-port: *ShareInPort
bind-address: "*" # 绑定地址,仅允许其他设备通过这个地址访问"*" 绑定所有 IP 地址192.168.31.31 绑定单个 IPV4 地址 [aaaa::a8aa:ff:fe09:57d8] 绑定单个 IPV6 地址
# lan-allowed-ips: # 允许连接的IP地址段,仅作用于 allow-lan 为 true 默认值为 0.0.0.0/0和 ::/0
# - 0.0.0.0/0
# - ::/0
# lan-disallowed-ips: # 禁止连接的IP地址段,黑名单优先级高于白名单,默认值为空
authentication: # http(s)/socks/mixed代理的用户验证
  - "somename:PASSWD"
# skip-auth-prefixes: # 设置允许跳过验证的IP段
#   - 127.0.0.1/8
#   - ::1/128

Try cargo clean on backend dir

@greenhat616
Copy link
Collaborator

Oh, I forgot it. It seems that the clash core is missing. Please run pnpm check before building the artifact.

What's more, I have added the test suite according to your sample.
d47f639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants