mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
const { createRuleset } = require('./lib/create-file');
|
|
const { parseFelixDnsmasq } = require('./lib/parse-dnsmasq');
|
|
const { runner } = require('./lib/trace-runner');
|
|
|
|
runner(__filename, async () => {
|
|
const res = await parseFelixDnsmasq('https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf');
|
|
|
|
const description = [
|
|
'License: AGPL 3.0',
|
|
'Homepage: https://ruleset.skk.moe',
|
|
'GitHub: https://github.com/SukkaW/Surge',
|
|
'',
|
|
'This file contains Apple\'s domains using their China mainland CDN servers.',
|
|
'',
|
|
'Data from:',
|
|
' - https://github.com/felixonmars/dnsmasq-china-list'
|
|
];
|
|
|
|
const ruleset = res.map(domain => `DOMAIN-SUFFIX,${domain}`);
|
|
const domainset = res.map(i => `.${i}`);
|
|
|
|
await Promise.all([
|
|
...createRuleset(
|
|
'Sukka\'s Ruleset - Apple CDN',
|
|
description,
|
|
new Date(),
|
|
ruleset,
|
|
'ruleset',
|
|
path.resolve(__dirname, '../List/non_ip/apple_cdn.conf'),
|
|
path.resolve(__dirname, '../Clash/non_ip/apple_cdn.txt')
|
|
),
|
|
...createRuleset(
|
|
'Sukka\'s Ruleset - Apple CDN',
|
|
description,
|
|
new Date(),
|
|
domainset,
|
|
'domainset',
|
|
path.resolve(__dirname, '../List/domainset/apple_cdn.conf'),
|
|
path.resolve(__dirname, '../Clash/domainset/apple_cdn.txt')
|
|
)
|
|
]);
|
|
});
|