feat: Tor hidden service management and outbound .onion peer connections#2037
feat: Tor hidden service management and outbound .onion peer connections#2037sat-engineer wants to merge 1 commit intogetAlby:masterfrom
Conversation
…ections Add Go-native Tor hidden service management and wire up SOCKS5 proxy support for outbound .onion peer connections via LDK-node. Backend: - New tor/ package: manages Tor hidden service via control port using cretz/bine library. Handles key persistence, retry logic, and lifecycle management. - Wire up builder.SetTorProxyAddress() in LDK service init when LDK_TOR_SOCKS_HOST is set, with DNS resolution for Docker hostnames. - Expose onion address in node connection info API. - New env vars: LDK_TOR_ENABLED, LDK_TOR_CONTROL_HOST/PORT/PASSWORD, LDK_TOR_TARGET_HOST, LDK_TOR_SOCKS_HOST/PORT. Frontend: - Tor settings page showing hidden service status and onion address. - Tor URI copy button on Channels page. - Settings sidebar entry for Tor (LDK backend only). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Author issue |
Summary
tor/package).onionpeer connections via LDK-nodeDetails
Depends on: getAlby/ldk-node-go#33
Backend
New
tor/package (274 lines + 86 lines tests):cretz/binelibraryADD_ONION— forwards.onion:9735to LDK's listenerLDK integration (
lnclient/ldk/ldk.go):builder.SetTorProxyAddress()whenLDK_TOR_SOCKS_HOSTis setnet.LookupHost()(Rust FFI needs numericIP:port)tor.Servicefor inbound hidden service lifecycle.onionaddress inGetNodeConnectionInfo()New env vars (
config/models.go):LDK_TOR_ENABLED— enable Tor integration (default: false)LDK_TOR_CONTROL_HOST/PORT— Tor control port addressLDK_TOR_CONTROL_PASSWORD— Tor control port authLDK_TOR_TARGET_HOST— container hostname for hidden service forwardingLDK_TOR_SOCKS_HOST/PORT— SOCKS5 proxy for outbound.onionconnectionsFrontend
TorSettings.tsx) — shows hidden service status and onion address with copy buttontorAddress,torPort,torEnabledfieldsArchitecture
The
tor/Go package handles inbound (hidden service registration via control port), while the Rust-side SOCKS5 proxy handles outbound (connecting to.onionpeers). This separation gives Go-side access to the onion address for the API/UI while keeping the performance-critical peer connection logic in Rust.Test plan
go build ./...passesgo test ./tor/passes (4 tests).onionto.onion)🤖 Generated with Claude Code