aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-11-03 02:08:10 +0000
committerMohamed Bassem <me@mbassem.com>2025-11-03 02:08:10 +0000
commit737b03172c2e063ba311c23d6552418bd2ab1955 (patch)
tree210b5d35d575192be01e41f10f16cfe629c6d64f /apps
parentf0b0959efe380f879b2c673b06de1e4b87d31dd6 (diff)
downloadkarakeep-737b03172c2e063ba311c23d6552418bd2ab1955.tar.zst
fix: metascraper logo to go through proxy if one configured. fixes #1863
Diffstat (limited to 'apps')
-rw-r--r--apps/workers/workers/crawlerWorker.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/workers/workers/crawlerWorker.ts b/apps/workers/workers/crawlerWorker.ts
index ae7cfcab..357ae976 100644
--- a/apps/workers/workers/crawlerWorker.ts
+++ b/apps/workers/workers/crawlerWorker.ts
@@ -12,6 +12,8 @@ import DOMPurify from "dompurify";
import { eq } from "drizzle-orm";
import { execa } from "execa";
import { exitAbortController } from "exit";
+import { HttpProxyAgent } from "http-proxy-agent";
+import { HttpsProxyAgent } from "https-proxy-agent";
import { JSDOM, VirtualConsole } from "jsdom";
import metascraper from "metascraper";
import metascraperAmazon from "metascraper-amazon";
@@ -129,7 +131,18 @@ const metascraperParser = metascraper([
metascraperDescription(),
metascraperTwitter(),
metascraperImage(),
- metascraperLogo(),
+ metascraperLogo({
+ gotOpts: {
+ agent: {
+ http: serverConfig.proxy.httpProxy
+ ? new HttpProxyAgent(getRandomProxy(serverConfig.proxy.httpProxy))
+ : undefined,
+ https: serverConfig.proxy.httpsProxy
+ ? new HttpsProxyAgent(getRandomProxy(serverConfig.proxy.httpsProxy))
+ : undefined,
+ },
+ },
+ }),
metascraperUrl(),
]);