mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Add Banner for Reject Domainset
This commit is contained in:
parent
15e3689ef7
commit
4a57089e3d
@ -2,6 +2,7 @@ const tldts = require('tldts');
|
|||||||
const { processFilterRules } = require('./lib/parse-filter.js');
|
const { processFilterRules } = require('./lib/parse-filter.js');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const { withBanner } = require('./lib/with-banner.js');
|
||||||
|
|
||||||
const WHITELIST_DOMAIN = new Set([
|
const WHITELIST_DOMAIN = new Set([
|
||||||
'w3s.link',
|
'w3s.link',
|
||||||
@ -89,5 +90,18 @@ const BLACK_TLD = Array.from(new Set([
|
|||||||
});
|
});
|
||||||
|
|
||||||
const filePath = path.resolve(__dirname, '../List/domainset/reject_phishing.conf');
|
const filePath = path.resolve(__dirname, '../List/domainset/reject_phishing.conf');
|
||||||
await fs.promises.writeFile(filePath, results.join('\n') + '\n', 'utf-8');
|
await fs.promises.writeFile(
|
||||||
|
filePath,
|
||||||
|
withBanner(
|
||||||
|
'Reject Domain Set for Surge',
|
||||||
|
[
|
||||||
|
'(Enhanced Phishing Protection)',
|
||||||
|
'Build from:',
|
||||||
|
'- https://gitlab.com/malware-filter/phishing-filter'
|
||||||
|
],
|
||||||
|
new Date(),
|
||||||
|
results
|
||||||
|
),
|
||||||
|
'utf-8'
|
||||||
|
);
|
||||||
})();
|
})();
|
||||||
|
|||||||
@ -8,6 +8,7 @@ const { isCI } = require('ci-info');
|
|||||||
const threads = isCI ? cpuCount : cpuCount / 2;
|
const threads = isCI ? cpuCount : cpuCount / 2;
|
||||||
|
|
||||||
const { HOSTS, ADGUARD_FILTERS, PREDEFINED_WHITELIST } = require('./lib/reject-data-source');
|
const { HOSTS, ADGUARD_FILTERS, PREDEFINED_WHITELIST } = require('./lib/reject-data-source');
|
||||||
|
const { withBanner } = require('./lib/with-banner');
|
||||||
|
|
||||||
const filterRuleWhitelistDomainSets = new Set(PREDEFINED_WHITELIST);
|
const filterRuleWhitelistDomainSets = new Set(PREDEFINED_WHITELIST);
|
||||||
|
|
||||||
@ -210,7 +211,17 @@ const filterRuleWhitelistDomainSets = new Set(PREDEFINED_WHITELIST);
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
fsPromises.writeFile(
|
fsPromises.writeFile(
|
||||||
pathResolve(__dirname, '../List/domainset/reject.conf'),
|
pathResolve(__dirname, '../List/domainset/reject.conf'),
|
||||||
`${[...domainSets].join('\n')}\n`,
|
withBanner(
|
||||||
|
'Reject Domain Set for Surge',
|
||||||
|
[
|
||||||
|
'(AdBlock, Tracking Protection, Privacy Protection, Anti-Phishing, Anti-Mining)',
|
||||||
|
'Build from:',
|
||||||
|
...HOSTS.map(host => `- ${host[0]}`),
|
||||||
|
...ADGUARD_FILTERS.map(filter => `- ${Array.isArray(filter) ? filter[0] : filter}`),
|
||||||
|
],
|
||||||
|
new Date(),
|
||||||
|
[...domainSets]
|
||||||
|
),
|
||||||
{ encoding: 'utf-8' }
|
{ encoding: 'utf-8' }
|
||||||
),
|
),
|
||||||
piscina.destroy()
|
piscina.destroy()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user