Skip to content

fix: update ip2region data source to v4/v6 split files - #210

Open
NorthSecond wants to merge 4 commits into
zu1k:masterfrom
NorthSecond:master
Open

fix: update ip2region data source to v4/v6 split files#210
NorthSecond wants to merge 4 commits into
zu1k:masterfrom
NorthSecond:master

Conversation

@NorthSecond

Copy link
Copy Markdown
  • 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.

- 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
@NorthSecond

Copy link
Copy Markdown
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.

@zu1k

zu1k commented May 1, 2026

Copy link
Copy Markdown
Owner

Thanks

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xdb and introduce ip2region_v6.xdb URL 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.

Comment thread pkg/ip2region/ip2region.go
Comment thread internal/db/default.go
@NorthSecond

Copy link
Copy Markdown
Author

fixed it

Repository owner deleted a comment from claude Bot May 12, 2026
@zu1k

zu1k commented May 12, 2026

Copy link
Copy Markdown
Owner

@claude review

@claude

claude Bot commented May 12, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants