mirror of
https://gitlab.com/SukkaW/ruleset.skk.moe.git
synced 2026-04-18 09:44:35 +00:00
deploy: 31e9f31e37e0f3d3c3c56b299c77d9f609297048
This commit is contained in:
@@ -2,6 +2,8 @@ const fs = require('fs');
|
||||
const { promises: fsPromises } = fs;
|
||||
const pathFn = require('path');
|
||||
const table = require('table');
|
||||
const listDir = require('@sukka/listdir');
|
||||
const { green, yellow } = require('picocolors');
|
||||
|
||||
const PRESET_MITM_HOSTNAMES = [
|
||||
'*baidu.com',
|
||||
@@ -158,13 +160,6 @@ const PRESET_MITM_HOSTNAMES = [
|
||||
})();
|
||||
|
||||
/** Util function */
|
||||
function green(...args) {
|
||||
return `\u001b[32m${args.join(' ')}\u001b[0m`;
|
||||
}
|
||||
function yellow(...args) {
|
||||
return `\u001b[33m${args.join(' ')}\u001b[0m`;
|
||||
}
|
||||
|
||||
function parseDomain(input) {
|
||||
try {
|
||||
const url = new URL(`https://${input}`);
|
||||
@@ -195,37 +190,3 @@ function escapeRegExp(string = '') {
|
||||
? string.replace(reRegExpChar, '\\$&')
|
||||
: string;
|
||||
}
|
||||
|
||||
function listDir(path, options) {
|
||||
const results = [];
|
||||
options = Object.assign({ ignoreHidden: true, ignorePattern: null }, options);
|
||||
return listDirWalker(path, results, '', options).then(() => results);
|
||||
}
|
||||
function listDirWalker(path, results, parent, options) {
|
||||
const promises = [];
|
||||
return readAndFilterDir(path, options).then(items => {
|
||||
items.forEach(item => {
|
||||
const currentPath = pathFn.join(parent, item.name);
|
||||
if (item.isDirectory()) {
|
||||
promises.push(listDirWalker(pathFn.join(path, item.name), results, currentPath, options));
|
||||
}
|
||||
else {
|
||||
results.push(currentPath);
|
||||
}
|
||||
});
|
||||
}).then(() => Promise.all(promises));
|
||||
}
|
||||
function readAndFilterDir(path, options) {
|
||||
const { ignoreHidden = true, ignorePattern } = options;
|
||||
return fs.promises.readdir(path, Object.assign(Object.assign({}, options), { withFileTypes: true }))
|
||||
.then(results => {
|
||||
if (ignoreHidden) {
|
||||
results = results.filter(({ name }) => !name.startsWith('.'));
|
||||
}
|
||||
if (ignorePattern) {
|
||||
results = results.filter(({ name }) => !ignorePattern.test(name));
|
||||
}
|
||||
return results;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
############################
|
||||
# Mainland China IPv4 CIDR
|
||||
# Data from misaka.io (misakaio @ GitHub)
|
||||
# Last Updated: 2022-04-22T00:40:34.337Z
|
||||
# Last Updated: 2022-04-22T00:46:04.361Z
|
||||
# Routes: 3381
|
||||
############################
|
||||
IP-CIDR,1.2.4.0/24
|
||||
|
||||
@@ -25,7 +25,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-22T00:40:34.401Z</p>
|
||||
<p>Last Updated: 2022-04-22T00:46:04.425Z</p>
|
||||
<hr>
|
||||
<br>
|
||||
<ul>
|
||||
|
||||
11
package-lock.json
generated
11
package-lock.json
generated
@@ -10,6 +10,7 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@sukka/listdir": "^0.2.0",
|
||||
"picocolors": "^1.0.0",
|
||||
"piscina": "^3.1.0",
|
||||
"table": "^6.7.3",
|
||||
"undici": "^5.0.0"
|
||||
@@ -189,6 +190,11 @@
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||
},
|
||||
"node_modules/piscina": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/piscina/-/piscina-3.1.0.tgz",
|
||||
@@ -420,6 +426,11 @@
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||
},
|
||||
"piscina": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/piscina/-/piscina-3.1.0.tgz",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@sukka/listdir": "^0.2.0",
|
||||
"picocolors": "^1.0.0",
|
||||
"piscina": "^3.1.0",
|
||||
"table": "^6.7.3",
|
||||
"undici": "^5.0.0"
|
||||
|
||||
Reference in New Issue
Block a user