From 561fb5355f412e9e940893e13fd58cd9c50da59b Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Tue, 24 Nov 2020 15:46:05 +0800 Subject: [PATCH] Add Telegram CIDR --- .github/workflows/run.yml | 8 +++++++- README.md | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 309da26..f499eea 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -26,6 +26,7 @@ jobs: echo "felixonmars_apple=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV echo "felixonmars_google=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV echo "ipipnet_chinaiplist=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt" >> $GITHUB_ENV + echo "telegram_cidr=https://core.telegram.org/resources/cidr.txt" >> $GITHUB_ENV shell: bash - name: Checkout the "hidden" branch @@ -83,10 +84,15 @@ jobs: echo "payload:" > cncidr.txt curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print " - |$1|\n"' | sed "s/|/'/g" >> cncidr.txt + - name: Generate telegramcidr.txt file + run: | + echo "payload:" > telegramcidr.txt + curl -sSL ${telegram_cidr} | perl -ne '/(.+\/\d+)/ && print " - |$1|\n"' | sed "s/|/'/g" >> telegramcidr.txt + - name: Move files to publish directory run: | mkdir -p publish - install -p {apple,icloud,google,proxy,direct,reject,gfw,greatfire,tld-not-cn,cncidr,lancidr}.txt ./publish/ + install -p {apple,icloud,google,proxy,direct,reject,gfw,greatfire,tld-not-cn,cncidr,lancidr,telegramcidr}.txt ./publish/ - name: Release and upload assets uses: softprops/action-gh-release@v1 diff --git a/README.md b/README.md index 942d4e0..af578c6 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,13 @@ rule-providers: path: ./ruleset/tld-not-cn.yaml interval: 86400 + telegramcidr: + type: http + behavior: ipcidr + url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt" + path: ./ruleset/telegramcidr.yaml + interval: 86400 + cncidr: type: http behavior: ipcidr @@ -176,6 +183,7 @@ rules: - RULE-SET,google,DIRECT - RULE-SET,proxy,PROXY - RULE-SET,direct,DIRECT + - RULE-SET,telegramcidr,PROXY - GEOIP,,DIRECT - GEOIP,CN,DIRECT - MATCH,PROXY @@ -211,6 +219,7 @@ rules: - RULE-SET,tld-not-cn,PROXY - RULE-SET,gfw,PROXY - RULE-SET,greatfire,PROXY + - RULE-SET,telegramcidr,PROXY - GEOIP,AE,PROXY - GEOIP,AU,PROXY - GEOIP,BR,PROXY