Files
sr-rules/egern.yaml
T
Forest a955d45567 feat: add Egern profile configuration (egern.yaml)
- 适配 Shadowrocket sr-rules 配置到 Egern format
- 转换 [General] 配置: DNS, bypass, hijack_dns, block_quic, ipv6
- 转换 [Proxy Group] 配置: 所有策略组 (select/auto_test)
- 转换 [Rule] 配置: rule_set, domain, geoip, default
- 转换 [URL Rewrite] 和 [MITM] 配置
- 保留所有原始规则集 URL 和策略优先级
2026-05-30 17:19:14 +08:00

519 lines
17 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Egern Profile - sr-rules 适配配置
# 适配来源: https://git.transnull.cn/transnull/sr-rules/raw/main/sr.conf
# 更新时间: 2026-05-30
# ============================================================
# 自动更新配置
# ============================================================
auto_update:
url: https://git.transnull.cn/transnull/sr-rules/raw/main/sr.conf
interval: 86400
# ============================================================
# 网络基本配置
# ============================================================
ipv6: false
block_quic: true
http_port: 3080
socks_port: 3090
allow_external_connections: false
vif_only: false
compat_route: false
include_all_networks: false
include_apns: false
include_cellular_services: false
include_local_networks: false
# ============================================================
# 绕过隧道代理的域名/IP(对应 Shadowrocket skip-proxy + tun-excluded-routes
# ============================================================
bypass_tunnel_proxy:
- "*.local"
- "192.168.0.0/16"
- "10.0.0.0/8"
- "172.16.0.0/12"
- "localhost"
- "localhost.weixin.qq.com"
- "captive.apple.com"
- "*.ccb.com"
- "*.abchina.com.cn"
- "*.psbc.com"
# TUN 接口排除的路由(对应 Shadowrocket tun-excluded-routes
tun_excluded_routes:
- 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.51.100.0/24
- 203.0.113.0/24
- 224.0.0.0/4
- 255.255.255.255/32
- 239.255.255.250/32
# 使用真实 IP 的域名列表(不使用 Fake IP)
real_ip_domains:
- "*.lan"
- "*.push.apple.com"
- "localhost.weixin.qq.com"
# 劫持 DNS(对应 Shadowrocket hijack-dns
hijack_dns:
- "*"
# ============================================================
# DNS 配置
# ============================================================
dns:
bootstrap:
- system
upstreams:
alidns:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query
google:
- https://8.8.8.8/dns-query
- https://8.8.4.4/dns-query
fallback:
- 223.5.5.5
- 119.29.29.29
forward:
# 中国大陆域名使用国内 DNS
- domain_suffix:
match: "cn"
value: fallback
- wildcard:
match: "*.cn"
value: fallback
- wildcard:
match: "*.baidu.com"
value: fallback
- wildcard:
match: "*.taobao.com"
value: fallback
- wildcard:
match: "*.qq.com"
value: fallback
# 广告域名拒绝解析
- regex:
match: "^ad\\..*|^ads\\..*|^adserv\\..*"
value: reject
# 其他默认走加密 DNS
- wildcard:
match: "*"
value: alidns
hosts:
"localhost.weixin.qq.com":
- 127.0.0.1
"*.apple.com":
- server: system
"*.icloud.com":
- server: system
localhost:
- 127.0.0.1
block_ips:
- 1.2.3.4
public_ip_lookup_url: https://ifconfig.me/ip
# ============================================================
# 代理节点(用户在 Egern 中添加自己的节点或订阅)
# proxylist: [] # 内置空数组,节点在 Egern 界面中添加
# ============================================================
# ============================================================
# 策略组配置
# ============================================================
policy_groups:
# --------------------------------------------------------
# 🚀 节点选择 - 主代理策略组(手动选择)
# --------------------------------------------------------
- select:
name: "🚀 节点选择"
policies:
- PROXY
- DIRECT
- REJECT
- 🇭🇰 香港节点
- 🇹🇼 台湾节点
- 🇯🇵 日本节点
- 🇺🇸 美国节点
- 🌐 其他节点
icon: rocket.fill
# --------------------------------------------------------
# 🇭🇰 香港节点 - 自动选择延迟最低的香港节点
# --------------------------------------------------------
- auto_test:
name: "🇭🇰 香港节点"
policies:
- 🚀 节点选择
filter: "🇭🇰|HK|Hong|hong|香港|深港|沪港|京港|港"
interval: 600
tolerance: 0
timeout: 5
icon: globe
# --------------------------------------------------------
# 🇹🇼 台湾节点 - 自动选择延迟最低的台湾节点
# --------------------------------------------------------
- auto_test:
name: "🇹🇼 台湾节点"
policies:
- 🚀 节点选择
filter: "🇹🇼|TW|TWN|Taiwan|Taipei|taiwan|台湾|台灣|台北|台中|新北|彰化"
interval: 600
tolerance: 0
timeout: 5
icon: globe
# --------------------------------------------------------
# 🇯🇵 日本节点 - 自动选择延迟最低的日本节点
# --------------------------------------------------------
- auto_test:
name: "🇯🇵 日本节点"
policies:
- 🚀 节点选择
filter: "🇯🇵|JP|Japan|japan|Tokyo|tokyo|日本|东京|大阪"
interval: 600
tolerance: 0
timeout: 5
icon: globe
# --------------------------------------------------------
# 🇺🇸 美国节点 - 自动选择延迟最低的美国节点
# --------------------------------------------------------
- auto_test:
name: "🇺🇸 美国节点"
policies:
- 🚀 节点选择
filter: "🇺🇸|US|USA|America|america|United States|美国|凤凰城|洛杉矶|西雅图|芝加哥|纽约|沪美|美"
interval: 600
tolerance: 0
timeout: 5
icon: globe
# --------------------------------------------------------
# 🌐 其他节点 - 所有非特定地区的节点
# --------------------------------------------------------
- auto_test:
name: "🌐 其他节点"
policies:
- 🚀 节点选择
filter: "^((?!(🇭🇰|HK|Hong|hong|香港|深港|沪港|京港|港|🇹🇼|TW|TWN|Taiwan|Taipei|taiwan|台湾|台灣|台北|台中|新北|彰化|🇯🇵|JP|Japan|japan|Tokyo|tokyo|日本|东京|大阪|🇺🇸|US|USA|America|america|United States|美国|凤凰城|洛杉矶|西雅图|芝加哥|纽约|沪美|美)).)*$"
interval: 600
tolerance: 0
timeout: 5
icon: globe
# --------------------------------------------------------
# 🤖 AI 服务 - ChatGPT、Claude、Gemini 等,优先美国节点
# --------------------------------------------------------
- select:
name: "🤖 AI 服务"
policies:
- 🇺🇸 美国节点
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: brain.head.profile
# --------------------------------------------------------
# 🔍 谷歌服务 - 优先日本节点
# --------------------------------------------------------
- select:
name: "🔍 谷歌服务"
policies:
- 🇯🇵 日本节点
- 🇭🇰 香港节点
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: magnifyingglass
# --------------------------------------------------------
# 📹 油管视频
# --------------------------------------------------------
- select:
name: "📹 油管视频"
policies:
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: play.rectangle.fill
# --------------------------------------------------------
# Ⓜ️ 微软服务
# --------------------------------------------------------
- select:
name: "Ⓜ️ 微软服务"
policies:
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: m.square.fill
# --------------------------------------------------------
# 🍏 苹果服务 - 优先直连
# --------------------------------------------------------
- select:
name: "🍏 苹果服务"
policies:
- DIRECT
- 🚀 节点选择
- PROXY
- REJECT
icon: apple.logo
# --------------------------------------------------------
# 🍎 苹果推送
# --------------------------------------------------------
- select:
name: "🍎 苹果推送"
policies:
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
# --------------------------------------------------------
# 📲 电报消息
# --------------------------------------------------------
- select:
name: "📲 电报消息"
policies:
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: paperplane.fill
# --------------------------------------------------------
# 🐱 代码托管 - GitHub、GitLab 等
# --------------------------------------------------------
- select:
name: "🐱 代码托管"
policies:
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: cat.fill
# --------------------------------------------------------
# 🏠 私有网络 - 本地局域网地址
# --------------------------------------------------------
- select:
name: "🏠 私有网络"
policies:
- DIRECT
- 🚀 节点选择
- REJECT
icon: house.fill
# --------------------------------------------------------
# 🔒 国内服务 - 中国大陆网站和服务
# --------------------------------------------------------
- select:
name: "🔒 国内服务"
policies:
- DIRECT
- 🚀 节点选择
- REJECT
icon: lock.fill
# --------------------------------------------------------
# 🌍 非中国 - 国际服务但非特定地区分流,优先日本节点
# --------------------------------------------------------
- select:
name: "🌍 非中国"
policies:
- 🇯🇵 日本节点
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: globe
# --------------------------------------------------------
# 🐟 漏网之鱼 - 兜底分组,优先日本节点
# --------------------------------------------------------
- select:
name: "🐟 漏网之鱼"
policies:
- 🇯🇵 日本节点
- 🚀 节点选择
- PROXY
- DIRECT
- REJECT
icon: fish.fill
# ============================================================
# 规则列表
# ============================================================
rules:
# --------------------------------------------------------
# 微信本地连接(最高优先级)
# --------------------------------------------------------
- domain:
match: "localhost.weixin.qq.com"
policy: DIRECT
name: "微信本地连接"
# --------------------------------------------------------
# 私人直连规则(最高优先级)
# --------------------------------------------------------
- rule_set:
match: https://git.transnull.cn/transnull/sr-rules/raw/main/PrivateDirect.list
policy: DIRECT
name: "私人直连规则"
# --------------------------------------------------------
# 私人代理规则(最高优先级)
# --------------------------------------------------------
- rule_set:
match: https://git.transnull.cn/transnull/sr-rules/raw/main/PrivateProxy.list
policy: 🚀 节点选择
name: "私人代理规则"
# --------------------------------------------------------
# AI 服务规则 - ChatGPT、Claude 等
# --------------------------------------------------------
- rule_set:
match: https://git.transnull.cn/transnull/sr-rules/raw/main/AI.list
policy: 🤖 AI 服务
name: "AI 服务规则"
# --------------------------------------------------------
# 谷歌服务规则
# --------------------------------------------------------
- rule_set:
match: https://git.transnull.cn/transnull/sr-rules/raw/main/Google.list
policy: 🔍 谷歌服务
name: "谷歌服务规则"
# --------------------------------------------------------
# YouTube 视频规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/YouTube/YouTube.list
policy: 📹 油管视频
name: "YouTube 规则"
# --------------------------------------------------------
# 本地局域网规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/Lan/Lan.list
policy: 🏠 私有网络
name: "局域网规则"
# --------------------------------------------------------
# Telegram 电报规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/Telegram/Telegram.list
policy: 📲 电报消息
name: "Telegram 规则"
# --------------------------------------------------------
# GitHub 代码托管规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/GitHub/GitHub.list
policy: 🐱 代码托管
name: "GitHub 规则"
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/GitLab/GitLab.list
policy: 🐱 代码托管
name: "GitLab 规则"
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/Atlassian/Atlassian.list
policy: 🐱 代码托管
name: "Atlassian 规则"
# --------------------------------------------------------
# 微软服务规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/Microsoft/Microsoft.list
policy: Ⓜ️ 微软服务
name: "微软服务规则"
# --------------------------------------------------------
# 苹果推送规则
# --------------------------------------------------------
- rule_set:
match: https://git.transnull.cn/transnull/sr-rules/raw/main/ApplePush.list
policy: 🍎 苹果推送
name: "苹果推送规则"
# --------------------------------------------------------
# 苹果服务规则
# --------------------------------------------------------
- rule_set:
match: https://git.transnull.cn/transnull/sr-rules/raw/main/Apple.list
policy: 🍏 苹果服务
name: "苹果服务规则"
# --------------------------------------------------------
# 中国大陆网站和服务规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/China/China.list
policy: 🔒 国内服务
name: "中国大陆规则"
# --------------------------------------------------------
# 国际服务规则
# --------------------------------------------------------
- rule_set:
match: https://cproxy.taichuos.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Shadowrocket/Global/Global.list
policy: 🌍 非中国
name: "国际服务规则"
# --------------------------------------------------------
# CN 地区 IP 直连
# --------------------------------------------------------
- geoip:
match: CN
policy: 🔒 国内服务
no_resolve: true
name: "CN IP 直连"
# --------------------------------------------------------
# 兜底规则 - 匹配所有未命中规则的流量
# --------------------------------------------------------
- default:
match: "*"
policy: 🐟 漏网之鱼
name: "兜底规则"
# ============================================================
# URL 重写(对应 Shadowrocket [URL Rewrite]
# ============================================================
url_rewrites:
- match: "^https?://(www\\.)?g\\.cn"
location: "https://www.google.com"
status: 302
- match: "^https?://(www\\.)?google\\.cn"
location: "https://www.google.com"
status: 302
# ============================================================
# MITM 证书解密配置(对应 Shadowrocket [MITM]
# ============================================================
mitm:
enabled: true
hostname:
- "*.google.cn"