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:
- Read user-created DNS policies from JSON data
- Filter out disabled policies, sort by
orderfield - Convert to sing-box format
dns.rules - Merge DNS servers and rules from the subscription config
- Apply profile-level DNS policy overrides
- Process hosts-override advanced settings
- 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:
- Read all enabled policy rules from JSON data
- Sort by
orderfield - Parse rule types and match conditions
- Convert to sing-box format
route.rules - Process rule set references, generate
route.rule_set - Set
route.finalto the user-selected final outbound - 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:
- View the current config in Settings → About
- Check the order and conditions of rules in
route.rules - Check if
route.finalis correct - Check if DNS configuration is correct
- Confirm which rule traffic actually matches on the Connections page