Files
HealthLog/assets/geolite2
Marc-André Bombeck 50150e35ef feat(geo): bundle GeoLite2-City and add an offline-first lookup path
Rewrites src/lib/geo.ts so lookupIpLocation reads from the bundled
MaxMind GeoLite2-City MMDB first and falls back to the existing
ipwho.is path only for IPs the offline DB cannot resolve. Adds a
sibling lookupIpAsn that returns { asn, carrier } from the
GeoLite2-ASN MMDB so the admin login-overview can grow a carrier
chip alongside the auth-provider chip.

The MMDB files are too large to vendor in git. scripts/fetch-geolite2.sh
downloads them at build time using a MaxMind license key; the
Dockerfile copies assets/geolite2/ into /opt/geolite2/. When the
license key is absent or the files are missing the image still
builds and the resolver falls back to ipwho.is (v1.4.26 behaviour).

GeoLite2 is CC BY-SA 4.0 — attribution lives on the new public
/about page and in docs/audit/v1427-summary.md.
2026-05-15 16:36:55 +02:00
..

GeoLite2 databases

GeoLite2-City.mmdb and GeoLite2-ASN.mmdb are downloaded at build time by scripts/fetch-geolite2.sh and copied into the Docker image at /opt/geolite2/. The runtime resolver in src/lib/geo.ts reads them via mmdb-lib.

Run before docker build:

MAXMIND_LICENSE_KEY=xxxx ./scripts/fetch-geolite2.sh

Without the key the script exits cleanly and the image builds without the databases — the resolver falls back to the ipwho.is online provider (the v1.4.26 behaviour).

This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com. The databases are licensed under CC BY-SA 4.0.