Commit Graph

6856 Commits

Author SHA1 Message Date
Brian Warner
2e3ec4109c document multiintroducer/introducerless config
refs ticket:68
2016-09-12 17:45:35 -07:00
Brian Warner
d802135db1 test introducerless config
refs ticket:68
2016-09-12 17:45:17 -07:00
Brian Warner
3b24e7e35e Merge PR 338 from david415/68.multi_intro.0
This enables the use of multiple introducers, via
NODEDIR/private/introducers.yaml . Still needs docs.

refs ticket:68
2016-09-12 17:31:16 -07:00
Brian Warner
4ae574cca0 test_multi_introducers: add more tests 2016-09-12 17:30:06 -07:00
David Stainton
4f717ba808 Add a multi-introducer implementation
this is based the previous work of warner, killyourtv and leif
 fixes ticket #68
2016-09-13 00:15:52 +00:00
Brian Warner
a8899c8fc3 Merge branch '2773-listen-port'
This adds several arguments to "tahoe create-node" and
create-introducer:

* --location=/--port=: always provided as a pair, directly set the
  listening port and the advertised location
* --hostname=: provides the node's hostname so it doesn't have to crawl
  the network interfaces for IP addresses, when listening on TCP
* --listen=: can only be "tcp" for now, but will soon be the way to
  enable automatic listener setup for Tor and I2P services

This is a rebased and cleaned-up version of #336, which fixes a bunch of
tests, and simplifies the argument validation slightly.

closes tahoe-lafs/tahoe-lafs#336
closes ticket:2773
2016-09-09 19:11:11 -07:00
Brian Warner
3b17289569 create_node: simplify validation, clean up tests 2016-09-09 18:53:22 -07:00
Brian Warner
229e306e9d test_runner: fix to use new conventions
create-node needs --hostname=, and we can't expect the node to write
client.port at startup (because tahoe.cfg now has tub.port= set
properly)
2016-09-09 18:53:22 -07:00
Brian Warner
38ebdfac20 create-node: reject --listen=tcp without --hostname= 2016-09-09 18:53:22 -07:00
Brian Warner
9a1a186197 simplify tests: use parse_cli, assertRaises, assertFailure
parse_cli() got added during the async-CLI-dispatch work

assertRaises/assertFailure have been in Twisted for a while, but I only
learned about them recently. Over time I'm looking forward to changing
all tahoe tests to use them (and getting rid of ShouldFailMixin/etc).
2016-09-09 18:52:01 -07:00
Brian Warner
7d3b4149ae remove leftover debug prints 2016-09-09 18:51:57 -07:00
Brian Warner
09ce7963c6 fixes 2016-09-09 17:29:20 -07:00
David Stainton
e9c1075ac5 Make corrections from Daira's code review 2016-09-09 17:29:16 -07:00
David Stainton
31dfee2dcd fix cli test create tests 2016-09-09 17:10:22 -07:00
David Stainton
83db7e8b43 Add create node args: listen, port, hostname, location
fixes ticket: 2773
2016-09-09 17:10:22 -07:00
Brian Warner
2a44a8e8cc setup.py: use python3-safe print() call 2016-09-09 17:09:42 -07:00
Brian Warner
3aac5aa577 'setup.py test' prints message about tox
closes ticket:2799
2016-09-09 16:43:58 -07:00
Brian Warner
ecc2080372 Merge branch '2826-async-dispatch' 2016-09-09 16:27:10 -07:00
Brian Warner
802cfc87fe CLI: allow dispatch functions to return Deferred
In addition, CLI functions are allowed to use sys.exit() instead of
always needing to return the exit code as an integer.

runner.py now knows about the blocking httplib calls in scripts/cli and
scripts/magic_folder, and uses deferToThread() to invoke them. Those
functions cannot return a Deferred: when rewrite them to use twisted.web
or treq, we'll remove this deferToThread call.

Option parsing was split out to a separate function for testing. We now
use twisted.internet.task.react() to start the reactor, which required
changing the way runner.py is tested.

closes ticket:2826
2016-09-09 15:52:42 -07:00
Brian Warner
97c29a3c0b test_runner: factor out parse_cli() helper 2016-09-09 15:41:00 -07:00
Brian Warner
7193bff48b tests: use shared run_cli()/do_cli()
A couple of test classes which defined their own flavors were changed to
use the common one.
2016-09-09 15:41:00 -07:00
Brian Warner
07e4c491f5 move run_cli() up to test/common_util.py 2016-09-09 15:40:01 -07:00
Brian Warner
442468f599 do_cli(): split out run_cli()
The main part of CLITestMixin.do_cli() was split into a standalone
function named run_cli(), leaving do_cli() as a method which includes a
nodedir in the arguments (for use by GridTestMixin tests which do a lot
of CLI operations against one of their client nodes, for which adding
the extra --nodedir argument would be ugly).
2016-09-09 15:40:01 -07:00
Brian Warner
1877bd38b9 consolidate skip_if_cannot_represent_filename()
Remove duplicate copies of this utility, move it from a mixin/test-class
method to being a simple function in common_util.py
2016-09-09 15:40:01 -07:00
Brian Warner
d85d1ea499 CLITestMixin: move into common.py
Also move parse_options(). It was kind of awkward having other test
files import these from test_cli.py.
2016-09-09 15:40:01 -07:00
Brian Warner
45e5d5b891 test_configutil doesn't need CLITestMixin 2016-09-09 15:40:01 -07:00
Brian Warner
720aa1a51f unify signature of all CLI dispatch functions
Now they all take a single 'config' argument, instead of some also
taking stdout/stderr args.
2016-09-09 15:40:01 -07:00
Brian Warner
57bed47495 runner.py: remove unused arguments 2016-09-09 15:40:01 -07:00
Brian Warner
8d9afdc27e CLI: remove 'debug trial', 'debug repl'
These are obsolete. Tests are run with 'tox', or by running 'trial
allmydata' from a populated virtualenv. A populated virtualenv is also
the right way to get a repl: just run 'python'.

