mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Feat: auto generate Telegram CIDR list
This commit is contained in:
parent
c69673f468
commit
045be0a736
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@ -29,6 +29,7 @@ jobs:
|
|||||||
- run: node ./Build/build-apple-cdn.js
|
- run: node ./Build/build-apple-cdn.js
|
||||||
- run: node ./Build/build-cidr.js
|
- run: node ./Build/build-cidr.js
|
||||||
- run: node ./Build/build-reject-domainset.js
|
- run: node ./Build/build-reject-domainset.js
|
||||||
|
- run: node ./Build/build-telegram-cidr.js
|
||||||
- run: node ./Build/build-index.html.js
|
- run: node ./Build/build-index.html.js
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
|||||||
24
Build/build-telegram-cidr.js
Normal file
24
Build/build-telegram-cidr.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
const { fetch } = require('undici');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const resp = await fetch('https://core.telegram.org/resources/cidr.txt');
|
||||||
|
const lastModified = new Date(resp.headers.get('last-modified'));
|
||||||
|
|
||||||
|
const res = (await resp.text())
|
||||||
|
.split('\n')
|
||||||
|
.filter(line => line.trim() !== '');
|
||||||
|
|
||||||
|
await fs.promises.writeFile(
|
||||||
|
path.resolve(__dirname, '../List/ip/telegram.conf'),
|
||||||
|
'# Telegram CIDR (https://core.telegram.org/resources/cidr.txt)' + '\n' +
|
||||||
|
'# Last Updated: ' + lastModified.toISOString() + '\n' +
|
||||||
|
res.map(ip => {
|
||||||
|
return ip.includes(':')
|
||||||
|
? `IP-CIDR6,${ip},no-resolve`
|
||||||
|
: `IP-CIDR,${ip},no-resolve`;
|
||||||
|
}).join('\n') + '\n',
|
||||||
|
'utf-8'
|
||||||
|
);
|
||||||
|
})();
|
||||||
@ -1,13 +1,16 @@
|
|||||||
# > Telegram
|
# Telegram CIDR (https://core.telegram.org/resources/cidr.txt)
|
||||||
IP-CIDR,91.105.192.0/23,no-resolve
|
# Last Updated: 2021-10-01T16:51:55.000Z
|
||||||
IP-CIDR,91.108.0.0/16,no-resolve
|
IP-CIDR,91.108.56.0/22,no-resolve
|
||||||
IP-CIDR,95.161.64.0/20,no-resolve
|
IP-CIDR,91.108.4.0/22,no-resolve
|
||||||
IP-CIDR,109.239.140.0/24,no-resolve
|
IP-CIDR,91.108.8.0/22,no-resolve
|
||||||
|
IP-CIDR,91.108.16.0/22,no-resolve
|
||||||
|
IP-CIDR,91.108.12.0/22,no-resolve
|
||||||
IP-CIDR,149.154.160.0/20,no-resolve
|
IP-CIDR,149.154.160.0/20,no-resolve
|
||||||
|
IP-CIDR,91.105.192.0/23,no-resolve
|
||||||
|
IP-CIDR,91.108.20.0/22,no-resolve
|
||||||
IP-CIDR,185.76.151.0/24,no-resolve
|
IP-CIDR,185.76.151.0/24,no-resolve
|
||||||
IP-CIDR,214.218.41.9/32,no-resolve
|
|
||||||
IP-CIDR6,2001:67c:4e8::/48,no-resolve
|
|
||||||
IP-CIDR6,2001:b28:f23c::/48,no-resolve
|
|
||||||
IP-CIDR6,2001:b28:f23d::/48,no-resolve
|
IP-CIDR6,2001:b28:f23d::/48,no-resolve
|
||||||
IP-CIDR6,2001:b28:f23f::/48,no-resolve
|
IP-CIDR6,2001:b28:f23f::/48,no-resolve
|
||||||
IP-CIDR6,2a0a:f280:203::/48,no-resolve
|
IP-CIDR6,2001:67c:4e8::/48,no-resolve
|
||||||
|
IP-CIDR6,2001:b28:f23c::/48,no-resolve
|
||||||
|
IP-CIDR6,2a0a:f280::/32,no-resolve
|
||||||
|
|||||||
@ -7,3 +7,4 @@ DOMAIN-SUFFIX,telegram.me
|
|||||||
DOMAIN-SUFFIX,telegram.org
|
DOMAIN-SUFFIX,telegram.org
|
||||||
DOMAIN-SUFFIX,graph.org
|
DOMAIN-SUFFIX,graph.org
|
||||||
DOMAIN-SUFFIX,legra.ph
|
DOMAIN-SUFFIX,legra.ph
|
||||||
|
DOMAIN-SUFFIX,telesco.pe
|
||||||
|
|||||||
@ -67,7 +67,8 @@ RULE-SET,https://ruleset.skk.moe/List/non_ip/telegram.conf,[Replace with your po
|
|||||||
RULE-SET,https://ruleset.skk.moe/List/ip/telegram.conf,[Replace with your policy]
|
RULE-SET,https://ruleset.skk.moe/List/ip/telegram.conf,[Replace with your policy]
|
||||||
```
|
```
|
||||||
|
|
||||||
- 人工维护
|
- 域名规则 人工维护
|
||||||
|
- IP CIDR 规则 自动生成(数据来源:[`https://core.telegram.org/resources/cidr.txt`](https://core.telegram.org/resources/cidr.txt))
|
||||||
|
|
||||||
#### Apple CDN
|
#### Apple CDN
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user