docs: improve the wording, add targeted examples

This commit is contained in:
fufsob committed 2026-09-25 09:54:12 +00:00
1 parent 53fc86dd83
commit 63d9dffcae
61 files changed
+3422 -5861

No files matched your search

+25 -26
View File
@@ -13,48 +13,48 @@ in
"direct"
];
default = "proxy";
description = "Where traffic no routing rule matches goes.";
description = "Where traffic goes when no rule matches.";
example = "direct";
};
directRu = mkOption {
type = types.bool;
default = true;
description = ''Send geosite "category-ru" and geoip "ru" direct.'';
description = ''Send Russian sites and IPs (geosite "category-ru", geoip "ru") direct.'';
};
proxy = {
domains = list "Domain suffixes sent through the proxy." [ "youtube.com" ];
ips = list "IP CIDRs sent through the proxy." [ "1.1.1.0/24" ];
geosites = list "Geosite names sent through the proxy." [ "netflix" ];
geoips = list "Geoip names sent through the proxy." [ "us" ];
ruleSets = list "Names from ruleSets sent through the proxy." [ "antifilter" ];
domains = list "Domains, with their subdomains, sent through the proxy." [ "youtube.com" ];
ips = list "IP ranges (CIDR) sent through the proxy." [ "1.1.1.0/24" ];
geosites = list "Geosite categories sent through the proxy." [ "netflix" ];
geoips = list "Geoip codes sent through the proxy." [ "us" ];
ruleSets = list "Rule sets from `ruleSets` sent through the proxy." [ "antifilter" ];
};
direct = {
domains =
list "Domain suffixes sent direct. zapret hostlists join them when zapret.directSync.enable is on."
list "Domains, with their subdomains, sent direct. `zapret.directSync` adds zapret's domains."
[
"internal.example"
];
ips = list "IP CIDRs sent direct." [ "10.10.0.0/16" ];
geosites = list "Geosite names sent direct." [ "category-ru" ];
geoips = list "Geoip names sent direct." [ "ru" ];
ruleSets = list "Names from ruleSets sent direct." [ "ru-services" ];
ips = list "IP ranges (CIDR) sent direct." [ "10.10.0.0/16" ];
geosites = list "Geosite categories sent direct." [ "category-ru" ];
geoips = list "Geoip codes sent direct." [ "ru" ];
ruleSets = list "Rule sets from `ruleSets` sent direct." [ "ru-services" ];
};
block = {
domains = list "Domain suffixes blocked." [ "ads.example.com" ];
ips = list "IP CIDRs blocked." [ "203.0.113.0/24" ];
geosites = list "Geosite names blocked." [ "category-ads-all" ];
geoips = list "Geoip names blocked." [ "cn" ];
ruleSets = list "Names from ruleSets blocked." [ "ads" ];
domains = list "Domains, with their subdomains, to block." [ "ads.example.com" ];
ips = list "IP ranges (CIDR) to block." [ "203.0.113.0/24" ];
geosites = list "Geosite categories to block." [ "category-ads-all" ];
geoips = list "Geoip codes to block." [ "cn" ];
ruleSets = list "Rule sets from `ruleSets` to block." [ "ads" ];
};
rules = mkOption {
type = types.listOf t.routingRuleType;
default = [ ];
description = "Rules checked before the proxy/direct/block lists, in order; the first match wins.";
description = "Rules checked in order before the proxy, direct and block lists. The first match wins.";
example = [
{
outbound = "vps-de";
@@ -73,7 +73,7 @@ in
options = {
url = mkOption {
type = types.strMatching "https?://.+";
description = "Where the sing-box rule set is downloaded from.";
description = "URL of the sing-box rule set.";
example = "https://example.com/antifilter.srs";
};
format = mkOption {
@@ -84,7 +84,7 @@ in
]
);
default = null;
description = ''"binary" (.srs) or "source" (JSON). Null goes by the URL: .srs is binary.'';
description = ''"binary" (.srs) or "source" (JSON). `null`: guess from the URL.'';
};
detour = mkOption {
type = types.enum [
@@ -92,17 +92,16 @@ in
"direct"
];
default = "proxy";
description = "Downloaded through the local proxy, or directly.";
description = "Download through the proxy or directly.";
};
};
}
);
default = { };
description = ''
sing-box rule sets kept up to date at runtime, for the ruleSets of proxy, direct, block,
rules and an outbound's routing. They are fetched every ruleSetUpdateInterval and on
`proxy-ctl proxy rulesets update`, and sing-box picks up a new file without a restart;
until the first fetch one matches nothing. Not for backend = "xray".
Named sing-box rule sets, usable in any `ruleSets` list. They are downloaded every
`ruleSetUpdateInterval` or on `proxy-ctl proxy rulesets update`, without a restart. A rule
set matches nothing until its first download. Not available with the "xray" backend.
'';
example = {
antifilter.url = "https://example.com/antifilter.srs";
@@ -112,7 +111,7 @@ in
ruleSetUpdateInterval = mkOption {
type = types.str;
default = "1d";
description = "How often ruleSets are downloaded again (systemd time span).";
description = "How often rule sets are refreshed (systemd time span).";
example = "6h";
};
};