diff --git a/package.json b/package.json index a72458b7..1186c6b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browsertrix-crawler", - "version": "1.5.10", + "version": "1.5.11", "main": "browsertrix-crawler", "type": "module", "repository": "https://github.com/webrecorder/browsertrix-crawler", diff --git a/src/util/file_reader.ts b/src/util/file_reader.ts index 096dd34f..9836358f 100644 --- a/src/util/file_reader.ts +++ b/src/util/file_reader.ts @@ -83,7 +83,9 @@ async function collectGitBehaviors(gitUrl: string): Promise { async function collectOnlineBehavior(url: string): Promise { const filename = crypto.randomBytes(4).toString("hex") + ".js"; - const behaviorFilepath = `/app/behaviors/${filename}`; + const tmpDir = `/tmp/behaviors-${crypto.randomBytes(4).toString("hex")}`; + await fsp.mkdir(tmpDir, { recursive: true }); + const behaviorFilepath = path.join(tmpDir, filename); try { const res = await fetch(url, { dispatcher: getProxyDispatcher() });