fix: hardening

This commit is contained in:
FUFSoB committed 2026-10-05 22:44:09 +05:00
1 parent 017a947a18
commit a435942b4f
168 files changed
+9166 -1644

No files matched your search

+2 -1
View File
@@ -112,7 +112,8 @@ proxy-ctl restart # restart what is running
In a terminal, `proxy-ctl logs` follows in [`lnav`](https://lnav.org): it follows while at
the bottom, scrolling back pauses it, `G` follows again, `e`/`E` jump between errors, `/`
searches, and `q` or Ctrl-C quits. `:enable-word-wrap` wraps long lines, and lnav remembers
it for the next time. Piped, it is plain `journalctl -f`.
it for the next time. Without lnav ([`tools.lnav.enable`](../options/tools.md#services-proxy-suite-tools-lnav-enable),
off on Nix-on-Droid) it follows in `less`. Piped, it is plain `journalctl -f`.
## See also
+3 -2
View File
@@ -84,8 +84,9 @@ The tray app shows the same, and switches with a click.
- `wrapEnv` sets the proxy variables for one program only, so the rest of the system keeps
its direct routing. `protocol = "all"` sets both kinds, for a program whose choice you
do not know.
- The kill switch guards whichever global tunnel is on (TUN or the VPN), and does nothing
while both are off.
- The kill switch guards whichever global tunnel is on (TUN or the VPN). It is up from boot,
so the internet stays blocked until one of them starts; turning a tunnel off with
`proxy-ctl` lifts it.
- While global TUN is on, per-app `tun` profiles run the app as it is. Everything already goes
through the proxy then.
- See [Wrap programs with the proxy](../wrap-apps.md) for the helpers, and
+9
View File
@@ -67,6 +67,15 @@ nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
optimisation for it.
- Point other apps at `127.0.0.1:1080`, in their own proxy settings or in the Wi-Fi proxy
settings.
- To save space, `proxy-ctl` comes without lnav and curl-impersonate: `proxy-ctl logs`
follows in `less`, and probes use plain curl. Set
[`tools.lnav.enable`](../options/tools.md#services-proxy-suite-tools-lnav-enable) and
[`tools.curlImpersonate.enable`](../options/tools.md#services-proxy-suite-tools-curlimpersonate-enable)
to have them back.
- Every app on the phone can reach `127.0.0.1`, not only the ones you point at the proxy: set
`proxy.listener.auth` so that only those you give the login to can use it. The loopback
hops behind it take a login of their own, drawn per boot, except Tor's SOCKS port and the
OpenSSH tunnel's under XRay, which take none: any app reaches those exits.
## See also
+5 -2
View File
@@ -109,8 +109,11 @@ services.proxy-suite = {
the global mode already carries its traffic. `proxy-ctl` prints a note when it does. So
does `--via`, except that an "interface" AmneziaWG outbound still takes the app under a
global TProxy or AmneziaWG profile.
- If `/etc/resolv.conf` points only at a local resolver (such as systemd-resolved on
127.0.0.53), the app's DNS queries skip its route. `proxy-ctl` warns about this.
- With `tun` and `tproxy`, the app's DNS queries go through its route wherever its resolver
is, a local one (such as systemd-resolved on 127.0.0.53) or the LAN router. Lookups glibc
hands to nscd (NixOS's default) do not: nscd resolves them itself, outside the route.
`proxy-ctl` warns when nscd runs. Apps that resolve names themselves are not affected:
programs built with Go, and browsers using their own resolver or DNS-over-HTTPS.
- The app follows your [routing rules](./routing.md) like any other proxied traffic.
## See also
+3 -1
View File
@@ -7,7 +7,9 @@ applies to the local proxy, TUN, TProxy and per-app routing alike.
1. `proxy.routing.rules`, in order. The first match wins, and a rule can name a specific
outbound.
2. The `proxy`, `direct` and `block` lists.
2. The lists: `proxy.domains` and `proxy.ips` first, then `block`, then `direct`, then
`proxy.geosites`, `proxy.geoips` and `proxy.ruleSets`. A name in both a block and a direct
list (an ad domain under `category-ru`, say) is blocked.
3. Anything left goes to `proxy.routing.default`: `"proxy"` (the default) or `"direct"`.
Russian sites and IPs go direct unless you set `routing.directRu = false`.
+3
View File
@@ -148,6 +148,9 @@ Without root, members of `userControl.group` need the `inbounds` scope.
- Clients cannot reach this host's LAN or Russian sites by default
(`inbounds.routing.blockPrivate`, `blockRu`).
- Through "direct", clients reach this host itself only on the listeners' ports and
`inbounds.serverPorts` (80/443 with subscriptions), whatever it listens on. Its addresses
are read when the inbounds start: restart them after the address changes.
- With `routing.via = "proxy"` (the default), client traffic goes through this host's own
proxy instead, following its routing. That needs `proxy.enable`. A listener can also exit
through one outbound with `via = "<tag>"`.
+14 -2
View File
@@ -44,8 +44,20 @@ proxy-ctl killswitch off # lift the kill switch without stopping the tunnel
## Good to know
- The kill switch blocks outgoing traffic while the tunnel restarts or after it fails, so
nothing leaks. LAN, DHCP and NTP stay open. Turning the tunnel off lifts it.
- The kill switch blocks outgoing traffic from boot until the tunnel is up, while it restarts
and after it fails, so nothing leaks. LAN, DHCP and the time daemon's NTP stay open.
Subscriptions are fetched through the tunnel; only if that fails are they fetched
directly, so the proxy can come up from a cold cache. The subscription host then sees
your address. Turning the tunnel off with `proxy-ctl` lifts the kill switch until the
next boot or tunnel start.
- With TUN or a global AmneziaWG profile, the kill switch also holds forwarded traffic
(Docker, libvirt, podman) to the LAN while the tunnel is down. TProxy diverts only
`proxy.tproxy.lanInterfaces`, so in TProxy mode other containers and VMs bypass the proxy
whether the tunnel is up or not. With TProxy alone the kill switch lets them through, and
with TUN or AmneziaWG also configured it cuts them off in TProxy mode.
- Networks the kill switch should leave open besides the private ranges, such as a routed
IPv6 prefix on a VM bridge, go in `killSwitch.allowedSubnets`. It defaults to
`proxy.tproxy.localSubnets`, so what TProxy leaves out stays reachable.
- If the uplink has no IPv6, set `proxy.dns.strategy = "ipv4_only"` (sing-box). Otherwise
direct IPv6 connections hang instead of falling back to IPv4.
- `proxy.tproxy.localSubnets` lists networks that skip TProxy. Add your LAN and VM bridges if