From b430a6f515b03d292dfe479c2b7e08e2c8c63c89 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 9 May 2025 01:15:49 -0700 Subject: [PATCH] rename var --- docs/troubleshooting/index.md | 12 ++++++++++++ src/utils/proxy/http.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting/index.md b/docs/troubleshooting/index.md index 815504390..0825eb0b2 100644 --- a/docs/troubleshooting/index.md +++ b/docs/troubleshooting/index.md @@ -81,3 +81,15 @@ services: sysctls: - net.ipv6.conf.all.disable_ipv6=1 ``` + +## Running homepage behind a proxy + +If you are running homepage behind e.g. squid proxy, you can set the environment variable `HOMEPAGE_HTTP_PROXY_URL` to the URL of your proxy. This will allow homepage to use the proxy for all outgoing requests. + +```yaml +services: + homepage: + ... + environment: + - HOMEPAGE_HTTP_PROXY=http://proxy.local:3128 +``` diff --git a/src/utils/proxy/http.js b/src/utils/proxy/http.js index c5fa51183..1feaf5780 100644 --- a/src/utils/proxy/http.js +++ b/src/utils/proxy/http.js @@ -110,7 +110,7 @@ export async function cachedRequest(url, duration = 5, ua = "homepage") { export async function httpProxy(url, params = {}) { const constructedUrl = new URL(url); - const proxyUrl = process.env.HOMEPAGE_HTTP_PROXY_URL; // e.g., http://proxy.local:3128 + const proxyUrl = process.env.HOMEPAGE_HTTP_PROX; // e.g. http://proxy.local:3128 const disableIpv6 = process.env.HOMEPAGE_PROXY_DISABLE_IPV6 === "true"; const agentOptions = disableIpv6 ? { family: 4, autoSelectFamily: false } : {};