Skip to content

Commit

Permalink
Merge branch 'SukkaW:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FYLSen authored Apr 16, 2024
2 parents d936d19 + 1b0d712 commit 9dd67d8
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Build/build-anti-bogus-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const getBogusNxDomainIPsPromise = fsFetchCache.apply(
async () => {
const result: string[] = [];
for await (const line of await fetchRemoteTextByLine(URL)) {
if (line && line.startsWith('bogus-nxdomain=')) {
if (line.startsWith('bogus-nxdomain=')) {
const ip = line.slice(15).trim();
if (isProbablyIpv4(ip)) {
result.push(`IP-CIDR,${ip}/32,no-resolve`);
Expand Down
2 changes: 1 addition & 1 deletion Build/lib/aho-corasick.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-unresolved -- bun
// eslint-disable-next-line import-x/no-unresolved -- bun
import { describe, expect, it } from 'bun:test';
import createKeywordFilter from './aho-corasick';

Expand Down
2 changes: 1 addition & 1 deletion Build/lib/cache-filesystem.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-unresolved -- bun built-in module
// eslint-disable-next-line import-x/no-unresolved -- bun built-in module
import { Database } from 'bun:sqlite';
import os from 'os';
import path from 'path';
Expand Down
4 changes: 2 additions & 2 deletions Build/lib/fetch-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class CustomAbortError extends Error {

const sleepWithAbort = (ms: number, signal: AbortSignal) => new Promise<void>((resolve, reject) => {
if (signal.aborted) {
reject(signal.reason);
reject(signal.reason as Error);
return;
}

function stop(this: AbortSignal) { reject(this.reason); }
function stop(this: AbortSignal) { reject(this.reason as Error); }

signal.addEventListener('abort', stop, { once: true });
Bun.sleep(ms).then(resolve).catch(reject).finally(() => signal.removeEventListener('abort', stop));
Expand Down
15 changes: 8 additions & 7 deletions Build/lib/fetch-retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ const MAX_RETRIES = 5;
const MAX_RETRY_AFTER = 20;
const FACTOR = 6;

function isClientError(err: any): err is NodeJS.ErrnoException {
if (!err) return false;
return (
err.code === 'ERR_UNESCAPED_CHARACTERS'
|| err.message === 'Request path contains unescaped characters'
);
function isClientError(err: unknown): err is NodeJS.ErrnoException {
if (!err || typeof err !== 'object') return false;

if ('code' in err) return err.code === 'ERR_UNESCAPED_CHARACTERS';
if ('message' in err) return err.message === 'Request path contains unescaped characters';

return false;
}

export class ResponseError extends Error {
Expand Down Expand Up @@ -70,7 +71,7 @@ function createFetchRetry($fetch: typeof fetch): FetchWithRetry {
return await retry<Response>(async (bail) => {
try {
// this will be retried
const res = (await $fetch(url, opts)) as Response;
const res = (await $fetch(url, opts));

if ((res.status >= 500 && res.status < 600) || res.status === 429) {
// NOTE: doesn't support http-date format
Expand Down
2 changes: 1 addition & 1 deletion Build/lib/trie.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTrie } from './trie';
// eslint-disable-next-line import/no-unresolved -- fuck eslint-import
// eslint-disable-next-line import-x/no-unresolved -- fuck eslint-import
import { describe, expect, it } from 'bun:test';

describe('Trie', () => {
Expand Down
1 change: 0 additions & 1 deletion Build/validate-domestic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { fetchRemoteTextByLine, readFileByLine } from './lib/fetch-text-by-line';
import { Readable } from 'stream';
import { parse } from 'csv-parse/sync';
import { createTrie } from './lib/trie';
import path from 'path';
Expand Down
24 changes: 23 additions & 1 deletion Source/domainset/cdn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ cdn.embed.ly
gitpkg-fork.vercel.sh
cdn.redoc.ly
.staticimgly.com
code.ionicframework.com

# Open Source Website and Services
docs.rs
Expand Down Expand Up @@ -306,6 +307,9 @@ safebrowsing.google.com
safebrowsing.googleapis.com
# Google NEL
.nel.goog
# Connectivity Check
connectivitycheck.android.com
connectivitycheck.gstatic.com

# >> Apple CDN
# Apple Live
Expand Down Expand Up @@ -820,6 +824,7 @@ edge1.certona.net
assets.hearstapps.com
cdn.quadpay.com
cdn1.identitymind.com
cdn.plot.ly

cdn.transcend.io
.transcend-cdn.com
Expand Down Expand Up @@ -903,9 +908,15 @@ cdn2.editmysite.com
updates.signal.org
updates2.signal.org

# Segment
# >> Segment
cdn.segment.com

# >> TikTok
# Following domains DO NOT have ANY geo block and can even access in Hong Kong
.tiktokcdn.com
.tiktokcdn-us.com
.ibyteimg.com

# >> Email Image CDN
.cmail20.com
css.createsend1.com
Expand Down Expand Up @@ -1061,6 +1072,10 @@ ocsp2.apple.com
ocsp.sectigo.com
crl.usertrust.com
crt.comodoca.com
crl.verisign.com
ocsp.godaddy.com
# https://letsencrypt.org/docs/lencr.org/
.lencr.org

# >> General CDN
# BackBlaze
Expand Down Expand Up @@ -2513,3 +2528,10 @@ ledger-wp-website-s3-prd.ledger.com
cdn.kobo.com
static.kobo.com
cdn.gofundme.com
static-r.kamihimeproject.net
web-assets.otogi-frontier.com
cdn.datdota.com
cdn.up-timely.com
img.supjav.com
.mycdn.me
favicon.yandex.net
1 change: 1 addition & 0 deletions Source/domainset/reject_sukka.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ optimus-ads.amap.com
.macyy.cn
.macdown.com
.zupee.com
.screenstudio.vip

# >> Qihoo 360
hot.m.shouji.360tpcdn.com
Expand Down
7 changes: 7 additions & 0 deletions Source/non_ip/domestic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ DOMAIN,cn.download.nvidia.com

DOMAIN-SUFFIX,12306.cn
DOMAIN-SUFFIX,12306.com
DOMAIN-SUFFIX,123pan.com
DOMAIN-SUFFIX,1905.com
DOMAIN-SUFFIX,22.cn
DOMAIN-SUFFIX,263.net
Expand All @@ -384,6 +385,8 @@ DOMAIN-SUFFIX,51ctocdn.cn
DOMAIN-SUFFIX,56.com
DOMAIN-SUFFIX,58.com
DOMAIN-SUFFIX,66law.cn
DOMAIN-SUFFIX,88.com
DOMAIN-SUFFIX,88y.cn
DOMAIN-SUFFIX,9game.cn
DOMAIN-SUFFIX,aicdn.com
DOMAIN-SUFFIX,aicoinstorge.com
Expand Down Expand Up @@ -480,6 +483,7 @@ DOMAIN-SUFFIX,jiguang.cn
DOMAIN-SUFFIX,jb51.net
DOMAIN-SUFFIX,jpush.cn
DOMAIN-SUFFIX,kaiyanapp.com
DOMAIN-SUFFIX,kdslife.net
DOMAIN-SUFFIX,keepcdn.com
DOMAIN-SUFFIX,kfc.com.cn
DOMAIN-SUFFIX,kkmh.com
Expand Down Expand Up @@ -519,6 +523,8 @@ DOMAIN-SUFFIX,orayimg.com
DOMAIN-SUFFIX,oray-img.com
DOMAIN-SUFFIX,oschina.net
DOMAIN-SUFFIX,pcauto.com.cn
DOMAIN-SUFFIX,pchome.net
DOMAIN-SUFFIX,pchpic.net
DOMAIN-SUFFIX,pconline.com.cn
DOMAIN-SUFFIX,peiluyou.com
DOMAIN-SUFFIX,php.cn
Expand Down Expand Up @@ -584,6 +590,7 @@ DOMAIN-SUFFIX,zdic.net
DOMAIN-SUFFIX,zhangzs.com
DOMAIN-SUFFIX,zhipin.com
DOMAIN-SUFFIX,zol.com.cn
DOMAIN-SUFFIX,zol-img.com.cn
DOMAIN-SUFFIX,zui.com
DOMAIN-SUFFIX,zuimeitianqi.com
DOMAIN-SUFFIX,zuoyebang.com
1 change: 1 addition & 0 deletions Source/non_ip/domestic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export const DOMESTICS = {
'iesdouyin.com',
'pstatp.com',
'snssdk.com',
'bytegoofy.com',
'toutiao.com',
'feishu.cn',
'feishu.net',
Expand Down
16 changes: 13 additions & 3 deletions Source/non_ip/global.conf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ DOMAIN-SUFFIX,run.app
DOMAIN-SUFFIX,cloudflare-dns.com
DOMAIN-SUFFIX,cloudflare.com
DOMAIN-SUFFIX,cloudflareresolve.com
DOMAIN-SUFFIX,cloudflarestatus.com

# >> Microsoft Overseas
DOMAIN-SUFFIX,office365.com
Expand Down Expand Up @@ -304,6 +305,7 @@ DOMAIN-SUFFIX,bitfinex.com
DOMAIN-SUFFIX,bit.ly
DOMAIN-SUFFIX,bitly.com
DOMAIN-SUFFIX,bitmex.com
DOMAIN-SUFFIX,blogimg.jp
DOMAIN-SUFFIX,bloomberg.com
DOMAIN-SUFFIX,blizzard.com
DOMAIN-SUFFIX,booklive.jp
Expand Down Expand Up @@ -350,6 +352,7 @@ DOMAIN-SUFFIX,dynu.com
DOMAIN-SUFFIX,dynu.net
DOMAIN-SUFFIX,dw.com
DOMAIN-SUFFIX,e-hentai.org
DOMAIN-SUFFIX,edgecastcdn.net
DOMAIN-SUFFIX,exhentai.org
DOMAIN-SUFFIX,etsy.com
DOMAIN-SUFFIX,euronews.com
Expand All @@ -362,6 +365,7 @@ DOMAIN-SUFFIX,flipkart.com
DOMAIN-SUFFIX,gameloft.com
DOMAIN-SUFFIX,gate.io
DOMAIN-SUFFIX,genius.com
DOMAIN-SUFFIX,getchu.com
DOMAIN-SUFFIX,gettyimages.com
DOMAIN-SUFFIX,gitlab.com
DOMAIN-SUFFIX,ghostery.com
Expand Down Expand Up @@ -391,6 +395,7 @@ DOMAIN-SUFFIX,istockphoto.com
DOMAIN-SUFFIX,iwara.tv
DOMAIN-SUFFIX,ixxx.com
DOMAIN-SUFFIX,jable.tv
DOMAIN-SUFFIX,java.com
DOMAIN-SUFFIX,jkforum.net
DOMAIN-SUFFIX,jsdelivr.com
DOMAIN-SUFFIX,jsdelivr.net
Expand All @@ -403,7 +408,7 @@ DOMAIN-SUFFIX,kwai.com
DOMAIN-SUFFIX,launchdarkly.com
DOMAIN-SUFFIX,leetcode.com
DOMAIN-SUFFIX,ledger.com
DOMAIN-SUFFIX,live.com
DOMAIN-SUFFIX,mapbox.com
DOMAIN-SUFFIX,mastodon.social
DOMAIN-SUFFIX,matrix.org
DOMAIN-SUFFIX,meetup.com
Expand All @@ -416,13 +421,16 @@ DOMAIN-SUFFIX,moegirl.uk
DOMAIN-SUFFIX,mojang.com
DOMAIN-SUFFIX,mozilla.com
DOMAIN-SUFFIX,mozilla.org
DOMAIN-SUFFIX,muku.tv
DOMAIN-SUFFIX,myfreecams.com
DOMAIN-SUFFIX,mypikpak.com
DOMAIN-SUFFIX,naver.com
DOMAIN-SUFFIX,nbcnews.com
DOMAIN-SUFFIX,newsblur.com
DOMAIN-SUFFIX,nhentai.net
DOMAIN-SUFFIX,nhentai.xxx
DOMAIN-SUFFIX,noip.com
DOMAIN-SUFFIX,notion.so
DOMAIN-SUFFIX,npm.im
DOMAIN-SUFFIX,npmjs.com
DOMAIN-SUFFIX,nyaa.si
Expand Down Expand Up @@ -495,6 +503,7 @@ DOMAIN-SUFFIX,stackoverflow.com
DOMAIN-SUFFIX,steamcommunity.com
DOMAIN-SUFFIX,stripchat.com
DOMAIN-SUFFIX,substack.com
DOMAIN-SUFFIX,supjav.com
DOMAIN-SUFFIX,surfshark.com
DOMAIN-SUFFIX,t66y.com
DOMAIN-SUFFIX,tenor.com
Expand Down Expand Up @@ -551,10 +560,11 @@ DOMAIN-SUFFIX,xvideos.com
DOMAIN-SUFFIX,xvideos-cdn.com
DOMAIN-SUFFIX,yahoo.com
DOMAIN-SUFFIX,yahoo.co.jp
DOMAIN-SUFFIX,yandex.com
DOMAIN-SUFFIX,yandex.net
DOMAIN-SUFFIX,yandex.ru
DOMAIN-SUFFIX,zendesk.com

DOMAIN,onedrive.live.com

DOMAIN-KEYWORD,jav
# Keyword Collected
DOMAIN-KEYWORD,pinterest
Expand Down
4 changes: 4 additions & 0 deletions Source/non_ip/microsoft.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DOMAIN-SUFFIX,aadrm.com
DOMAIN-SUFFIX,acompli.com
DOMAIN-SUFFIX,acompli.net
DOMAIN-SUFFIX,aka.ms
DOMAIN-SUFFIX,appcenter.ms
DOMAIN-SUFFIX,aria.ms
DOMAIN-SUFFIX,asp.net
DOMAIN-SUFFIX,aspnetcdn.com
Expand All @@ -18,16 +19,19 @@ DOMAIN-SUFFIX,azure.net
DOMAIN-SUFFIX,azureedge.net
DOMAIN-SUFFIX,azurerms.com
DOMAIN-SUFFIX,bing.com
DOMAIN-SUFFIX,clarity.ms
DOMAIN-SUFFIX,cloudapp.net
DOMAIN-SUFFIX,cloudappsecurity.com
DOMAIN-SUFFIX,docs.com
DOMAIN-SUFFIX,edgesuite.net
DOMAIN-SUFFIX,gfx.ms
DOMAIN-KEYWORD,hotmail
DOMAIN-SUFFIX,hotmail.com
DOMAIN-SUFFIX,live.com
DOMAIN-SUFFIX,live.net
DOMAIN-SUFFIX,lync.com
DOMAIN-SUFFIX,microsoft.com
DOMAIN-SUFFIX,microsoftonline.com
DOMAIN-SUFFIX,msappproxy.net
DOMAIN-SUFFIX,msauth.net
DOMAIN-SUFFIX,msauthimages.net
Expand Down
10 changes: 4 additions & 6 deletions Source/non_ip/reject.conf
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ DOMAIN-KEYWORD,appsflyer
DOMAIN-KEYWORD,dnserror
DOMAIN-KEYWORD,marketing.net
DOMAIN,stun.smartgslb.com
DOMAIN-SUFFIX,2o7.net
DOMAIN-SUFFIX,omtrdc.net
DOMAIN-SUFFIX,footprintdns.com
DOMAIN-SUFFIX,measure.office.com

DOMAIN-KEYWORD,_vmind.qqvideo.tc.qq.com
DOMAIN-KEYWORD,-logging.nextmedia.com
Expand Down Expand Up @@ -217,12 +221,6 @@ DOMAIN-KEYWORD,smetrics.marketing.
DOMAIN-SUFFIX,notifysrv.com
DOMAIN-SUFFIX,notify6.com

# >> Simplify CNAME disguised domains
DOMAIN-SUFFIX,2o7.net
DOMAIN-SUFFIX,omtrdc.net
DOMAIN-SUFFIX,footprintdns.com
DOMAIN-SUFFIX,measure.office.com

# Tencent AD KEYWORD
DOMAIN-KEYWORD,wxsnsdy

Expand Down
6 changes: 4 additions & 2 deletions Source/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,15 +659,17 @@ const TIKTOK: StreamService = {
rules: [
'DOMAIN-SUFFIX,byteoversea.com',
'DOMAIN-SUFFIX,ibytedtos.com',
'DOMAIN-SUFFIX,ibyteimg.com',
// 'DOMAIN-SUFFIX,ibyteimg.com', // We confirm that tiktokcdn DOES NOT have ANY geoblock
'DOMAIN-SUFFIX,ipstatp.com',
'DOMAIN-SUFFIX,isnssdk.com',
'DOMAIN-SUFFIX,muscdn.com',
'DOMAIN-SUFFIX,musical.ly',
'DOMAIN-SUFFIX,tiktok.com',
'DOMAIN-SUFFIX,tiktok.us',
'DOMAIN-SUFFIX,tik-tokapi.com',
'DOMAIN-SUFFIX,tiktokcdn.com',
// 'DOMAIN-SUFFIX,tiktokcdn.com', // We confirm that tiktokcdn DOES NOT have ANY geoblock
'DOMAIN-SUFFIX,tiktokv.com',
'DOMAIN-SUFFIX,tiktokw.com',
'DOMAIN-KEYWORD,-tiktokcdn-com',

'USER-AGENT,TikTok*'
Expand Down
Binary file modified bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
"tldts": "^6.1.16"
},
"devDependencies": {
"@eslint-sukka/node": "5.1.2",
"@eslint-sukka/ts": "5.1.2",
"@eslint-sukka/node": "6.0.0-beta.3",
"@eslint-sukka/ts": "6.0.0-beta.3",
"@types/async-retry": "^1.4.8",
"@types/bun": "^1.0.12",
"@types/tar-stream": "^3.1.3",
"bun-types": "^1.1.3",
"eslint": "^8.57.0",
"eslint-config-sukka": "5.1.2",
"eslint-formatter-sukka": "5.1.2",
"eslint": "^9.0.0",
"eslint-config-sukka": "6.0.0-beta.3",
"eslint-formatter-sukka": "6.0.0-beta.3",
"mitata": "^0.1.11",
"typescript": "^5.4.5"
},
Expand Down

0 comments on commit 9dd67d8

Please sign in to comment.