Repository navigation
feat(backend): download IP lookup databases at build time - #683
Merged
Merged
Conversation
Stop storing the IP lookup databases in git. The build downloads the release pinned by ipLookupDataVersion from TorMap/ip-lookup-data, an immutable monthly mirror of DB-IP Lite, and verifies it against the release's SHA256SUMS. Renovate updates the version. Autonomous system data now comes from DB-IP ASN Lite instead of MaxMind GeoLite2 ASN, so no MaxMind account or EULA is needed. It matched Onionoo's AS numbers for 9,475 of 9,477 running relays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWRrkPsxib5FkfeDUyteh5
Member
Author
|
Generated by Claude Code |
|
Visit the preview URL for this PR (updated for commit dba5b6c): https://tormap-36f44--pr683-claude-project-threa-ag0tajr7.web.app (expires Sat, 07 Nov 2026 10:44:45 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0c1f71965de18e60b0e686b0d0356977fec090dc |
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.
Requested by ju · project thread
Stops storing the IP lookup databases in git, so the repo no longer grows by about 65 MB with every monthly update. The databases now come from the immutable monthly releases of TorMap/ip-lookup-data. The first one,
2026-11, is published.Changes
downloadIpLookupDatabasesreplacesunpackIpLookupDatabases. It downloads the release named byipLookupDataVersioninbackend/gradle.propertiesfromhttps://github.com/TorMap/ip-lookup-data/releases/download/<version>/, checks both files against the release'sSHA256SUMS, and unpacks them tolocation.mmdbandautonomous-system.mmdbin the same generated resource folder as before. It has no new dependencies or repositories.-PipLookupDataUrl=file:///<dir>builds offline.backend/ip-lookup/*.zipremoved (the history keeps the existing ~50 MB; no rewrite).TorMap/ip-lookup-data(YYYY-MM, year = major) with no release-age delay, because the releases are immutable.IpLookupServiceTestnow runs without a Spring context or database, and also checks the AS organization.Data quality
I looked up all 9,479 running relays from Onionoo (Tor Project, IPFire-based AS data) on 2026-11-04:
Testing
backend_testCI passes against the published2026-11release, with the full test suite.IpLookupServiceTestpasses 7/7, which confirms the GeoIP2 reader accepts the DB-IP ASN database (DBIP-ASN-Lite (compat=GeoLite2-ASN)).SHA-256 mismatch for …/dbip-asn-lite.mmdb.gz. A missing release fails withCould not download …/SHA256SUMS. The task is up to date on a second run.Deployment notes
Published images are unaffected. Anyone building the backend needs access to github.com on the first build, or must use
-PipLookupDataUrl. The unpacked location database is now about 127 MB (the 2026-11 edition), so the JAR and image grow accordingly.🤖 Generated with Claude Code
https://claude.ai/code/session_01SWRrkPsxib5FkfeDUyteh5