diff --git a/Build/build-internal-rules.js b/Build/build-internal-rules.js index 8bbc4a28..50d0c5ad 100644 --- a/Build/build-internal-rules.js +++ b/Build/build-internal-rules.js @@ -6,8 +6,6 @@ const readline = require('readline'); const { isDomainLoose } = require('./lib/is-domain-loose'); const tldts = require('tldts'); - - (async () => { const set = new Set(); /** @@ -20,44 +18,55 @@ const tldts = require('tldts'); } }; - for await ( - const line of readline.createInterface({ - input: fs.createReadStream(path.resolve(__dirname, '../List/non_ip/cdn.conf')), - crlfDelay: Infinity - }) - ) { - if (line.startsWith('DOMAIN-SUFFIX,')) { - addApexDomain(line.replace('DOMAIN-SUFFIX,', '')) - } else if (line.startsWith('DOMAIN,')) { - addApexDomain(line.replace('DOMAIN,', '')); + /** + * @param {string} domainSetPath + */ + const processLocalDomainSet = async (domainSetPath) => { + for await ( + const line of readline.createInterface({ + input: fs.createReadStream(domainSetPath), + crlfDelay: Infinity + }) + ) { + if (line[0] === '.') { + addApexDomain(line.slice(1)); + } else if (isDomainLoose(line)) { + addApexDomain(line); + } else if (!line.startsWith('#') && line.trim() !== '') { + console.warn('[drop line from domainset]', line); + } } } - for await ( - const line of readline.createInterface({ - input: fs.createReadStream(path.resolve(__dirname, '../List/domainset/cdn.conf')), - crlfDelay: Infinity - }) - ) { - if (line[0] === '.') { - addApexDomain(line.slice(1)); - } else if (isDomainLoose(line)) { - addApexDomain(line); + /** + * @param {string} ruleSetPath + */ + const processLocalRuleSet = async (ruleSetPath) => { + for await ( + const line of readline.createInterface({ + input: fs.createReadStream(ruleSetPath), + crlfDelay: Infinity + }) + ) { + if (line.startsWith('DOMAIN-SUFFIX,')) { + addApexDomain(line.replace('DOMAIN-SUFFIX,', '')) + } else if (line.startsWith('DOMAIN,')) { + addApexDomain(line.replace('DOMAIN,', '')); + } else if (!line.startsWith('#') && line.trim() !== '') { + console.warn('[drop line from ruleset]', line); + } } } - for await ( - const line of readline.createInterface({ - input: fs.createReadStream(path.resolve(__dirname, '../List/domainset/download.conf')), - crlfDelay: Infinity - }) - ) { - if (line[0] === '.') { - addApexDomain(line.slice(1)); - } else if (isDomainLoose(line)) { - addApexDomain(line); - } - } + await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/cdn.conf')); + await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/global.conf')); + await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/global_plus.conf')); + await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/my_proxy.conf')); + await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/stream.conf')); + await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/telegram.conf')); + + await processLocalDomainSet(path.resolve(__dirname, '../List/domainset/cdn.conf')); + await processLocalDomainSet(path.resolve(__dirname, '../List/domainset/download.conf')); await fse.ensureDir(path.resolve(__dirname, '../List/internal')); await fs.promises.writeFile( diff --git a/List/domainset/cdn.conf b/List/domainset/cdn.conf index 3bb2a3d4..3e7a38ba 100644 --- a/List/domainset/cdn.conf +++ b/List/domainset/cdn.conf @@ -476,10 +476,7 @@ www.10086.win # imgix custom domain www.datocms-assets.com -# >> Medium -cdn-client.medium.com -glyph.medium.com -miro.medium.com + # >> Shopify cdn.shopify.com @@ -1152,6 +1149,7 @@ image.lichess1.org .chesscomfiles.com # adguard.com cdn.adguard.com +static.adguardvpn.com # cdn.adtidy.org # ik.me .storage.infomaniak.com @@ -1239,6 +1237,9 @@ media.dlsite.com img.dlsite.jp # Dribbble cdn.dribbble.com +# flaticon.com +cdn-share-sprites.flaticon.com +media.flaticon.com # spot.im static-cdn.spot.im images.spot.im @@ -1332,6 +1333,21 @@ cache-05.filehippo.net wp.salesforce.com ui.trailhead.com resources.help.salesforce.com +# mayoclinic.org +assets.mayoclinic.org +design.mayoclinic.org +# ubisoft +static-dm.ubisoft.com +static-overlay.ubisoft.com +staticctf.ubisoft.com +ubistatic2-a.ubisoft.com +ubistatic-a.ubisoft.com +.cdn.ubi.com +ubistatic2-a.akamaihd.net +# Medium +cdn-client.medium.com +glyph.medium.com +miro.medium.com # Others content-prod-live.cert.starbucks.com at.adtech.redventures.io @@ -1600,3 +1616,5 @@ hawk.tomsguide.com forest-mt-s3.seekrtech.com cdn.apkmonk.com .rocketcdn.me +cdn.img.ly +.kym-cdn.com diff --git a/List/domainset/download.conf b/List/domainset/download.conf index dddee00f..acbca17a 100644 --- a/List/domainset/download.conf +++ b/List/domainset/download.conf @@ -52,3 +52,5 @@ builds.parsec.app download.sketch.com # >> Wireshark .dl.wireshark.org +# >> Mozilla +download.mozilla.org diff --git a/List/ip/stream.conf b/List/ip/stream.conf index d49140d8..1c09ec77 100644 --- a/List/ip/stream.conf +++ b/List/ip/stream.conf @@ -1,26 +1,19 @@ # --- Stream Service --- # >> Netflix -IP-CIDR,8.41.4.0/24,no-resolve -IP-CIDR,23.246.0.0/18,no-resolve +IP-CIDR,23.246.18.0/23,no-resolve IP-CIDR,37.77.184.0/21,no-resolve -IP-CIDR,38.72.126.0/24,no-resolve IP-CIDR,45.57.0.0/17,no-resolve IP-CIDR,64.120.128.0/17,no-resolve IP-CIDR,66.197.128.0/17,no-resolve IP-CIDR,69.53.224.0/19,no-resolve -IP-CIDR,103.87.204.0/22,no-resolve IP-CIDR,108.175.32.0/20,no-resolve IP-CIDR,185.2.220.0/22,no-resolve IP-CIDR,185.9.188.0/22,no-resolve IP-CIDR,192.173.64.0/18,no-resolve IP-CIDR,198.38.96.0/19,no-resolve IP-CIDR,198.45.48.0/20,no-resolve -IP-CIDR,207.45.72.0/22,no-resolve IP-CIDR,208.75.76.0/22,no-resolve -IP-CIDR,34.210.42.111/32,no-resolve -IP-CIDR,52.89.124.203/32,no-resolve -IP-CIDR,54.148.37.5/32,no-resolve IP-CIDR6,2607:fb10::/32,no-resolve IP-CIDR6,2620:10c:7000::/44,no-resolve IP-CIDR6,2a00:86c0::/32,no-resolve diff --git a/List/non_ip/direct.conf b/List/non_ip/direct.conf index fe053665..5c42d55a 100644 --- a/List/non_ip/direct.conf +++ b/List/non_ip/direct.conf @@ -209,4 +209,4 @@ DOMAIN-SUFFIX,acm.org ## JSTOR 旗下 DOMAIN-SUFFIX,jstor.org -URL-REGEX,(Subject|HELO|SMTP) +# URL-REGEX,(Subject|HELO|SMTP)