Skip to content

Config Generation

Rover's core job is converting your UI actions into a sing-box-executable JSON configuration. Understanding this process helps troubleshoot configuration issues.

Generation Flow

User Action (UI)
JSON Data Files
├── Policy rules (policies)
├── DNS policies (dns_policies)
├── DNS servers (dns_servers)
├── Rule providers (rule_providers)
└── Settings (settings)
Config Generator (generateConfigFile)
├── 1. Read subscription config (sing-box JSON)
├── 2. Read user policy rules → route.rules
├── 3. Read user DNS policies → dns.rules
├── 4. Read user DNS servers → dns.servers
├── 5. Read rule providers → route.rule_set
├── 6. Merge subscription's built-in rules and DNS config
├── 7. Apply profile-level overrides
├── 8. Process hosts-override
└── 9. Write config.json
Restart sing-box core to load new config

DNS Config Generation

The DNS configuration generation process:

  1. Read user-created DNS policies from JSON data
  2. Filter out disabled policies, sort by order field
  3. Convert to sing-box format dns.rules
  4. Merge DNS servers and rules from the subscription config
  5. Apply profile-level DNS policy overrides
  6. Process hosts-override advanced settings
  7. Write the final config.json

Generated DNS Config Example

{
  "dns": {
    "servers": [
      { "tag": "dns_direct_out", "address": "223.5.5.5", "detour": "direct" },
      { "tag": "dns_proxy_out", "address": "tls://8.8.8.8", "detour": "proxy_out" },
      { "tag": "dns_hosts", "address": "hosts" }
    ],
    "rules": [
      { "rule_set": ["geosite-cn"], "server": "dns_direct_out" },
      { "domain_suffix": [".google.com"], "server": "dns_proxy_out" }
    ],
    "final": "dns_direct_out"
  }
}

Policy Config Generation

The policy rules generation process:

  1. Read all enabled policy rules from JSON data
  2. Sort by order field
  3. Parse rule types and match conditions
  4. Convert to sing-box format route.rules
  5. Process rule set references, generate route.rule_set
  6. Set route.final to the user-selected final outbound
  7. Write config.json

Generated Policy Config Example

{
  "route": {
    "rules": [
      { "domain_suffix": [".google.com"], "outbound": "proxy_out" },
      { "rule_set": ["geosite-cn"], "outbound": "direct" },
      { "rule_set": ["geoip-cn"], "outbound": "direct" }
    ],
    "rule_set": [
      { "tag": "geosite-cn", "type": "remote", "format": "binary", "url": "..." },
      { "tag": "geoip-cn", "type": "remote", "format": "binary", "url": "..." }
    ],
    "final": "direct"
  }
}

Override Rules

When "Settings → Advanced → Override Rules" is enabled:

  • User-defined policy rules completely replace the subscription's built-in rules
  • The subscription's proxy nodes are still preserved
  • DNS configuration works the same way

When disabled:

  • User-defined policy rules are appended after the subscription rules
  • Subscription rules match first

When to Enable Override Rules?

  • Enable — You want full control over routing rules, not using the subscription's built-in rules
  • Disable — You want to keep the subscription's rules and only add a few custom rules

Viewing Generated Config

You can preview the complete sing-box JSON configuration in Settings → About → View Current Config to help troubleshoot issues.

Troubleshooting Config Issues

If traffic routing doesn't behave as expected, follow these steps:

  1. View the current config in Settings → About
  2. Check the order and conditions of rules in route.rules
  3. Check if route.final is correct
  4. Check if DNS configuration is correct
  5. Confirm which rule traffic actually matches on the Connections page