Skip to content

fix: Announce onion address in tor mode#1

Merged
macterra merged 1 commit intomainfrom
fix/tor-announce-addr
Mar 6, 2026
Merged

fix: Announce onion address in tor mode#1
macterra merged 1 commit intomainfrom
fix/tor-announce-addr

Conversation

@macterra
Copy link

@macterra macterra commented Mar 6, 2026

Summary

  • In tor mode, add announce-addr for the generated .onion address so the node is discoverable (was only done in hybrid mode)
  • Run temp Tor as debian-tor to fix permission error on /var/lib/tor/cln-service
  • Use pkill to kill the actual tor process (not just the su wrapper) after hostname generation
  • Poll for port 9050 release before supervisor starts the main Tor

Also upstream: lightning-goats#81

Test plan

  • Tested on remote node — onion address generated and announced successfully
  • Tor supervisor process starts cleanly (no port conflict)
  • getinfo shows .onion address in the address array

🤖 Generated with Claude Code

In tor mode, the entrypoint didn't add announce-addr for the generated
.onion address, so the node was undiscoverable. In hybrid mode, the
announce-addr logic existed but had two bugs:

1. Temp Tor ran as root but /var/lib/tor/cln-service is owned by
   debian-tor, causing a permission error
2. Killing the su wrapper didn't kill the actual tor child process,
   leaving port 9050 bound when supervisor tried to start the main Tor

Fixes:
- Add onion announce-addr to tor mode (matching hybrid behavior)
- Run temp Tor as debian-tor via su
- Use pkill to kill the actual tor process after hostname generation
- Poll for port 9050 release before handing off to supervisor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@macterra macterra merged commit 3034cf5 into main Mar 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant