From 10af362fe8fc2d22077cd2cbaede7f7da7ad7661 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 23 Jul 2025 19:42:30 +0600 Subject: [PATCH] api/env: add a warning about deprecation of API_EXTERNAL_PROXY --- api/src/core/env.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/src/core/env.js b/api/src/core/env.js index 519074db..e504a8dc 100644 --- a/api/src/core/env.js +++ b/api/src/core/env.js @@ -135,6 +135,8 @@ export const loadEnvs = (env = process.env) => { }; } +let loggedProxyWarning = false; + export const validateEnvs = async (env) => { if (env.sessionEnabled && env.jwtSecret.length < 16) { throw new Error("JWT_SECRET env is too short (must be at least 16 characters long)"); @@ -172,6 +174,15 @@ export const validateEnvs = async (env) => { throw new Error('freebind is not available when external proxy is enabled') } + if (env.externalProxy && !loggedProxyWarning) { + console.error('API_EXTERNAL_PROXY is deprecated and will be removed in a future release.'); + console.error('Use HTTP_PROXY or HTTPS_PROXY instead.'); + console.error('You can read more about the new proxy variables in docs/api-env-variables.md\n'); + + // prevent the warning from being printed on every env validation + loggedProxyWarning = true; + } + return env; }