deploy: b8a394d27aedaae1d00c6c7e86cc01ff8311a1e9

This commit is contained in:
SukkaBot
2022-04-28 05:01:35 +00:00
parent 050d00f118
commit d8cd5ce449
2 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
const { fetch } = require('undici'); const { fetch } = require('undici');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const { isIPv4, isIPv6 } = require('net');
(async () => { (async () => {
const resp = await fetch('https://core.telegram.org/resources/cidr.txt'); const resp = await fetch('https://core.telegram.org/resources/cidr.txt');
@@ -15,9 +16,14 @@ const path = require('path');
'# Telegram CIDR (https://core.telegram.org/resources/cidr.txt)' + '\n' + '# Telegram CIDR (https://core.telegram.org/resources/cidr.txt)' + '\n' +
'# Last Updated: ' + lastModified.toISOString() + '\n' + '# Last Updated: ' + lastModified.toISOString() + '\n' +
res.map(ip => { res.map(ip => {
return ip.includes(':') const [subnet, range] = ip.split('/');
? `IP-CIDR6,${ip},no-resolve` if (isIPv4(subnet)) {
: `IP-CIDR,${ip},no-resolve`; return `IP-CIDR,${ip},no-resolve`;
}
if (isIPv6(subnet)) {
return `IP-CIDR6,${ip},no-resolve`;
}
return '';
}).join('\n') + '\n', }).join('\n') + '\n',
'utf-8' 'utf-8'
); );

View File

@@ -24,7 +24,7 @@
<main class="container"> <main class="container">
<h1>Sukka Surge Ruleset Server</h1> <h1>Sukka Surge Ruleset Server</h1>
<p>Made by <a href="https://skk.moe">Sukka</a> | <a href="https://github.com/SukkaW/Surge/">Source @ GitHub</a> | Licensed under <a href="https://github.com/SukkaW/Surge/blob/master/LICENSE" target="_blank">AGPL-3.0</a></p> <p>Made by <a href="https://skk.moe">Sukka</a> | <a href="https://github.com/SukkaW/Surge/">Source @ GitHub</a> | Licensed under <a href="https://github.com/SukkaW/Surge/blob/master/LICENSE" target="_blank">AGPL-3.0</a></p>
<p>Last Updated: 2022-04-28T04:59:04.484Z</p> <p>Last Updated: 2022-04-28T05:01:34.972Z</p>
<hr> <hr>
<br> <br>
<ul> <ul>