8000 GitHub - xxxbrian/Surge-Geosite: Geosite ruleset for Surge · GitHub
[go: up one dir, main page]

Skip to content

About

Geosite ruleset for Surge

Resources

Stars

79 stars

Watchers

1 watching

Forks

Repository files navigation

Surge Geosite

Converts v2fly/domain-list-community geosite lists into rule sets for Surge, sing-box, and mihomo. The service checks for new upstream releases every minute and updates the rule sets automatically.

English | 中文

Browse the lists · Guide

Quick start

Find a rule set

Search by name or browse the alphabetical index.

Rule set directory with search, an alphabetical index, and rule counts

Copy the URL for your client

Open a rule set page at https://surge.bojin.co/view/<list> to preview its Surge rules, see their sources, and copy the URL for your client.

The google rule set page with mode and tag filters, three client URLs, and a rule preview

Rule set URLs

Client Rule set URL
Surge (default balanced mode) https://surge.bojin.co/geosite/<list>
Surge (explicit mode) https://surge.bojin.co/geosite/<mode>/<list>
sing-box (.srs) https://surge.bojin.co/geosite-srs/<list>
mihomo (.mrs) https://surge.bojin.co/geosite-mrs/<list>

All three formats accept @<tag> after the list name. For example, apple@cn keeps only entries tagged cn in the apple list.

In Surge, add a RULE-SET entry under [Rule] and set its third field to a policy from your configuration.

[Rule]
RULE-SET,https://surge.bojin.co/geosite/apple@cn,DIRECT
RULE-SET,https://surge.bojin.co/geosite/strict/category-ads-all,REJECT
RULE-SET,https://surge.bojin.co/geosite/google,PROXY

The guide has configuration examples for sing-box and mihomo.

Surge conversion modes

The selected mode controls how upstream regular expressions are converted to Surge domain rules.

  • strict converts only regexes that Surge rules can represent exactly.
  • balanced (default) uses conservative approximations and skips regexes that would produce overly broad rules.
  • full attempts more approximations and can match additional domains.

sing-box preserves keywords and regexes in .srs. mihomo’s .mrs domain rule sets omit them. The rule set page reports the number omitted when applicable.

Metadata API

  • GET /geosite maps each list name to its tags.
  • GET /geosite-meta returns the current upstream release’s lists, tags, and rule counts.
  • GET /geosite-meta/<list> returns a list’s description, inclusions, tags, and entry sources.

Responses carry a content-based ETag. Revalidate with If-None-Match to get 304 when the content is unchanged, even after an upstream release. The machine-readable reference is available at llms.txt.

Development

Use Node.js 26 or newer with pnpm 11.5.2.

pnpm install
pnpm check          # type checks and tests
pnpm build

Run pnpm worker:dev and pnpm panel:dev in separate terminals to start the API worker and the website. With an upstream checkout at ./domain-list-community, pnpm build:real builds its data/ directory into ./out with the CLI.

Deployment

Deploy the API worker before the website.

pnpm worker:deploy && pnpm panel:deploy

Staging uses separate Workers and storage with indexing disabled. Run pnpm worker:deploy:staging && pnpm panel:deploy:staging to bring it up for a preview.

See the architecture overview.

About

Geosite ruleset for Surge

Resources

Stars

79 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages

0