Commit Graph

7022 Commits

Author SHA1 Message Date
Brian Warner
5a195e2339 Merge branch '2490-tor-2'
This adds --listen=tor to create-node and create-server, along with
.onion-address allocation at creation time, and onion-service
starting (launching or connecting to tor as necessary) as node startup
time.

closes ticket:2490
refs ticket:2773
refs ticket:1010
refs ticket:517
2016-10-09 02:07:17 -04:00
Brian Warner
42c6a1587b remove docs about --listen=tor being unfinished 2016-10-09 02:02:40 -04:00
Brian Warner
6d3a20e78b test_tor_provider: accept windows pathname separators 2016-10-09 01:49:32 -04:00
Brian Warner
272cb78af1 bump txtorcon dep to 0.17.0
This is the first version that allows us to use unix-domain control
ports for the launched tor.
2016-10-09 01:25:51 -04:00
Brian Warner
ea1c1d27de fix tests to match 2016-10-09 01:22:17 -04:00
meejah
2ecb8171eb flip remote/local around for Onion-service 'ports' lines 2016-10-09 01:21:52 -04:00
meejah
eb6c6bee9e tor's output, for debugging 2016-10-09 01:21:52 -04:00
meejah
646fad69ed ControlPort needs "unix:" prefix for Tor, and allocate SOCKSPort 2016-10-09 01:21:52 -04:00
Brian Warner
89eb86c5a4 node.py: use tor_provider at startup
We use it for two things: to create the foolscap connection handler, and
to possibly start an .onion listener at startup.

This also updates node._common_config_sections to accept the new tor
settings written by create-node/create-introducer.
2016-10-09 01:21:51 -04:00
Brian Warner
6b9218ff22 create_node.py: use tor_provider to handle --listen=tor
This adds tor-related CLI arguments to "create-node" and
"create-introducer", to control exactly how we should be using Tor.

* --tor-launch
* --tor-executable=
* --tor-control-port=

I went with "--tor-launch" instead of "--launch-tor" for consistency. I
don't particularly like the grammatical flow of it, and it doesn't
actually put all the tor-related arguments next to each other in the
--help output (the flags are put in one block, then the parameters in
the next). But it seems slightly more consistent to start all the
tor-related argument names with a "--tor*" prefix.
2016-10-09 01:21:51 -04:00
Brian Warner
a1741ce4dc rewrite tor_provider
This uses a unix-domain control port, and includes test coverage.

create_onion() displays pacifier messages, since the allocate-onion step
takes around 35 seconds
2016-10-09 01:21:47 -04:00
Brian Warner
8f9ad009bb move torutil.py to util/tor_provider.py 2016-10-09 00:57:02 -04:00
David Stainton
897079105a Code refactor TorProvider from Daira's code review 2016-10-09 00:35:03 -04:00
David Stainton
e02d21aed1 Add tor listening options to create-node 2016-10-09 00:34:57 -04:00
David Stainton
4a1d1a5541 Add helper function CreateOnion 2016-10-09 00:30:33 -04:00
David Stainton
b3b80d376b Use a TorProvider to get a Tor handler 2016-10-09 00:30:33 -04:00
David Stainton
993d91ec0d Implement TorProvider class as described by Brian Warner
https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2490#comment:10
2016-10-09 00:30:33 -04:00
Brian Warner
f549000121 test_create: get full coverage on create_node.py 2016-10-09 00:29:29 -04:00
Brian Warner
1e418ade83 create_node: slight refactoring
This prepares for various listeners to contribute values to tub.port and
tub.location, which will be helpful once Tor support is added.
2016-10-09 00:24:19 -04:00
Brian Warner
b5aaafbe68 create_node: add cosmetic newline in tahoe.cfg 2016-10-09 00:24:19 -04:00
Brian Warner
0eda544a73 create-node: introducer needs private/ too
All server-like nodes (storage servers and introducers both) will need
this for the tor state directory and .onion private key file, and it
needs to exist before the config is written, so tor onion-service
private keys can be placed there.

Also remove a redundant import.
2016-10-09 00:24:19 -04:00
Brian Warner
395f7cd4f0 create_node: prep for slow write_node_config()
This puts the right inlineCallbacks in place to allow
write_node_config() to return a Deferred. The upcoming Tor support will
need this (since it must wait for an .onion address to be allocated
before it can write tahoe.cfg's tub.port and tub.location lines).
2016-10-09 00:24:11 -04:00
Brian Warner
0e3225ac27 set up logging before init_connections 2016-10-09 00:11:17 -04:00
Brian Warner
1f09e8f3ce tox -e coverage: build coverage.xml too
This is handy for my see-coverage-in-emacs workflow.
2016-10-08 21:23:05 -04:00
Brian Warner
8a9326f5e9 travis: switch to codecov 2016-10-08 18:53:44 -04:00
Brian Warner
e8c246f346 Merge daira/2807.magic-folder-unicode-test-fail.1
refs ticket:2807

This allows tests to pass under an odd environment: our OS-X buildslave.
That process is started as a LaunchDaemon that doesn't provide any
Environment dictionary in the .plist file, so it runs with an empty
environment. On OS-X, this causes filesystem.encoding to default to
"utf-8", but locale.getpreferredencoding() returns "US-ASCII". The tests
previously assumed that any platform which used unicode for the
filesystem pathnames would also use it for sys.argv .

To simulate this without involving launchd, use "unset LANG", and
double-check that locale.getpreferredencoding() has changed.

This fix tolerates such platforms.
2016-09-27 10:26:03 -07:00
Daira Hopwood
4d18425ed4 Fix for Magic Folder tests if the I/O encoding is borked on Unicode platforms (OS X, Windows).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-09-27 18:05:09 +01:00
Brian Warner
fc1832d4a1 Merge PR356 2016-09-27 09:26:51 -07:00
Daira Hopwood
64841e339d Remove redundant use of NonASCIIPathMixin.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-09-27 16:16:19 +01:00
Daira Hopwood
c9d73a936a Fix Unicode-related Magic Folder test failures. fixes #2807
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-09-27 16:09:15 +01:00
Brian Warner
5ef04ef59e add hashutil.permute_server_hash
which uses SHA1 to combine the file's storage index (known as "peer
selection index" in this context) and each server's "server permutation
seed". This is the only thing in tahoe that uses SHA1.

With this change, we stop importing sha1 from anywhere else.
2016-09-26 20:42:42 -07:00
Brian Warner
b50094dff0 Merge PR350 (in rebased form)
closes tahoe-lafs/tahoe-lafs#350
2016-09-26 15:19:23 -07:00
pataquets
b5d16f0718 Remove $HOME/.cache/ directory after building. 2016-09-26 15:19:04 -07:00
pataquets
ab698c05fa Dockerfile fix: 'make' doesn't builds tahoe anymore. 2016-09-26 15:19:04 -07:00
Brian Warner
f8d800a3eb Merge PR349 (in rebased form)
closes tahoe-lafs/tahoe-lafs#349
2016-09-26 13:33:57 -07:00
meejah
37062d1307 tell travis to run integration (but only on linux) 2016-09-26 13:33:45 -07:00
meejah
ffdf4bf878 longer timeouts for windows' benefit 2016-09-26 13:33:45 -07:00
meejah
52e4bf0503 slightly more reliable... 2016-09-26 13:33:45 -07:00
meejah
2497435c1a use full paths for everything 2016-09-26 13:33:45 -07:00
meejah
b2628b0826 Ignore IOErrors while we're still waiting 2016-09-26 13:33:45 -07:00
meejah
a0fc80d544 Use "python -m allmydata.scripts.runner" instead of tahoe.exe
On windows, it seems that the generated tahoe.exe (which comes
via entry_points=) doesn't deal with signals nicely. I'm not
sure if this is a pip bug (or just "one of those Windows things")
but running with python -m allows us to kill our subprocesses.
2016-09-26 13:33:45 -07:00
meejah
a93e8d7bd0 fix create-introducer, create-node after master changes 2016-09-26 13:33:45 -07:00
Brian Warner
06cdc7e624 Merge PR352 (in rebased form)
closes tahoe-lafs/tahoe-lafs#352
2016-09-26 13:32:03 -07:00
David Stainton
4d30d698cf Minor correction to ipv6 + ipv4 configuration considerations 2016-09-26 13:31:18 -07:00
equim
f941db60ac Fix typos in garbage-collection.rst 2016-09-24 23:05:09 +01:00
Brian Warner
b7d561f458 appveyor: tox upstream moved repo to github
Once they make a new release (that includes the fix for a windows bug),
we can stop installing it from VCS, and it won't matter where the repo
lives.
2016-09-22 09:56:24 -07:00
Brian Warner
19f6f42811 Merge PR348 from david415:867.tub_multi_port_ipv6.0
closes tahoe-lafs/tahoe-lafs#348
2016-09-20 13:13:15 -07:00
Brian Warner
b00c2d21b7 test tub.port with multiple endpoints, add docs
I think the preferred way to listen on both IPv4 and IPv6 will be to use
"--port=tcp:PORT,tcp6:PORT". This is now reflected in the docs.

refs ticket:867
2016-09-20 13:04:06 -07:00
David Stainton
e6d7895865 Support comma separated endpoint list in tub.port
fixes ticket #867
2016-09-20 10:20:28 -07:00
Brian Warner
b537f470c9 Merge PR351 from str4d:2824-update-error-message 2016-09-20 10:15:29 -07:00