Commit Graph

331 Commits

Author SHA1 Message Date
Zooko O'Whielacronx
2841d6a266 setup: add pysqlite and sqlite to get_package_versions() 2009-06-04 08:37:28 -07:00
Zooko O'Whielacronx
77b578928e trivial: fix comment 2009-04-13 10:41:38 -07:00
Zooko O'Whielacronx
9729753692 dirnode: add 'tahoe'/'linkcrtime' and 'tahoe'/'linkmotime' to take the place of what 'mtime'/'ctime' originally did, and make the 'tahoe' subdict be unwritable through the set_children API
Also add extensive documentation in docs/frontends/webapi.txt about the behaviors of these values.  See ticket #628.
2009-04-11 15:52:05 -07:00
Zooko O'Whielacronx
b12a7f9ee8 leases, time_format: modify time stamping in lease description
* emit lease expiry date in ISO-8601'ish format as well as Brian's format
 * rename iso_utc_time_to_localseconds() to iso_utc_time_to_seconds()
 * add iso_utc_date()
 * simplify the body of iso_utc_time_to_seconds()
2009-04-03 15:59:04 -07:00
Brian Warner
b5d4972a7a move GC docs out of proposed/, since it's all implemented now. Add reference to configuration.txt . Add expire.*= suggestions to tahoe.cfg . 2009-03-23 16:08:20 -07:00
Brian Warner
475e7b8804 tahoe_ls.py: add comment about error cases to improve 2009-03-16 22:12:06 -07:00
Brian Warner
f0b0ad1c8f tahoe cp -r: add --caps-only flag, to write filecaps into local files instead of actual file contents. Used only for debugging and as a quick tree-comparison tool. 2009-03-15 16:19:58 -07:00
Brian Warner
e59164e0bb consolidate: remove pointless 'else' after for loop 2009-03-13 01:27:51 -07:00
Brian Warner
ae64ddf8e6 consolidate: add eta, flush stdout 2009-03-13 01:24:51 -07:00
Brian Warner
06bf443e91 consolidate: tolerate unicode dirnames 2009-03-12 23:54:02 -07:00
Brian Warner
a18f8d4cc7 consolidator: add progress to scan-old-directory passes 2009-03-12 22:47:28 -07:00
Brian Warner
ddb2f1a6e3 consolidator: fix cycle detection to not trigger on merely shared directories, add snapshot counter to progress 2009-03-12 21:22:29 -07:00
Brian Warner
ddc9a7ae74 consolidator: re-use more directories, add total directories seen-vs-used counts 2009-03-12 20:48:01 -07:00
Brian Warner
809ec25ffa tahoe_backup.py: tolerate more time formats 2009-03-12 18:16:00 -07:00
Brian Warner
1c24707f19 consolidator: add more verbose traversal of directories 2009-03-12 16:29:00 -07:00
Brian Warner
760688a224 consolidate: create multiple numbered backups of the original Archives directory, not just the first time 2009-03-12 16:04:27 -07:00
Brian Warner
c4c6a62954 add 'tahoe debug consolidate' command, to merge directories created by repeated 'tahoe cp -r' or the allmydata win32 backup tool, into the form that would have been created by 'tahoe backup'. 2009-03-12 13:56:06 -07:00
Brian Warner
969b758bf5 tahoe_cp.py: return 0 for success, instead of None 2009-03-12 13:53:45 -07:00
Brian Warner
192c161be7 tahoe_cp.py: improve error reporting slightly: don't json-interpret HTTP errors, pass through tahoe webapi error messages 2009-03-07 05:40:51 -07:00
Brian Warner
24ebdb3954 tahoe_cp.py: don't be verbose unless --verbose is passed: default is one line of success 2009-03-07 02:44:21 -07:00
Brian Warner
0dee2a6036 storage: add a lease-checker-and-expirer crawler, plus web status page.
This walks slowly through all shares, examining their leases, deciding which
are still valid and which have expired. Once enabled, it will then remove the
expired leases, and delete shares which no longer have any valid leases. Note
that there is not yet a tahoe.cfg option to enable lease-deletion: the
current code is read-only. A subsequent patch will add a tahoe.cfg knob to
control this, as well as docs. Some other minor items included in this patch:

 tahoe debug dump-share has a new --leases-only flag
 storage sharefile/leaseinfo code is cleaned up
 storage web status page (/storage) has more info, more tests coverage
 space-left measurement on OS-X should be more accurate (it was off by 2048x)
  (use stat .f_frsize instead of f_bsize)
