mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 15:06:36 +08:00
3a368119e5
Agent embeds GeoLite2-Country.mmdb but the file is not checked into the repository. Download it in CI, Docker, and Makefile build paths via scripts/fetch-agent-geoip-mmdb.sh, and correct the gitignore exception path for the geoipdata package.
16 lines
471 B
Bash
Executable File
16 lines
471 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
TARGET="${ROOT}/internal/apps/agent/geoipdata/GeoLite2-Country.mmdb"
|
|
URL="${GEOIP_MMDB_URL:-https://raw.githubusercontent.com/Loyalsoldier/geoip/release/GeoLite2-Country.mmdb}"
|
|
|
|
mkdir -p "$(dirname "$TARGET")"
|
|
curl -fsSL -o "$TARGET" "$URL"
|
|
|
|
if [ ! -s "$TARGET" ]; then
|
|
echo "downloaded GeoIP database is empty: $TARGET" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "GeoIP database ready: $TARGET" |