Commit Graph

5522 Commits

Author SHA1 Message Date
david-sarah
3738c3e2d1 fileutil.py: use try/finally to close file in write_atomically. 2012-05-16 23:08:39 +00:00
david-sarah
959248cd49 Change logging.rst to address warner's review comment. refs #1693 2012-05-16 22:13:29 +00:00
Brian Warner
c4d7b7b109 write node.url and portnum files atomically, to fix race in test_runner
Previously, test_runner sometimes fails because the _node_has_started()
poller fires after the portnum file has been opened, but before it has
actually been filled, allowing the test process to observe an empty file,
which flunks the test.

This adds a new fileutil.write_atomically() function (using the usual
write-to-.tmp-then-rename approach), and uses it for both node.url and
client.port . These files are written a bit before the node is really up and
running, but they're late enough for test_runner's purposes, which is to know
when it's safe to read client.port and use 'tahoe restart' (and therefore
SIGINT) to restart the node.

The current node/client code doesn't offer any better "are you really done
with startup" indicator.. the ideal approach would be to either watch the
logfile, or connect to its flogport, but both are a hassle. Changing the node
to write out a new "all done" file would be intrusive for regular
operations.
2012-05-14 15:03:14 -07:00
david-sarah
bf7e351464 Improve a comment in __init__.py. 2012-05-14 16:34:31 +00:00
david-sarah
4b80299fdd Suppress the PowmInsecureWarning from PyCrypto. refs #1586 2012-05-14 03:23:52 +00:00
david-sarah
1e2657efe3 Clarify an ambiguity about which version number is meant in quickstart.rst. 2012-05-14 00:26:37 +00:00
Brian Warner
e850b54772 performance.rst: small updates, mention (lack of) MDMF
refs #1398
2012-05-13 14:07:39 -07:00
Brian Warner
6856e53b36 CREDITS: add amiller, zooko, rearrange a bit 2012-05-13 10:32:17 -07:00
Brian Warner
fcc7e64759 Doc updates and cosmetic fixes for #1115 patch.
Removes the caveat from webapi.txt about count-good-share-hosts being wrong.

This series should close #1115.
2012-05-13 01:15:50 -07:00
Andrew Miller
04eb6086ad Fixed an error in previous commit where an empty servermap would throw an exception in 'count-good-share-hosts'. Augmented unit test.
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:59:30 -07:00
Andrew Miller
4b7f34d179 Added tests for count-good-share-hosts under check and repair conditions. Patched the incorrect computation in immutable/filenode.py
Signed-off-by: Andrew Miller <amiller@dappervision.com>

Fixed missing import statements

Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:59:30 -07:00
Brian Warner
8f630a76fe test_web: fix use of headers= that's been wrong for a while 2012-05-13 00:45:12 -07:00
Brian Warner
5d404db898 webapi: don't allow ETags in t=info or t=rename-form, both are variable
t=info contains randomly-generated ophandles, and t=rename-form contains the
name of the child being renamed, so neither is eligible for a
short-circuiting ETag. Enhanced test_web to exercise this. Had to improve
FakeCHKFileNode slightly to let it participate. Refs #443.
2012-05-13 00:45:11 -07:00
Brian Warner
d437a9b33e test_web: improve ETag tests, add If-None-Match test 2012-05-13 00:45:11 -07:00
Andrew Miller
16eddc35e8 Added unit tests covering #466:comment-15. Refactored the 'etag' behavior for immutable files to respond to all GET '?t=' flags, not just t=None
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:45:11 -07:00
Jeremy Fitzhardinge
4f1bc1b387 Short circuit GET on ETags match
When client does a conditional GET/HEAD with If-none-match:, if the condition
fails (ie, the client's ETag matches the file's) then we can short-circuit
the whole process and immediately return an empty body.
2012-05-13 00:45:11 -07:00
Jeremy Fitzhardinge
518ef25bdb Add ETags for immutable directories
Like immutable files, the ETag is based on the storage index. However, since
a directory is a special interpretation of a file, it is distinguished from
the file by prepending "DIR:" onto the start of the ETag, and adding
-representation on the end (where -representation is the ?t= argument, json,
info, etc).

It also checks the return of setETag and avoids generating a representation
if the client already has it.
2012-05-13 00:45:11 -07:00
Brian Warner
488b6f8ccd test-dont-use-too-old-dep.py: fix tarfile timestamps
It turns out that TarFile.addfile() doesn't provide a reasonable default
timestamp, resulting in files dated to 1970 (they're probably wearing
bell-bottoms and listening to disco too). Then, when the bdist_egg command
tries to create a *zip*file with those files, it explodes because zipfiles
cannot handle timestamps before 1980 (it prefers boomboxes and jackets with
straps on the shoulders, thank you very much).

