lib/geoip, cmd/relaypoolsrv, cmd/ursrv: Automatically manage GeoIP updates (#9342)

This adds a small package `geoip` which knows how to download and manage
the Maxmind GeoLite2 database we use. This removes the need for various
scripts to download and manage the geoip database, something that today
happens on Docker startup for the relay pool server and using various
hand written hacks for the usage reporting server.

The database is downloaded when needed and then refreshed on a
best-effort basis weekly.
This commit is contained in:
Jakob Borg
2024-05-18 19:31:49 +02:00
committed by GitHub
parent 57d399317e
commit ba6ac2f604
8 changed files with 212 additions and 62 deletions

View File

@@ -1,10 +0,0 @@
#!/bin/sh
set -eu
if [ "$MAXMIND_KEY" != "" ] ; then
curl "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MAXMIND_KEY}&suffix=tar.gz" \
| tar --strip-components 1 -zxv
fi
exec "$@"