mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
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
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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user