2009-03-06 22:45:17 -07:00
Brian Warner
7c35f01073 startstop_node.py: when restarting, tolerate a stale pid too 2009-02-25 19:52:45 -07:00
Brian Warner
a3c1fe35d9 CLI: modify 'tahoe manifest' and 'tahoe deep-check' to report ERROR: properly. For #590. 2009-02-24 23:44:15 -07:00
Brian Warner
7f8708cb7c scripts/common: fix alias handling on windows again, emit slightly nicer error message in response to an unknown alias 2009-02-24 22:21:36 -07:00
Brian Warner
fdb0200eca #165: make 'tahoe restart --force' the default behavior: warn but do not stop if restart is used on something that wasn't a running node, and always try to start it afterwards. This is particularly important for #315 (restart -m), because otherwise a single not-already-running node will prevent all nodes from being restarted, resulting in longer downtime than necessary 2009-02-24 21:42:13 -07:00
Brian Warner
a0aea06a9e scripts/common: on windows, tolerate paths like 'c:\dir\file.txt', by treating single-letter aliases on windows/cygwin as non-aliases 2009-02-24 17:55:22 -07:00
Alberto Berti
e1c925b373 Two small fixes on documentation for cli backup command. 2009-02-24 16:36:34 -07:00
Alberto Berti
7e8958671b Add elapsed timestamp to cli backup command final summary. 2009-02-24 11:14:25 -07:00
Brian Warner
15ee186499 scripts: stop using RuntimeError, for #639 2009-02-22 17:31:06 -07:00
Alberto Berti
b2f8fe04c6 Use failUnlessEqual instead of failUnless(a == b) 2009-02-22 16:42:14 -07:00
Alberto Berti
89a20fe4dd Better implementation of filtering algorithm. 2009-02-22 16:40:49 -07:00
Alberto Berti
2fbca1596b Removed '.hgrags' from vcs excludes 2009-02-22 16:39:46 -07:00
Alberto Berti
5d57da93fd Added --exclude, --exclude-from and --exclude-vcs options to backup command.
It is still impossible to specify absolute exclusion path, only
relative. I must check with tar or rsync how they allow them to be
specified.
2009-02-22 11:08:29 -07:00
Alberto Berti
c54fdd61b0 Raise a more explanatory exception for errors encountered during backup processing. 2009-02-22 11:02:52 -07:00
Alberto Berti
ffab4002aa Add missing synopsis and descriptions for alias commands. 2009-02-20 18:31:06 -07:00
Brian Warner
ef53da2b12 break storage.py into smaller pieces in storage/*.py . No behavioral changes. 2009-02-18 14:46:55 -07:00
Brian Warner
bce4a5385b add --add-lease to 'tahoe check', 'tahoe deep-check', and webapi. 2009-02-17 19:32:43 -07:00
Brian Warner
fde2289e7b CLI #590: convert 'tahoe deep-check' to streaming form, improve display, add tests 2009-02-17 17:15:11 -07:00
Brian Warner
770f976a85 test_cli: add test coverage for help strings 2009-02-16 15:08:33 -07:00
Zooko O'Whielacronx
14d23d99a5 setup: make the "full version string" be "allmydata-tahoe/1.3.0" instead of "allmydata-tahoe-1.3.0" and the UserAgent string of the cli be "allmydata-tahoe/1.3.0 (tahoe-client)"
This is webbish.  Thanks to kpreid for suggesting it.
2009-02-12 22:37:38 -07:00
Zooko O'Whielacronx
7eb260a9cf versioning: include an "appname" in the application version string in the versioning protocol, and make that appname be controlled by setup.py
It is currently hardcoded in setup.py to be 'allmydata-tahoe'.  Ticket #556 is to make it configurable by a runtime command-line argument to setup.py: "--appname=foo", but I suddenly wondered if we really wanted that and at the same time realized that we don't need that for tahoe-1.3.0 release, so this patch just hardcodes it in setup.py.
setup.py inspects a file named 'src/allmydata/_appname.py' and assert that it contains the string "__appname__ = 'allmydata-tahoe'", and creates it if it isn't already present.  src/allmydata/__init__.py import _appname and reads __appname__ from it.  The rest of the Python code imports allmydata and inspects "allmydata.__appname__", although actually every use it uses "allmydata.__full_version__" instead, where "allmydata.__full_version__" is created in src/allmydata/__init__.py to be:

__full_version__ = __appname + '-' + str(__version__).

All the code that emits an "application version string" when describing what version of a protocol it supports (introducer server, storage server, upload helper), or when describing itself in general (introducer client), usese allmydata.__full_version__.

This fixes ticket #556 at least well enough for tahoe-1.3.0 release.
2009-02-11 17:18:16 -07:00
Brian Warner
23fdd4f48e backupdb: cosmetic: capitalize the no-pysqlite instructions properly. Thanks to Terrell Russell for the catch. 2009-02-11 15:28:30 -07:00
Brian Warner
f7a263eb0b #619: make 'tahoe backup' complain and refuse to run if sqlite is unavailable and --no-backupdb is not passed 2009-02-10 18:49:10 -07:00
Brian Warner
19902a0f16 test_runner.py: revert the CreateNode section to using runner() inline, rather than spawning a process, to get more precise coverage 2009-02-09 02:26:17 -07:00
Brian Warner
d8e00c37b5 test_cli.Backup: capture stderr when sqlite is unavailable 2009-02-07 15:14:40 -07:00
Brian Warner
5bc0ef7ffe backupdb.py: catch OperationalError on duplicate-insert too, since pysqlite2 on dapper raises it instead of IntegrityError 2009-02-06 01:34:01 -07:00
Brian Warner
ca32db5b39 #598: add cli+backupdb tests, improve user display, update docs, move docs out of proposed/ 2009-02-05 22:07:01 -07:00
Brian Warner
add0e1f2f8 #598: add backupdb to 'tahoe backup' command, enable it by default 2009-02-05 19:56:40 -07:00
Brian Warner
4be2e11d11 add sqlite-based backupdb, for #598 and others (including 'tahoe cp'). Not enabled yet. 2009-02-05 18:17:56 -07:00
Zooko O'Whielacronx
9ba5f9347d setup: add a case to execute "python .../twistd.py" if "twistd" is not found 2009-02-04 18:06:20 -07:00
Brian Warner
0716fbcd16 CLI: tahoe_check: stop escaping the JSON output when using --raw 2009-02-02 21:12:32 -07:00
Brian Warner
cfce8b5eab #598: first cut of 'tahoe backup' command: no backupdb, but yes shared-unchanged-directories and Archives/TIMESTAMP and Latest/ 2009-02-02 21:09:02 -07:00
Brian Warner
91dacc3dbc CLI: move node-url -should-end-in-slash code into a common place, so other tools can rely upon it later 2009-02-02 21:08:56 -07:00
Brian Warner
a7de479767 tahoe_ls: CLI command should return rc=0, not None 2009-02-02 21:07:20 -07:00
Brian Warner
1427db1c88 CLI: fix examples in tahoe put --help 2009-01-27 15:39:09 -07:00
Brian Warner
1de4110b35 #509: remove non-streaming 'tahoe manifest' CLI form 2009-01-23 17:00:02 -07:00
Brian Warner
6a04103cc2 #509 CLI: add 'tahoe manifest --stream' 2009-01-23 16:33:21 -07:00
Brian Warner
6ba154851f CLI: remove the '-v' alias for --version-and-path, to free up '-v' for more traditional uses (like --verbose) 2009-01-23 15:21:50 -07:00
Zooko O'Whielacronx
fafdd2ce59 setup: fix "tahoe start" to work on Windows even when a Tahoe base dir hasn't been configured in the Windows registry 2009-01-21 12:47:20 -07:00
cgalvan
7bfaa74ef1 add option to show version and path to the tahoe executable 2009-01-16 12:47:51 -07:00
Larry Hosken
3267984fa9 'tahoe cp -r', upon encountering a dangling symlink, would assert out.
This was somewhat sad; the assertion didn't say what path caused the
error, what went wrong.  So... silently skip over things that are
neither dirs nor files.
2009-01-07 23:51:14 -07:00
Zooko O'Whielacronx
821e64203c cli: make startstop_node wait 40 seconds instead of 20 for a process to go away after we signalled it to go away, before emitting a warning
Because the unit tests on the VirtualZooko? buildslave failed when it took 31 seconds for a process to go away.
Perhaps getting warning message after only 5 seconds instead of 40 seconds is desirable, and we should change the unit tests and set this back to 5, but I don't know exactly how to change the unit tests. Perhaps match this particular warning message about the shutdown taking a while and allow the code under test to pass if the only stderr that it emits is this warning.
2009-01-06 07:51:06 -07:00
Zooko O'Whielacronx
778167c2b1 immutable: refactor downloader to be more reusable for checker/verifier/repairer (and better)
The code for validating the share hash tree and the block hash tree has been rewritten to make sure it handles all cases, to share metadata about the file (such as the share hash tree, block hash trees, and UEB) among different share downloads, and not to require hashes to be stored on the server unnecessarily, such as the roots of the block hash trees (not needed since they are also the leaves of the share hash tree), and the root of the share hash tree (not needed since it is also included in the UEB).  It also passes the latest tests including handling corrupted shares well.
  
ValidatedReadBucketProxy takes a share_hash_tree argument to its constructor, which is a reference to a share hash tree shared by all ValidatedReadBucketProxies for that immutable file download.
  
ValidatedReadBucketProxy requires the block_size and share_size to be provided in its constructor, and it then uses those to compute the offsets and lengths of blocks when it needs them, instead of reading those values out of the share.  The user of ValidatedReadBucketProxy therefore has to have first used a ValidatedExtendedURIProxy to compute those two values from the validated contents of the URI.  This is pleasingly simplifies safety analysis: the client knows which span of bytes corresponds to a given block from the validated URI data, rather than from the unvalidated data stored on the storage server.  It also simplifies unit testing of verifier/repairer, because now it doesn't care about the contents of the "share size" and "block size" fields in the share.  It does not relieve the need for share data v2 layout, because we still need to store and retrieve the offsets of the fields which come after the share data, therefore we still need to use share data v2 with its 8-byte fields if we want to store share data larger than about 2^32.
  
Specify which subset of the block hashes and share hashes you need while downloading a particular share.  In the future this will hopefully be used to fetch only a subset, for network efficiency, but currently all of them are fetched, regardless of which subset you specify.
  
ReadBucketProxy hides the question of whether it has "started" or not (sent a request to the server to get metadata) from its user.

Download is optimized to do as few roundtrips and as few requests as possible, hopefully speeding up download a bit.
2009-01-05 09:51:45 -07:00
Zooko O'Whielacronx
8d83699783 cli: make startstop_node wait 20 seconds instead of 5 for a process to go away after we signalled it to go away
Because the unit tests on the VirtualZooko buildslave failed when it took 16 seconds for a process to go away.
Perhaps getting notification after only 5 seconds instead of 20 seconds is desirable, and we should change the unit tests and set this back to 5, but I don't know exactly how to change the unit tests.  Perhaps match this particular warning message about the shutdown taking a while and allow the code under test to pass if the only stderr that it emits is this warning.
2008-12-30 01:20:22 -07:00
Zooko O'Whielacronx
883e51b02d cli: undo the effects of [http://allmydata.org/trac/tahoe/changeset/20081222235453-92b7f-f841e18afb94e1fd95e6dafb799a3d876dd85c69]
We're just going to mark unicode in the cli as unsupported for tahoe-lafs-1.3.0.  Unicode filenames on the command-line do actually work for some platforms and probably only if the platform encoding is utf-8, but I'm not sure, and in any case for it to be marked as "supported" it would have to work on all platforms, be thoroughly tested, and also we would have to understand why it worked.  :-)
2008-12-24 09:53:17 -07:00
Zooko O'Whielacronx
36df38e58b cli: decode all cli arguments, assuming that they are utf-8 encoded
Also encode all args to urllib as utf-8 because urllib doesn't handle unicode objects.
I'm not sure if it is appropriate to *assume* utf-8 encoding of cli args.  Perhaps the Right thing to do is to detect the platform encoding.  Any ideas?
This patch is mostly due to François Deppierraz.
2008-12-22 17:54:53 -07:00
Zooko O'Whielacronx
c79230c854 cli: if response code from wapi server is not 200 then stop instead of proceeding
Also, include the data that failed to json parse in an exception raised by the json parser.
2008-12-20 07:49:18 -07:00
Zooko O'Whielacronx
82ee44ed5b debug: pass empty optional arguments to ReadBucketProxy
because those arguments are about to become non-optional (for other code than test/debug code)
2008-12-16 17:51:45 -07:00
Brian Warner
a2ce315074 CLI: check for pre-existing aliases in 'tahoe create-alias' and 'tahoe add-alias' 2008-12-02 20:20:22 -07:00
Brian Warner
71c62f8fcb #542 'tahoe create-key-generator': fix the .tac file this creates to be compatible with modern code, add a test 2008-12-01 17:47:21 -07:00
Brian Warner
cfba882b30 storage: replace sizelimit with reserved_space, make the stats 'disk_avail' number incorporate this reservation 2008-12-01 17:24:21 -07:00
Zooko O'Whielacronx
fe6abac87b wui/wapi: change the default port number from 8123 to 3456 to avoid conflict with TorButton
See ticket #536 for details.
2008-11-25 17:57:37 -07:00
Brian Warner
b84c2c6541 manifest: add storage-index strings to the json results 2008-11-19 16:00:27 -07:00
Brian Warner
677928a1da cli: tahoe stats: abbreviate total sizes too 2008-11-18 20:28:16 -07:00
Brian Warner
9871f3f1b7 cli: 'tahoe stats': add abbreviated size to the histogram. Not sure this actually improves things. 2008-11-18 20:17:36 -07:00
Brian Warner
0cdf526b50 cli: add 'tahoe check' and 'tahoe deep-check' commands, with primitive reporting code 2008-11-18 19:12:10 -07:00
Brian Warner
9c866ada71 cli: factor out slow-http-operation to a separate module 2008-11-18 19:11:13 -07:00
Brian Warner
5c3e153d0e cli: tahoe stats/manifest: change --verbose to --raw, since I want -v for --verify for check/deep-check/repair 2008-11-18 18:36:08 -07:00
Brian Warner
918970b63a 'tahoe create-key-generator': fix help text 2008-11-18 01:47:58 -07:00
Brian Warner
8473a96ada #330: convert stats-gatherer into a .tac file service, add 'tahoe create-stats-gatherer' 2008-11-18 01:46:20 -07:00
Brian Warner
cae54ab118 tahoe.cfg: add controls for k and N (and shares-of-happiness) 2008-11-18 00:29:44 -07:00
Brian Warner
ead0e4d6ca cli: add tests for 'tahoe stats --verbose' 2008-11-17 22:11:14 -07:00
Brian Warner
94de73ddc0 cli: add --verbose to 'tahoe manifest', to show the raw JSON data 2008-11-17 22:02:19 -07:00
Brian Warner
5a60086dbc CLI: add 'tahoe stats', to run start-deep-stats and print the results 2008-11-13 19:43:50 -07:00
francois
c1f639d230 Fix an filename encoding issue with "tahoe cp" 2008-11-11 14:08:03 -07:00
Brian Warner
0d93d6244e CLI: add 'tahoe manifest', which takes a directory and returns a list of things you can reach from it 2008-11-12 20:17:25 -07:00
Brian Warner
c9175de0f2 create_node.py: also remove now-unused import of pkg_resources 2008-11-12 18:47:16 -07:00
Brian Warner
9976bd439a tahoe.cfg: add tub.location, to override the location hints we include in our FURL. This replaces advertised_ip_addresses, which doesn't remain useful enough to retain it. Helps with #517 (Tor). 2008-11-12 18:44:58 -07:00
Zooko O'Whielacronx
74ce1cdc00 setup: remove pkg_resources.require() from create_node.py and add it to runner.py
Brian correctly points out that the latter is an entry point.
2008-11-12 15:25:03 -07:00
Zooko O'Whielacronx
1aed9fcfa1 setup: the .tac files created by create_node.py call pkg_resources.require() so that they can load tahoe and twisted packages which were installed with setuptools multi-version mode
Also the create_node.py script itself uses pkg_resources.require() for the same reason.
1970-01-01 17:50:05 -07:00
Brian Warner
a2e195df3e debug catalog-shares: tolerate even more errors on bad files/directories 2008-10-30 14:54:47 -07:00
Brian Warner
d97c34d622 debug/test_cli: fix error handling for catalog-shares, to make the test stop failing on windows 2008-10-30 12:06:51 -07:00
Brian Warner
6a7d5b893b create_node.py: add 'web.static = public_html' to the initial tahoe.cfg 2008-10-29 17:13:36 -07:00
Brian Warner
a9101112a4 catalog-shares command: tolerate errors, log them to stderr, handle v2-immutable shares 2008-10-29 15:10:10 -07:00
Brian Warner
7338440d86 scripts/create_node.py: remove empty-string defaults for --introducer= and --nickname= 2008-10-23 16:02:35 -07:00
Brian Warner
fd32d72b20 scripts/debug.py: emit the immutable-share version number, tolerate v2 2008-10-09 18:34:22 -07:00
Brian Warner
a0250e320b debug.py: oops, add missing import for ReadBucketProxy 2008-10-09 17:29:22 -07:00
Brian Warner
288d55825c storage: split WriteBucketProxy and ReadBucketProxy out into immutable/layout.py . No behavioral changes. 2008-10-09 17:08:00 -07:00
Brian Warner
dbc2337639 CLI: remove 'tahoe admin generate-keypair', since the pycryptopp ecdsa API is about to change incompatibly. We'll undo this once pycryptopp is updated 2008-10-06 17:23:20 -07:00
Brian Warner
034364c80b scripts/admin: split up generate_keypair code so that unit tests can use it more easily 2008-10-01 16:52:38 -07:00