# Error reports reach a locked-down tracker only through the Worker

The Worker alone holds the tracker's ingest key; the browser and the Expo app send through /api/errors/tunnel, which forwards an allowlist of DSNs.

- **An ingest key only the Worker holds.** A tracker can now refuse every envelope that lacks a secret header. Set `ERROR_REPORTING_INGEST_KEY` as a Worker secret, at least 32 characters (header name `ERROR_REPORTING_INGEST_HEADER`, default `X-Rustrak-Ingest-Key`). It goes only to the host of `ERROR_REPORTING_DSN`, over HTTPS: the Worker's own SDK sends it and no longer follows redirects, and no client bundle or response carries it. Without a key nothing changes against an open tracker. See [error reporting](/docs/architecture/observability#error-reporting). ([bb2996b](https://github.com/CarlosZiegler/template-cloudflare/commit/bb2996b8951acb6a7db3783893a74241c111045f), [126c597](https://github.com/CarlosZiegler/template-cloudflare/commit/126c5979da4e7932dad78f0b9e2e0b2dd8ad82c5))
- **One tunnel for the browser and the app.** `POST /api/errors/tunnel` forwards envelopes whose DSN names the host and project of one in `ERROR_REPORTING_TUNNEL_DSNS` (comma-separated) or `VITE_ERROR_REPORTING_DSN`, and answers 403 to any other before counting it. It adds the ingest header for the Worker's own tracker, uses the allowed DSN's own key, caps bodies at 256 KB, never follows a redirect and keeps the database limit of 30 a minute per User or address. ([bb2996b](https://github.com/CarlosZiegler/template-cloudflare/commit/bb2996b8951acb6a7db3783893a74241c111045f))
- **The Expo app posts to the Worker.** Errors go to `${EXPO_PUBLIC_SERVER_URL}/api/errors/tunnel`, never to the tracker. The native SDKs cannot use a tunnel, so they stay off: JS errors are reported, native crashes no longer are. Add the app's DSN to `ERROR_REPORTING_TUNNEL_DSNS`. ([42100e8](https://github.com/CarlosZiegler/template-cloudflare/commit/42100e89939a6589883e52657296ed8d6e36247f))
- **A locked-down ingest host.** `deploy/error-tracker` gains the `locked` profile: Caddy in front of Rustrak passes only `POST /api/<id>/envelope/` with the ingest key and sentry-cli uploads with their token, answers 403 to an envelope without the key and 404 to the rest. The README also describes a dashboard reachable only on a Tailscale tailnet. A local run proved the Worker's event, a browser error and an app envelope through the tunnel, a foreign DSN refused, and no key in any stored event. ([1ce77d2](https://github.com/CarlosZiegler/template-cloudflare/commit/1ce77d2b265801289c9e1584834477101bfb37ee))
