Update CDN & Reject & Global Hosts
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.12) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled
Build / Remove Artifacts after Deployment (push) Has been cancelled

This commit is contained in:
SukkaW
2025-11-13 04:26:39 +08:00
parent 08892b3a88
commit 32cea41f04
7 changed files with 60 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import { $$fetch } from './lib/fetch-retry';
import runAgainstSourceFile from './lib/run-against-source-file';
import { nullthrow } from 'foxts/guard';
import { Buffer } from 'node:buffer';
import { GLOBAL } from '../Source/non_ip/global';
export async function getTopOneMillionDomains() {
const { parse: csvParser } = await import('csv-parse');
@@ -132,6 +133,18 @@ export async function parseGfwList() {
runAgainstSourceFile(path.resolve(OUTPUT_SURGE_DIR, 'domainset/cdn.conf'), callback, 'domainset')
]);
Object.values(GLOBAL).forEach(({ domains }) => {
domains.forEach(domain => {
if (domain[0] === '$') {
callback(domain.slice(1), false);
} else if (domain[0] === '+') {
callback(domain.slice(1), true);
} else {
callback(domain, true);
}
});
});
whiteSet.forEach(domain => gfwListTrie.whitelist(domain, true));
const kwfilter = createKeywordFilter([...keywordSet]);