Add Telegram CIDR

pull/20/head 202011252130
loyalsoldier 2020-11-24 15:46:05 +08:00
parent 79f97847f4
commit f85ed2f9e1
No known key found for this signature in database
GPG Key ID: 23829BBC1ACF2C90
2 changed files with 19 additions and 1 deletions

View File

@ -26,6 +26,7 @@ jobs:
echo "felixonmars_apple=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV 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 "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 "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 shell: bash
- name: Checkout the "hidden" branch - name: Checkout the "hidden" branch
@ -83,10 +84,15 @@ jobs:
echo "payload:" > cncidr.txt 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 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 - name: Move files to publish directory
run: | run: |
mkdir -p publish 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 - name: Release and upload assets
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1

View File

@ -47,6 +47,9 @@
- **非中国大陆使用的顶级域名列表 tld-not-cn.txt** - **非中国大陆使用的顶级域名列表 tld-not-cn.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt) - [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt) - [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt)
- **Telegram 使用的 IP 地址列表 telegramcidr.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/telegramcidr.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/telegramcidr.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt)
- **局域网 IP 及保留 IP 地址列表 lancidr.txt** - **局域网 IP 及保留 IP 地址列表 lancidr.txt**
- [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt) - [https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt](https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt)
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt) - [https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt)
@ -127,6 +130,13 @@ rule-providers:
path: ./ruleset/tld-not-cn.yaml path: ./ruleset/tld-not-cn.yaml
interval: 86400 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: cncidr:
type: http type: http
behavior: ipcidr behavior: ipcidr
@ -176,6 +186,7 @@ rules:
- RULE-SET,google,DIRECT - RULE-SET,google,DIRECT
- RULE-SET,proxy,PROXY - RULE-SET,proxy,PROXY
- RULE-SET,direct,DIRECT - RULE-SET,direct,DIRECT
- RULE-SET,telegramcidr,PROXY
- GEOIP,,DIRECT - GEOIP,,DIRECT
- GEOIP,CN,DIRECT - GEOIP,CN,DIRECT
- MATCH,PROXY - MATCH,PROXY
@ -211,6 +222,7 @@ rules:
- RULE-SET,tld-not-cn,PROXY - RULE-SET,tld-not-cn,PROXY
- RULE-SET,gfw,PROXY - RULE-SET,gfw,PROXY
- RULE-SET,greatfire,PROXY - RULE-SET,greatfire,PROXY
- RULE-SET,telegramcidr,PROXY
- GEOIP,AE,PROXY - GEOIP,AE,PROXY
- GEOIP,AU,PROXY - GEOIP,AU,PROXY
- GEOIP,BR,PROXY - GEOIP,BR,PROXY