mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 21:23:07 +00:00
Fix race condition where sandbox warning appeared on every refresh even after checking "Do not show again". The issue was that the sandbox check effect ran before settings were hydrated from the server, so skipSandboxWarning was always false (the default). Changes: - Add settingsLoaded to sandbox check dependencies to ensure the user's preference is loaded before checking - Add AUTOMAKER_SKIP_SANDBOX_WARNING env var option to skip the warning entirely (useful for dev/CI environments)
23 lines
696 B
TypeScript
23 lines
696 B
TypeScript
/**
|
|
* GET /environment endpoint - Environment information including containerization status
|
|
*
|
|
* This endpoint is unauthenticated so the UI can check it on startup
|
|
* before login to determine if sandbox risk warnings should be shown.
|
|
*/
|
|
|
|
import type { Request, Response } from 'express';
|
|
|
|
export interface EnvironmentResponse {
|
|
isContainerized: boolean;
|
|
skipSandboxWarning?: boolean;
|
|
}
|
|
|
|
export function createEnvironmentHandler() {
|
|
return (_req: Request, res: Response): void => {
|
|
res.json({
|
|
isContainerized: process.env.IS_CONTAINERIZED === 'true',
|
|
skipSandboxWarning: process.env.AUTOMAKER_SKIP_SANDBOX_WARNING === 'true',
|
|
} satisfies EnvironmentResponse);
|
|
};
|
|
}
|