From 3fa8194e290bb06ebd6d6356b24a755c9ed101de Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 8 Dec 2024 15:18:54 +0800 Subject: [PATCH] =?UTF-8?q?~=E8=B0=83=E6=95=B4meta=E5=86=85=E6=A0=B8mix?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=BF=87=E6=BB=A4=E5=AE=9E=E7=8E=B0(geosite>?= =?UTF-8?q?rule-set=E6=95=B0=E6=8D=AE=E5=BA=93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/bin_update.yml | 3 ++- scripts/start.sh | 12 +++++++++++- scripts/webget.sh | 24 ++++++++++++------------ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/bin_update.yml b/.github/workflows/bin_update.yml index bbe8c10..23a146e 100644 --- a/.github/workflows/bin_update.yml +++ b/.github/workflows/bin_update.yml @@ -110,7 +110,7 @@ jobs: run: | cd bin source version - curl -kfSL -o geodata/Country.mmdb https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb + #curl -kfSL -o geodata/Country.mmdb https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb curl -kfSL -o geodata/cn_mini.mmdb https://raw.githubusercontent.com/Hackl0us/GeoIP2-CN/release/Country.mmdb curl -kfSL -o geodata/china_ip_list.txt https://raw.githubusercontent.com/ChanthMiao/China-IPv4-List/release/cn.txt curl -kfSL -o geodata/china_ipv6_list.txt https://raw.githubusercontent.com/ChanthMiao/China-IPv6-List/release/cn6.txt @@ -119,6 +119,7 @@ jobs: curl -kfSL -o geodata/geosite_cn.db https://github.com/DustinWin/ruleset_geodata/releases/download/sing-box/geosite-lite.db curl -kfSL -o geodata/srs_geoip_cn.srs https://github.com/DustinWin/ruleset_geodata/releases/download/sing-box-ruleset/cnip.srs curl -kfSL -o geodata/srs_geosite_cn.srs https://github.com/DustinWin/ruleset_geodata/releases/download/sing-box-ruleset/cn.srs + curl -kfSL -o geodata/mrs_geosite_cn.mrs https://github.com/DustinWin/ruleset_geodata/releases/download/clash-ruleset/cn.mrs mv -f ../ca-bundle.crt ./fix/ca-certificates.crt sed -i "s/GeoIP_v=.*/GeoIP_v=$(date '+%Y%m%d')/" version #修改版本号 echo 数据库及根证书文件更新完成! diff --git a/scripts/start.sh b/scripts/start.sh index b00e9a9..0590e5a 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -386,7 +386,7 @@ dns: EOF if [ "$dns_mod" != "redir_host" ]; then cat "$CRASHDIR"/configs/fake_ip_filter "$CRASHDIR"/configs/fake_ip_filter.list 2>/dev/null | grep '\.' | sed "s/^/ - '/" | sed "s/$/'/" >>"$TMPDIR"/dns.yaml - [ "$dns_mod" = "mix" ] && echo ' - "geosite:CN"' >>"$TMPDIR"/dns.yaml + [ "$dns_mod" = "mix" ] && echo ' - "rule-set:geosite-cn"' >>"$TMPDIR"/dns.yaml #插入cn过滤规则 else echo " - '+.*'" >>"$TMPDIR"/dns.yaml #使用fake-ip模拟redir_host fi @@ -517,6 +517,14 @@ EOF cat "$TMPDIR"/rules.yaml >>"$TMPDIR"/rules.add mv -f "$TMPDIR"/rules.add "$TMPDIR"/rules.yaml } + #mix模式生成rule-providers + [ "$dns_mod" = "mix" ] && ! grep -q 'geosite-cn' "$TMPDIR"/rule-providers.yaml && cat >>"$TMPDIR"/rule-providers.yaml <