port 8123. Writing "tcp:8123:interface=127.0.0.1" into $NODEDIR/webport does
the same but binds to the loopback interface, ensuring that only the programs
on the local host can connect. Using
-"ssl:8123:privateKey=mykey.pem:certKey=cert.pem" would run an SSL server. See
-twisted.application.strports for more details.
+"ssl:8123:privateKey=mykey.pem:certKey=cert.pem" runs an SSL server. See
+twisted.application.strports:
+
+http://twistedmatrix.com/documents/current/api/twisted.application.strports.html
This webport can be set when the node is created by passing a --webport
option to the 'tahoe create-client' command. By default, the node listens on
-port 8123, on the loopback (localhost) interface.
+port 8123, on the loopback (127.0.0.1) interface.
b. file names
resource gives access to files and directories in all of the user's virtual
drives. For example, the URL that corresponds to notes.txt would be:
-http://localhost:8123/vdrive/global/Documents/notes.txt
+http://127.0.0.1:8123/vdrive/global/Documents/notes.txt
and the URL for tractors.jpg would be:
-http://localhost:8123/uri/$PRIVATE_VDRIVE_URI/Pictures/tractors.jpg
+http://127.0.0.1:8123/uri/$PRIVATE_VDRIVE_URI/Pictures/tractors.jpg
In addition, each directory has a corresponding URL. The Pictures URL is:
-http://localhost:8123/uri/$PRIVATE_VDRIVE_URI/Pictures
+http://127.0.0.1:8123/uri/$PRIVATE_VDRIVE_URI/Pictures
Note that all filenames in URLs are required to be UTF-8 encoded, so
"resume.doc" (with an acute accent on both E's) would be accessed with:
- http://localhost:8123/uri/$PRIVATE_VDRIVE_URI/r%C3%A9sum%C3%A9.doc
+ http://127.0.0.1:8123/uri/$PRIVATE_VDRIVE_URI/r%C3%A9sum%C3%A9.doc
The filenames inside upload POST forms are interpreted using whatever
character set was provided in the conventional '_charset' field, and defaults
For example, this identifies a file or directory:
-http://localhost:8123/uri/$URI
+http://127.0.0.1:8123/uri/$URI
And this identifies a file or directory named "tractors.jpg" in a
subdirectory "Pictures" of the identified directory:
-http://localhost:8123/uri/$URI/Pictures/tractors.jpg
+http://127.0.0.1:8123/uri/$URI/Pictures/tractors.jpg
In the following examples, "$URL" is a shorthand for a URL like the ones
above, either with "vdrive/" and a vdrive name as the top level and a
file (e.g. if it ends with the URI of the file instead). This filename is
also the one used if the 'save=true' argument is set. For example:
- GET http://localhost:8123/uri/$TRACTORS_URI?filename=tractors.jpg
+ GET http://127.0.0.1:8123/uri/$TRACTORS_URI?filename=tractors.jpg
f. uploading a file
- PUT http://localhost:8123/uri
+ PUT http://127.0.0.1:8123/uri
in: file contents
out: file write cap
visible from the virtual drive -- to do that, see section 1.h. below, or
the convenience method in section 2.a..
- POST http://localhost:8123/uri?t=upload
+ POST http://127.0.0.1:8123/uri?t=upload
This action also uploads a file without attaching it to a virtual drive
directory, but can be used from an HTML form. The response is an HTML page
when_done=URL argument is provided, the reponse is a redirect to the given
URL instead of the upload-results page.
- POST http://localhost:8123/uri?t=upload&mutable=true
+ POST http://127.0.0.1:8123/uri?t=upload&mutable=true
This action also uploads a file without attaching it to a virtual drive
directory, but creates a mutable file (SSK) instead of an immutable one.
The response contains the new URI that was created.
- PUT http://localhost:8123/uri?mutable=true
+ PUT http://127.0.0.1:8123/uri?mutable=true
This second form also accepts data from the HTTP request body, but creates
a mutable file (SSK) instead of an immutable one (CHK). The response
g. creating a new directory
- PUT http://localhost:8123/uri?t=mkdir
+ PUT http://127.0.0.1:8123/uri?t=mkdir
in: (nothing)
out: directory write cap
drive, but you can use section 1.h. to attach it, or the convenience method
in section 2.XXX.
- POST http://localhost:8123/uri?t=mkdir
+ POST http://127.0.0.1:8123/uri?t=mkdir
in: (nothing)
out: directory write cap
Just like the equivalent PUT form, but this can be called from an HTML
form.
- POST http://localhost:8123/uri?t=mkdir&redirect_to_result=true
+ POST http://127.0.0.1:8123/uri?t=mkdir&redirect_to_result=true
in: (nothing)
out: redirects to the /uri/$NEWDIRURI page
$URL is required to indicate a directory as the second-to-last element and
the desired filename as the last element, for example:
- PUT http://localhost:8123/uri/$URI_OF_SOME_DIR/Pictures/tractors.jpg
- PUT http://localhost:8123/uri/$URI_OF_SOME_DIR/tractors.jpg
- PUT http://localhost:8123/uri/$PRIVATE_VDRIVE_URI/Pictures/tractors.jpg
+ PUT http://127.0.0.1:8123/uri/$URI_OF_SOME_DIR/Pictures/tractors.jpg
+ PUT http://127.0.0.1:8123/uri/$URI_OF_SOME_DIR/tractors.jpg
+ PUT http://127.0.0.1:8123/uri/$PRIVATE_VDRIVE_URI/Pictures/tractors.jpg
(Note that a URI_OF_SOME_DIR and a PRIVATE_VDRIVE_URI are each just
separate URIs, and there is nothing special about the latter except that it
modifying an existing file, and a 201 (Created) code when creating a new
file. (TODO: as of 0.5, the web server only returns 200, never 201).
- To use this, run 'curl -T localfile http://localhost:8123/vdrive/global/newfile'
+ To use this, run 'curl -T localfile http://127.0.0.1:8123/vdrive/global/newfile'
3. safety and security issues -- names vs. URIs
a. uri redirect
- GET http://localhost:8123/uri?uri=$URI
+ GET http://127.0.0.1:8123/uri?uri=$URI
This causes a redirect to /uri/$URI, and retains any additional query
arguments (like filename= or save=). This is for the convenience of web
localdir= is used with a $URL that refers to a file.
This request will only be accepted from an HTTP client connection
- originating at localhost . This request is most useful when the client node
+ originating at 127.0.0.1 . This request is most useful when the client node
and the HTTP client are operated by the same user. $LOCALPATH should be an
absolute pathname.
This uploads a file or directory from the node's local filesystem to the
vdrive. As with "GET $URL?t=download&localfile=$LOCALPATH", this request
- will only be accepted from an HTTP connection originating from localhost .
+ will only be accepted from an HTTP connection originating from 127.0.0.1 .
The localfile= form expects that $LOCALPATH will point to a file on the
node's local filesystem, and causes the node to upload that one file into
Note that the "curl" utility can be used to provoke this sort of recursive
upload, since the -T option will make it use an HTTP 'PUT':
- curl -T /dev/null 'http://localhost:8123/vdrive/global/newdir?t=upload&localdir=/home/user/directory-to-upload'
+ curl -T /dev/null 'http://127.0.0.1:8123/vdrive/global/newdir?t=upload&localdir=/home/user/directory-to-upload'
This form is only implemented for testing purposes, because any attacker's
web server that a local browser visits could serve an IMG tag that causes
6. XMLRPC (coming soon)
- http://localhost:8123/xmlrpc
+ http://127.0.0.1:8123/xmlrpc
This resource provides an XMLRPC server on which all of the previous
operations can be expressed as function calls taking a "pathname" argument.