#2821 closed enhancement (fixed)

make "tahoe create-client --hide-ip" fail if txtorcon/txi2p are not installed

Reported by: warner Owned by: warner
Priority: normal Milestone: 1.12.0
Component: code-nodeadmin Version: 1.11.0
Keywords: anonymity tor Cc:
Launchpad Bug:

Description

This would speed up the interactive discovery process when a node admin tries to set up a tor/i2p -based node. Instead of:

  • pip install tahoe-lafs
  • tahoe create-client --hide-ip
  • edit tahoe.cfg
  • tahoe start
  • error: txtorcon not installed
  • pip install tahoe-lafs[tor]
  • tahoe start
  • no error, but welcome page shows connection not established
  • oops, apt-get install tor
  • tahoe restart
  • ok

we could make it:

  • pip install tahoe-lafs
  • tahoe create-client --hide-ip
  • error: txtorcon not installed
  • pip install tahoe-lafs[tor]
  • tahoe create-client --hide-ip
  • edit tahoe.cfg
  • tahoe start
  • no error, but welcome page shows connection not established
  • oops, apt-get install tor
  • tahoe restart
  • ok

And then maybe we can detect that there's no tor daemon available too (perhaps create-client could try to establish a connection to a tor server we run on tahoe-lafs.org, or torproject.org, or something), and cut down a few more steps.

I think #2820 and having create-client disable the tub listeners would remove the need for the edit tahoe.cfg step.

Change History (7)

comment:1 Changed at 2016-09-06T19:28:53Z by warner

  • Owner set to warner
  • Status changed from new to assigned

comment:2 Changed at 2016-09-20T16:18:51Z by warner

This should go into Node.init_connections, at the end, where if not self._reveal_ip, we check to see that at least one of handlers["tor"] or handlers["i2p"] is not None. If not, throw an error.

comment:4 Changed at 2016-09-26T22:40:19Z by warner

Oh, I tried to write some tests for your branch, and I discovered that I was wrong about this needing to go into init_connections(). The #2820 change makes create-client --hide-ip set tcp = tor, which then triggers an error at startup (unavailable/unimportable handler type 'tor'. Please pip install tahoe-lafs[tor] to fix.), so we don't need a new error in init_connections(). (in the test I added, it kept bailing before the new error that you added)

Instead, I think we need new code in tahoe create-client, to make --hide-ip try to import the Foolscap/Tor connection handler, and give that same useful error message if it fails. This should probably be done as part of the #2490 "create-node-does-tor" changes.

comment:6 Changed at 2016-10-26T21:25:51Z by warner

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [783449b].

comment:7 Changed at 2016-10-26T21:32:22Z by warner

One leftover note: it'd be nice if the outbound-connection-hint-handler side of tahoe only relied upon foolscap[tor] (or i2p), and didn't look for txtorcon/txi2p directly. So, at least in theory, Foolscap could change the way it accesses Tor, to use something other than txtorcon, and tahoe's outbound side should still work. Of course there's not really much point in doing that, since the inbound side (tor_provider) really does need txtorcon. Same for I2P.

So I don't really want to change anything, but just so I remember the idea for the future, ideally it'd be nice if create_node either tried to import foolscap.connections.tor (and caught the failure) to detect when tor was unavailable, or delegated the question to some tor_provider method. Maybe TorProvider.is_available()?

Note: See TracTickets for help on using tickets.