Skip to content

Commit 87a4af9

Browse files
committed
So there's no native support for tor in albyhub and Go’s default HTTP client (which Hub uses) apparently doesn’t understand the socks5h scheme in HTTP_PROXY/HTTPS_PROXY, so even if I set env vars like HTTPS_PROXY=socks5://127.0.0.1:9050 this is going to want to leak DNS. I'll have to do some testing to confirm this and then try to think of a workaround. All the other packages in nb seem to have native support for tor. I might need to open an issue upstream.
1 parent e88a127 commit 87a4af9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

modules/albyhub.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,22 @@ in
354354
RestartSec = "10s";
355355
ReadWritePaths = [ cfg.dataDir ];
356356
} // nbLib.allowedIPAddresses cfg.tor.enforce;
357+
358+
# albyhub has no native tor support
359+
environment = mkIf (cfg.tor.proxy) (let
360+
proxy = config.nix-bitcoin.torClientAddressWithPort;
361+
socks5h = "socks5h://${proxy}";
362+
in {
363+
# TODO: if this works at all, remove the ones we don't need
364+
ALL_PROXY = socks5h;
365+
HTTP_PROXY = socks5h;
366+
HTTPS_PROXY = socks5h;
367+
all_proxy = socks5h;
368+
http_proxy = socks5h;
369+
https_proxy = socks5h;
370+
NO_PROXY = "127.0.0.1,::1,localhost";
371+
no_proxy = "127.0.0.1,::1,localhost";
372+
});
357373
};
358374

359375
nix-bitcoin.secrets = {

0 commit comments

Comments
 (0)