A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
feat(workers): add CRAWLER_BROWSER_TIMEZONE
Mohamed Bassemba8c18850517
diff --git a/apps/workers/workers/crawler/crawlPage.ts b/apps/workers/workers/crawler/crawlPage.tsindex 71605837..51ca484b 100644--- a/apps/workers/workers/crawler/crawlPage.ts+++ b/apps/workers/workers/crawler/crawlPage.ts@@ -651,6 +651,9 @@ export async function crawlPage(browser.newContext({viewport: { width: 1440, height: 900 },userAgent,+ // A UTC browser behind a proxy that geolocates elsewhere is a+ // strong bot signal; this should match the proxy's location.+ timezoneId: serverConfig.crawler.browserTimezone,proxy: proxyConfig,serviceWorkers: "block",}),diff --git a/docs/docs/03-configuration/01-environment-variables.md b/docs/docs/03-configuration/01-environment-variables.mdindex 4cf22471..d2297b0d 100644--- a/docs/docs/03-configuration/01-environment-variables.md+++ b/docs/docs/03-configuration/01-environment-variables.md@@ -149,6 +149,7 @@ Either `OPENAI_API_KEY` or `OLLAMA_BASE_URL` need to be set for automatic taggin| CRAWLER_FULL_PAGE_ARCHIVE_MAX_SIZE_MB | No | 0 | Maximum size in MB for a stored full-page archive. Archives larger than this are discarded instead of saved, since media-rich pages can produce 1GB+ files that never render. 0 disables the limit. || CRAWLER_JOB_TIMEOUT_SEC | No | 60 | How long to wait for the crawler job to finish before timing out. If you have a slow internet connection or a low powered device, you might want to bump this up a bit || CRAWLER_NAVIGATE_TIMEOUT_SEC | No | 30 | How long to spend navigating to the page (along with its redirects). Increase this if you have a slow internet connection |+| CRAWLER_BROWSER_TIMEZONE | No | Not set | IANA timezone (e.g. `America/New_York`) that the crawler's browser reports to websites. Bot-protection services flag browsers whose timezone doesn't match their IP's location, so if you crawl through a proxy, set this to the proxy's location. When not set, the browser uses its own timezone (usually UTC in containers). || CRAWLER_PREFLIGHT_USER_AGENT | No | Not set | The `User-Agent` header to send on the crawler's preflight request (the plain HTTP request that determines a link's content type and extracts early preview metadata before the full crawl). If not set, no `User-Agent` header is sent. || CRAWLER_PARSE_TIMEOUT_SEC | No | 60 | How long to wait for the HTML parsing subprocess (metadata extraction + readability) to finish before timing out. || CRAWLER_PARSER_MEM_LIMIT_MB | No | 512 | Maximum heap size in MB for the HTML parsing subprocess. If the parser OOMs on large pages, increase this value. The subprocess is isolated so an OOM won't crash the main worker. |diff --git a/packages/shared/config.ts b/packages/shared/config.tsindex 212ffe68..11408952 100644--- a/packages/shared/config.ts+++ b/packages/shared/config.ts@@ -126,6 +126,20 @@ const allEnv = z.object({BROWSER_COOKIE_PATH: z.string().optional(),CRAWLER_JOB_TIMEOUT_SEC: z.coerce.number().default(60),CRAWLER_NAVIGATE_TIMEOUT_SEC: z.coerce.number().default(30),+ CRAWLER_BROWSER_TIMEZONE: z+ .string()+ .refine(+ (tz) => {+ try {+ new Intl.DateTimeFormat("en-US", { timeZone: tz });+ return true;+ } catch {+ return false;+ }+ },+ { message: "must be a valid IANA timezone (e.g. America/New_York)" },+ )+ .optional(),CRAWLER_NUM_WORKERS: z.coerce.number().default(1),INFERENCE_NUM_WORKERS: z.coerce.number().default(1),SEARCH_NUM_WORKERS: z.coerce.number().default(1),@@ -406,6 +420,7 @@ const serverConfigSchema = allEnv.transform((val, ctx) => {browserCookiePath: val.BROWSER_COOKIE_PATH,jobTimeoutSec: val.CRAWLER_JOB_TIMEOUT_SEC,navigateTimeoutSec: val.CRAWLER_NAVIGATE_TIMEOUT_SEC,+ browserTimezone: val.CRAWLER_BROWSER_TIMEZONE,downloadBannerImage: val.CRAWLER_DOWNLOAD_BANNER_IMAGE,storeScreenshot: val.CRAWLER_STORE_SCREENSHOT,fullPageScreenshot: val.CRAWLER_FULL_PAGE_SCREENSHOT,