Commit Graph

617 Commits

Author SHA1 Message Date
Brian Warner
d1d988410b remove "key-generator" node type and client support
closes ticket:2783
2016-05-04 16:53:04 -07:00
Brian Warner
d2ab4c593b initial tahoe.cfg: explain encoding params better
Meejah pointed out that new users might think the encoding parameters
are fixed, something you must pick correctly when you first set up the
node, and then are never allowed to change again, which is kind of
anxiety-inducing. This updates the comment to explain that the encoding
is stored in each filecap, and the tahoe.cfg values are only used for
newly-uploaded files.
2016-04-26 11:18:44 -07:00
Daira Hopwood
ee8bddbb1a Allow tahoe to be run using 'python -m allmydata.scripts.runner'.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-04-19 17:22:34 +01:00
meejah
db517e8edd Progress API
- IProgress interface + PercentProgress implementation
 - progress= args to many upload/download APIs
 - ultimately for magic-folder
2016-04-12 00:30:50 -07:00
Daira Hopwood
0598c830ed Rename distribution from allmydata-tahoe to tahoe-lafs. fixes ticket:2011
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 19:16:01 +00:00
Brian Warner
dd84abd9f2 setup.py: work with tox under py3
This allows a python3-based "tox" (as shipped with modern debian and
ubuntu systems) to run setup.py egg_info, update_version, and sdist
commands. It moves the main "tahoe requires py2" check out of setup.py
and into allmydata.scripts.runner.run, where it gets applied at runtime
rather than build time.

It also changes the execfile(_auto_deps.py) and Versioneer-like "ask git
what our version string should be" code to work under both py2 and py3.

fixes ticket:2747
2016-03-22 22:34:42 -07:00
Daira Hopwood
0d6fcf445e Remove -u shortcut for 'tahoe ls --uri' which clashes with --node-url. fixes ticket:1949, ticket:2137
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-02 18:45:52 +00:00
Daira Hopwood
56bf458355 Find the node-directory option correctly even if we are in a subcommand.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:52:51 +00:00
Daira Hopwood
46719a8bcf Aliases are Unicode.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:12:29 +00:00
Daira Hopwood
02d96b970e Quote local paths correctly in the output of node creation commands. fixes ticket:2556
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-01 17:54:46 +00:00
Brian Warner
98ab848cda cp: error on target-filename collisions, rather than overwrite
Closes ticket:2447
2015-07-28 17:39:26 -07:00
Brian Warner
45ebbbf44b wrap long lines, and tolerate various-width wrappings of the --help output
test_cli.Help was too sensitive to the way that the --help output was
wrapped, which caused failures on travis when COLUMNS= was set low and
the expected strings were split across separate lines.
2015-05-26 11:40:17 -07:00
Brian Warner
8f41713fe9 cli: improve formatting of all commands
Also:

* do some light refactoring of create-client/node
* make it clear that these commands' --basedir options do the same as
  the global --node-directory option
* use "global-options" instead of "global-opts"
2015-05-26 11:31:06 -07:00
Brian Warner
01619844de scripts: improve rendering of synopsis/usage
Subcommands "--help" is now rendered as:

```
 tahoe [global-options] COMMAND [options] ARGS
 (use 'tahoe --help' to view global options)
 USAGE (flags/options)
 DESCRIPTION
 DESCRIPTION_UNWRAPPED
```

The new .description and .description_unwrapped fields allow
commands (subclasses of twisted.python.usage.Usage) better control over
how their explanations are rendered: the old .longdesc field was wrapped
unpleasantly.
2015-05-26 11:29:49 -07:00
Brian Warner
5d5fa05a42 scripts/runner.py: put command group descriptions in parens 2015-05-26 11:27:57 -07:00
Brian Warner
1c34cbd627 refactor scripts/common.py: move _default_nodedir out to its own file 2015-05-26 11:27:57 -07:00
Brian Warner
be5d07a70a apply review feedback 2015-05-03 22:14:36 -07:00
Brian Warner
275ddb93cc cp: trailing slash on source filename is an error, just like on targets 2015-05-03 22:14:35 -07:00
Brian Warner
ca23c4fa23 tahoe cp: ignore trailing slash on source arguments
This avoids an error case where an empty child name resulted in a
duplicate mkdir. It adds a precondition check to guard against empty
child names, and some test cases. It also cleans up a funny redundancy
noticed earlier (refs ticket:2329).
2015-05-03 22:13:52 -07:00
Brian Warner
97fd19407d Improve docs on 'cp -r', noting the recent 2329 changes
refs ticket:2329
2015-05-03 21:49:34 -07:00
Daira Hopwood
45c1dc7e63 backupdb.py: cosmetics
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-17 22:31:01 +01:00
Daira Hopwood
6e9a602df6 Make backupdb use dbutil.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-17 22:30:47 +01:00
Brian Warner
48da2cd99b tahoe_cp: be consistent with "source.basename() is None" testing 2015-03-17 11:13:57 -07:00
Brian Warner
190743e066 tahoe_cp: minor cleanups, no behavior changes 2015-03-17 11:13:33 -07:00
Brian Warner
1838fe8eaf tahoe_cp: make populate(recurse=) more explicit 2015-03-17 11:11:11 -07:00
Brian Warner
f3a9be1c5e improve error message for slash-terminated non-directories 2015-03-10 09:17:17 -07:00
Brian Warner
2a361bc46f tahoe cp: overhaul target assignment, update tests
This substantially changes the internals of "tahoe cp", to behave in
accordance with the scheme developed in ticket:2329. test_cli_cp.py got
a large new test to exercise all the various combinations. This also
changes the set of error messages that "tahoe cp" can produce.

