SurfSense/surfsense_web/lib/env-config.ts

29 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-01-13 20:47:21 -08:00
/**
* Environment configuration for the frontend.
2026-01-14 15:27:42 +02:00
*
2026-01-13 20:47:21 -08:00
* This file centralizes access to NEXT_PUBLIC_* environment variables.
* For Docker deployments, these placeholders are replaced at container startup
* via sed in the entrypoint script.
2026-01-14 15:27:42 +02:00
*
2026-01-13 20:47:21 -08:00
* IMPORTANT: Do not use template literals or complex expressions with these values
* as it may prevent the sed replacement from working correctly.
*/
// Auth type: "LOCAL" for email/password, "GOOGLE" for OAuth
// Placeholder: __NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE__
export const AUTH_TYPE = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE || "GOOGLE";
// Backend API URL
// Placeholder: __NEXT_PUBLIC_FASTAPI_BACKEND_URL__
export const BACKEND_URL = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000";
// ETL Service: "DOCLING" or "UNSTRUCTURED"
// Placeholder: __NEXT_PUBLIC_ETL_SERVICE__
export const ETL_SERVICE = process.env.NEXT_PUBLIC_ETL_SERVICE || "DOCLING";
// Helper to check if local auth is enabled
export const isLocalAuth = () => AUTH_TYPE === "LOCAL";
2026-01-14 15:27:42 +02:00
// Helper to check if Google auth is enabled
2026-01-13 20:47:21 -08:00
export const isGoogleAuth = () => AUTH_TYPE === "GOOGLE";