From: Zooko O'Whielacronx Date: Wed, 26 Nov 2008 00:57:37 +0000 (-0700) Subject: wui/wapi: change the default port number from 8123 to 3456 to avoid conflict with... X-Git-Url: https://git.rkrishnan.org/%5B/COPYING.TGPPL.html?a=commitdiff_plain;h=fe6abac87baf1786928956d15228008ff3bed84d;p=tahoe-lafs%2Ftahoe-lafs.git wui/wapi: change the default port number from 8123 to 3456 to avoid conflict with TorButton See ticket #536 for details. --- diff --git a/contrib/fuse/impl_c/blackmatch.py b/contrib/fuse/impl_c/blackmatch.py index bde7462b..91379785 100644 --- a/contrib/fuse/impl_c/blackmatch.py +++ b/contrib/fuse/impl_c/blackmatch.py @@ -57,7 +57,7 @@ class TahoeFuseOptions(usage.Options): "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."], diff --git a/contrib/fuse/runtests.py b/contrib/fuse/runtests.py index 050f066f..a93455c2 100644 --- a/contrib/fuse/runtests.py +++ b/contrib/fuse/runtests.py @@ -803,9 +803,9 @@ class TestFailure (Failure): 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: diff --git a/docs/CLI.txt b/docs/CLI.txt index f88464c6..9d52373b 100644 --- a/docs/CLI.txt +++ b/docs/CLI.txt @@ -41,7 +41,7 @@ have client functionality (upload/download files), web API services "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. diff --git a/docs/configuration.txt b/docs/configuration.txt index 5cc658ca..4d5f0fe0 100644 --- a/docs/configuration.txt +++ b/docs/configuration.txt @@ -24,7 +24,7 @@ The item descriptions below use the following types: 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 @@ -50,11 +50,11 @@ web.port = (strports string, optional) 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. @@ -67,7 +67,7 @@ web.static = (string, optional) 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) @@ -479,7 +479,7 @@ these are not the default values), merely a legal one. 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 diff --git a/docs/frontends/webapi.txt b/docs/frontends/webapi.txt index 5ec59067..5080b836 100644 --- a/docs/frontends/webapi.txt +++ b/docs/frontends/webapi.txt @@ -15,8 +15,8 @@ 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 @@ -24,14 +24,14 @@ additional arguments. For more details, see the documentation on 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 == @@ -100,31 +100,31 @@ URLs). 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: @@ -143,13 +143,13 @@ named child inside it, just append the child name to the URL. For example, if 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: @@ -170,7 +170,7 @@ Note that all components of pathnames 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://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 @@ -300,7 +300,7 @@ PUT /uri/$DIRCAP/[SUBDIRS../]FILENAME 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 @@ -1191,7 +1191,7 @@ The webapi server will take any request for a URL that starts with /static 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 diff --git a/docs/helper.txt b/docs/helper.txt index 0e71396a..3be57960 100644 --- a/docs/helper.txt +++ b/docs/helper.txt @@ -82,10 +82,10 @@ helper. 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 @@ -129,7 +129,7 @@ uploads will use the helper rather than using direct connections to the 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". @@ -140,7 +140,7 @@ client will automatically attempt to reconnect to the helper if the 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 == diff --git a/docs/using.html b/docs/using.html index 31ac9a53..dc93f32d 100644 --- a/docs/using.html +++ b/docs/using.html @@ -13,7 +13,7 @@

The WUI

-

Point your web browser to http://127.0.0.1:8123 -- which is the URL of your own local computer -- to use your newly created node.

+

Point your web browser to http://127.0.0.1:3456 -- which is the URL of your own local computer -- to use your newly created node.

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.

diff --git a/src/allmydata/gui/macapp.py b/src/allmydata/gui/macapp.py index 5b39d8f5..96061129 100644 --- a/src/allmydata/gui/macapp.py +++ b/src/allmydata/gui/macapp.py @@ -88,7 +88,7 @@ class AppContainer(object): # 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(): diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index c7bdfab7..999ebcde 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -15,7 +15,7 @@ class VDriveOptions(BaseOptions, usage.Options): "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."] diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py index e0a7bf09..9dd76918 100644 --- a/src/allmydata/scripts/create_node.py +++ b/src/allmydata/scripts/create_node.py @@ -11,7 +11,7 @@ class CreateClientOptions(BasedirMixin, usage.Options): # 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 = [ diff --git a/src/allmydata/test/test_uri.py b/src/allmydata/test/test_uri.py index 5ea2a6a6..858009f0 100644 --- a/src/allmydata/test/test_uri.py +++ b/src/allmydata/test/test_uri.py @@ -95,7 +95,7 @@ class CHKFile(unittest.TestCase): 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()) @@ -182,7 +182,7 @@ class Invalid(unittest.TestCase): 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 + '===' diff --git a/src/allmydata/uri.py b/src/allmydata/uri.py index 1d09e62d..0a67f448 100644 --- a/src/allmydata/uri.py +++ b/src/allmydata/uri.py @@ -18,8 +18,8 @@ SEP='(?::|%3A)' 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: @@ -36,7 +36,7 @@ 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