mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-04 19:21:51 +00:00
853610bbbf
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
599 B
TypeScript
22 lines
599 B
TypeScript
import { readEnv } from "@/lib/runtime-env";
|
|
|
|
// Boot-time required-env assertion so a misconfigured container fails fast
|
|
// with a clear message. A key with a deprecated legacy name is satisfied by
|
|
// either name (see readEnv).
|
|
const REQUIRED: ReadonlyArray<{
|
|
key: keyof NodeJS.ProcessEnv;
|
|
legacy?: keyof NodeJS.ProcessEnv;
|
|
}> = [
|
|
{ key: "UI_API_BASE_URL", legacy: "NEXT_PUBLIC_API_BASE_URL" },
|
|
{ key: "AUTH_URL" },
|
|
{ key: "AUTH_SECRET" },
|
|
];
|
|
|
|
for (const { key, legacy } of REQUIRED) {
|
|
if (!readEnv(key, legacy)) {
|
|
throw new Error(`Missing required env: ${key}`);
|
|
}
|
|
}
|
|
|
|
export {};
|