refs ticket:2735
2016-09-09 15:37:28 -07:00
Brian Warner
ff82112b89 Merge pr337 from meejah:2218.fix-shutdown.0
closes tahoe-lafs/tahoe-lafs#337
2016-09-08 12:19:17 -07:00
meejah
de8e61ddf1 it's okay if we already cancelled it 2016-09-08 12:18:58 -07:00
meejah
622ae646b1 fix shutdown 2016-09-08 12:18:58 -07:00
Brian Warner
74dc7194b6 validate_config: improve tests
closes ticket:2809
2016-09-06 19:23:51 -07:00
meejah
2732c37941 Check for unknown config options
The list of valid sections + config-items came from
grep'ing the source for `.get_config`
2016-09-06 15:05:46 -06:00
Brian Warner
00ea41ef2c Merge PR333 from str4d:anon-conf-doc-fixes 2016-09-03 10:01:35 -07:00
str4d
af6cb47390 Explain how to install the tor and i2p extras together 2016-09-03 12:05:08 +12:00
str4d
453574141e Minor format fix 2016-09-03 11:59:18 +12:00
Brian Warner
ed91398a3f WUI: disable google timing chart on mapupdate page
The google image chart API has been deprecated since 2012, sending the
URL to google leaks server IDs and the client's IP address (especially
important when the client is otherwise behind Tor), and the X-axis has
no units anyways.

refs ticket:1942 , which is both about removing the URL-based chart, and
eventually replacing it with a browser-rendered d3.js-based one
2016-09-02 16:30:21 -07:00
Brian Warner
ed22b60026 Merge PR331 from david415:2818.fix_grid_status_address.0
Closes tahoe-lafs/tahoe-lafs#331.
2016-09-02 11:13:19 -07:00
David Stainton
f88ae3861a Make the grid status display the location hints
Instead of displaying what appears to be the remote peer address
we display the list of connection hints.

closes ticket:2818
2016-09-02 11:09:16 -07:00
Brian Warner
0116c965fa private-mode: reject legacy host:port locations 2016-09-02 09:25:26 -07:00
Brian Warner
c17217699e docs: improve reveal-IP-address description 2016-09-02 09:18:47 -07:00
Brian Warner
d0da17adeb create-node: add --hide-ip, update docs
So "tahoe create-node --hide-ip" causes "reveal-IP-address = false" to
get written into tahoe.cfg . This also changes the default tahoe.cfg to
include "reveal-IP-address = true", for clarity.

refs ticket:1010
2016-09-01 23:24:38 -07:00
Brian Warner
57e7f7bb7c import/delegate-to foolscap's allocate_tcp_port
(instead of using a copy). Foolscap-0.12.3 fixes a problem with
allocate_tcp_port() that was causing intermittent test failures. I think
it makes more sense to use Foolscap's copy (and fixes) than to keep
re-copying it into Tahoe each time it changes.

If/when we manage to stop depending upon foolscap for server RPC, we can
re-copy this back into tahoe's source tree.

refs ticket:2795
2016-09-01 22:39:03 -07:00
Brian Warner
076b3895dc config: change syntax of no-listen mode
We now use::

  tub.port = disabled
  tub.location = disabled

instead of using an empty value (but the key still being present, since
if the key is missing entirely, that means "be automatic").

closes ticket:2816
2016-09-01 21:26:48 -07:00
Brian Warner
a1594df0a6 introclient: only give ascii key_s to storagebroker
This was triggered when the initial Introducer connection failed, so the
node read the introducer_cache.yaml from disk. That always returns
unicode strings, and the StorageFarmBroker insisted that it's
server-IDs (aka "key_s") were bytestrings.

The tests were extended to exercise the code that loads from disk and
delivers to the StorageFarmBroker, and more preconditions were put in
place to catch this sort of thing earlier next time.

closes ticket:2817
2016-09-01 20:29:52 -07:00
Brian Warner
78ccae35b1 Merge PR327 from david415:2813.socks_endpoint_desc.0
This should fix compatibility with the current versions of foolscap and
txtorcon.
2016-09-01 20:28:40 -07:00
Brian Warner
7f9b715b3e bump foolscap dep to 0.12.3, for the new tor API
The current version of Foolscap is compatible with the current version
of txtorcon, but not with tahoe. This fixes that.
2016-09-01 20:26:08 -07:00
David Stainton
1307c7262d Use the new Foolscap Tor handler, pass an endpoint for SOCKS connectivity
closes ticket:2813
2016-09-02 03:17:45 +00:00
Brian Warner
a03f68b787 tahoe.cfg: fix spelling of 'enabled' for tor/i2p
We should use "enabled = true", instead of "enable = true", since
the rest of tahoe.cfg uses "enabled".

refs ticket:2788
2016-08-31 15:23:47 -07:00