This modifies try_copy(), inserts a new implementation of
copy_things_to_directory() (and supporting methods), and fixes a few
bugs elsewhere.

fixes ticket:2329
2015-03-03 18:19:58 -08:00
Brian Warner
ca92bfdc88 tahoe_cp: delete copy_to_directory() code
This code will be replaced in the next commit with an entirely different
approach, and modifying it in a single commit would yield a completely
unreadable diff.
2015-03-03 18:18:17 -08:00
Brian Warner
c32c8794bc tahoe_cp: simplify some checks, rename some functions
no behavioral changes
2015-03-03 18:03:17 -08:00
Brian Warner
6d84cdd35d tahoe_cp.py: use s.basename() instead of tracking it separately 2015-02-24 02:07:57 -08:00
Brian Warner
98ec466d54 tahoe_cp.py: store basename in the Source instance 2015-02-24 01:55:53 -08:00
Brian Warner
30987c1e7d remove stray trailing whitespace 2015-02-04 01:35:44 -08:00
Daira Hopwood
86726729b7 Quote the default node-directory correctly in help output. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-04 00:10:21 +00:00
Brian Warner
7426eccb29 tahoe_cp.py: clean up unicode handling 2015-02-03 11:10:36 -08:00
Daira Hopwood
8147f3c77e Changes filename to unicode before placing the file. refs #2027
Author: Mark Berger <mark.berger.j@gmail.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:50:25 +00:00
Daira Hopwood
14f783086f Change uses of os.path.expanduser and os.path.abspath. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:50:18 +00:00
Daira Hopwood
4a0cdce86b Use absolute paths in tahoe cp and tahoe backup. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:47:35 +00:00
Daira Hopwood
95f98e1aae Quote local paths correctly. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:05:20 +00:00
Daira Hopwood
c20a3525b7 Use "long" paths prefixed with \\?\ on Windows. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:05:14 +00:00
Daira Hopwood
fc886a7d02 Improve error reporting and help for start/stop/etc. commands.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-21 19:15:32 +01:00
Daira Hopwood
13ae872ace startstop_node.py: rename internal command and twistd plugin class used to start tahoe nodes.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-21 19:04:14 +01:00
Brian Warner
87a6894e62 'tahoe start': stop using the contents of .tac files
Instead of constructing a sys.argv for 'twistd' that reads the node's
.tac file, we construct arguments that tell twistd to use a special
in-memory-only plugin that creates the desired node instance directly.

We still use the name of the .tac file to decide which kind of instance
to make (Client, IntroducerNode, KeyGenerator, StatsGatherer), but never
actually read the contents of the .tac file. Later improvements could
change this to look inside the tahoe.cfg for a nodetype= directive, etc.

This also makes it easy to have "tahoe start BASEDIR" pass the rest of
its arguments on to twistd, so e.g. "tahoe start BASEDIR --nodaemon
--profile=prof.out" does what you'd expect "twistd --nodaemon
--profile=prof.out" to do. "tahoe run BASEDIR" is thus simply aliased to
"tahoe start BASEDIR --nodaemon". This removes the need to special-case
--profile and --syslog.

I also removed some of the default logging behavior:

 before:
  'tahoe start' = 'twistd --logfile BASEDIR logs/twistd.log'
  'tahoe start --profile' adds '--profile=profiling_results.prof --savestats'
  'tahoe run' = 'twistd --nodaemon --logfile BASEDIR/logs/tahoesvc.log'

 after:
  'tahoe start' = 'twistd --logfile BASEDIR logs/twistd.log'
     unless --logfile, --nodaemon, or --syslog are passed
  'tahoe start --profile' invalid, use 'tahoe start --profile=OUTPUT'
  'tahoe run' = 'twistd --nodaemon'
     so log messages go to stdout

This finally enables 'tahoe run' to work with all node types, including
the key-generator and stats-gatherer.

