mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
CCTV Street View budget: key the client before the camera wait, share the default
- 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.
This commit is contained in:
1 parent
01368b95bf
commit
01d4a3f454
10 files changed
+175
-201
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
GOOGLE_DEFAULT_PER_MIN,
|
||||
googleServerApiKey,
|
||||
keylessGooglePlacesResponse,
|
||||
keylessGoogleGeocodeResponse,
|
||||
@@ -15,17 +16,7 @@ import {
|
||||
// undefined = not built yet; null = the explicit 0 opt-out; fn = active limiter
|
||||
let _googleRateLimiter;
|
||||
|
||||
/**
|
||||
* Requests/min/IP applied when GEV_RATELIMIT_GOOGLE_PER_MIN is unset. This is
|
||||
* the value the Pinokio build already ships (pinokio/_ENVIRONMENT), so the
|
||||
* packaged app keeps behaving exactly as it does today and only an
|
||||
* unconfigured server changes — from unlimited to what the product already
|
||||
* runs with. Places calls are user-driven (a search, a nearby lookup, an
|
||||
* installation probe) rather than polled, so this sits far above what the app
|
||||
* generates and bites only a caller enumerating the endpoint. `.env.example`
|
||||
* suggests a tighter 60 when the host is not localhost; that still applies.
|
||||
*/
|
||||
export const GOOGLE_DEFAULT_PER_MIN = 120;
|
||||
export { GOOGLE_DEFAULT_PER_MIN };
|
||||
|
||||
/** Google cost endpoints (nearby-places, text-search, geocoding). Null only when set to 0. */
|
||||
function googleRateLimiter() {
|
||||
|
||||
Reference in new issue
Block a user