mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 02:00:37 +08:00
Fix: whitelist reject extra from reject base
This commit is contained in:
parent
26739b9dd7
commit
152db2d9cf
@ -19,8 +19,6 @@ import { appendArrayInPlace } from './lib/append-array-in-place';
|
|||||||
import { OUTPUT_INTERNAL_DIR, SOURCE_DIR } from './constants/dir';
|
import { OUTPUT_INTERNAL_DIR, SOURCE_DIR } from './constants/dir';
|
||||||
import { DomainsetOutput } from './lib/create-file';
|
import { DomainsetOutput } from './lib/create-file';
|
||||||
|
|
||||||
const getRejectSukkaConfPromise = readFileIntoProcessedArray(path.join(SOURCE_DIR, 'domainset/reject_sukka.conf'));
|
|
||||||
|
|
||||||
export const buildRejectDomainSet = task(require.main === module, __filename)(async (span) => {
|
export const buildRejectDomainSet = task(require.main === module, __filename)(async (span) => {
|
||||||
const rejectOutput = new DomainsetOutput(span, 'reject')
|
const rejectOutput = new DomainsetOutput(span, 'reject')
|
||||||
.withTitle('Sukka\'s Ruleset - Reject Base')
|
.withTitle('Sukka\'s Ruleset - Reject Base')
|
||||||
@ -104,7 +102,7 @@ export const buildRejectDomainSet = task(require.main === module, __filename)(as
|
|||||||
})
|
})
|
||||||
)),
|
)),
|
||||||
getPhishingDomains(childSpan).then(appendArrayToRejectExtraOutput),
|
getPhishingDomains(childSpan).then(appendArrayToRejectExtraOutput),
|
||||||
getRejectSukkaConfPromise.then(appendArrayToRejectOutput)
|
readFileIntoProcessedArray(path.join(SOURCE_DIR, 'domainset/reject_sukka.conf')).then(appendArrayToRejectOutput)
|
||||||
].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;
|
||||||
@ -129,18 +127,22 @@ export const buildRejectDomainSet = task(require.main === module, __filename)(as
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await Promise.all([
|
||||||
|
rejectOutput.done(),
|
||||||
|
rejectExtraOutput.done()
|
||||||
|
]);
|
||||||
|
|
||||||
// whitelist
|
// whitelist
|
||||||
span.traceChildSync('whitelist', () => {
|
span.traceChildSync('whitelist', () => {
|
||||||
for (const domain of filterRuleWhitelistDomainSets) {
|
for (const domain of filterRuleWhitelistDomainSets) {
|
||||||
rejectOutput.whitelistDomain(domain);
|
rejectOutput.whitelistDomain(domain);
|
||||||
rejectExtraOutput.whitelistDomain(domain);
|
rejectExtraOutput.whitelistDomain(domain);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
await Promise.all([
|
for (const domain of rejectOutput.sorted) {
|
||||||
rejectOutput.done(),
|
rejectExtraOutput.whitelistDomain(domain);
|
||||||
rejectExtraOutput.done()
|
}
|
||||||
]);
|
});
|
||||||
|
|
||||||
span.traceChildSync(
|
span.traceChildSync(
|
||||||
'build domain map for sort & collect stat',
|
'build domain map for sort & collect stat',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user