carlos / platform Public

static-site-geo-962

Discussion #962: a static site's page script can learn the visitor's country, so carloku.com/pricing can default its currency.

What changes

  • Every site the edge serves answers GET/HEAD /.carlos/geo itself: {"country":"IE","source":"DBIP-City-Lite"}, or both null when unknown. Other methods get 405 (Allow: GET, HEAD).
  • Same answer as the X-Carlos-Geo-* headers (#241): the request's one geo answer from decideGeo, adopted from a verified hop or a tunnel, null on a rejected hop, a door call, or with no database. There is no per-app switch (geoip spec R4), so "geo off" = no database = null.
  • Answered by the box that serves the route, after the routing checks (backhaul, HA forwards, door scope, import gate, lapse) and before the meter, observer, guard, password gate, asset catch, page cache and LRU. Never billed, counted in analytics or filed as a request record, like the edge's other own answers (lb-health, steering probe, HA control).
  • Cache-Control: no-store, private, Vary: *, nosniff, no cookie. The far asset catch skips the path whatever prefix an app declares. Demos answer it through the demo response policy (Cache-Control becomes its no-store).
  • Shadowing: the path is reserved in every spelling that cleans to it; a site's own file or an app's route there is never served. A linked (pinned) request goes on to its app.
  • Docs: a short section in docs/site/cli.md, "The visitor's country in a static page". Copy awaits Paul's review.

Tests and review

  • internal/edge/geoanswer_test.go plus HA ingress: static and app sites with the MaxMind test database, no database, unplaced address, methods, never cached (page cache, asset store, LRU), not counted, custom and wildcard domains, backhaul, far asset catch, tunnel hub and client, forward row, door, rejected hop, linked, demo, HA front forward, HA ingress, regional name.
  • Census: Edge.ServeHTTP and Edge.serveDemoTraffic (body, read sites unchanged), envelope internal/edge; card docs/superpowers/notes/census-proposal-static-site-geo-962.md. Astra approved all three in rounds 1 and 2.
  • Astra: R1 NOT READY (demo P1, test P2), fixed; R2 READY AFTER FIXES (test P2), fixed. Review stopped at round 2.
Commits 9
Discussions 0 0 open
Tasks 0/0 done

Discussions

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity