mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 17:50:34 +08:00
Update CDN Hosts & Move Microsoft OCSP
This commit is contained in:
parent
cf1f657dae
commit
275e983521
@ -3,10 +3,11 @@ import { SHARED_DESCRIPTION } from './constants/description';
|
|||||||
import { once } from 'foxts/once';
|
import { once } from 'foxts/once';
|
||||||
import { RulesetOutput } from './lib/rules/ruleset';
|
import { RulesetOutput } from './lib/rules/ruleset';
|
||||||
import Worktank from 'worktank';
|
import Worktank from 'worktank';
|
||||||
|
import { RULES } from './constants/microsoft-cdn';
|
||||||
|
|
||||||
const pool = new Worktank({
|
const pool = new Worktank({
|
||||||
pool: {
|
pool: {
|
||||||
name: 'build-internal-reverse-chn-cidr',
|
name: 'get-microsoft-cdn',
|
||||||
size: 1 // The number of workers to keep in the pool, if more workers are needed they will be spawned up to this limit
|
size: 1 // The number of workers to keep in the pool, if more workers are needed they will be spawned up to this limit
|
||||||
},
|
},
|
||||||
worker: {
|
worker: {
|
||||||
@ -16,7 +17,7 @@ const pool = new Worktank({
|
|||||||
methods: {
|
methods: {
|
||||||
// eslint-disable-next-line object-shorthand -- workertank
|
// eslint-disable-next-line object-shorthand -- workertank
|
||||||
getMicrosoftCdnRuleset: async function (importMetaUrl: string): Promise<[domains: string[], domainSuffixes: string[]]> {
|
getMicrosoftCdnRuleset: async function (importMetaUrl: string): Promise<[domains: string[], domainSuffixes: string[]]> {
|
||||||
// TODO: createRequire is a temporary workaround for https://github.com/nodejs/node/issues/51956
|
// TODO: createRequire is a temporary workaround for https://github.com/nodejs/node/issues/51956
|
||||||
const { default: module } = await import('node:module');
|
const { default: module } = await import('node:module');
|
||||||
const __require = module.createRequire(importMetaUrl);
|
const __require = module.createRequire(importMetaUrl);
|
||||||
|
|
||||||
@ -67,6 +68,7 @@ export const buildMicrosoftCdn = task(require.main === module, __filename)(async
|
|||||||
'',
|
'',
|
||||||
'This file contains Microsoft\'s domains using their China mainland CDN servers.'
|
'This file contains Microsoft\'s domains using their China mainland CDN servers.'
|
||||||
)
|
)
|
||||||
|
.addFromRuleset(RULES)
|
||||||
.appendDataSource('https://github.com/felixonmars/dnsmasq-china-list')
|
.appendDataSource('https://github.com/felixonmars/dnsmasq-china-list')
|
||||||
.bulkAddDomain(domains)
|
.bulkAddDomain(domains)
|
||||||
.bulkAddDomainSuffix(domainSuffixes)
|
.bulkAddDomainSuffix(domainSuffixes)
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
export const PROBE_DOMAINS = ['.microsoft.com', '.windows.net', '.windows.com', '.windowsupdate.com', '.windowssearch.com', '.office.net'];
|
export const PROBE_DOMAINS = ['.microsoft.com', '.windows.net', '.windows.com', '.windowsupdate.com', '.windowssearch.com', '.office.net'];
|
||||||
|
|
||||||
|
export const RULES = [
|
||||||
|
// Microsoft OCSP (HTTP Only)
|
||||||
|
String.raw`URL-REGEX,^http://www\.microsoft\.com/pki/`,
|
||||||
|
String.raw`URL-REGEX,^http://www\.microsoft\.com/pkiops/`
|
||||||
|
];
|
||||||
|
|
||||||
export const DOMAINS = [
|
export const DOMAINS = [
|
||||||
'res.cdn.office.net',
|
'res.cdn.office.net',
|
||||||
'res-1.cdn.office.net',
|
'res-1.cdn.office.net',
|
||||||
|
|||||||
@ -1021,6 +1021,10 @@ cdn5.telegram.space
|
|||||||
us1-prod-images.disco-api.com
|
us1-prod-images.disco-api.com
|
||||||
.sndimg.com
|
.sndimg.com
|
||||||
|
|
||||||
|
# >> Neustar
|
||||||
|
ns-cdn.neustar.biz
|
||||||
|
.cdn.neustar
|
||||||
|
|
||||||
# >> Embed Tag / Widget
|
# >> Embed Tag / Widget
|
||||||
.2mdn.net
|
.2mdn.net
|
||||||
cdn.embedly.com
|
cdn.embedly.com
|
||||||
|
|||||||
@ -14,9 +14,7 @@ DOMAIN-KEYWORD,dsn.algolia.net
|
|||||||
# Microsoft
|
# Microsoft
|
||||||
DOMAIN-WILDCARD,cdn.*.office.net
|
DOMAIN-WILDCARD,cdn.*.office.net
|
||||||
DOMAIN-WILDCARD,cdn.*.microsoft.com
|
DOMAIN-WILDCARD,cdn.*.microsoft.com
|
||||||
# Microsoft OCSP (HTTP Only)
|
DOMAIN-WILDCARD,cdn-*.microsoft.com
|
||||||
URL-REGEX,^http://www\.microsoft\.com/pki/
|
|
||||||
URL-REGEX,^http://www\.microsoft\.com/pkiops/
|
|
||||||
# >> AppCenter Download
|
# >> AppCenter Download
|
||||||
DOMAIN-WILDCARD,appcenter-filemanagement-*.cloudapp.net
|
DOMAIN-WILDCARD,appcenter-filemanagement-*.cloudapp.net
|
||||||
# >> Daily Motion
|
# >> Daily Motion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user