mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-12 04:18:28 +00:00
introducer: stop tracking hints for subscribed clients
A long time ago, the introducer's status web page would show the advertised IP addresses for all subscribers, by parsing their RemoteReference's FURL's connection hints. This hasn't worked since about 12-Aug-2014 when foolscap-0.6.5 changed the internal format of these hints. This removes the feature: we no longer attempt to show advertised IP addresses of subscribed clients. It also removes the code that looked inside foolscap internals for this information.
This commit is contained in:
@ -100,20 +100,18 @@ class SubscriberDescriptor:
|
|||||||
.nickname: their self-provided nickname, or "?" (unicode)
|
.nickname: their self-provided nickname, or "?" (unicode)
|
||||||
.version: their self-provided version (string)
|
.version: their self-provided version (string)
|
||||||
.app_versions: versions of each library they use (dict str->str)
|
.app_versions: versions of each library they use (dict str->str)
|
||||||
.advertised_addresses: what hosts they listen on (list of strings)
|
|
||||||
.remote_address: the external address from which they connected (string)
|
.remote_address: the external address from which they connected (string)
|
||||||
.tubid: for subscribers connecting with Foolscap, their tubid (string)
|
.tubid: for subscribers connecting with Foolscap, their tubid (string)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, service_name, when,
|
def __init__(self, service_name, when,
|
||||||
nickname, version, app_versions,
|
nickname, version, app_versions,
|
||||||
advertised_addresses, remote_address, tubid):
|
remote_address, tubid):
|
||||||
self.service_name = service_name
|
self.service_name = service_name
|
||||||
self.when = when
|
self.when = when
|
||||||
self.nickname = nickname
|
self.nickname = nickname
|
||||||
self.version = version
|
self.version = version
|
||||||
self.app_versions = app_versions
|
self.app_versions = app_versions
|
||||||
self.advertised_addresses = advertised_addresses
|
|
||||||
self.remote_address = remote_address
|
self.remote_address = remote_address
|
||||||
self.tubid = tubid
|
self.tubid = tubid
|
||||||
|
|
||||||
|
@ -405,13 +405,11 @@ class IntroducerService_v1(service.MultiService, Referenceable):
|
|||||||
for service_name, subscribers in self._subscribers.items():
|
for service_name, subscribers in self._subscribers.items():
|
||||||
for rref, when in subscribers.items():
|
for rref, when in subscribers.items():
|
||||||
tubid = rref.getRemoteTubID() or "?"
|
tubid = rref.getRemoteTubID() or "?"
|
||||||
advertised_addresses = rrefutil.hosts_for_rref(rref)
|
|
||||||
remote_address = rrefutil.stringify_remote_address(rref)
|
remote_address = rrefutil.stringify_remote_address(rref)
|
||||||
nickname, version, app_versions = u"?", u"?", {}
|
nickname, version, app_versions = u"?", u"?", {}
|
||||||
sd = SubscriberDescriptor(service_name, when,
|
sd = SubscriberDescriptor(service_name, when,
|
||||||
nickname, version, app_versions,
|
nickname, version, app_versions,
|
||||||
advertised_addresses, remote_address,
|
remote_address, tubid)
|
||||||
tubid)
|
|
||||||
s.append(sd)
|
s.append(sd)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
@ -175,7 +175,6 @@ class IntroducerService(service.MultiService, Referenceable):
|
|||||||
# tubid will be None. Also, subscribers do not tell us which
|
# tubid will be None. Also, subscribers do not tell us which
|
||||||
# pubkey they use; only publishers do that.
|
# pubkey they use; only publishers do that.
|
||||||
tubid = rref.getRemoteTubID() or "?"
|
tubid = rref.getRemoteTubID() or "?"
|
||||||
advertised_addresses = rrefutil.hosts_for_rref(rref)
|
|
||||||
remote_address = rrefutil.stringify_remote_address(rref)
|
remote_address = rrefutil.stringify_remote_address(rref)
|
||||||
# these three assume subscriber_info["version"]==0, but
|
# these three assume subscriber_info["version"]==0, but
|
||||||
# should tolerate other versions
|
# should tolerate other versions
|
||||||
@ -188,8 +187,7 @@ class IntroducerService(service.MultiService, Referenceable):
|
|||||||
# 'when' is the time they subscribed
|
# 'when' is the time they subscribed
|
||||||
sd = SubscriberDescriptor(service_name, when,
|
sd = SubscriberDescriptor(service_name, when,
|
||||||
nickname, version, app_versions,
|
nickname, version, app_versions,
|
||||||
advertised_addresses, remote_address,
|
remote_address, tubid)
|
||||||
tubid)
|
|
||||||
s.append(sd)
|
s.append(sd)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
@ -27,20 +27,6 @@ def trap_deadref(f):
|
|||||||
return trap_and_discard(f, DeadReferenceError)
|
return trap_and_discard(f, DeadReferenceError)
|
||||||
|
|
||||||
|
|
||||||
def hosts_for_rref(rref, ignore_localhost=True):
|
|
||||||
# actually, this only returns hostnames
|
|
||||||
advertised = []
|
|
||||||
for hint in rref.getLocationHints():
|
|
||||||
# Foolscap-0.2.5 and earlier used strings in .locationHints, but we
|
|
||||||
# require a newer version that uses tuples of ("ipv4", host, port)
|
|
||||||
assert not isinstance(hint, str), hint
|
|
||||||
if hint[0] == "ipv4":
|
|
||||||
host = hint[1]
|
|
||||||
if ignore_localhost and host == "127.0.0.1":
|
|
||||||
continue
|
|
||||||
advertised.append(host)
|
|
||||||
return advertised
|
|
||||||
|
|
||||||
def hosts_for_furl(furl, ignore_localhost=True):
|
def hosts_for_furl(furl, ignore_localhost=True):
|
||||||
advertised = []
|
advertised = []
|
||||||
for hint in SturdyRef(furl).locationHints:
|
for hint in SturdyRef(furl).locationHints:
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
<th class="nickname-and-peerid">
|
<th class="nickname-and-peerid">
|
||||||
<div class="service-nickname">Nickname</div>
|
<div class="service-nickname">Nickname</div>
|
||||||
<div class="nodeid data-chars">Tub ID</div></th>
|
<div class="nodeid data-chars">Tub ID</div></th>
|
||||||
<th>Advertised IPs</th>
|
|
||||||
<th>Connected From</th>
|
<th>Connected From</th>
|
||||||
<th>Since</th>
|
<th>Since</th>
|
||||||
<th>Version</th>
|
<th>Version</th>
|
||||||
@ -66,7 +65,6 @@
|
|||||||
<td class="nickname-and-peerid">
|
<td class="nickname-and-peerid">
|
||||||
<div class="nickname"><n:slot name="nickname"/></div>
|
<div class="nickname"><n:slot name="nickname"/></div>
|
||||||
<div class="nodeid data-chars"><n:slot name="tubid"/></div></td>
|
<div class="nodeid data-chars"><n:slot name="tubid"/></div></td>
|
||||||
<td><n:slot name="advertised"/></td>
|
|
||||||
<td><n:slot name="connected"/></td>
|
<td><n:slot name="connected"/></td>
|
||||||
<td class="service-since"><n:slot name="since"/></td>
|
<td class="service-since"><n:slot name="since"/></td>
|
||||||
<td class="service-version"><n:slot name="version"/></td>
|
<td class="service-version"><n:slot name="version"/></td>
|
||||||
|
@ -119,7 +119,6 @@ class IntroducerRoot(rend.Page):
|
|||||||
def render_subscriber_row(self, ctx, s):
|
def render_subscriber_row(self, ctx, s):
|
||||||
ctx.fillSlots("nickname", s.nickname)
|
ctx.fillSlots("nickname", s.nickname)
|
||||||
ctx.fillSlots("tubid", s.tubid)
|
ctx.fillSlots("tubid", s.tubid)
|
||||||
ctx.fillSlots("advertised", " ".join(s.advertised_addresses))
|
|
||||||
ctx.fillSlots("connected", s.remote_address)
|
ctx.fillSlots("connected", s.remote_address)
|
||||||
since_s = time.strftime("%H:%M:%S %d-%b-%Y", time.localtime(s.when))
|
since_s = time.strftime("%H:%M:%S %d-%b-%Y", time.localtime(s.when))
|
||||||
ctx.fillSlots("since", since_s)
|
ctx.fillSlots("since", since_s)
|
||||||
|
Reference in New Issue
Block a user