Skip to content

KuGouGo/Rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rules

Build Last Commit Repo Size Surge sing-box mihomo

A rule repository that keeps source files on main and publishes ready-to-use artifacts to the surge, sing-box, and mihomo branches.

What This Repo Does

  • syncs domain artifacts from nekolsd/sing-geosite
  • syncs IP artifacts from nekolsd/geoip
  • builds local custom domain and IP rules into all supported client formats
  • publishes client-specific branches: surge, sing-box, and mihomo

Branches

  • main: source files, scripts, workflows, and documentation
  • surge: final Surge artifacts only
  • sing-box: final sing-box artifacts only
  • mihomo: final mihomo artifacts only

Quick Links

Layout

.
|-- .github/         # CI workflows
|-- docs/            # conversion and maintenance notes
|-- scripts/         # sync/build/publish scripts
|-- sources/         # editable rule sources only
|-- tools/           # vendored helper code and generators
`-- README.md

Directory Roles

  • sources/: hand-maintained rule inputs. Custom sources live under sources/custom/.
  • tools/: vendored helper code or upstream tooling kept in-repo for maintenance. tools/geoip/ contains the geoip generator source that was previously mixed into sources/.
  • .output/: local build output directory, ignored on main, and used as the publish source for client-specific branches.

Custom Sources

  • editable custom inputs live under sources/custom/
  • generated client artifacts are written to .output/
  • intermediate conversion formats are documented in Intermediate Artifacts

Workflow

GitHub Actions will:

  1. lint custom rule sources
  2. choose between a full sync or a custom-only fast path
  3. resolve the latest official sing-box and mihomo core versions
  4. sync upstream rule artifacts when a full refresh is needed
  5. build local custom artifacts
  6. verify artifact integrity
  7. publish to client-specific branches

The main branch does not keep synced upstream artifacts. Generated files are built in CI or locally under .output/ and then published to the client branches. Each published client branch is trimmed to README.md, domain/, and ip/ only. The tool bootstrap layer resolves the latest official sing-box and mihomo releases at runtime instead of pinning them in the repo. Build scripts are intended for GitHub Actions or non-Windows shell environments.

Triggers:

  • manual workflow_dispatch with auto, custom, or full scope
  • scheduled sync once per day at 08:00 UTC
  • pushes that modify workflows, scripts, custom sources, or vendored tooling

Pushes that only add or edit sources/custom/** now reuse the currently published client branches as the artifact baseline, rebuild custom outputs, and skip the expensive upstream sync step. Scheduled runs, workflow/tooling changes, custom deletions, and manual full runs still refresh all upstream artifacts.

Branch Usage

Surge:

[Rule]
DOMAIN-SET,https://raw.githubusercontent.com/KuGouGo/Rules/surge/domain/cn.list,DIRECT
RULE-SET,https://raw.githubusercontent.com/KuGouGo/Rules/surge/ip/cn.list,DIRECT

sing-box:

{
  "route": {
    "rule_set": [
      {
        "tag": "cn",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/KuGouGo/Rules/sing-box/domain/cn.srs"
      },
      {
        "tag": "cn-ip",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/KuGouGo/Rules/sing-box/ip/cn.srs"
      }
    ]
  }
}

mihomo:

rule-providers:
  cn:
    type: http
    behavior: domain
    format: mrs
    url: "https://raw.githubusercontent.com/KuGouGo/Rules/mihomo/domain/cn.mrs"
    interval: 86400

  cn-ip:
    type: http
    behavior: ipcidr
    format: mrs
    url: "https://raw.githubusercontent.com/KuGouGo/Rules/mihomo/ip/cn.mrs"
    interval: 86400

Upstream

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors