Commit Graph

745 Commits

Author SHA1 Message Date
Brian Warner
f0c32617d0 README: mention libsodium-dev package
pynacl-1.0.1 has a bug, on systems which have the sodium runtime library
installed (/usr/lib/libsodium.so, as provided by a package like
"libsodium13"), but not the development headers (/usr/include/sodium.h,
as provided by "libsodium-dev"). The pynacl setup.py tries to detect
whether a system libsodium can be used (instead of the bundled copy), by
using cffi to load libsodium.so and check the version strings. However
this test doesn't check that sodium.h is available, which is needed to
build the glue code.

The long-term fix is to change pynacl, either to improve the test (to
look for a header file, which sounds tricky), or to always use the
bundled sodium unless explicitly told otherwise (removing the test
altogether). The short term fix is to tell magic-wormhole builders to
install libsodium-dev if they run into this error, or use the
environment-variable override when installing.

closes #10

refs https://github.com/pyca/pynacl/issues/184
2016-06-23 11:31:24 -07:00
Brian Warner
fa29789769 test_scripts: re-enable tests on py3
These weren't running because Click complained about an ASCII locale
when running under py3, which triggered an error check that was there to
detect broken virtualenvs, skipping those tests.

The fix appears to be to force the en_US.UTF-8 locale when running the
wormhole program in a subprocess.
2016-06-22 19:28:17 -07:00
Brian Warner
177aac2d84 test upgrader, badly
This adds a test for database upgrades, which I developed on a branch
that added a new DB schema (v3) and an upgrader to match, but then I
changed my mind about the schema and removed that part. The test will be
useful some time in the future when I change the schema in a small
enough way that I bother to write an upgrader for the change. For now,
the test is disabled.

In addition, the upgrader test is kind of lame. I'd really prefer to
assert that the upgraded schema is identical to the schema of a
brand-new (latest-version) database, but ALTER TABLE doesn't quite work
that way (comments are omitted, and the order of the columns is slightly
different).

This also adds database.dump_db() for the tests.
2016-06-22 19:05:52 -07:00
Brian Warner
7250deb94c add schema upgrades 2016-06-22 19:05:48 -07:00
Brian Warner
38ebc0d8a4 Merge branch 'pr47' 2016-06-22 13:23:35 -07:00
Brian Warner
b613ac1b3b cli.py: add comment 2016-06-22 13:15:07 -07:00
Brian Warner
60b40c2de2 server/cli.py: remove timing instrumentation
I don't anticipate ever caring how long it takes to import code on the
server side. Only the client's performance is interesting to me.
2016-06-22 13:12:45 -07:00
Brian Warner
d8c2c1249e server/cli.py: fix port numbers
There was some vestigal server-cli code (leftover in the client-side
wormhole.cli.cli_args) that used port 3000/3001, and it accidentally got
used for the new Click-based parser, rather than the actual server-cli
code (in wormhole.server.cli_args) that uses port 4000/4001. This
changes the port numbers to match (everything uses 4000/4001 these days,
to avoid confusing interactions with the old 0.7.6 server that might
still be listening on the old ports).
2016-06-22 13:12:34 -07:00
Brian Warner
940aec7570 cli.py: improve parallelism between send+receive 2016-06-22 13:11:43 -07:00
Brian Warner
b1f994e939 transit.py: improve error 2016-06-22 13:10:46 -07:00
meejah
e11c7496a9 add 'dev' extra, with mock + tox, and a pypy environment 2016-06-22 02:14:34 -06:00
meejah
7fab6b3dff Change UsageError -> InternalError, use click.UsageError for human-visible errors 2016-06-22 02:14:34 -06:00
meejah
f32cd46e2c remove argparse, whitespace-ify requirements 2016-06-22 01:30:15 -06:00
meejah
6b29d62d78 typo 2016-06-22 01:29:13 -06:00
meejah
03594a2d0e consistent return usage 2016-06-22 01:28:53 -06:00
meejah
ad6200c474 resolve XXX comments 2016-06-22 01:27:29 -06:00
meejah
c4cd4db30e Correct exit code when no twistd.pid file 2016-06-22 01:25:47 -06:00
meejah
e16b53817e Refactor to use Click 2016-06-22 01:11:07 -06:00
Brian Warner
d89fbd69dd sketching out a click-based CLI parser 2016-06-22 01:02:09 -06:00
meejah
07b4067727 unit-test for relay request, and fix Data() handling 2016-06-20 16:32:07 -07:00
Francois Marier
1170f196b3 Add missing install to Debian instructions 2016-06-06 19:01:55 -07:00
laharah
2a056059c0 fix for wormhole-server count-* functions
broken when we switched to dictfactory on db
2016-06-04 16:50:56 -07:00
Brian Warner
7042a01369 Merge 'pr44': remove u"" marker from most files
refs #30
2016-06-04 15:13:21 -07:00
laharah
150caedf73 u"" cleanup on test_scripts.py 2016-06-04 14:09:19 -07:00
laharah
bb970dafc0 u"" cleanup on test_server.py 2016-06-04 14:09:19 -07:00
laharah
2dd76f57c0 u"" cleanup on test_transit.py 2016-06-04 14:09:19 -07:00
laharah
aff13e9121 u"" cleanup on test_util.py 2016-06-04 14:09:19 -07:00
laharah
8fa40d3cd5 u"" cleanup on test_wormhole.py 2016-06-04 14:09:19 -07:00
laharah
255fb12f88 `u"" cleanup on cmd_usage.py 2016-06-04 14:09:19 -07:00
laharah
57d117e4f0 u"" cleanup on rendezvous_websocket.py 2016-06-04 14:09:19 -07:00
laharah
8537d90527 u"" cleanup on rendezvous.py 2016-06-04 14:09:19 -07:00
laharah
2c38795476 u"" cleanup on transit_server.py 2016-06-04 14:09:19 -07:00
laharah
64f7348d05 u"" cleanup on util.py and codes.py 2016-06-04 14:09:19 -07:00
laharah
2c25b4d97d u"" cleanup on wormhole.py 2016-06-04 14:09:19 -07:00
Brian Warner
ef6d704311 Merge pr43: set 'unicode_literals' in most source files
refs (but doesn't close) #30
2016-06-04 12:45:55 -07:00
laharah
6a73d50fdd added unicode_literals import to all apropriate modules
bug in twisted serverFromString prevents test.common and transit
from using unicode properly should revisit if twisted gets patched
2016-06-04 12:42:59 -07:00
laharah
33758abd18 added a dict_factory as a new row_factory for the database 2016-06-04 12:28:09 -07:00
Brian Warner
7c15cf7353 code input: don't eat "b" under GNU readline
GNU libreadline, and the libedit-based library shipped on stock OS-X
python, require different key-binding syntaxes to enable tab completion.
The previous commit to fix this (0977ef0) added both binding commands
Unfortunately when GNU libreadline is given the libedit-style
command (i.e. "bind ^I rl_complete"), it binds the letter "b" to a
non-existent command "ind", or something, and as a result the letter "b"
doesn't work anymore.

This patch uses the readline docstring to sense which flavor is
installed, and only runs the one binding command that's appropriate.

refs #37
2016-06-04 00:52:27 -07:00
Brian Warner
996c739b2a oops, fix tests
In some tests, we artificially call _event_connected() without first
initiating a connection.
2016-06-03 23:30:31 -07:00
Brian Warner
5b5b4b7134 JS: add knob to correct for tx/server/rx time skew
It's an internal variable for now (and requires a page reload to
update), but it's a start.
2016-06-03 23:23:44 -07:00
Brian Warner
d11af9d0a6 Merge branch 'JS-timing' 2016-06-03 22:57:03 -07:00
Brian Warner
b0f2b24ab2 render websocket establishment in timeline 2016-06-03 22:56:27 -07:00
Brian Warner
a1ce0d8df0 record websocket establishment in timing data 2016-06-03 22:55:52 -07:00
Brian Warner
3964d4c646 JS: highlight dots and lines together 2016-06-03 22:39:29 -07:00
Brian Warner
a0ce912305 JS: move unused code out of the way 2016-06-03 22:34:28 -07:00
Brian Warner
4857348361 fix display-timeline JS for new message format 2016-06-03 22:32:52 -07:00
Brian Warner
e13b95660b test_transit: tolerate a localhost-only system
e.g. Appveyor . Refs #16.
2016-06-03 21:46:56 -07:00
Brian Warner
b6ff5f3946 README: mention build-essential
I keep forgetting that nothing automatically depends upon it.
2016-06-03 18:27:20 -07:00
Brian Warner
3f05cd3007 Merge branch 'pr36'
Closes #36
2016-06-03 18:24:24 -07:00
Brian Warner
682fe0ae2c transit: allow 127.0.0.1 if that's all we've got
The appveyor tests were failing because their VMs only have 127.0.0.1,
and stripping it out resulted in an empty hint list, which meant Transit
couldn't work at all.
2016-06-03 18:22:53 -07:00