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 fs = require('fs');
const path = require('path');
const { isIPv4, isIPv6 } = require('net');
(async () => {
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' +
'# Last Updated: ' + lastModified.toISOString() + '\n' +
res.map(ip => {
return ip.includes(':')
? `IP-CIDR6,${ip},no-resolve`
: `IP-CIDR,${ip},no-resolve`;
const [subnet, range] = ip.split('/');
if (isIPv4(subnet)) {
return `IP-CIDR,${ip},no-resolve`;
}
if (isIPv6(subnet)) {
return `IP-CIDR6,${ip},no-resolve`;
}
return '';
}).join('\n') + '\n',
'utf-8'
);

View File

@@ -24,7 +24,7 @@
<main class="container">
<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>Last Updated: 2022-04-28T04:59:04.484Z</p>
<p>Last Updated: 2022-04-28T05:01:34.972Z</p>
<hr>
<br>
<ul>