feat: tproxy lan gateway, killswitch; fix: zapret2 fixes, various other

This commit is contained in:
FUFSoB committed 2026-09-23 01:12:31 +05:00
1 parent 4bcc168b2a
commit ae8f65da2e
54 files changed
+1880 -143

No files matched your search

+26 -2
View File
@@ -48,6 +48,8 @@ Part of the [proxy-suite options reference](./index.md).
- [subnet](#services-proxy-suite-inbounds-listeners-name-amneziawg-subnet)
- [subnet6](#services-proxy-suite-inbounds-listeners-name-amneziawg-subnet6)
- [flow](#services-proxy-suite-inbounds-listeners-name-flow)
- hysteria
- [masquerade](#services-proxy-suite-inbounds-listeners-name-hysteria-masquerade)
- [jsonFile](#services-proxy-suite-inbounds-listeners-name-jsonfile)
- [method](#services-proxy-suite-inbounds-listeners-name-method)
- [port](#services-proxy-suite-inbounds-listeners-name-port)
@@ -770,6 +772,27 @@ null
"xtls-rprx-vision"
```
<a id="services-proxy-suite-inbounds-listeners-name-hysteria-masquerade"></a>
## services\.proxy-suite\.inbounds\.listeners\.\<name>\.hysteria\.masquerade
Site that a hysteria2 listener serves, reverse-proxied, to anything that is not a client
(a browser, a prober)\. Null answers them with 404\.
*Type:*
null or string
*Default:*
```nix
null
```
*Example:*
```nix
"https://www.example.com"
```
<a id="services-proxy-suite-inbounds-listeners-name-jsonfile"></a>
## services\.proxy-suite\.inbounds\.listeners\.\<name>\.jsonFile
@@ -1292,10 +1315,11 @@ one of “raw”, “ws”, “grpc”, “httpupgrade”, “xhttp”
Protocol\. Set exactly one of type, xrayJson, or jsonFile\. “amneziawg” is an AmneziaWG
server on UDP port, with its own interface (see amneziaWg); its traffic is handed to XRay
and leaves like any other listener’s\.
and leaves like any other listener’s\. “hysteria2” is QUIC on UDP port: it needs tls (a
certificate) and takes passwords, and no transport, reality or flow\.
*Type:*
null or one of “vless”, “vmess”, “trojan”, “shadowsocks”, “socks”, “http”, “amneziawg”
null or one of “vless”, “vmess”, “trojan”, “hysteria2”, “shadowsocks”, “socks”, “http”, “amneziawg”
*Default:*
+10
View File
@@ -10,6 +10,7 @@ Update the module option docs there instead of editing these files by hand.
- [geodata](./geodata.md)
- [gui](./gui.md)
- [inbounds](./inbounds.md)
- [killSwitch](./killSwitch.md)
- [perAppRouting](./perAppRouting.md)
- [proxy](./proxy.md)
- [sshProxy](./sshProxy.md)
@@ -72,6 +73,9 @@ services.proxy-suite = {
group = "nginx";
};
};
killSwitch = {
enable = false;
};
perAppRouting = {
createDefaultProfiles = false;
enable = false;
@@ -159,6 +163,7 @@ services.proxy-suite = {
geoips = [ ];
geosites = [ ];
ips = [ ];
ruleSets = [ ];
};
default = "proxy";
direct = {
@@ -166,6 +171,7 @@ services.proxy-suite = {
geoips = [ ];
geosites = [ ];
ips = [ ];
ruleSets = [ ];
};
directRu = true;
proxy = {
@@ -173,7 +179,10 @@ services.proxy-suite = {
geoips = [ ];
geosites = [ ];
ips = [ ];
ruleSets = [ ];
};
ruleSetUpdateInterval = "1d";
ruleSets = { };
rules = [ ];
};
selection = "first";
@@ -187,6 +196,7 @@ services.proxy-suite = {
tproxy = {
enable = false;
fwmark = 1;
lanInterfaces = [ ];
localSubnets = [
"192.168.0.0/16"
];
+34
View File
@@ -0,0 +1,34 @@
# services.proxy-suite.killSwitch
Part of the [proxy-suite options reference](./index.md).
## Options
- killSwitch
- [enable](#services-proxy-suite-killswitch-enable)
<a id="services-proxy-suite-killswitch-enable"></a>
## services\.proxy-suite\.killSwitch\.enable
Whether to enable a kill switch for the global tunnels (proxy\.tun, proxy\.tproxy and global AmneziaWG profiles):
once one starts, outgoing traffic that would leave outside it is rejected, also while it
restarts, after it crashes or after its handshake gives up\. LAN destinations, DHCP and NTP
stay open; tproxy\.lanInterfaces clients keep the LAN but lose the internet\. Only
` proxy-ctl killswitch off `, ` proxy off `, ` proxy tun off `, ` proxy tproxy off ` or ` awg off `
lift it (proxy-suite-killswitch)
\.
*Type:*
boolean
*Default:*
```nix
false
```
*Example:*
```nix
true
```
+235
View File
@@ -51,6 +51,7 @@ Part of the [proxy-suite options reference](./index.md).
- [geoips](#services-proxy-suite-proxy-outbounds-routing-geoips)
- [geosites](#services-proxy-suite-proxy-outbounds-routing-geosites)
- [ips](#services-proxy-suite-proxy-outbounds-routing-ips)
- [ruleSets](#services-proxy-suite-proxy-outbounds-routing-rulesets)
- [singBoxJson](#services-proxy-suite-proxy-outbounds-singboxjson)
- [tag](#services-proxy-suite-proxy-outbounds-tag)
- [url](#services-proxy-suite-proxy-outbounds-url)
@@ -62,18 +63,27 @@ Part of the [proxy-suite options reference](./index.md).
- [geoips](#services-proxy-suite-proxy-routing-block-geoips)
- [geosites](#services-proxy-suite-proxy-routing-block-geosites)
- [ips](#services-proxy-suite-proxy-routing-block-ips)
- [ruleSets](#services-proxy-suite-proxy-routing-block-rulesets)
- [default](#services-proxy-suite-proxy-routing-default)
- direct
- [domains](#services-proxy-suite-proxy-routing-direct-domains)
- [geoips](#services-proxy-suite-proxy-routing-direct-geoips)
- [geosites](#services-proxy-suite-proxy-routing-direct-geosites)
- [ips](#services-proxy-suite-proxy-routing-direct-ips)
- [ruleSets](#services-proxy-suite-proxy-routing-direct-rulesets)
- [directRu](#services-proxy-suite-proxy-routing-directru)
- proxy
- [domains](#services-proxy-suite-proxy-routing-proxy-domains)
- [geoips](#services-proxy-suite-proxy-routing-proxy-geoips)
- [geosites](#services-proxy-suite-proxy-routing-proxy-geosites)
- [ips](#services-proxy-suite-proxy-routing-proxy-ips)
- [ruleSets](#services-proxy-suite-proxy-routing-proxy-rulesets)
- [ruleSetUpdateInterval](#services-proxy-suite-proxy-routing-rulesetupdateinterval)
- [ruleSets](#services-proxy-suite-proxy-routing-rulesets)
- `<name>`
- [detour](#services-proxy-suite-proxy-routing-rulesets-name-detour)
- [format](#services-proxy-suite-proxy-routing-rulesets-name-format)
- [url](#services-proxy-suite-proxy-routing-rulesets-name-url)
- [rules](#services-proxy-suite-proxy-routing-rules)
- item
- [domains](#services-proxy-suite-proxy-routing-rules-domains)
@@ -81,6 +91,7 @@ Part of the [proxy-suite options reference](./index.md).
- [geosites](#services-proxy-suite-proxy-routing-rules-geosites)
- [ips](#services-proxy-suite-proxy-routing-rules-ips)
- [outbound](#services-proxy-suite-proxy-routing-rules-outbound)
- [ruleSets](#services-proxy-suite-proxy-routing-rules-rulesets)
- [selection](#services-proxy-suite-proxy-selection)
- [selectionExclude](#services-proxy-suite-proxy-selectionexclude)
- singBox
@@ -96,6 +107,7 @@ Part of the [proxy-suite options reference](./index.md).
- tproxy
- [enable](#services-proxy-suite-proxy-tproxy-enable)
- [fwmark](#services-proxy-suite-proxy-tproxy-fwmark)
- [lanInterfaces](#services-proxy-suite-proxy-tproxy-laninterfaces)
- [localSubnets](#services-proxy-suite-proxy-tproxy-localsubnets)
- [port](#services-proxy-suite-proxy-tproxy-port)
- [proxyMark](#services-proxy-suite-proxy-tproxy-proxymark)
@@ -859,6 +871,28 @@ list of string
]
```
<a id="services-proxy-suite-proxy-outbounds-routing-rulesets"></a>
## services\.proxy-suite\.proxy\.outbounds\.\*\.routing\.ruleSets
Names from proxy\.routing\.ruleSets to match (sing-box and hybrid backends)\.
*Type:*
list of string
*Default:*
```nix
[ ]
```
*Example:*
```nix
[
"antifilter"
]
```
<a id="services-proxy-suite-proxy-outbounds-singboxjson"></a>
## services\.proxy-suite\.proxy\.outbounds\.\*\.singBoxJson
@@ -1050,6 +1084,28 @@ list of string
]
```
<a id="services-proxy-suite-proxy-routing-block-rulesets"></a>
## services\.proxy-suite\.proxy\.routing\.block\.ruleSets
Names from ruleSets blocked\.
*Type:*
list of string
*Default:*
```nix
[ ]
```
*Example:*
```nix
[
"ads"
]
```
<a id="services-proxy-suite-proxy-routing-default"></a>
## services\.proxy-suite\.proxy\.routing\.default
@@ -1158,6 +1214,28 @@ list of string
]
```
<a id="services-proxy-suite-proxy-routing-direct-rulesets"></a>
## services\.proxy-suite\.proxy\.routing\.direct\.ruleSets
Names from ruleSets sent direct\.
*Type:*
list of string
*Default:*
```nix
[ ]
```
*Example:*
```nix
[
"ru-services"
]
```
<a id="services-proxy-suite-proxy-routing-directru"></a>
## services\.proxy-suite\.proxy\.routing\.directRu
@@ -1260,6 +1338,117 @@ list of string
]
```
<a id="services-proxy-suite-proxy-routing-proxy-rulesets"></a>
## services\.proxy-suite\.proxy\.routing\.proxy\.ruleSets
Names from ruleSets sent through the proxy\.
*Type:*
list of string
*Default:*
```nix
[ ]
```
*Example:*
```nix
[
"antifilter"
]
```
<a id="services-proxy-suite-proxy-routing-rulesetupdateinterval"></a>
## services\.proxy-suite\.proxy\.routing\.ruleSetUpdateInterval
How often ruleSets are downloaded again (systemd time span)\.
*Type:*
string
*Default:*
```nix
"1d"
```
*Example:*
```nix
"6h"
```
<a id="services-proxy-suite-proxy-routing-rulesets"></a>
## services\.proxy-suite\.proxy\.routing\.ruleSets
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”\.
*Type:*
attribute set of (submodule)
*Default:*
```nix
{ }
```
*Example:*
```nix
{
antifilter = {
url = "https://example.com/antifilter.srs";
};
}
```
<a id="services-proxy-suite-proxy-routing-rulesets-name-detour"></a>
## services\.proxy-suite\.proxy\.routing\.ruleSets\.\<name>\.detour
Downloaded through the local proxy, or directly\.
*Type:*
one of “proxy”, “direct”
*Default:*
```nix
"proxy"
```
<a id="services-proxy-suite-proxy-routing-rulesets-name-format"></a>
## services\.proxy-suite\.proxy\.routing\.ruleSets\.\<name>\.format
“binary” (\.srs) or “source” (JSON)\. Null goes by the URL: \.srs is binary\.
*Type:*
null or one of “binary”, “source”
*Default:*
```nix
null
```
<a id="services-proxy-suite-proxy-routing-rulesets-name-url"></a>
## services\.proxy-suite\.proxy\.routing\.ruleSets\.\<name>\.url
Where the sing-box rule set is downloaded from\.
*Type:*
string matching the pattern https?://\.+
*Example:*
```nix
"https://example.com/antifilter.srs"
```
<a id="services-proxy-suite-proxy-routing-rules"></a>
## services\.proxy-suite\.proxy\.routing\.rules
@@ -1395,6 +1584,28 @@ string
"vps-de"
```
<a id="services-proxy-suite-proxy-routing-rules-rulesets"></a>
## services\.proxy-suite\.proxy\.routing\.rules\.\*\.ruleSets
Names from proxy\.routing\.ruleSets to match (sing-box and hybrid backends)\.
*Type:*
list of string
*Default:*
```nix
[ ]
```
*Example:*
```nix
[
"antifilter"
]
```
<a id="services-proxy-suite-proxy-selection"></a>
## services\.proxy-suite\.proxy\.selection
@@ -1638,6 +1849,30 @@ signed integer
1
```
<a id="services-proxy-suite-proxy-tproxy-laninterfaces"></a>
## services\.proxy-suite\.proxy\.tproxy\.lanInterfaces
Interfaces whose forwarded TCP and UDP is taken through the proxy too: devices on them
that use this host as their gateway\. Turns on IP forwarding for the rest (ping, the LAN
itself), which is routed as it is\. Needs the nftables firewall on NixOS\.
*Type:*
list of string
*Default:*
```nix
[ ]
```
*Example:*
```nix
[
"br0"
]
```
<a id="services-proxy-suite-proxy-tproxy-localsubnets"></a>
## services\.proxy-suite\.proxy\.tproxy\.localSubnets
+2 -1
View File
@@ -718,7 +718,8 @@ attribute set of string
Some lines let TLS to certain hosting networks handshake and then cut it at 12-34 KB,
which no strategy fixes\. z2k’s probe checks this line against ~110 known targets when
its network changes and once a day, and for each cut-off network searches a whitelisted
name that nfqws2 then puts into a fake ClientHello: thousands of short TLS connections to
name that nfqws2 then puts into a fake ClientHello (strategySource “z2k” only; ahead of
the nfqws2-keenetic strategies it breaks them): thousands of short TLS connections to
foreign hosting IPs per full run, sent directly and never touched by zapret2\. State and
maps live in /var/lib/proxy-suite/zapret2/cutoff; ` proxy-ctl zapret cutoff ` shows them\.