feat: tor support

This commit is contained in:
FUFSoB committed 2026-09-17 20:12:17 +05:00
1 parent 97332c1774
commit 321e9ca468
42 files changed
+1853 -69

No files matched your search

+24 -6
View File
@@ -171,12 +171,30 @@ let
tag = "dns-out";
settings = {
userLevel = 0;
rules = [
{
action = "direct";
qType = "2-27,29-65535";
}
];
# No resolver knows .onion, and asking one leaks the name. The TUN's fake DNS
# answers with an address that routes to Tor by name; anything else is told there
# is no such name.
rules =
lib.optionals derived.torRouteOnion (
lib.optional enableTunFakeDns {
action = "hijack";
qType = "1,28";
domain = [ "domain:onion" ];
}
++ [
{
action = "return";
rCode = 3;
domain = [ "domain:onion" ];
}
]
)
++ [
{
action = "direct";
qType = "2-27,29-65535";
}
];
};
}
];