MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / readBackground

Function readBackground

apps/api/src/config/env/validate.ts:283–304  ·  view source on GitHub ↗
(source: EnvSource)

Source from the content-addressed store, hash-verified

281});
282
283const readBackground = (source: EnvSource) => ({
284 /*
285 * Schema defaults for QUEUES_ENABLED, CACHE_ENABLED, and
286 * NOTIFICATIONS_SSE_ENABLED are all `true` — see schema.ts. Calling
287 * `toBool` alone would collapse an unset variable to `false`, silently
288 * weakening JWT revocation (cache-backed) and SSE delivery for any
289 * deploy that didn't explicitly set them. `toBoolWithDefault` keeps
290 * the resolved config aligned with the documented schema.
291 */
292 QUEUES_ENABLED: toBoolWithDefault(
293 source.QUEUES_ENABLED,
294 true,
295 "QUEUES_ENABLED"
296 ),
297 CACHE_ENABLED: toBoolWithDefault(source.CACHE_ENABLED, true, "CACHE_ENABLED"),
298 CACHE_PROVIDER: source.CACHE_PROVIDER ?? "memory",
299 NOTIFICATIONS_SSE_ENABLED: toBoolWithDefault(
300 source.NOTIFICATIONS_SSE_ENABLED,
301 true,
302 "NOTIFICATIONS_SSE_ENABLED"
303 ),
304});
305
306const readWebPush = (source: EnvSource) => ({
307 WEB_PUSH_VAPID_PUBLIC: source.WEB_PUSH_VAPID_PUBLIC ?? "",

Callers 1

readRawFunction · 0.85

Calls 1

toBoolWithDefaultFunction · 0.85

Tested by

no test coverage detected