mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 22:02:16 +00:00
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.
21 lines
708 B
Markdown
21 lines
708 B
Markdown
# 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](https://creativecommons.org/licenses/by-sa/4.0/).
|