fix: update ip2region data source to v4/v6 split files - #210
Open
NorthSecond wants to merge 4 commits into
Open
Conversation
- Update ip2region download URLs from deprecated ip2region.xdb to ip2region_v4.xdb and add ip2region_v6.xdb support - Upgrade ip2region xdb binding to latest version with IPv6 support - Fix update deduplication to allow same-format databases (v4/v6) to be updated independently - Add migration v8 to auto-update old ip2region URLs in user configs - Extend migration v7 to also migrate broken gh-release.zu1k.com qqwry URLs Fixes broken ip2region downloads caused by upstream repo renaming ip2region.xdb to ip2region_v4.xdb / ip2region_v6.xdb.
- golang.org/x/crypto v0.17.0 → v0.35.0 (CVE-2024-45337, CVE-2025-22869) - github.com/cloudflare/circl v1.3.6 → v1.3.7 (GHSA-9763-4f94-gfch) - golang.org/x/sys v0.15.0 → v0.30.0 - golang.org/x/text v0.14.0 → v0.22.0 Note: go version bumped to 1.23.0 as required by x/crypto v0.35.0
Author
|
And I dumped golang.org/x/crypto and github.com/cloudflare/circl to fix the 3 security alerts flagged by the repo scanner (CVE-2024-45337, CVE-2025-22869, GHSA-9763-4f94-gfch). This requires go >= 1.23.0. |
Owner
|
Thanks |
There was a problem hiding this comment.
Pull request overview
Updates the ip2region database integration to accommodate upstream’s split of ip2region.xdb into separate IPv4/IPv6 .xdb files, and adjusts update/migration logic so v4/v6 databases can be managed independently.
Changes:
- Switch ip2region download URLs to
ip2region_v4.xdband introduceip2region_v6.xdbURL support. - Add a new default DB entry (
ip2region-ipv6) and update the updater de-duplication key so v4/v6 update independently. - Add migration v8 to rewrite deprecated ip2region URLs in user configs; extend v7 to migrate additional broken qqwry URLs; bump Go module dependencies.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/ip2region/ip2region.go | Updates ip2region URLs and adapts to new xdb binding API (version detection + new search method). |
| internal/migration/v8.go | New migration to overwrite deprecated ip2region.xdb URLs in user configs. |
| internal/migration/v7.go | Extends qqwry migration to also cover gh-release.zu1k.com URLs. |
| internal/migration/mirgration.go | Registers migration v8 to run during init. |
| internal/db/update.go | Adds ip2region-ipv6 to update list and changes dedup key to allow independent updates. |
| internal/db/default.go | Introduces ip2region-ipv6 default DB entry using the new v6 file/URLs. |
| go.mod | Updates Go version and bumps ip2region binding + related dependencies. |
| go.sum | Records updated dependency checksums. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
fixed it |
Owner
|
@claude review |
|
I'll analyze this and get back to you. |
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.

Fixes broken ip2region downloads caused by upstream repo renaming ip2region.xdb to ip2region_v4.xdb / ip2region_v6.xdb.