Skip to content

web

The web server for unset.sh. Package @unset/interfaces-web. Compose service web still sets UNSET_SERVICE: http. The image starts at node interfaces/web/server.ts (deployment/images/node-app.Dockerfile).

Routes and limits are on Endpoints. The request gate is on Security model. ADR 0054, ADR 0055 and ADR 0056 are the decisions.

Owns

Public pages, sign-in, the signed-in member’s page, and the adapters those routes call. interfaces/web/src/lib/server/compose.ts is the only file here that builds adapters. startServices runs from the SvelteKit init hook, before server.ts listens. It wires the web pools, the sealer, net-guard, the identity network, the OAuth client, the session store and the account repository.

interfaces/web/server.ts is the adapter-node custom server. Every response, files included, gets the host check, the security headers from shared/http, one log line, listen and the drain. Settings load first and exit 78 when invalid.

interfaces/web/src/hooks.server.ts is the request gate. Its header lists the order: the route’s policy (none is a refusal), test routes, form-only bodies, the body size, the client address and its limit, the session and the member limit, the route under its deadline, then the group’s CSP. SvelteKit’s Origin check runs on form posts before this hook. Any other body is 415. tests/integration/web/csrf-coverage.test.ts covers that.

PathWhat it holds
interfaces/web/src/lib/server/policy.tsdefinePolicy. Session modes are required, writes, onboarding and optional.
interfaces/web/src/lib/server/route-table.tsReads each route folder’s policy.ts.
interfaces/web/src/lib/server/app-gate.tsAfter the session: onboarding, then a confirmed email.
interfaces/web/src/lib/server/session.tsCookie __Host-sid.
interfaces/web/src/lib/server/limits.tsRate-limit names. Which route uses which is on Endpoints.
interfaces/web/src/lib/server/config.tsTyped settings for this process.
interfaces/web/src/routes/One folder per route, each with a policy.ts.

Screens are web. A server file may import a domain or infrastructure. A .svelte file or a universal +page.ts may not (svelte-screens-no-core). A route does not import infrastructure/postgres (web-routes-no-postgres). GET /health is interfaces/web/src/routes/health/ (probe: true); the body is shared/http/health.ts.