mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-04 16:14:07 +00:00
fix: keep the mock JMAP server out of release builds
The mock JMAP server behind `/api/dev-jmap` accepts any password and shipped in every image, held back only by `DEV_MOCK_JMAP=true` at runtime. It now also needs the flag at build time (inlined through `next.config.ts`), so a build made without it cannot switch the mock on, and the Docker image drops the route before building.
This commit is contained in:
@@ -2471,7 +2471,11 @@ function tooLargeFor(method: string, args: MethodArgs, callId: string): MethodRe
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function isDevMockEnabled(): boolean {
|
||||
return process.env.DEV_MOCK_JMAP === 'true';
|
||||
// NEXT_PUBLIC_DEV_MOCK_JMAP is inlined at build time from DEV_MOCK_JMAP
|
||||
// (next.config.ts `env`), so a build made without the mock - every
|
||||
// release image and tarball - cannot switch it on through the runtime
|
||||
// environment: the mock accepts any password.
|
||||
return process.env.NEXT_PUBLIC_DEV_MOCK_JMAP === 'true' && process.env.DEV_MOCK_JMAP === 'true';
|
||||
}
|
||||
|
||||
function getBaseUrl(request: NextRequest): string {
|
||||
|
||||
Reference in New Issue
Block a user