- The /frame handler reads the client's network key (IPv6 /64) before it
awaits the camera, so a client that drops the connection is still
charged to its own window instead of the shared fallback key.
- The budget is charged only after the Google key and finite catalog
coordinates are confirmed, and the key is read once.
- Places and the CCTV window share one default (GOOGLE_DEFAULT_PER_MIN).
- Tests: the catalog-only test checks heading/fov/pitch from the query at
the catalog location; the budget test covers unknown ids, forwarded
requests and /64 grouping; a real-socket test covers a dropped
connection. The duplicate pose test is removed.
- .env.example, SECURITY.md, CURRENT-STATE and the changelog fragment
describe the separate per-IP window, the catalog position and the
placeholder for seed cameras.
Tests now check Cache-Control on the proxy's own 400, 405, 429 and
transport 502, a geocode 503 with ZERO_RESULTS on both geocode routes,
and an upstream 429 with an HTML body on both Places routes; the geocode
status cases move to the geocode suite and cover reverse-geocode too.
An unreadable Places 200 now throws into the existing catch instead of
repeating its 502 reply. Comments and the CURRENT-STATE rule are shorter
and match the code.
Every Google route now sets no-store right after the same-site gate and
switches to private, max-age=300 only on a confirmed answer, so the
proxy's own 400, 405, 429 and 502 replies are no longer left without a
header. Both Places routes answer an unreadable 200 body with 502 instead
of caching an empty result, as the geocode routes already did. The test
pins the allowlist with OVER_DAILY_LIMIT and UNKNOWN_ERROR and covers the
unreadable and empty Places bodies; the changelog fragment is shorter.
The Places and Geocoding proxies sent Cache-Control: private,
max-age=300 whatever Google answered. A 403 from a key without the
Places API, or a geocode REQUEST_DENIED / OVER_QUERY_LIMIT (which
Google sends as HTTP 200), was then replayed from the browser cache for
five minutes after the key was fixed. Refusals are now no-store.
/api/google/text-search spends the same Google quota as nearby-places but
was not behind the cross-site gate. It now refuses cross-site requests
before calling Google, and a test covers both paid Google routes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The OpenAI endpoints (/api/realtime/token, /api/openai/hud-summary) now
allow 30 requests per minute per client IP and the Google Places endpoints
120, the caps the Pinokio build already ships. GEV_RATELIMIT_OPENAI_PER_MIN
and GEV_RATELIMIT_GOOGLE_PER_MIN still override them and exactly 0 disables
them; an unreadable value falls back to the default rather than to
unlimited.
Salvaged from #683 onto current main.
Co-authored-by: Sameh Khamis <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The cost-bearing endpoints (/api/realtime/token, /api/openai/hud-summary,
/api/google/nearby-places) and the voice debug log refuse cross-site browser
requests: a foreign or opaque Origin, a Sec-Fetch-Site other than
same-origin/none, or proxy forwarding headers. Loopback tools without an
Origin and the LAN opt-in keep working. The dev and preview servers send one
shared Content-Security-Policy, and embed-mode framing rewrites only the
frame-ancestors directive of it.
Salvaged from #242 onto current main.
Co-authored-by: Sameh Khamis <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- reject blank viewport-bias components before Number() reads them as 0
- give the upstream call a 10s deadline and a 256 KiB capped body read
- return fixed public text on failure instead of the upstream message
- Google's Geocoding web service refuses referrer-restricted keys, so the
browser call forced GOOGLE_MAPS_API_KEY to ship unrestricted
- add /api/google/geocode and /api/google/reverse-geocode, using the server
key like Places and Street View already do
- the browser key now needs the Map Tiles API only