mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 02:00:37 +08:00
Chore: use non_ip/reject to dedupe reject_extra as well
This commit is contained in:
parent
38bcd58466
commit
6127d4d021
@ -20,7 +20,8 @@ import { OUTPUT_INTERNAL_DIR, SOURCE_DIR } from './constants/dir';
|
|||||||
import { DomainsetOutput } from './lib/create-file';
|
import { DomainsetOutput } from './lib/create-file';
|
||||||
|
|
||||||
const readLocalRejectDomainsetPromise = readFileIntoProcessedArray(path.join(SOURCE_DIR, 'domainset/reject_sukka.conf'));
|
const readLocalRejectDomainsetPromise = readFileIntoProcessedArray(path.join(SOURCE_DIR, 'domainset/reject_sukka.conf'));
|
||||||
const reloadLocalRejectExtraDomainsetPromise = readFileIntoProcessedArray(path.join(SOURCE_DIR, 'domainset/reject_sukka_extra.conf'));
|
const readLocalRejectExtraDomainsetPromise = readFileIntoProcessedArray(path.join(SOURCE_DIR, 'domainset/reject_sukka_extra.conf'));
|
||||||
|
const readLocalRejectRulesetPromise = readFileByLine(path.join(SOURCE_DIR, 'non_ip/reject.conf'));
|
||||||
|
|
||||||
export const buildRejectDomainSet = task(require.main === module, __filename)(async (span) => {
|
export const buildRejectDomainSet = task(require.main === module, __filename)(async (span) => {
|
||||||
const rejectBaseDescription = [
|
const rejectBaseDescription = [
|
||||||
@ -102,14 +103,15 @@ export const buildRejectDomainSet = task(require.main === module, __filename)(as
|
|||||||
})),
|
})),
|
||||||
getPhishingDomains(childSpan).then(appendArrayToRejectExtraOutput),
|
getPhishingDomains(childSpan).then(appendArrayToRejectExtraOutput),
|
||||||
readLocalRejectDomainsetPromise.then(appendArrayToRejectOutput),
|
readLocalRejectDomainsetPromise.then(appendArrayToRejectOutput),
|
||||||
reloadLocalRejectExtraDomainsetPromise.then(appendArrayToRejectExtraOutput),
|
readLocalRejectExtraDomainsetPromise.then(appendArrayToRejectExtraOutput),
|
||||||
// Dedupe domainSets
|
// Dedupe domainSets
|
||||||
// span.traceChildAsync('collect black keywords/suffixes', async () =>
|
// span.traceChildAsync('collect black keywords/suffixes', async () =>
|
||||||
/**
|
/**
|
||||||
* Collect DOMAIN, DOMAIN-SUFFIX, and DOMAIN-KEYWORD from non_ip/reject.conf for deduplication
|
* Collect DOMAIN, DOMAIN-SUFFIX, and DOMAIN-KEYWORD from non_ip/reject.conf for deduplication
|
||||||
* DOMAIN-WILDCARD is not really useful for deduplication, it is only included in AdGuardHome output
|
* DOMAIN-WILDCARD is not really useful for deduplication, it is only included in AdGuardHome output
|
||||||
*/
|
*/
|
||||||
rejectOutput.addFromRuleset(readFileByLine(path.resolve(__dirname, '../Source/non_ip/reject.conf')))
|
rejectOutput.addFromRuleset(readLocalRejectRulesetPromise),
|
||||||
|
rejectExtraOutput.addFromRuleset(readLocalRejectRulesetPromise)
|
||||||
].flat());
|
].flat());
|
||||||
// eslint-disable-next-line sukka/no-single-return -- not single return
|
// eslint-disable-next-line sukka/no-single-return -- not single return
|
||||||
return shouldStop;
|
return shouldStop;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user