It gets 'tahoe start' one step closer to accepting --reactor= . To
actually accomplish this will require this file, the enclosing
__init_.py files, and everything they import to avoid importing the
reactor. (if anything imports twisted.internet.reactor before
startstop_node.start() gets to run, then --reactor= comes too late).
That will take a lot of work, and requires lazy-loading of many core
libraries (foolscap.logging in particular), and removing a lot of code
from src/allmydata/__init__.py .
2014-10-21 19:02:25 +01:00
Mark Berger
1c96039270 tahoe cp -r now copies the top level directory with its children 2014-09-02 12:51:13 -07:00
Brian Warner
99479226ed hush current pyflakes warnings (list comprehensions)
closes #2245
2014-06-23 13:54:07 -07:00
Daira Hopwood
aa29f2655d tahoe debug trial: print a warning message if testing uncommitted code. fixes #1992
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-08-31 18:01:34 +01:00
Mark Berger
bf235849c9 Allows check and deep-check to take multiple arguments (ticket #740) 2013-07-26 13:01:50 -04:00
Daira Hopwood
57e9978090 Add "[global-opts]" to help synopsis for tahoe ls. refs #166
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-22 16:10:48 +01:00
Brian Warner
7edae210c6 CLI: tolerate caps-from-future in unused aliases. Closes #1643. 2013-04-12 20:45:55 +01:00
Brian Warner
3ee950f09e CLI: put "[global-opts]" in all command synopses 2013-04-09 19:11:33 +01:00
Brian Warner
51ddab6edb rename VDriveOptions to FilesystemOptions 2013-04-09 19:11:33 +01:00
Brian Warner
5874a7d3a7 bin/tahoe: clean up global-vs-subcommand arguments like --node-directory
The new rules for "bin/tahoe ARG1.. SUBCOMMAND ARG2.." arg:

* --node-directory is only accepted in ARG1, not ARG2
* create-*/start/stop/restart accept --basedir in ARG2, or an explicit
  basedir argument
* only one of --node-directory/--basedir/explicit-basedir is accepted
* --quiet/--version is only accepted in ARG1, not ARG2

Closes #166
2013-04-09 19:11:32 +01:00
David-Sarah Hopwood
656e819560 Improve 'tahoe put --help' to clarify behaviour for mutable files, and
make sure the documented behaviour is tested. fixes #1372

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-20 01:27:17 +00:00
David-Sarah Hopwood
ef0a6c3015 Avoid double-counting source files in 'tahoe cp --verbose'. fixes #1783
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-20 00:57:50 +00:00
David-Sarah Hopwood
ea9dfb0de1 tahoe_ls.py: JSON responses don't need quotemarks or quoted newlines.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-07 16:22:47 +00:00
David-Sarah Hopwood
a9272522d5 tahoe_check.py: tolerate missing fields in check results for LIT files/dirs. fixes #1758
Also test this case and improve some existing tests of 'tahoe check'.

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-01-03 22:16:20 +00:00
David-Sarah Hopwood
1ffed22651 CLI: fix synopsis for 'tahoe ls'. fixes #1839
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-11-01 23:40:06 +00:00
frederik b
595d611c9b fixed wrong index in tahoe cp --verbose, as explained in #1805
this bug shows wrong counters for copied files in verbose mode
2012-09-29 21:32:51 -07:00
Brian Warner
15c95c2e12 Apply David-Sarah's recommended changes. Closes #974 2012-09-04 15:45:38 -07:00
Andrew Miller
4f19f2b4b4 When the CLI cannot connect to the gateway, it prints an error message rather than raising a python exception. Includes a unit test
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-09-04 14:48:50 -07:00
david-sarah
2ee1bc7148 Catch exceptions from CLI in order to prevent the Ubuntu crash monolog from triggering. refs #1746 2012-05-20 15:35:29 +00:00
david-sarah
4ddcde3094 Since we now require Python 2.5, we can use os.SEEK_END. 2012-05-16 21:39:48 +00:00
david-sarah
a1a1b5bf8a Simplifications resulting from requiring Python 2.5 and therefore being able to use sqlite3 from the standard library. This also drops sqlite3 from the set of versions and paths we report. 2012-05-16 02:47:25 +00: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
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
david-sarah
7f8bbcc155 Use a private/drop_upload_dircap file instead of the [drop_upload]upload.dircap option in tahoe.cfg. Fail if the upload.dircap option is used, or options are missing. Also updates tests and docs. fixes #1593 2011-11-20 23:24:26 +00:00
Brian Warner
d28041fbe4 CLI: don't deprecate --mutable, small docs fixes. refs #1561
Also don't accept 'tahoe mkdir --format=chk'.
2011-10-13 21:00:02 -07:00
Brian Warner
57ee56533f add --format= to 'tahoe put'/'mkdir', remove --mutable-type. Closes #1561 2011-10-13 20:15:00 -07:00
Brian Warner
dad354b275 webapi: handle format=, remove mutable-type=
* fix CLI commands (put, mkdir) to send format=, not mutable-type=
* fix tests
* test_cli: fix tests that observe t=json output, don't ignore failures in
  'tahoe put'
* fix handling of version= to make it easier to use the default
* interpret ?mutable=true&format=MDMF as MDMF, not SDMF
2011-10-13 09:29:51 -07:00
Brian Warner
0716c496c8 MDMF: remove extension fields from caps, tolerate arbitrary ones. Fixes #1526
The filecaps used to be produced with hints for 'k' and segsize, but they
weren't actually used, and doing so had the potential to limit how we change
those filecaps in the future. Also the parsing code had some problems dealing
with other numbers of extensions. Removing the existing fields and making the
parser tolerate (and ignore) extra ones makes MDMF more future-proof.
2011-10-02 00:35:53 +01:00
david-sarah
23f46b758e CLI: make the --mutable-type option value for 'tahoe put' and 'tahoe mkdir' case-insensitive, and change --help for these commands accordingly. fixes #1527 2011-09-04 19:09:22 -07:00
Kevan Carstensen
64996a913d cli: make --mutable-type imply --mutable in 'tahoe put' 2011-09-03 12:09:20 -07:00
Brian Warner
d575ccba28 Teach 'tahoe debug catalog-shares about MDMF. Closes #1507. 2011-08-28 01:09:31 -07:00
Brian Warner
97b601f75a debug.py: remove some dead comments 2011-08-28 00:45:56 -07:00
Brian Warner
9f827ffa7b hush pyflakes 2011-08-28 00:42:54 -07:00
Brian Warner
a3d6fd4992 teach 'tahoe debug dump-share' about MDMF and offsets. refs #1507 2011-08-28 00:38:34 -07:00
Brian Warner
482a7dd3f1 Add 'tahoe debug dump-cap' support for MDMF, DIR2-CHK, DIR2-MDMF. refs #1507.
This also adds tests for all those cases, and fixes an omission in uri.py
that broke parsing of DIR2-MDMF-Verifier and DIR2-CHK-Verifier.
2011-08-27 12:50:48 -07:00
Kevan Carstensen
4d09ef3d83 cli: teach CLI how to create MDMF mutable files
Specifically, 'tahoe mkdir' and 'tahoe put' now take a --mutable-type
argument.
2011-08-01 19:16:13 -07:00
Brian Warner
5aad81f84d replace tabs with spaces in the #1441 'tahoe debug' synopsis 2011-08-11 10:37:04 -07:00
david-sarah
0dc917af08 Correct the information printed by '/usr/bin/tahoe debug --help' on Debian/Ubuntu. fixes #1441 2011-07-24 09:25:30 -07:00
Zooko O'Whielacronx
b7683d9b83 drop-upload: rename the 'upload.uri' parameter to 'upload.dircap', and a couple of cleanups to error messages. refs #1429
I rerecorded this patch, originally by David-Sarah, to use "darcs replace" instead of editing to do the renames. This uncovered one missed rename in Client.init_drop_uploader. (Which also means that code isn't exercised by the current unit tests.)
refs #1429
2011-08-09 15:05:08 -07:00
david-sarah
bbed522033 Remove all trailing whitespace from .py files. 2011-08-08 17:11:17 -07:00
david-sarah
32a7717205 Drop-upload frontend, rerecorded for 1.9 beta (and correcting a minor mistake). Includes some fixes for Windows but not the Windows inotify implementation. fixes #1429 2011-08-08 16:40:49 -07:00
Brian Warner
550d67f51f remove get_serverid() from ReadBucketProxy and customers, including Checker
and debug.py dump-share commands
refs #1363
2011-08-01 15:43:07 -07:00
david-sarah
2da3f69f25 Address Kevan's comment in #776 about Options classes missed when adding 'self.command_name'. refs #776, #1359 2011-08-01 15:13:17 -07:00
david-sarah
06a5d0c1a3 cleanup: implement rm as a synonym for unlink rather than vice-versa. refs #776 2011-08-01 15:01:08 -07:00
david-sarah
52963f4a76 tahoe_rm.py: better error message when there is no path. refs #1292 2011-01-22 00:42:12 -07:00
Kevan Carstensen
448278e807 cli: make 'tahoe cp' overwrite mutable files in-place 2011-07-29 13:20:39 -07:00
david-sarah
b21a4f6b3f src/allmydata/scripts/cli.py: fix pyflakes warning. 2011-07-27 19:14:02 -07:00
david-sarah
b978378392 Fix the help synopses of CLI commands to include [options] in the right place. fixes #1359, fixes #636 2011-07-24 15:54:40 -07:00
david-sarah
f9d218c673 encodingutil: argv and output encodings are always the same on all platforms. Lose the unnecessary generality of them being different. fixes #1120 2011-06-29 11:53:56 -07:00
david-sarah
49fd2e6e56 scripts/common.py: don't assume that the default alias is always 'tahoe' (it is, but the API of get_alias doesn't say so). refs #1342 2011-01-30 10:49:23 -07:00
david-sarah
74b6ea36c4 CLI: improve help synopsis for 'tahoe create-key-generator'. 2011-01-22 17:50:04 -08:00
david-sarah
cb02adb110 Don't put debugging information in 'My versions' section of the Welcome page. Also remove the extra blank line between version and command output when --version[-and-path] is used. refs #1306 2011-01-21 20:02:20 -08:00
david-sarah
0c51ce3d89 CLI: improve help synopses for some commands. 2011-01-21 17:27:00 -08:00
david-sarah
28bd80812f Change --version and --version-and-path to not exit immediately, if a command is given. 2011-01-20 23:59:13 -08:00
david-sarah
3798d9946e Add support to bin/tahoe for invoking a runner command prefixed with @, with the Tahoe libraries on the PYTHONPATH. This is documented in 'tahoe debug --help'. 2011-01-18 21:11:37 -08:00
david-sarah
74b1eec1d6 trivial: add comment in scripts/debug.py about trial option parsing. refs #1296 2011-01-18 22:08:08 -08:00
david-sarah
7a887871b0 src/allmydata/scripts/debug.py: add 'tahoe debug trial' command (rebased for trunk). refs #1296 2011-01-18 12:46:59 -08:00
Brian Warner
980fb0b2bb 'tahoe debug catalog-shares': sort SIs and shnums
Without this, SIs or shnums could be emitted in random order, depending upon
what the filesystem happens to return.
2011-01-17 01:59:32 -08:00
david-sarah
f10a2c0902 CLI: make 'tahoe create-alias' and 'tahoe add-alias' accept a trailing colon on the new alias name (v2, minor change not to rely on implicit Unicode conversion). Includes doc changes and news; tests in a separate patch. fixes #1305 2011-01-13 19:44:14 -08:00
Brian Warner
b9fb74d2a0 Improve 'tahoe ln' help text. Patch by David-Sarah. Closes #1230. 2011-01-17 00:14:21 -08:00
david-sarah
d3f24736ca create_node.py: add comments to default tahoe.cfg to clarify the meaning of each section. fixes #1311 2011-01-16 21:24:19 -08:00
Brian Warner
45212d8000 Set "reserved_space=1G" in newly-created storage nodes. Closes #1208. 2011-01-16 12:58:22 -08:00
david-sarah
2d5f3f694f scripts/backupdb.py: more accurate comment about path field. 2010-12-12 09:03:20 -08:00
david-sarah
bb7c04ff9f scripts/cli.py: fix missing 'put' in usage example for 'tahoe put'. 2010-12-12 09:02:07 -08:00
david-sarah
ee4e0d8106 scripts/cli.py: remove the disclaimer in the help for 'tahoe cp' that it does not handle non-ASCII filenames well. (At least, we intend to handle them.) 2010-11-29 16:21:45 -08:00
david-sarah
9ceb527787 Change another doc reference from .txt to .rst in a text string. 2010-11-28 09:45:07 -08:00
Brian Warner
69b42c6cb7 remove --multiple/-m option from all CLI commands: closes #1262
I personally used "tahoe start/restart -m ../MY-TESTNET/node*" all the time,
to spin up or update a local testgrid while iterating over new code. However,
with the recent switch from "subprocess.Popen(/bin/twistd)" to "import and
call twistd.run()" in scripts/startstop_node.py (yay fewer processes!),
"start -m" broke, and fixing it requires os.fork, which is unavailable on
windows (boo windows!). And I was probably the only one using -m. So in the
interests of uniformity among platforms and simpler code (yay negative code
days!), we're just removing -m from everything. I will start using a little
shell script or something to simulate the removed functionality.

This patch also cleans up CLI-function calling a bit: get the basedir from
the config dict (instead of sometimes from a separate argument), and always
return a numeric exit code.
2010-11-27 00:38:09 -08:00
Brian Warner
f36bda2780 Revert previous commit: there's an ugly corner-case on windows that fails tests.
Specifically, test_runner.CreateNode.test_client failed, because the
os.fork-is-present test decided that --multiple should not be allowed on
windows, even though --multiple works just fine for 'tahoe create-client'.
The only restriction on --multiple is for 'tahoe start' and 'tahoe restart'.

This needs a different approach, probably by cleaning up BasedirMixin. We
should only be withholding --multiple on windows for "start" and
"restart". (we should continue withholding --multiple on all platforms for
"run").

This reverts (git) commit f3adb037ae:
 "startstop_node.py: fix "tahoe start -m" by forking before non-final targets"
2010-11-26 16:44:11 -08:00
Brian Warner
f3adb037ae startstop_node.py: fix "tahoe start -m" by forking before non-final targets
* don't advertise -m flag on tahoe start/restart/run unless os.fork is
  available (i.e. windows)
* test_runner.py: add test to exercise "start/stop/restart -m"
2010-11-26 14:45:38 -08:00
david-sarah
38a0d3f5fa tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255 2010-11-09 17:09:16 -08:00
david-sarah
cb777ad14f tahoe_mv.py: use do_http, not urllib.openurl, in order to avoid connecting to the webapi server via a proxy. refs #1253 2010-11-09 16:53:36 -08:00
david-sarah
6eaa7f2356 tahoe backup: perform tilde expansion in exclude-from filename (version 2). fixes #1241 2010-10-30 20:52:31 -07:00
david-sarah
1950d5a719 scripts/runner.py: fix unused import of allmydata. refs #1190 2010-10-29 17:31:49 -07:00
david-sarah
2a8f700026 scripts/runner.py: remove pkg_resources.require() calls. These are at best redundant because we have already called _auto_deps.require_auto_deps() (from allmydata.__init__) at that point, and they are causing failure of the test-from-prefixdir step on some buildslaves. refs #1190 2010-10-29 16:53:28 -07:00
Brian Warner
c88eb097d9 scripts/tahoe_backup.py: oops, fix missing import, thanks pyflakes
test_cli.py: hush minor pyflakes complaint
2010-10-29 02:42:23 -07:00
Francois Deppierraz
14ee763c54 tahoe_cp.py: Don't call urllib.quote with an Unicode argument, fix #1224
tahoe_backup.py: Fix another (potential) occurrence of calling urllib.quote()
with an Unicode parameter
2010-10-29 01:45:20 -07:00
david-sarah
270322ad47 startstop_node.py: pyflakes import fix. refs #1190 2010-10-27 18:48:05 -07:00
Brian Warner
ac3b26ecf2 'tahoe start': use import+call rather than find+spawn
This removes the need to use a locally-built (dependency) bin/twistd, and
removes a big chunk of behavior differences between unix and windows. It
also happens to resolve the "client node probably started" uncertainty.
Might help with #1190, #602, and #71.
2010-10-26 23:13:42 -07:00
Zooko O'Whielacronx
98ffbfb31f setup: add --multi-version to the "setup.py develop" command-line
fixes #530. I earlier tried this twice (see #530 for history) and then twice rolled it back due to some problems that arose. However, I didn't write down what the problems were in enough detail on the ticket that I can tell today whether those problems are still issues, so here goes the third attempt. (I did write down on the ticket that it would not create site.py or .pth files in the target directory with --multi-version mode, but I didn't explain why *that* was a problem.)
2010-10-05 11:23:50 -07:00
david-sarah
a7c474a098 CLI: further improve consistency of basedir options and add tests. addresses #118 2010-08-03 01:54:16 -07:00
david-sarah
b730385ec8 CLI: make the synopsis for 'tahoe unlink' say unlink instead of rm. 2010-08-03 01:53:59 -07:00
david-sarah
a32f625db9 CLI: make all of the option descriptions imperative sentences. 2010-08-03 01:48:01 -07:00
david-sarah
37b07a545f Changes to Tahoe needed to work with new zetuptoolz (that does not use .exe wrappers on Windows), and to support Unicode arguments and stdout/stderr -- v5 2010-07-25 01:32:16 -07:00
david-sarah
54a9ba8232 scripts/common.py: fix an error introduced when rebasing to the ticket798 branch, which caused base directories to be duplicated in self.basedirs. 2010-08-01 23:49:29 -07:00
david-sarah
f952532f08 Basedir/node directory option improvements for ticket798 branch. addresses #188, #706, #715, #772, #890 2010-08-01 21:30:04 -07:00
david-sarah
16647b49f6 scripts/create_node.py: allow nickname to be Unicode. Also ensure webport is validly encoded in config file. 2010-08-01 17:02:12 -07:00
david-sarah
02199db615 Additional Unicode basedir changes for ticket798 branch. 2010-08-01 18:05:52 -07:00
david-sarah
d3a8ef762f Unicode basedir changes for ticket798 branch. 2010-08-01 16:53:10 -07:00
david-sarah
618db4867c Replace uses of os.path.abspath with abspath_expanduser_unicode where necessary. This makes basedir paths consistently represented as Unicode. 2010-07-21 17:14:18 -07:00
Zooko O'Whielacronx
fd874d6669 setup: fix a couple instances of hard-coded 'allmydata-tahoe' in the scripts, tighten the tests (as suggested by David-Sarah) 2010-08-01 09:42:07 -07:00
Zooko O'Whielacronx
1c62db0db8 docs: use current cap to Zooko's wiki page in example text
fixes #1134
2010-07-20 18:05:43 -07:00
david-sarah
a8161c915a Correct stringutils->encodingutil patch to be the newer version, rather than the old version that was committed in error. 2010-07-17 18:34:35 -07:00
david-sarah
8090785716 CLI: add 'tahoe unlink' as an alias to 'tahoe rm', for forward-compatibility. 2010-07-17 15:04:11 -07:00
david-sarah
11077ea74d Rename stringutils to encodingutil, and drop listdir_unicode and open_unicode (since the Python stdlib functions work fine with Unicode paths). Also move some utility functions to fileutil. 2010-07-11 17:30:15 -07:00
david-sarah
e2ef2c2691 cli.py: make command descriptions consistently end with a full stop. 2010-07-13 18:45:38 -07:00
david-sarah
1a0674bf37 CLI: allow Unicode patterns in exclude option to 'tahoe backup'. 2010-06-16 20:39:01 -07:00
david-sarah
ffd1c5aca5 Fix for Unicode-related test failures on Zooko's OS X 10.6 machine. 2010-06-08 22:54:48 -07:00
david-sarah
7092de1b6f Remove the 'tahoe debug consolidate' subcommand. 2010-06-07 11:37:57 -07:00
david-sarah
731e3d68df common_http.py, tahoe_cp.py: Fix an error in calling the superclass constructor in HTTPError and MissingSourceError (introduced by the Unicode fixes). 2010-06-07 10:47:14 -07:00
david-sarah
65b6f4e3ce Unicode fixes for platforms with non-native-Unicode filesystems. 2010-06-06 21:32:38 -07:00
david-sarah
80252debcd Unicode fixes. 2010-06-06 18:02:15 -07:00
Zooko O'Whielacronx
442008a690 unicode: always decode json manifest as utf-8 then encode for stdout
pyflakes pointed out that the exception handler fallback called an un-imported function, showing that the fallback wasn't being exercised.
I'm not 100% sure that this patch is right and would appreciate François or someone reviewing it.
2010-06-04 01:48:40 -07:00
Zooko O'Whielacronx
952f3bf3ef fix flakes 2010-06-04 00:58:45 -07:00
Francois Deppierraz
496802420e Fix handling of correctly encoded unicode filenames (#534)
Tahoe CLI commands working on local files, for instance 'tahoe cp' or 'tahoe
backup', have been improved to correctly handle filenames containing non-ASCII
characters.
  
In the case where Tahoe encounters a filename which cannot be decoded using the
system encoding, an error will be returned and the operation will fail.  Under
Linux, this typically happens when the filesystem contains filenames encoded
with another encoding, for instance latin1, than the system locale, for
instance UTF-8.  In such case, you'll need to fix your system with tools such
as 'convmv' before using Tahoe CLI.
  
All CLI commands have been improved to support non-ASCII parameters such as
filenames and aliases on all supported Operating Systems except Windows as of
now.
2010-05-19 17:43:56 -07:00
david-sarah
e76092e16c Change relative imports to absolute 2010-02-26 01:14:33 -07:00
Francois Deppierraz
dd95e8e71b CLI: Support for https url in option --node-url
This patch modifies the regular expression used for verifying of '--node-url'
parameter.  Support for accessing a Tahoe gateway over HTTPS was already
present, thanks to Python's urllib.
2010-04-30 11:56:09 -07:00
Brian Warner
e2031aff0f backupdb.did_create_directory: use REPLACE INTO, not INSERT INTO + ignore error
This handles the case where we upload a new tahoe directory for a
previously-processed local directory, possibly creating a new dircap (if the
metadata had changed). Now we replace the old dirhash->dircap record. The
previous behavior left the old record in place (with the old dircap and
timestamps), so we'd never stop creating new directories and never converge
on a null backup.
2010-04-27 22:08:03 -07:00
Brian Warner
f6f8256b35 "tahoe webopen": add --info flag, to get ?t=info
Also fix some trailing whitespace.
2010-04-24 16:30:03 -07:00
Zooko O'Whielacronx
34a50b857a docs: a few small edits to try to guide newcomers through the docs
These edits were suggested by my watching over Jake Appelbaum's shoulder as he completely ignored/skipped/missed install.html and also as he decided that debian.txt wouldn't help him with basic installation. Then I threw in a few docs edits that have been sitting around in my sandbox asking to be committed for months.
2010-03-03 15:19:02 -08:00
david-sarah
973f0afdd3 Change direct accesses to an_uri.storage_index to calls to .get_storage_index() (fixes #948) 2010-02-21 18:45:04 -08:00
david-sarah
6a7feea455 Tweak to 'tahoe ls --help' output (#837) 2010-02-23 19:02:31 -08:00
david-sarah
03134eedb5 Improve behaviour of 'tahoe ls' for unknown objects, addressing kevan's comments 2010-02-19 22:13:13 -08:00
Kevan Carstensen
63c8c65747 Alter CLI utilities to handle nonexistent aliases better 2010-02-10 18:43:18 -08:00
david-sarah
6057bc02cc Prevent mutable objects from being retrieved from an immutable directory, and associated forward-compatibility improvements. 2010-01-26 22:44:30 -08:00
Brian Warner
5045a8721a scripts/runner.py: simplify David-Sarah's clever grouped-commands usage trick 2010-01-27 14:37:58 -08:00
Brian Warner
e769bbb6dd tahoe backup: skip all symlinks, with warning. Fixes #850, addresses #641. 2010-01-27 14:35:17 -08:00
Brian Warner
52185053c3 "tahoe backup": fix --exclude-vcs docs to include Git 2010-01-27 12:10:44 -08:00
francois
b03406af9d tahoe_backup.py: display warnings on errors instead of stopping the whole backup. Fix #729.
This patch displays a warning to the user in two cases:
  
  1. When special files like symlinks, fifos, devices, etc. are found in the
     local source.
  
  2. If files or directories are not readables by the user running the 'tahoe
     backup' command.

In verbose mode, the number of skipped files and directories is printed at the
end of the backup.

Exit status returned by 'tahoe backup':

  - 0 everything went fine
  - 1 the backup failed
  - 2 files were skipped during the backup
2010-01-20 01:42:49 -08:00
Zooko O'Whielacronx
a1444d9367 cli: merge the better version of David-Sarah's split-usage-and-help patch with the earlier version that I mistakenly committed 2010-01-25 20:45:59 -08:00
david-sarah
b079f32da2 Split tahoe --help options into groups. 2010-01-11 20:39:35 -08:00
Zooko O'Whielacronx
b94b9af189 cli: split usage strings into groups (patch by David-Sarah Hopwood) 2010-01-25 20:39:21 -08:00
david-sarah
87f1bae7fe Add create-node CLI command, and make create-client equivalent to create-node --no-storage (fixes #760) 2010-01-15 21:20:55 -08:00
Brian Warner
bb4883bbd4 tahoe_add_alias.py: minor refactoring 2010-01-14 22:42:20 -08:00
Brian Warner
731d15e56f hush pyflakes-0.4.0 warnings: remove trivial unused variables. For #900. 2010-01-14 14:15:29 -08:00
Brian Warner
874a979a8e tahoe add-alias/create-alias: don't corrupt non-newline-terminated alias
file. Closes #741.
2010-01-14 13:02:46 -08:00
Brian Warner
d3d1293d2f change docs and --help to use "grid" instead of "virtual drive": closes #892.
Thanks to David-Sarah Hopwood for the patch.
2010-01-14 12:11:19 -08:00
Brian Warner
00d0ca3902 addendum to "Fix 'tahoe ls' on files (#771)"
tahoe_ls.py: tolerate missing metadata
web/filenode.py: minor cleanups
test_cli.py: test 'tahoe ls FILECAP'
2009-12-27 18:21:49 -05:00
Brian Warner
a8a768ef9d Fix 'tahoe ls' on files (#771). Patch adapted from Kevan Carstensen.
web/filenode.py: also serve edge metadata when using t=json on a
                 DIRCAP/childname object.
tahoe_ls.py: list file objects as if we were listing one-entry directories.
             Show edge metadata if we have it, which will be true when doing
             'tahoe ls DIRCAP/filename' and false when doing 'tahoe ls
             FILECAP'
2009-12-27 17:54:43 -05:00
Brian Warner
931ab76588 tahoe_get: don't create the output file on error. Closes #121. 2009-12-27 17:04:04 -05:00
Brian Warner
499add09e6 webapi: don't accept zero-length childnames during traversal. Closes #358, #676.
This forbids operations that would implicitly create a directory with a
zero-length (empty string) name, like what you'd get if you did "tahoe put
local /oops/blah" (#358) or "POST /uri/CAP//?t=mkdir" (#676). The error
message is fairly friendly too.

Also added code to "tahoe put" to catch this error beforehand and suggest the
correct syntax (i.e. without the leading slash).
2009-12-27 15:10:43 -05:00
Brian Warner
2e0a61a953 CLI: send 'Accept:' header to ask for text/plain tracebacks. Closes #646.
The webapi has been looking for an Accept header since 1.4.0, but it treats a
missing header as equal to */* (to honor RFC2616). This change finally
modifies our CLI tools to ask for "text/plain, application/octet-stream",
which seems roughly correct (we either want a plain-text traceback or error
message, or an uninterpreted chunk of binary data to save to disk). Some day
we'll figure out how JSON fits into this scheme.
2009-12-27 14:58:28 -05:00
Brian Warner
74974b27fe Implement more coherent behavior when copying with dircaps/filecaps (closes #761). Patch by Kevan Carstensen. 2009-11-30 13:10:09 -08:00
Brian Warner
9901a08fd3 Add dirnodes to backupdb and "tahoe backup", closes #606.
* backups now share dirnodes with any previous backup, in any location,
  so renames and moves are handled very efficiently
* "tahoe backup" no longer bothers reading the previous snapshot
* if you switch grids, you should delete ~/.tahoe/private/backupdb.sqlite,
  to force new uploads of all files and directories
2009-11-26 15:42:57 -08:00
Brian Warner
6e7fb1006d Use DIR-IMM and t=mkdir-immutable for "tahoe backup", for #828 2009-11-18 11:28:13 -08:00
kevan
52aceb1a8e Implement more clearly defined moving semantics in tahoe_mv.py 2009-07-19 20:45:23 -07:00
kevan
36f2e01275 Update tahoe mv help text. 2009-07-19 20:45:03 -07:00
Brian Warner
531cc7899f rename NewDirectoryNode to DirectoryNode, NewDirectoryURI to DirectoryURI 2009-07-17 17:15:49 -05:00
Brian Warner
efa608a135 'tahoe stats': tolerate empty directories. Closes #693. 2009-07-15 00:51:09 -07:00
Brian Warner
b640baf500 cli: webopen: when called with no arguments, open the Welcome page 2009-07-01 13:05:48 -07:00
Brian Warner
b43672c9f5 one last tweak 2009-06-25 22:26:27 -07:00
Brian Warner
08effc6499 more 'tahoe cp' docs tweaks 2009-06-25 22:16:52 -07:00
Brian Warner
b30db031ab cli.py: minor tweaks to test posthooks 2009-06-25 19:45:57 -07:00
Brian Warner
df1ddf83f5 cli.py: update comments on 'tahoe cp' --help a bit 2009-06-25 19:38:37 -07:00
Brian Warner
8d5cc756f0 cli: add some --help text to 'tahoe cp' 2009-06-25 16:57:51 -07:00
Zooko O'Whielacronx
8c18ac38a9 backup: remove the --no-backupdb command, the handling of "can't import sqlite", and the related tests, and change an error message to more correctly indicate failure to load the database from disk rather than failure to import sqlite module
Fixes #728.
2009-06-04 10:31:31 -07:00
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