mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-27 07:38:28 +00:00
api/env: add a warning about deprecation of API_EXTERNAL_PROXY
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run service tests / test service functionality (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run service tests / test service functionality (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
This commit is contained in:
parent
9fc5370b03
commit
10af362fe8
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user