CCTV Street View fallback: the browser's pose at the catalog position

The fallback keeps the catalog position but takes heading, field of view
and pitch from the request again, as before, clamped as before. A catalog
camera with no pose (every world-cameras row on main) otherwise asked
Google for heading 0, pitch 0, FOV 80 while the browser draws it at the
id-hash heading, pitch -17 and FOV 74, and a calibrated camera lost its
calibration. Cost and the per-IP budget are unchanged.

- The Street View budget is built per proxy, so tests no longer depend on
  GEV_RATELIMIT_GOOGLE_PER_MIN in the shell; the fixture pins it.
- New tests: a pose-less catalog camera, and the per-IP budget (no call
  without a key, the cap, a separate budget per address).
- The client no longer sends lat/lon on /frame.
- CURRENT-STATE, the changelog fragment and SECURITY.md say the fallback
  has its own per-client limit, and that unlisted (seed) cameras get the
  placeholder.
This commit is contained in:
German Khokhlov committed 2026-11-19 19:06:53 +04:00
1 parent f579b23f52
commit 11e1c9d26d
8 files changed
+235 -36

No files matched your search

+8 -3
View File
@@ -1277,9 +1277,14 @@ redirects on those hosts, are pinned by parsed URL to the agency's image
directory. Every `/api/cctv` route refuses cross-site browser requests but
accepts forwarding headers, so cameras work behind a reverse proxy; a forwarded
request skips the key-bearing Street View fallback and gets the placeholder. The
Street View fallback serves only catalog cameras, at the catalog position,
heading, field of view and pitch, never coordinates a request supplies, and it
shares the per-client Google budget (`GEV_RATELIMIT_GOOGLE_PER_MIN`, default 120).
Street View fallback serves only catalog cameras, always at the catalog
position; coordinates a request supplies are ignored. Heading, field of view
and pitch come from the request, the pose the browser draws with calibration
included, and fall back to the catalog pose. A camera the server does not list,
such as a bundled seed camera the browser shows when the server catalog is
empty, gets the placeholder. The fallback has its own per-client limit on the
Google setting (`GEV_RATELIMIT_GOOGLE_PER_MIN`, default 120, `0` disables it);
a request over it gets the placeholder.
The CCTV layer draws only the cameras on or near the screen. Zoomed out, it
keeps one camera per ground cell sized to the view, preferring a healthy feed,