This puts a modern time.time() on the members of the tarfile, allowing future
cryptocoderarchaeologists the opportunity to make fun of fashion trends from
the user's chosen era, rather than an artificially older one.

refs #1342
2012-05-12 23:34:03 -07:00
david-sarah
379901bf8f Add 'tahoe debug flogtool' command, test for --help, and docs. This version gets the help synopses more correct, and changes the doc to say that this command is added in 1.10.0 rather than 1.9.2. fixes #1693 2012-03-31 22:41:22 +00:00
Zooko
d867765604 modify build_helpers files
Should close #1342. This makes the actual changes to the two test
files (separated from the 'rename' patch to avoid VC complications).
2012-05-12 20:47:24 -07:00
Zooko
533e4bc813 rename build_helpers files
This is from the darcs patch for #1342, which failed to apply on my darcs
tree, so I'm landing it from git. I'm landing the rename-files part
separately from the modify-those-files part to avoid VC complications.
2012-05-12 20:47:01 -07:00
Brian Warner
eb2a4ef246 webapi: remove undocumented t=mkdir-p operation
Closes #380
2012-05-12 19:19:43 -07:00
Brian Warner
2c5a7f7ba4 Improve webapi t=move docs. 2012-05-09 16:46:53 -07:00
Brian Warner
8417579147 webui: merge 'move' form with 'rename' form 2012-05-09 14:21:37 -07:00
Brian Warner
81c30b1cd1 test_web: improve shouldFail2() error reporting 2012-05-09 14:18:37 -07:00
Brian Warner
a92385b54b webapi 'move'-button cleanups
test_web.py: use shouldFail2(), safer than old shouldFail()
directory.py: forbid slashes in from_name=, return BAD_REQUEST instead of
              GONE when trying to move into a non-directory
2012-05-09 14:18:27 -07:00
Marcus Wanner
e89bce21a5 Add unit test for moving a directory
My gut tells me this case sould be tested. The rename suite tests it, so
move's will too.
2012-05-09 13:07:14 -07:00
Marcus Wanner
e58a01270b Change the arbitrary URI support from implied to explicit
The move webapi function now takes a target_type argument which lets it
know whether the target is a subdirectory name or URI. This is an
improvement over the old system in which the move handler tried to guess
whether the target was a name or a URI. Also fixed a little docs
copypaste problem and tweaked some line wrapping.
2012-05-09 13:07:14 -07:00
Marcus Wanner
b29d0920d3 Adding 'move' button to web UI, closes #1579
This adds "move file" capability to the web UI's directory display. The
support and test framework is heavily based on the similar "rename file"
feature. Unit tests and documentation are included. Multiple in-progress
versions of this patch may be found in ticket 1579. This version
includes arbitrary URI target support and is compatible with the change
from tahoe_css to tahoe.css.
2012-05-09 13:07:13 -07:00
Zooko O'Whielacronx
8aa690b64e CREDITS: lebek 2012-05-03 17:30:33 +00:00
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
Patrick R McDonald
080c136daf Updated webapi.rst to list /cap as a synonym for /uri 2012-04-17 11:41:11 -07:00
markus reichelt
711edb2b6e Adding jg71 to CREDITS 2012-04-14 16:01:07 +02:00
Patrick R McDonald
589179cf03 Fix for ticket #1662 2012-04-10 11:33:14 -07:00
david-sarah
496b65bf02 docs/frontends/drop-upload.rst: document more known issues and link to new ticket for an existing one. 2012-04-06 04:39:46 +00: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
3a2a086f6c webapi.rst: de-tabify 2012-04-02 16:32:05 -07:00
Brian Warner
470acbf1e1 servermap.py: oops, fix _done() condition, good catch by davidsarah 2012-04-01 15:10:34 -07:00
Zooko O'Whielacronx
c84cbcae71 doc: cross-link known_issues.rst and cautions.rst with one another 2012-04-01 21:40:39 +00:00
Zooko O'Whielacronx
62515f1fc3 docs: FTP-and-SFTP.rst: recommend SFTP
Add an explicit recommendation of SFTP over FTP. Separate the known issues of
FTP from SFTP. List "SFTP" first in all lists of the two. Use unicode bullet
points and prepend a utf-8 BOM. Use out-of-line rst hyperlinks.
2012-04-01 21:20:02 +00: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
c7038d1807 misc/build_helpers/show-tool-versions.py: s/print_stderr/print_stdout/ 2012-04-01 02:28:26 +00:00
david-sarah
07369205e1 bin/tahoe-script.template: fix the error message that is displayed when a runner script cannot be found. fixes #1488 2011-08-17 22:26:51 +00:00