Skip to content

Commit 6e83927

Browse files
committed
Update CDN Hosts
1 parent 573c0f5 commit 6e83927

File tree

2 files changed

+38
-18
lines changed

2 files changed

+38
-18
lines changed

Build/download-previous-build.js

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { Readable } = require('stream');
88
const { pipeline } = require('stream/promises');
99
const { readFileByLine } = require('./lib/fetch-remote-text-by-line');
1010
const { isCI } = require('ci-info');
11-
const { task } = require('./lib/trace-runner');
11+
const { task, traceAsync } = require('./lib/trace-runner');
1212

1313
const fileExists = (path) => {
1414
return fs.promises.access(path, fs.constants.F_OK)
@@ -31,7 +31,7 @@ const downloadPreviousBuild = task(__filename, async () => {
3131
line.startsWith('Modules/')
3232
) && !line.endsWith('/')
3333
) {
34-
allFileExists = await fileExists(join(__dirname, '..', line));
34+
allFileExists = fs.existsSync(join(__dirname, '..', line));
3535
filesList.push(line);
3636

3737
if (!allFileExists) {
@@ -47,35 +47,40 @@ const downloadPreviousBuild = task(__filename, async () => {
4747
return;
4848
}
4949

50-
console.log('Download previous build.');
51-
5250
const extractedPath = join(tmpdir(), `sukka-surge-last-build-extracted-${Date.now()}`);
5351

54-
const [resp] = await Promise.all([
55-
fetch('https://codeload.github.com/sukkaw/surge/tar.gz/gh-pages'),
56-
fse.ensureDir(extractedPath)
57-
]);
58-
59-
await pipeline(
60-
Readable.fromWeb(resp.body),
61-
tar.x({
62-
cwd: extractedPath,
63-
filter(p) {
64-
const dir = p.split('/')[1];
65-
return dir === 'List' || dir === 'Modules' || dir === 'Clash';
66-
}
67-
})
52+
await traceAsync(
53+
'Download and extract previous build',
54+
() => Promise.all([
55+
fetch('https://codeload.github.com/sukkaw/surge/tar.gz/gh-pages'),
56+
fse.ensureDir(extractedPath)
57+
]).then(([resp]) => pipeline(
58+
Readable.fromWeb(resp.body),
59+
tar.x({
60+
cwd: extractedPath,
61+
filter(p) {
62+
const dir = p.split('/')[1];
63+
return dir === 'List' || dir === 'Modules' || dir === 'Clash';
64+
}
65+
})
66+
))
6867
);
6968

69+
console.log('Files list:', filesList);
70+
7071
await Promise.all(filesList.map(async p => {
7172
const src = join(extractedPath, 'Surge-gh-pages', p);
7273
if (await fileExists(src)) {
74+
const dst = join(__dirname, '..', p);
75+
console.log('Copy', { src, dst });
7376
return fse.copy(
7477
src,
7578
join(__dirname, '..', p),
7679
{ overwrite: true }
7780
);
7881
}
82+
83+
console.log('File not exists:', src);
7984
}));
8085

8186
await fs.promises.unlink(extractedPath).catch(() => { });

Source/domainset/cdn.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ embed-ssl.wistia.com
362362
.alonestreaming.com
363363
.thisiscdn.com
364364
cdn.vidible.tv
365+
.video-cdn.net
365366
# vimeo
366367
player.vimeo.com
367368
.vimeocdn.com
@@ -658,6 +659,7 @@ player-frontend.cnevids.com
658659
w.chatlio.com
659660
snippet.maze.co
660661
.transcend-cdn.com
662+
imgssl.constantcontact.com
661663

662664
c.navattic.com
663665
js.navattic.com
@@ -929,6 +931,8 @@ assets.video.yahoo.net
929931
yep.video.yahoo.com
930932
# CookieLaw
931933
.cdn.cookielaw.org
934+
# CookieBot
935+
cookie-cdn.cookiepro.com
932936
# Cloudflare
933937
static.dash.cloudflare.com
934938
info.cloudflare.com
@@ -969,6 +973,7 @@ steamcdn-a.akamaihd.net
969973
# TikTok
970974
.ibytedtos.com
971975
.bytedapm.com
976+
.ttwstatic.com
972977
# eBay
973978
.ebayimg.com
974979
.ebaystatic.com
@@ -1517,6 +1522,12 @@ images.idgesg.net
15171522
.staticworld.net
15181523
# Indiegogo
15191524
.iggcdn.com
1525+
# dynamicyield.com
1526+
static.dynamicyield.com
1527+
st.dynamicyield.com
1528+
st-eu.dynamicyield.com
1529+
cdn.dynamicyield.com
1530+
cdn-eu.dynamicyield.com
15201531
# Others
15211532
api.mintlify.com
15221533
content-prod-live.cert.starbucks.com
@@ -1858,3 +1869,7 @@ assets.dnsfilter.com
18581869
images.emojiterra.com
18591870
cdn.osxdaily.com
18601871
user-uploads.perchance.org
1872+
img.riskified.com
1873+
cdn.pathfactory.com
1874+
cdn-app.pathfactory.com
1875+
.prcdn.co

0 commit comments

Comments
 (0)