See ticket #536 for details.
"the mapping from alias name to root dirnode URI."
],
["node-url", None, None,
- "URL of the tahoe node to use, a URL like \"http://127.0.0.1:8123\". "
+ "URL of the tahoe node to use, a URL like \"http://127.0.0.1:3456\". "
"This overrides the URL found in the --node-directory ."],
["alias", None, None,
"Which alias should be mounted."],
class Impl_A_UnitTests (unittest.TestCase):
'''Tests small stand-alone functions.'''
def test_canonicalize_cap(self):
- iopairs = [('http://127.0.0.1:8123/uri/URI:DIR2:yar9nnzsho6czczieeesc65sry:upp1pmypwxits3w9izkszgo1zbdnsyk3nm6h7e19s7os7s6yhh9y',
+ iopairs = [('http://127.0.0.1:3456/uri/URI:DIR2:yar9nnzsho6czczieeesc65sry:upp1pmypwxits3w9izkszgo1zbdnsyk3nm6h7e19s7os7s6yhh9y',
'URI:DIR2:yar9nnzsho6czczieeesc65sry:upp1pmypwxits3w9izkszgo1zbdnsyk3nm6h7e19s7os7s6yhh9y'),
- ('http://127.0.0.1:8123/uri/URI%3ACHK%3Ak7ktp1qr7szmt98s1y3ha61d9w%3A8tiy8drttp65u79pjn7hs31po83e514zifdejidyeo1ee8nsqfyy%3A3%3A12%3A242?filename=welcome.html',
+ ('http://127.0.0.1:3456/uri/URI%3ACHK%3Ak7ktp1qr7szmt98s1y3ha61d9w%3A8tiy8drttp65u79pjn7hs31po83e514zifdejidyeo1ee8nsqfyy%3A3%3A12%3A242?filename=welcome.html',
'URI:CHK:k7ktp1qr7szmt98s1y3ha61d9w:8tiy8drttp65u79pjn7hs31po83e514zifdejidyeo1ee8nsqfyy:3:12:242?filename=welcome.html')]
for input, output in iopairs:
"no_storage" and the like).
NODEDIR defaults to ~/.tahoe/ , and newly-created clients default to
-publishing a web server on port 8123 (limited to the loopback interface, at
+publishing a web server on port 3456 (limited to the loopback interface, at
127.0.0.1, to restrict access to other programs on the same host). All of the
other "tahoe" subcommands use corresponding defaults.
boolean: one of (True, yes, on, 1, False, off, no, 0), case-insensitive
strports string: a Twisted listening-port specification string, like "tcp:80"
- or "tcp:8123:interface=127.0.0.1". For a full scription of
+ or "tcp:3456:interface=127.0.0.1". For a full scription of
the format, see
http://twistedmatrix.com/documents/current/api/twisted.application.strports.html
FURL string: a Foolscap endpoint identifier, like
This controls where the node's webserver should listen, providing filesystem
access and node status as defined in webapi.txt . This file contains a
- Twisted "strports" specification such as "8123" or
- "tcp:8123:interface=127.0.0.1". The 'tahoe create-client' command sets the
- web.port to "tcp:8123:interface=127.0.0.1" by default, and is overridable by
+ Twisted "strports" specification such as "3456" or
+ "tcp:3456:interface=127.0.0.1". The 'tahoe create-client' command sets the
+ web.port to "tcp:3456:interface=127.0.0.1" by default, and is overridable by
the "--webport" option. You can make it use SSL by writing
- "ssl:8123:privateKey=mykey.pem:certKey=cert.pem" instead.
+ "ssl:3456:privateKey=mykey.pem:certKey=cert.pem" instead.
If this is not provided, the node will not run a web server.
node, or other services.
The default value is "public_html", which will serve $BASEDIR/public_html .
- With the default settings, http://127.0.0.1:8123/static/foo.html will serve
+ With the default settings, http://127.0.0.1:3456/static/foo.html will serve
the contents of $BASEDIR/public_html/foo.html .
tub.port = (integer, optional)
nickname = Bob's Tahoe Node
tub.port = 34912
tub.location = 123.45.67.89:8098,44.55.66.77:8098
-web.port = 8123
+web.port = 3456
log_gatherer.furl = pb://soklj4y7eok5c3xkmjeqpw@192.168.69.247:44801/eqpwqtzm
timeout.keepalive = 240
timeout.disconnect = 1800
Every Tahoe node is capable of running a built-in HTTP server. To enable
this, just write a port number into a file named "webport" in the node's base
-directory. For example, writing "8123" into $NODEDIR/webport will cause the
-node to run a webserver on port 8123.
+directory. For example, writing "3456" into $NODEDIR/webport will cause the
+node to run a webserver on port 3456.
This string is actually a Twisted "strports" specification, meaning you can
get more control over the interface to which the server binds by supplying
twisted.application.strports:
http://twistedmatrix.com/documents/current/api/twisted.application.strports.html
-Writing "tcp:8123:interface=127.0.0.1" into $NODEDIR/webport does the same
+Writing "tcp:3456: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" runs an SSL server.
+"ssl:3456:privateKey=mykey.pem:certKey=cert.pem" runs an SSL server.
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 (127.0.0.1) interface.
+port 3456, on the loopback (127.0.0.1) interface.
== Basic Concepts ==
To refer to any Tahoe object through the web API, you simply need to combine
a prefix (which indicates the HTTP server to use) with the cap (which
indicates which object inside that server to access). Since the default Tahoe
-webport is 8123, the most common prefix is one that will use a local node
+webport is 3456, the most common prefix is one that will use a local node
listening on this port:
- http://127.0.0.1:8123/uri/ + $CAP
+ http://127.0.0.1:3456/uri/ + $CAP
So, to access the directory named above (which happens to be the
publically-writable sample directory on the Tahoe test grid, described at
http://allmydata.org/trac/tahoe/wiki/TestGrid), the URL would be:
- http://127.0.0.1:8123/uri/URI%3ADIR2%3Adjrdkfawoqihigoett4g6auz6a%3Ajx5mplfpwexnoqff7y5e4zjus4lidm76dcuarpct7cckorh2dpgq/
+ http://127.0.0.1:3456/uri/URI%3ADIR2%3Adjrdkfawoqihigoett4g6auz6a%3Ajx5mplfpwexnoqff7y5e4zjus4lidm76dcuarpct7cckorh2dpgq/
(note that the colons in the directory-cap are url-encoded into "%3A"
sequences).
Likewise, to access the file named above, use:
- http://127.0.0.1:8123/uri/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202
+ http://127.0.0.1:3456/uri/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202
In the rest of this document, we'll use "$DIRCAP" as shorthand for a read-cap
or write-cap that refers to a directory, and "$FILECAP" to abbreviate a cap
that refers to a file (whether mutable or immutable). So those URLs above can
be abbreviated as:
- http://127.0.0.1:8123/uri/$DIRCAP/
- http://127.0.0.1:8123/uri/$FILECAP
+ http://127.0.0.1:3456/uri/$DIRCAP/
+ http://127.0.0.1:3456/uri/$FILECAP
The operation summaries below will abbreviate these further, by eliding the
server prefix. They will be displayed like this:
our sample directory contains a file named "welcome.txt", we can refer to
that file with:
- http://127.0.0.1:8123/uri/$DIRCAP/welcome.txt
+ http://127.0.0.1:3456/uri/$DIRCAP/welcome.txt
-(or http://127.0.0.1:8123/uri/URI%3ADIR2%3Adjrdkfawoqihigoett4g6auz6a%3Ajx5mplfpwexnoqff7y5e4zjus4lidm76dcuarpct7cckorh2dpgq/welcome.txt)
+(or http://127.0.0.1:3456/uri/URI%3ADIR2%3Adjrdkfawoqihigoett4g6auz6a%3Ajx5mplfpwexnoqff7y5e4zjus4lidm76dcuarpct7cckorh2dpgq/welcome.txt)
Multiple levels of subdirectories can be handled this way:
- http://127.0.0.1:8123/uri/$DIRCAP/tahoe-source/docs/webapi.txt
+ http://127.0.0.1:3456/uri/$DIRCAP/tahoe-source/docs/webapi.txt
In this document, when we need to refer to a URL that references a file using
this child-of-some-directory format, we'll use the following string:
encoded, so "resume.doc" (with an acute accent on both E's) would be accessed
with:
- http://127.0.0.1:8123/uri/$DIRCAP/r%C3%A9sum%C3%A9.doc
+ http://127.0.0.1:3456/uri/$DIRCAP/r%C3%A9sum%C3%A9.doc
Also note that the filenames inside upload POST forms are interpreted using
whatever character set was provided in the conventional '_charset' field, and
to 201 CREATED. If an existing file was replaced or modified, the response
code will be 200 OK.
- Note that the 'curl -T localfile http://127.0.0.1:8123/uri/$DIRCAP/foo.txt'
+ Note that the 'curl -T localfile http://127.0.0.1:3456/uri/$DIRCAP/foo.txt'
command can be used to invoke this operation.
PUT /uri
and serve it from a configurable directory which defaults to
$BASEDIR/public_html . This is configured by setting the "[node]web.static"
value in $BASEDIR/tahoe.cfg . If this is left at the default value of
-"public_html", then http://localhost:8123/static/subdir/foo.html will be
+"public_html", then http://localhost:3456/static/subdir/foo.html will be
served with the contents of the file $BASEDIR/public_html/subdir/foo.html .
This can be useful to serve a javascript application which provides a
cat $BASEDIR/private/helper.furl |mail -s "helper furl" friend@example.com
You can tell if your node is running a helper by looking at its web status
-page. Assuming that you've set up the 'webport' to use port 8123, point your
-browser at http://localhost:8123/ . The welcome page will say "Helper: 0
+page. Assuming that you've set up the 'webport' to use port 3456, point your
+browser at http://localhost:3456/ . The welcome page will say "Helper: 0
active uploads" or "Not running helper" as appropriate. The
-http://localhost:8123/helper_status page will also provide details on what
+http://localhost:3456/helper_status page will also provide details on what
the helper is currently doing.
The helper will store the ciphertext that is is fetching from clients in
storage server.
If the node has been configured to use a helper, that node's HTTP welcome
-page (http://localhost:8123/) will say "Helper: $HELPERFURL" instead of
+page (http://localhost:3456/) will say "Helper: $HELPERFURL" instead of
"Helper: None". If the helper is actually running and reachable, the next
line will say "Connected to helper?: yes" instead of "no".
connection is lost, using the same exponential-backoff algorithm as all other
tahoe/foolscap connections.
-The upload/download status page (http://localhost:8123/status) will announce
+The upload/download status page (http://localhost:3456/status) will announce
the using-helper-or-not state of each upload, in the "Helper?" column.
== Other Helper Modes ==
<h1>The WUI</h1>
- <p>Point your web browser to <a href="http://127.0.0.1:8123">http://127.0.0.1:8123</a> -- which is the URL of your own local computer -- to use your newly created node.</p>
+ <p>Point your web browser to <a href="http://127.0.0.1:3456">http://127.0.0.1:3456</a> -- which is the URL of your own local computer -- to use your newly created node.</p>
<p>Create a new directory (with the button labelled "create a directory"). Your web browser will load the new directory. Now if you want to be able to come back to this directory later, you have to bookmark it, or otherwise save the URL of it. If you lose URL to this directory, then you can never again come back to this directory.</p>
# handle initial config
if not os.path.exists(os.path.join(self.nodedir, 'webport')):
f = file(os.path.join(self.nodedir, 'webport'), 'wb')
- f.write('8123')
+ f.write('3456')
f.close()
if self.is_config_incomplete():
"the mapping from alias name to root dirnode URI."
],
["node-url", "u", None,
- "URL of the tahoe node to use, a URL like \"http://127.0.0.1:8123\". "
+ "URL of the tahoe node to use, a URL like \"http://127.0.0.1:3456\". "
"This overrides the URL found in the --node-directory ."],
["dir-cap", None, None,
"Which dirnode URI should be used as the 'tahoe' alias."]
# tahoe.cfg before node startup.
("nickname", "n", None, "nickname for this node"),
("introducer", "i", None, "introducer FURL to use"),
- ("webport", "p", "tcp:8123:interface=127.0.0.1",
+ ("webport", "p", "tcp:3456:interface=127.0.0.1",
"which TCP port to run the HTTP interface on. Use 'none' to disable."),
]
optFlags = [
u1a = IFileURI(u.to_string())
self.failUnlessEqual(u1a, u)
he = u.to_human_encoding()
- self.failUnlessEqual(he, "http://127.0.0.1:8123/uri/" + u.to_string())
+ self.failUnlessEqual(he, "http://127.0.0.1:3456/uri/" + u.to_string())
self.failUnlessEqual(uri.CHKFileURI.init_from_human_encoding(he), u)
u2 = uri.from_string(u.to_string())
class Constraint(unittest.TestCase):
def test_constraint(self):
- good="http://127.0.0.1:8123/uri/URI%3ADIR2%3Agh3l5rbvnv2333mrfvalmjfr4i%3Alz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma/"
+ good="http://127.0.0.1:3456/uri/URI%3ADIR2%3Agh3l5rbvnv2333mrfvalmjfr4i%3Alz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma/"
uri.NewDirectoryURI.init_from_human_encoding(good)
self.failUnlessRaises(AssertionError, uri.NewDirectoryURI.init_from_string, good)
bad = good + '==='
NUMBER='([0-9]+)'
# URIs (soon to be renamed "caps") are always allowed to come with a leading
-# 'http://127.0.0.1:8123/uri/' that will be ignored.
-OPTIONALHTTPLEAD=r'(?:https?://(?:127.0.0.1|localhost):8123/uri/)?'
+# 'http://127.0.0.1:(8123|3456)/uri/' that will be ignored.
+OPTIONALHTTPLEAD=r'(?:https?://(?:127.0.0.1|localhost):(?:8123|3456)/uri/)?'
class _BaseURI:
else:
return True
def to_human_encoding(self):
- return 'http://127.0.0.1:8123/uri/'+self.to_string()
+ return 'http://127.0.0.1:3456/uri/'+self.to_string()
def get_storage_index(self):
return self.storage_index