mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
- Introduced a new endpoint to check if the application is running in a containerized environment, allowing the UI to display appropriate risk warnings. - Added a confirmation dialog for users when running outside a sandbox, requiring acknowledgment of potential risks before proceeding. - Implemented a rejection screen for users who deny sandbox risk confirmation, providing options to restart in a container or reload the application. - Updated the main application logic to handle sandbox status checks and user responses effectively, enhancing security and user experience.
31 lines
930 B
TypeScript
31 lines
930 B
TypeScript
/**
|
|
* Health check routes
|
|
*
|
|
* NOTE: Only the basic health check (/) and environment check are unauthenticated.
|
|
* The /detailed endpoint requires authentication.
|
|
*/
|
|
|
|
import { Router } from 'express';
|
|
import { createIndexHandler } from './routes/index.js';
|
|
import { createEnvironmentHandler } from './routes/environment.js';
|
|
|
|
/**
|
|
* Create unauthenticated health routes (basic check only)
|
|
* Used by load balancers and container orchestration
|
|
*/
|
|
export function createHealthRoutes(): Router {
|
|
const router = Router();
|
|
|
|
// Basic health check - no sensitive info
|
|
router.get('/', createIndexHandler());
|
|
|
|
// Environment info including containerization status
|
|
// This is unauthenticated so the UI can check on startup
|
|
router.get('/environment', createEnvironmentHandler());
|
|
|
|
return router;
|
|
}
|
|
|
|
// Re-export detailed handler for use in authenticated routes
|
|
export { createDetailedHandler } from './routes/detailed.js';
|