Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to have a non persistent not announced .onion address if the node is Not on an internal network #2183

Closed
gabridome opened this issue Dec 16, 2018 · 6 comments

Comments

@gabridome
Copy link
Contributor

Issue and Steps to Reproduce

If the node is NOT on an internal network and doesn't want to announce its .onion address,
according to:

# lightningd --help
--bind-addr <arg>                    Set an IP address (v4 or v6) to listen on, but not announce

and according to tor.md in doc directory,
the --bind-address=autotor:127.0.0.1:9051 option should be used to bind the service to a non persistent .onion address without announcing it.

This behaviour used to work and the generated .onion address resulted in the output of the lightning-cli getinfocommand.

as v0.6.2, this doesn't work anymore.

starting with:

lightningd --proxy=127.0.0.1:9050 --bind-addr=autotor:127.0.0.1:9051 --addr=127.0.0.1:9738 --network=bitcoin

You get:

$ lightning-cli getinfo
{
  "id": "02c4fec754506ea170712588600bf23f11fa123aa6b0eaf1e3617c1e6a6cd02848", 
  "alias": "LIGHTNINGARTIST", 
  "color": "02c4fe", 
  "address": [ # <<<<<<<<<<<<<<<<<<< empty!
  ], 
  "binding": [
    {
      "type": "ipv4", 
      "address": "127.0.0.1", 
      "port": 9738
    }
  ], 
  "version": "v0.6.2", 
  "blockheight": 554055, 
  "network": "bitcoin", 
  "msatoshi_fees_collected": 0
}

If an address has been generated, is not available anywhere.
If the intent is to get rid of the --bind-addr option in the case the node is not on an internal network, some correction is necessary to the documentation.

@Saibato
Copy link
Contributor

Saibato commented Dec 16, 2018

hello @gabridome can confirm your issue.
i have a now working version in my branch at bindtor Saibato@c02929f
but i have to do more tests as we dont want to leak ;-) our 🖤
if all is fine i push the PR

@gabridome
Copy link
Contributor Author

Great!
It create a strange behaviour in which nodes inside a network could hide their non persistent .onion address, while exposed servers could not.

Saibato added a commit to Saibato/lightning that referenced this issue Dec 18, 2018
fix issue ElementsProject#2183


Signed-off-by: Saibato <Saibato.naga@pm.me>
Saibato pushed a commit to Saibato/lightning that referenced this issue Dec 19, 2018
Seems the context parameter got lost somewhere.

Reported-by: Ulmo <@Ulmo>
Signed-off-by: Christian Decker <decker.christian@gmail.com>

allow --bind-addr (not announce) to work with tor autoservice

fix issue reported by @gabridome

Signed-off-by: Saibato <Saibato.naga@pm.me>

allow --bind-addr (not announce) to work with tor autoservice

fix issue ElementsProject#2183 as reported by @gabridome
Saibato added a commit to Saibato/lightning that referenced this issue Dec 19, 2018
fix issue ElementsProject#2183

Signed-off-by: Saibato <Saibato.naga@pm.me>

allow --bind-addr (not announce) to work with tor autoservice

fix issue ElementsProject#2183 as reported by @gabridome
Saibato added a commit to Saibato/lightning that referenced this issue Dec 19, 2018
fix issue ElementsProject#2183 as reported by @gabridome

Signed-off-by: Saibato <Saibato.naga@pm.me>
@Saibato
Copy link
Contributor

Saibato commented Dec 19, 2018

Hello @gabridome i now pushed the PR Saibato@d5d9936
👍

cdecker pushed a commit to Saibato/lightning that referenced this issue Dec 19, 2018
fix issue ElementsProject#2183 as reported by @gabridome

Signed-off-by: Saibato <Saibato.naga@pm.me>
@Saibato
Copy link
Contributor

Saibato commented Dec 19, 2018

Great!
It create a strange behaviour in which nodes inside a network could hide their non persistent .onion address, while exposed servers could not.

Thanks this is also addressed now

Please also note some other unrelated fact, that the assumption "non persistent" is only true if you always also restart tor.
autotor: as now implemented generates random bindings on every start of LN
but as long as tor is running and the cruft is not rebooted or tor restarted the temp .onions still pesist.
So maybe this can be more explicit documented?

cdecker pushed a commit that referenced this issue Dec 19, 2018
fix issue #2183 as reported by @gabridome

Signed-off-by: Saibato <Saibato.naga@pm.me>
@cdecker
Copy link
Member

cdecker commented Dec 19, 2018

Fixed by #2192

@cdecker cdecker closed this as completed Dec 19, 2018
@gabridome
Copy link
Contributor Author

gabridome commented Dec 19, 2018

Please also note some other unrelated fact, that the assumption "non persistent" is only true if you always also restart tor.
autotor: as now implemented generates random bindings on every start of LN
but as long as tor is running and the cruft is not rebooted or tor restarted the temp .onions still pesist.
So maybe this can be more explicit documented?

Concept ACK.

The document already states: "To provide the node a non-persistent .onion address is necessary to access the Tor auto service. These types of addresses change each time the Tor service is restarted."
We could add something like "(autotor: generates random bindings on every start of LN. If the service is not restarted the .onion address persists)"

gabridome referenced this issue Apr 17, 2019
Case 5 in the Tor documentation currently states that if you use `--bind-addr=autotor:127.0.0.1:9051`, you can get your onion address by running `lightning-cli getinfo`. I have not found that to be the case; with that flag no onion address will be generated.

On the other hand, if `--addr=autotor:127.0.0.1:9051` is used instead, an onion address is generated and `lightning-cli getinfo` behaves as the docs say.
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

No branches or pull requests

3 participants