mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-04 04:42:32 +08:00
New build infra: Build for Clash (#11)
This commit is contained in:
@@ -5,6 +5,7 @@ const { withBannerArray } = require('./lib/with-banner.js');
|
||||
const { compareAndWriteFile } = require('./lib/string-array-compare');
|
||||
const { processLine } = require('./lib/process-line.js');
|
||||
const domainSorter = require('./lib/stable-sort-domain');
|
||||
const { surgeDomainsetToClashDomainset } = require('./lib/clash.js');
|
||||
|
||||
const WHITELIST_DOMAIN = new Set([
|
||||
'w3s.link',
|
||||
@@ -141,21 +142,34 @@ const BLACK_TLD = new Set([
|
||||
|
||||
results.sort(domainSorter);
|
||||
|
||||
await compareAndWriteFile(
|
||||
withBannerArray(
|
||||
'Sukka\'s Surge Rules - Reject Phishing',
|
||||
[
|
||||
'License: AGPL 3.0',
|
||||
'Homepage: https://ruleset.skk.moe',
|
||||
'GitHub: https://github.com/SukkaW/Surge',
|
||||
'',
|
||||
'The domainset supports enhanced phishing protection',
|
||||
'Build from:',
|
||||
' - https://gitlab.com/malware-filter/phishing-filter'
|
||||
],
|
||||
new Date(),
|
||||
results
|
||||
const description = [
|
||||
'License: AGPL 3.0',
|
||||
'Homepage: https://ruleset.skk.moe',
|
||||
'GitHub: https://github.com/SukkaW/Surge',
|
||||
'',
|
||||
'The domainset supports enhanced phishing protection',
|
||||
'Build from:',
|
||||
' - https://gitlab.com/malware-filter/phishing-filter'
|
||||
];
|
||||
|
||||
await Promise.all([
|
||||
compareAndWriteFile(
|
||||
withBannerArray(
|
||||
'Sukka\'s Ruleset - Reject Phishing',
|
||||
description,
|
||||
new Date(),
|
||||
results
|
||||
),
|
||||
path.resolve(__dirname, '../List/domainset/reject_phishing.conf')
|
||||
),
|
||||
path.resolve(__dirname, '../List/domainset/reject_phishing.conf')
|
||||
);
|
||||
compareAndWriteFile(
|
||||
withBannerArray(
|
||||
'Sukka\'s Ruleset - Reject Phishing',
|
||||
description,
|
||||
new Date(),
|
||||
surgeDomainsetToClashDomainset(results)
|
||||
),
|
||||
path.resolve(__dirname, '../Clash/domainset/reject_phishing.txt')
|
||||
)
|
||||
]);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user