From d969701070bc50056123b57aa778899e5420366a Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Wed, 21 Feb 2024 10:26:39 -0800 Subject: [PATCH] warc prefix: support setting from WARC_PREFIX env var bump version to 1.0.0-beta.4 --- package.json | 2 +- src/util/recorder.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 56f0acd6..4e1fb750 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browsertrix-crawler", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "main": "browsertrix-crawler", "type": "module", "repository": "https://github.com/webrecorder/browsertrix-crawler", diff --git a/src/util/recorder.ts b/src/util/recorder.ts index 4def07ee..58354154 100644 --- a/src/util/recorder.ts +++ b/src/util/recorder.ts @@ -128,7 +128,8 @@ export class Recorder { fs.mkdirSync(this.archivesDir, { recursive: true }); fs.mkdirSync(this.tempCdxDir, { recursive: true }); - const prefix = crawler.params.warcPrefix || "rec"; + const prefix = + process.env.WARC_PREFIX || crawler.params.warcPrefix || "rec"; const crawlId = process.env.CRAWL_ID || os.hostname(); const filenameTemplate = `${prefix}-${crawlId}-$ts-${this.workerid}.warc${ this.gzip ? ".gz" : ""