mirror of
https://github.com/SukkaW/Surge.git
synced 2026-04-30 01:46:57 +08:00
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.12) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled
Build / Remove Artifacts after Deployment (push) Has been cancelled
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { parseFelixDnsmasqFromResp } from './lib/parse-dnsmasq';
|
|
import { task } from './trace';
|
|
import { SHARED_DESCRIPTION } from './constants/description';
|
|
import { DomainsetOutput } from './lib/rules/domainset';
|
|
import { $$fetch } from './lib/fetch-retry';
|
|
|
|
const getAppleCdnDomainsPromise = $$fetch('https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf').then(parseFelixDnsmasqFromResp);
|
|
|
|
export const buildAppleCdn = task(require.main === module, __filename)(async (span) => {
|
|
const res: string[] = await span.traceChildPromise('get apple cdn domains', getAppleCdnDomainsPromise);
|
|
|
|
return new DomainsetOutput(span, 'apple_cdn')
|
|
.withTitle('Sukka\'s Ruleset - Apple CDN')
|
|
.appendDescription(SHARED_DESCRIPTION)
|
|
.appendDescription(
|
|
'',
|
|
'This file contains Apple\'s domains using their China mainland CDN servers.',
|
|
'',
|
|
'Data from:',
|
|
' - https://github.com/felixonmars/dnsmasq-china-list'
|
|
)
|
|
.bulkAddDomainSuffix(res)
|
|
.whitelistDomain('apps.apple.com')
|
|
.write();
|
|
});
|