Opened 21 months ago

Last modified 21 months ago

#18547 new enhancement

Add hostnames and geoip to connection panel

Reported by: atagar Owned by: atagar
Priority: High Milestone:
Component: Core Tor/Nyx Version:
Severity: Normal Keywords: connections
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor: None

Description

Many releases ago Nyx showed hostnames on the connection panel, but dropped this because it leaked our connections to our DNS provider. We can still get this information, but it must be on every relay or none at all.

Turns out Onionoo already supports exactly what we want! In particular here's the query we want...

https://onionoo.torproject.org/details?fields=fingerprint,country,country_name,region_name,city_name,host_name&running=true&type=relay

Note that Onionoo supports gzip compression and we want to take advantage since it drops the size of our replies from 1.5 MB to 432.6 KB.

For this we want a new Daemon subclass in tracker.py. This class would have a single relay_details(fingerprint) method that returns a struct with these attributes. If we meet the following two constraints then it calls Onionoo to update our cache...

  1. We make a request for a fingerprint the cache doesn't have.
  2. It's been over an hour since the relays_published date in our last reply (like the consensus Onionoo updates hourly, so no point in requesting more frequently).

Note that we might not want all of these geoip fields (we'll need to fiddle with the panel to see what is nice to have).

Child Tickets

Change History (1)

comment:1 Changed 21 months ago by atagar

Sponsor: None

Just stumbled upon both a complication and an opportunity.

Earlier this week I pushed a 'fixed' to prevent curses from flickering. We called GETINFO ns/all causing us to read 1.6 MB of data from the local tor process, bogging down our interface and disrupting curses.

On reflection my 'fix' simply broke the ConsensusTracker (_task() is never called since it isn't a Daemon subclass). As a result curses now works great but we don't have any consensus information, which in effect causes us to not show any connections.

How is this relevant to this issue? Two things...

  1. If we also request or_addresses from Onionoo we can move the get_relay_fingerprints() method from the ConsensusTracker to the OnionooTracker. Once we've done this we won't have a need to call GETINFO ns/all.
  1. The curses flickering will be caused by any long-running task. Downloading 500 KB of Onionoo data will likely have a similar issue. If so we might need to spawn a separate process to do this so the download doesn't hog python's GIL.
Note: See TracTickets for help on using tickets.