New build infra: Build for Clash (#11)

This commit is contained in:
Sukka
2023-09-11 00:51:35 +08:00
committed by GitHub
parent fa7e2f775c
commit df4a10e180
45 changed files with 661 additions and 237 deletions

View File

@@ -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')
)
]);
})();