Commit Graph

3138 Commits

Author SHA1 Message Date
david-sarah
a555336910 Make sure that foolscap.logging.log.setLogDir is called with a str (not unicode) path, v2. Includes test. fixes #1725 2012-04-29 02:28:44 +00:00
Brian Warner
842a3a132b introweb announcements: show serverid, not tubid
'serverid' is the pubkey (for V2 clients), falling back to the tubid (for V1
clients). This also required cleaning up the way the index is created for the
old V1 introducer.
2012-04-24 01:37:28 -04:00
Brian Warner
84c9f3bfb4 Fix introweb display for mixed V1/V2 clients. Closes #1721.
This significantly cleans up the IntroducerServer web-status renderers.
Instead of poking around in the introducer's internals, now the web-status
renderers get clean AnnouncementDescriptor and SubscriberDescriptor
objects. They are still somewhat foolscap-centric, but will provide a clean
abstraction boundary for future improvements.

The specific #1721 bug was that old (V1) subscribers were handled by
wrapping their RemoteReference in a special WrapV1SubscriberInV2Interface
object, but the web-status display was trying to peek inside the object to
learn what host+port it was associated with, and the wrapper did not proxy
those extra attributes.

A test was added to test_introducer to make sure the introweb page renders
properly and at least contains the nicknames of both the V1 and V2 clients.
2012-04-23 18:30:53 -04:00
david-sarah
9d87f8ddd5 Change capitalization of WUI and introducer welcome page headings; add test for introducer welcome page. Also fix a typo in a CSS class name. fixes #1708 2012-04-05 23:57:23 +00:00
Brian Warner
4e93f77289 test/common.py: remove ununsed 'is_bad' mechanism
This was a premature feature addition to the mock filenode, and gets in the
way of the IServer refactoring I'm trying to do. Best to remove it now and
re-introduce it in a better form later when it's actually needed.
2012-04-04 12:11:03 -07:00
Brian Warner
4b8876c5da checker.py: minor simplifications 2012-04-04 12:05:31 -07:00
Brian Warner
55973e61e5 make IServer instances retain identity in copy() and deepcopy() 2012-04-04 11:14:09 -07:00
Brian Warner
b38cfd0235 move IServer from storage_client.py to interfaces.py 2012-04-04 11:13:59 -07:00
Brian Warner
bf390cca4b Rename web CheckResults to -Renderer, to avoid confusion. Closes #1705.
This avoids the name collision between the actual results
objects (defined in allmydata.check_results) and the code that renders
these objects into HTML (defined in allmydata.web.check_results). Only
the web-side objects were renamed.
2012-04-02 20:04:51 -07:00
Brian Warner
470acbf1e1 servermap.py: oops, fix _done() condition, good catch by davidsarah 2012-04-01 15:10:34 -07:00
david-sarah
93e50f5e16 interfaces.py: ensure that NoSuchChildError can be converted to str even when it is for a non-ASCII name. fixes #1483 2011-08-14 22:59:59 +00:00
david-sarah
122f63aa64 Spelling error in a comment. 2012-04-01 01:36:55 +00:00
david-sarah
972beffb25 test_node.py: test that we tolerate a UTF-8 BOM at the start of tahoe.cfg, and can read UTF-8 option values. refs #1470 2011-08-08 18:05:52 +00:00
david-sarah
ba0df23927 node.py: tolerate a UTF-8 BOM at the start of tahoe.cfg. fixes #1470 2011-08-08 18:02:04 +00:00
david-sarah
87ca4fc705 mutable/layout.py: improve confusing documentation of layout. fixes #1534 2011-09-14 14:39:47 +00:00
Brian Warner
5bae4a1bd2 Mutable repair: use new MODE_REPAIR to query all servers *and* get privkey
This fixes bug #1689. Repair was using MODE_READ to build the servermap,
which doesn't try hard enough to grab the privkey, and also doesn't guarantee
sending queries to all servers. This patch adds a new MODE_REPAIR which does
both, and does a separate, distinct mapupdate to start wth repair cycle,
instead of relying upon the (MODE_CHECK) mapupdate leftover from the
filecheck that triggered the repair.
2012-03-31 11:39:02 -07:00
Brian Warner
2b8a312cb7 Add test for bug #1689: repairing empty file hits no-privkey assertion 2012-03-31 11:39:02 -07:00
david-sarah
74cfa65f0d test_ftp.py: fix a couple of unused imports. refs #1668 2012-03-31 02:17:25 +00:00
Peter Le Bek
7f6ee7e918 ftpd file `size' attribute must be an integer 2012-03-22 13:18:06 +00:00
Peter Le Bek
be1fd9d2b5 unit test for ftpd LIST 2012-03-30 23:41:39 +00:00
Peter Le Bek
14a50f258a fix ftpd mtime retrieval 2012-03-30 23:41:19 +00:00
Brian Warner
24812905a1 test_introducer.SystemTest: fix race condition
SystemTest has a couple of different phases, separated by a poller which
waits for everything to be idle (all messages delivered, none in flight). It
does this by watching some internal "_debug_outstanding" counters in the
server and in each client, and waiting for them to hit zero.

Just before the last phase, we replace the server with a new one (to make
sure clients re-send their messages properly). Unfortunately, the polling
function closed over the variable holding the original server, and didn't see
the replacement. It kept polling the old server, and failed to notice the
outstanding messages for the new server. The last phase of the test (check3)
was started too early, which failed (since some messages had not yet been
delivered), and then exploded in a flurry of dirty-reactor errors (because
some messages were delivered after test shutdown).

This replaces the closed-over-variable with a "self.the_introducer", which
seems to fix the race.

One additional place to look at in the future: the client
announcement-receive path (remote_announce) uses an eventually(). If the
message has been received and the eventual-send posted (but not yet executed)
when the poller sees it, the poller might erroneously conclude that the
client is idle and cause the same problem as above. To fix this, the poller
(probably all pollers) could be enhanced to do a flushEventualQueue before
querying the are-we-done-yet predicate function.
2012-03-30 17:29:06 -07:00
Brian Warner
a56e639346 Fix mutable status (mapupdate/retrieve/publish) to use serverids, not tubids
This still leaves immutable-publish results incorrectly using tubids instead
of serverids. That will need some more work, since it might change the Helper
interface.
2012-03-17 17:01:35 -07:00
Brian Warner
890449801e IServer.get_name(): remove v0- prefix from displayed server names
Don't remove the prefix if it isn't there: that avoids the need to fix tests
which use a bogus key (usually all-zeros).
2012-03-17 17:01:35 -07:00
david-sarah
cef646c4a7 Fix a missing comma in the last patch. refs #1295 2012-03-14 23:50:40 +00:00
david-sarah
421b8b9369 Temporarily suppress the DeprecationWarning about IFinishableConsumer; it's irritating, but not in a way that is likely to make me fix the underlying issue (#1525) any sooner :-). refs #1295 2012-03-14 23:47:29 +00:00
Brian Warner
a133c08732 minor: hush pyflakes, move pycryptopp dep to unconditional section
Also change Makefile's "pyflakes" rule to emit less output, so buildbot will
count errors properly.
2012-03-13 23:20:35 -07:00
david-sarah
d9c7dfa4a0 Update more links from http: to https: in documentation and comments. 2012-03-13 20:26:54 +00:00
Brian Warner
bc21726dfd new introducer: signed extensible dictionary-based messages! refs #466
This introduces new client and server halves to the Introducer (renaming the
old one with a _V1 suffix). Both have fallbacks to accomodate talking to a
different version: the publishing client switches on whether the server's
.get_version() advertises V2 support, the server switches on which
subscription method was invoked by the subscribing client.

The V2 protocol sends a three-tuple of (serialized announcement dictionary,
signature, pubkey) for each announcement. The V2 server dispatches messages
to subscribers according to the service-name, and throws errors for invalid
signatures, but does not otherwise examine the messages. The V2 receiver's
subscription callback will receive a (serverid, ann_dict) pair. The
'serverid' will be equal to the pubkey if all of the following are true:

  the originating client is V2, and was told a privkey to use
  the announcement went through a V2 server
  the signature is valid

If not, 'serverid' will be equal to the tubid portion of the announced FURL,
as was the case for V1 receivers.

Servers will create a keypair if one does not exist yet, stored in
private/server.privkey .

The signed announcement dictionary puts the server FURL in a key named
"anonymous-storage-FURL", which anticipates upcoming Accounting-related
changes in the server advertisements. It also provides a key named
"permutation-seed-base32" to tell clients what permutation seed to use. This
is computed at startup, using tubid if there are existing shares, otherwise
the pubkey, to retain share-order compatibility for existing servers.
2012-03-13 18:24:32 -07:00
Brian Warner
5ea8b698a5 'tahoe admin generate-keypair/derive-pubkey': add Ed25519 keypair commands
Also add parse_privkey/parse_pubkey tools to util.keyutil
2012-03-13 18:24:32 -07:00
Brian Warner
0e60920baf bump pycryptopp dependency to >=0.6.0, to get ed25519 signatures
This is for the upcoming #466 signed-introducer code.
2012-03-13 18:24:32 -07:00
david-sarah
aaee828abb Make the link on the Welcome page to 'https://tahoe-lafs.org/', not 'http:'. Includes a test. fixes #1682 2012-03-08 23:17:58 +00:00
david-sarah
aebaa838da Update various references to allmydata.org or http://tahoe-lafs.org in comments, to https://tahoe-lafs.org. refs #1682 2012-03-08 23:17:19 +00:00
david-sarah
916d26e710 Suppress a warning from win32eventreactor on Windows (patch v2). fixes #1681 2012-02-27 19:03:17 +00:00
Brian Warner
880af4e1fd Add nickname/nodeid to storage-status web page. Closes #1204.
Also add tahoe.css to the page, to make it look slightly prettier.
2012-03-12 19:57:36 -07:00
Brian Warner
dc28e3144a add some quick tests of the introducer/web improvements 2012-03-12 12:35:36 -07:00
Brian Warner
e27423e4a9 introducer web page: add CSS styling, roughly match client Welcome page
Also add /static and the top-level /tahoe.css -type stuff to the introducer's
web server.
2012-03-06 18:25:05 -08:00
Brian Warner
ec7bc05c04 tahoe.css: fix #section typo, update welcome.xhtml to match
The "#section" declaration (which matches id="section") should have been
".section" (which matches class="section").

The welcome page has a feature that I actually liked: the little "This
Client" sidebar sits just to the right of the start of the Controls block.
Fixing .section broke that (the clear:both introduces a gap, forcing the
Controls block to start strictly below the bottom of the This Client block).
So I also removed class="section" from the Controls block to allow them to
share the horizontal space again.
2012-03-06 18:22:41 -08:00
Brian Warner
11f9394704 remove 'provisioning'/'reliability' from WUI, add to misc/operations_helpers
Also remove docs related to reliability/provisioning pages
2012-02-16 22:29:05 +00:00
Brian Warner
e0f409c681 provisioning.py: update disk sizes and usage numbers 2012-02-13 15:57:08 +00:00
Kevan
1469b1b9f9 Ensure that verification proceeds and stops when appropriate.
The removed assertions are appropriate for a download that seeks to
return plaintext to a caller; if we don't have at least k active remote
shares, then we can't hope to do that. They're not appropriate for a
verification operation; a user can try to verify a file that has fewer
than k shares available, so that shouldn't be treated as an error.
Instead, we proceed with fewer than k shares, and ensure that we
terminate the download if we have no shares at all and we're verifying.
2012-01-24 12:52:09 -08:00
Kevan
5e1e58d4a8 Add test_verify_mdmf_all_bad_sharedata
test_verify_mdmf_all_bad_sharedata tests for the regression described
in ticket 1648. In particular, it will trigger the misplaced assertion
in the share activation code. It also tests to make sure that
verification continues with fewer than k shares.
2012-01-24 12:52:09 -08:00
Brian Warner
d10f260f36 retrieve.py: unconditionally check share-hash-tree. Fixes #1654.
Add Kevan's unit test, update known_issues.rst
2012-01-12 13:35:53 -08:00
david-sarah
76e7f0ad4b _auto_deps.py: don't allow pycrypto 2.0.1. fixes #1631 2012-01-10 19:57:58 +00:00
Brian Warner
893eea849b mutable/retrieve.py: clean up control flow to avoid dropping errors
* replace DeferredList with gatherResults, simplify result handling
* use BadShareError to signal recoverable problems in either fetch or
  validate, catch after _validate_block
* _validate_block is thus not responsible for noticing fetch problems
* rename _validation_or_decoding_failed() to _handle_bad_share()
* _get_needed_hashes() returns two Deferreds, instead of a hard-to-unpack
  DeferredList
2012-01-08 14:12:48 -08:00
Brian Warner
c56839478e mutable/layout.py: raise BadShareError instead of assert() 2012-01-08 14:12:47 -08:00
Brian Warner
ca78e6b146 mutable: don't tell server about corruption unless it's really CorruptShareError 2012-01-08 14:12:45 -08:00
Brian Warner
f1752f54c0 mutable: simplify Retrieve._process_segment() to use a gatherDeferred 2012-01-08 14:12:44 -08:00
Brian Warner
7f0bc64325 Retrieve.decode(): simplify setup of DeferredList-like argument
make it more obviously match the expectations of _decode_blocks() and
_maybe_decode_and_decrypt_segment()
2012-01-08 14:12:40 -08:00
Brian Warner
341b8c5715 mutable: add comments about the tricky DeferredList structures in retrieve 2012-01-08 14:12:38 -08:00