forked from tahoe-lafs/tahoe-lafs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add minimal /introducerless_config page
- Loading branch information
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
from twisted.internet import defer | ||
from nevow import rend, inevow, tags as T | ||
from allmydata.web.common import getxmlfile | ||
|
||
class IntroducerlessConfig(rend.Page): | ||
|
||
docFactory = getxmlfile("introducerless_config.xhtml") | ||
|
||
def __init__(self, client): | ||
self.client = client | ||
|
||
def data_servers(self, ctx, data): | ||
sb = self.client.get_storage_broker() | ||
return sorted(sb.get_known_servers(), key=lambda s: s.get_serverid()) | ||
|
||
def render_server_config(self, ctx, server): | ||
|
||
announcement = server.get_announcement() | ||
seed = announcement['permutation-seed-base32'] | ||
furl = announcement['anonymous-storage-FURL'] | ||
peerid = server.get_longname() | ||
nickname = server.get_nickname() | ||
|
||
config = """ | ||
server.%s.type = tahoe-foolscap | ||
server.%s.nickname = %s | ||
server.%s.seed = %s | ||
server.%s.furl = %s | ||
""" % (peerid, peerid, nickname, peerid, seed, peerid, furl) | ||
|
||
return config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<html xmlns:n="http://nevow.com/ns/nevow/0.1"> | ||
<head> | ||
<title>Tahoe-LAFS - Introducerless Config</title> | ||
<link href="/tahoe.css" rel="stylesheet" type="text/css"/> | ||
<link href="/icon.png" rel="shortcut icon" /> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
</head> | ||
<body> | ||
|
||
<h1>Introducerless Config</h1> | ||
|
||
This version of Tahoe-LAFS supports introducerless operation. To connect to the currently-connected storage servers without an introducer, add the lines below to your gateway's <tt>tahoe.cfg</tt> and restart it. | ||
|
||
<pre> | ||
[client-server-selection] | ||
use_introducer = false | ||
<span n:render="sequence" n:data="servers"><span n:pattern="item" n:render="server_config"/></span> | ||
</pre> | ||
|
||
<div>Return to the <a href="/">Welcome Page</a></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters