Commit Graph

6787 Commits

Author SHA1 Message Date
str4d
d09173cbf7 Expanded explanation of [node]anonymize 2016-08-30 08:55:08 -07:00
str4d
8cc2307d80 Spelling, rST layout fixes 2016-08-30 08:55:08 -07:00
str4d
1a3f4f2f35 I2P information 2016-08-30 08:55:08 -07:00
Daira Hopwood
8d1fa17d70 Add more info to docs about usage with tor 2016-08-30 08:55:08 -07:00
David Stainton
cb44f883e5 Fix formatting 2016-08-30 08:55:08 -07:00
David Stainton
4f0b7e0f83 Removed I2P ticket info because it belongs in a trac ticket 2016-08-30 08:55:08 -07:00
Daira Hopwood
3126d49d32 Rename tor.rst to anonymity-configuration.rst.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-08-30 08:55:08 -07:00
str4d
f3bc270a4e Changes required for safe txi2p use 2016-08-30 08:55:08 -07:00
David Stainton
832a798374 Fix formatting 2016-08-30 08:55:08 -07:00
David Stainton
3242a67c3f Add anonymity roadmap 2016-08-30 08:55:08 -07:00
David Stainton
ce889d5834 Change option name to anonymize for ticket #1010 2016-08-30 08:55:08 -07:00
Daira Hopwood
ed38d69302 Add more details in the Tor integration section 2016-08-30 08:55:08 -07:00
Daira Hopwood
92c908d332 Attempt to fix formating for torsocks section 2016-08-30 08:55:08 -07:00
David Stainton
2a82c2c63c Add more Torsocks Tahoe Tor usage documentation 2016-08-30 08:55:08 -07:00
David Stainton
5859a17efc Add legacy torsocks usage 2016-08-30 08:55:08 -07:00
David Stainton
9a6fe0edbd Minor corrections of index and indention 2016-08-30 08:55:08 -07:00
David Stainton
856f4ce266 Articulated more configuration subtleties 2016-08-30 08:55:08 -07:00
David Stainton
39820821ce Minor cleanup and added some links 2016-08-30 08:55:08 -07:00
David Stainton
02899f7e59 Add Tor usage and configuration documentation
Written by Zooko and I.
We need to add more technical citations and have it
reviewed for inaccuracies by Tor developers.
2016-08-30 08:55:08 -07:00
Brian Warner
fea8b627dd if tub.port is empty, don't listen
Updated config docs. Added errors if we're not listening but were told
to enable storage, helper, or if we're the Introducer server.

closes ticket:2816
2016-08-29 22:28:55 -07:00
Brian Warner
2d8a1e865b docs/config: use "#" to number sections
so I don't have to renumber everything when inserting/removing a
section.. wish I knew about this .rst trick earlier
2016-08-29 18:16:31 -07:00
Brian Warner
2d358f2e35 Disable foolscap "gifts"
"gifts" are third-party references (where Alice sends Bob a reference to
Carol, and Carol lives in a different Tub than either Alice or Bob).
Tahoe doesn't currently use these, and they make it possible for e.g. a
server to provoke a client into making a connection to an IP address of
the server's choosing. If the client isn't configured otherwise, this
would use raw TCP (revealing the client's IP address) even if the
connection to the server used Tor.

A connection policy of `tcp: tor` would block this, but it seems like a
good idea to disable gifts entirely.

closes ticket:2810
2016-08-28 18:15:30 -07:00
Brian Warner
095120112d Merge 2788-connection-handlers: add Tor/I2P support
This adds client-side support for automatically connecting to Tor and
I2P -hosted servers (when the server advertises a "tor:" or "i2p:"
-style connection hint, and when the necessary extra libraries are
installed, and when a Tor/I2P daemon is running and reachable at the
default location).

The new `[connections]` section of `tahoe.cfg` can include `tcp: tor` to
make all TCP connections use Tor instead. This ought to hide the
client's IP address from servers and the Introducer.

The new `[tor]` and `[i2p]` sections of `tahoe.cfg` will control how
Tor/I2P connections are made (whether to spin up a new Tor daemon, what
port to use to connect to an existing one, etc). `configuration.rst`
explains the possible syntax. Note that only the default I2P connection
method is implemented in Foolscap-0.12.2, but not the alternatives, so
many options that are legal syntax for `tahoe.cfg` will not work yet.

It also enables the `connections` section of `private/servers.yaml` to
override the connection-handler mapping.

refs ticket:517
closes ticket:2788
2016-08-28 18:06:15 -07:00
Brian Warner
a099b9237d tor: socks.port is now a (restricted) endpoint string
Foolscap has limitations that prevent us from accepting anything but a
TCP endpoint, but that will change in the future, so make the tahoe.cfg
syntax accept an endpoint, but then reject non-TCP ones. See the ticket
for details: refs ticket:2813.

This depends upon the new `foolscap.connections.tor.socks_port(host,
port)` API in foolscap-0.12.2, so it bumps the dependency to that (the
previous commit depended upon 0.12.1, but I hadn't gotten around to
updating the dep before now).
2016-08-28 16:30:31 -07:00
Brian Warner
bc079a71eb implement+test I2P setup
Note that many of the Foolscap handler-creation functions are still
stubbed out, so Tahoe won't be able to honor the full range of config
syntax until foolscap support is complete.
2016-08-28 03:16:43 -07:00
Brian Warner
15e5ca0e99 exercise TCP/Tor-related tahoe.cfg parsing
This exercises everything about _make_tcp_handler() and
_make_tor_handler() except for when txtorcon cannot be imported.
2016-08-28 03:16:40 -07:00
Brian Warner
eb230d1e5f setup.py: add 'tox' and 'i2p' extras
Now you can do `pip install tahoe-lafs[tor]` to get tor support.

The necessary support libraries are also installed with `[test]`, so
unit tests can rely upon importing txtorcon and friends.
2016-08-28 02:42:51 -07:00
Brian Warner
c56a0a4ba9 fix unicode handling in server_id from YAML
YAML, like JSON, is all-unicode. StorageFarmBroker.set_static_servers()
is defined to take an all-unicode dictionary (the "storage:" key from
private/servers.yaml), so the server_id keys it gets will be unicode.
NativeStorageServer is defined to accept server_ids which are bytes (at
least it is now). The tests were only passing bytes into
set_static_servers(), whereas a real launch passed unicode in, causing a
problem when NativeStorageServer tried to base32.a2b() the pubkey and
choked on the unicode it received.

This fixes set_static_servers() to convert the server_id to bytes, and
changes NativeStorageServer to assert that it gets bytes. It also fixes
the test to match real usage more closely.
2016-08-28 02:42:51 -07:00
Brian Warner
3cc8daf5bd implement full range of Tor handlers 2016-08-28 02:42:47 -07:00
Brian Warner
73d5376b6a Implement basic connection handlers (tor/i2p)
The node now attempts to create Tor/I2P connection handlers (if the
right libraries are available), and will use them for tor/i2p FURL hints
by default. For now it only creates default handlers: there is not yet
any code to interpret the `[tor]`/`[i2p]` sections of tahoe.cfg which
would let you override that process.

The node also parses the `[connections]` section, allowing `tcp: tor` to
use Tor for all outbound TCP connections. It defaults to `tcp: tcp`, of
course.

Static storage-server connections will now honor the `connections:`
overrides in `servers.yaml`, allowing specific servers to use TCP where
they would normally be restricted to Tor.

refs ticket:2788
refs ticket:517
2016-08-28 02:41:44 -07:00
Brian Warner
2db38e0cf3 document tor/i2p/connections 2016-08-28 02:41:44 -07:00
Brian Warner
30b421d48b test_client: improve coverage slightly 2016-08-28 02:39:39 -07:00
Brian Warner
cac99569e9 factor out "Tub maker"
This adds Node._create_tub(), which knows how to make a Tub with all the
right options and connection handlers that were specified in
tahoe.cfg (the connection handlers are disabled for now, but they'll get
implemented soon).

The new Node.create_main_tub() calls it. This main Tub is used:

* to connect to the Introducer
* to host the Helper (if enabled)
* to host the Storage Server (if enabled)

Node._create_tub() is also passed into the StorageFarmBroker, which
passes it into each NativeStorageServer, to create the (separate) Tub
for each server connection. _create_tub knows about the options, and
NativeStorageServer can override the connection handlers. This way we
don't need to pass tub options or default handlers into Client,
StorageFarmBroker, or NativeStorageServer.

A number of tests create NativeStorageServer objects: these were updated
to match the new arguments. test_storage_client was simplified because
we no longer need to mock out the Tub() constructor.
2016-08-27 17:36:55 -07:00
Brian Warner
8cf53d2d12 derive permutation seed from pubkey/server_id 2016-08-27 13:08:18 -07:00
Brian Warner
386edeb405 Merge 2788-load-static-servers: add servers.yaml
Closes tahoe-lafs/tahoe-lafs#319 (in rebased form, with some additional
tests and better docs)

refs ticket:2788
2016-08-27 11:47:03 -07:00
Brian Warner
663e39593b static servers: tolerate missing nickname/versions
A minimally-defined static server only specifies server_id,
anonymous-storage-FURL, and permutation-seed-base32. But the WUI Welcome
page wouldn't render (it raised an exception) without also defining
nickname and version. This allows those values to be missing.
2016-08-27 11:34:32 -07:00
Brian Warner
859ce66a03 document private/servers.yaml (static servers) 2016-08-27 11:34:32 -07:00
Brian Warner
d75b9f822a Improve loading of static servers
This follows the latest comments in ticket:2788, moving the static
server definitions from "connections.yaml" to "servers.yaml". It removes
the "connections" and "introducers" blocks from that file, leaving it
responsible for just static servers (I think connections and introducers
can be configured from tahoe.cfg).

This feeds all the static server specs to the StorageFarmBroker in a
single call, rather than delivering them as simulated introducer
announcements. It cleans up the way handlers are specified too (the
handler dictionary is ignored, but that will change soon).
2016-08-26 18:05:03 -07:00
Brian Warner
f23660e178 NativeStorageServer: create with server_id, not key_s
They're the same thing, but knowing that is the responsibility of the
caller, not NativeStorageServer. Try to normalize on "server_id" as the
spelling. Remove support for missing key_s, now that we require V2
introductions.
2016-08-26 18:04:31 -07:00
Brian Warner
37f89b1346 docs: update sample tahoe.cfg
* tub.port should be an endpoint
* web.port should be a strports string (with "tcp:" prefix)
* tub.location should include "tcp:" hint types
* FURL hints should include "tcp:" hint types
2016-08-26 17:59:09 -07:00
Brian Warner
54f974d44c make IServer.get_serverid() use pubkey, not tubid
This is a change I've wanted to make for many years, because when we get
to HTTP-based servers, we won't have tubids for them. What held me back
was that there's code all over the place that uses the serverid for
various purposes, so I wasn't sure it was safe. I did a big push a few
years ago to use IServer instances instead of serverids in most
places (in #1363), and to split out the values that actually depend upon
tubid into separate accessors (like get_lease_seed and
get_foolscap_write_enabler_seed), which I think took care of all the
important uses.

There are a number of places that use get_serverid() as dictionary key
to track shares (Checker results, mutable servermap). I believe these
are happy to use pubkeys instead of tubids: the only thing they do with
get_serverid() is to compare it to other values obtained from
get_serverid(). A few places in the WUI used serverid to compute display
values: these were fixed.

The main trouble was the Helper: it returns a HelperUploadResults (a
Copyable) with a share->server mapping that's keyed by whatever the
Helper's get_serverid() returns. If the uploader and the helper are on
different sides of this change, the Helper could return values that the
uploader won't recognize. This is cosmetic: that mapping is only used to
display the upload results on the "Recent and Active Operations" page.
I've added code to StorageFarmBroker.get_stub_server() to fall back to
tubids when looking up a server, so this should still work correctly
when the uploader is new and the Helper is old. If the Helper is new and
the uploader is old, the upload results will show unusual server ids.

refs ticket:1363
2016-08-26 14:29:50 -07:00
Brian Warner
66fcd6e12a Merge branch 'pr317'
closes #317

refs ticket:2788
2016-08-26 13:58:12 -07:00
Brian Warner
a970828b94 dicts don't have .haskey()
Apparently we don't have test coverage for this yet.
2016-08-26 13:56:50 -07:00
David Stainton
140c9a92cd Make StorageFarmBroker use specified or default handler 2016-08-26 11:17:56 +00:00
David Stainton
de61cd260c Add got_static_announcement and unit test 2016-08-24 21:11:58 +00:00
David Stainton
61eb839843 Add tub_handlers arg to NativeStorageServer constructor
Here we also define tub_handlers as a node attribute and pass it all the way
down to the NativeStorageServer via the Client and StorageFarmBroker
2016-08-22 09:15:25 -07:00
Brian Warner
85cf1d65be travis: add codechecks, run before main tests 2016-08-19 17:42:05 -07:00
Brian Warner
32974775ff fix codechecks: trailing whitespace, suspicious variable captures 2016-08-19 17:42:05 -07:00
Brian Warner
2e7c7d30c9 run_trial: don't do anything on import
That broke check-interfaces.py, which imports everything.
2016-08-19 17:42:05 -07:00
Brian Warner
36c57c74f4 make tox env for code-checks
This executes: check-debugging, check-interfaces, check-miscaptures,
find-trailing-spaces, check-umids, pyflakes.

Other changes:

* fix check-umids.py to take starting points. run it as `check-umids.py
  src` instead of `check-umids.py src/allmydata/*.py`
* check-debugging: rewrite in python to run from tox: tox doesn't like
  to run shell scripts.
* put check-interfaces.py last: it produces lots of warnings, but passes
  anyways. The others only produce significant output if they fail.
2016-08-19 17:42:05 -07:00