Skip to content

feat(domain_set): load geosite dat files by tag - #938

Open
marstion wants to merge 1 commit into
IrineSistiana:mainfrom
marstion:feat/domain-set-geosite
Open

feat(domain_set): load geosite dat files by tag#938
marstion wants to merge 1 commit into
IrineSistiana:mainfrom
marstion:feat/domain-set-geosite

Conversation

@marstion

Copy link
Copy Markdown

Summary

Add domain_set support for loading selected tags from v2fly GeoSite-format files, including domain-list-community's dlc.dat.

Example:

- tag: geosite_cn
  type: domain_set
  args:
    geosite:
      - file: ./dlc.dat
        tags:
          - cn

Changes

  • Add the geosite source configuration to domain_set.
  • Decode the required GeoSite protobuf wire format without adding the full v2fly-core dependency.
  • Load only explicitly requested tags.
  • Map GeoSite domain types to existing matchers:
    • Plainkeyword
    • Regexregexp
    • RootDomaindomain
    • Fullfull
  • Return clear errors for empty/missing tags, malformed data, and unsupported rule types.
  • Preserve existing text-based files behavior.
  • Add unit tests for rule conversion, tag filtering, missing tags, malformed data, and file loading.

AI assistance disclosure

This change was implemented with assistance from OpenAI Codex. The AI helped inspect the existing codebase, design the GeoSite parsing approach, write the implementation and unit tests, and run the test suite. The resulting changes were reviewed and validated locally.

@marstion
marstion marked this pull request as ready for review August 14, 2026 02:33
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.

2 participants