Conversation
Each request's client address is placed in a country from DB-IP's free country CSV, loaded at boot from the stats bucket into a sorted range table — no library, a binary search is the whole lookup — and geo_stats keys day, host, agent class, and country with request, 403, and probe counts. Served at /stats/v1/countries. GEO_DB_KEY names the object; unset, every row reads "--", and a key that fails to load fails boot.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
1d4-web | 8faee61 | Commit Preview URL Branch Preview URL |
Sep 02 2026, 01:51 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ast-lol | 8faee61 | Commit Preview URL Branch Preview URL |
Sep 02 2026, 01:53 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
iili | 8faee61 | Commit Preview URL Branch Preview URL |
Sep 02 2026, 01:52 PM |
A geo key that will not load is retried while the bucket wakes up, then logged and run without — an all-"--" table, never a boot failure that takes the other endpoints with it. Ranges are validated after unmapping, overlaps lose to the range they sit in, and country codes are interned so the table does not pin its CSV lines. Tests cover the refused probe, the unplaced row, and the boot path; the deploy test pins GEO_DB_KEY; the READMEs say which prefixes the IAM user needs and where the file goes.
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1467, part of #1365. Each request's client address is placed in a country and
geo_statskeys day, host, agent class, and country with request, 403, and probe counts, served at/stats/v1/countries. The database is DB-IP's free country CSV (CC BY 4.0; the stats page on muchq.com carries the attribution), pinned as anhttp_fileby URL and sha256 and bundled into the stats image at/geo, where the service loads it at boot into a sorted range table and binary-searches it rather than pulling in a GeoIP library. A new month is a pin bump; a file that will not load means every row reads--with an error in the log, never a boot failure. Hosting a fallback copy of the pinned file is #1478.Panel ran against the first push and its findings are the second commit; the third moves the file from a hand-uploaded S3 object to the image. Tested with
bazel teston stats (store tests against a local postgres:18 on the second commit; the third touches no SQL), the deploy config, and the image build.