[tor-bugs] #6708 [Onionoo]: Pyonionoo returns code 500 for a few parameters

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sun Sep 23 02:20:04 UTC 2012


#6708: Pyonionoo returns code 500 for a few parameters
---------------------+------------------------------------------------------
 Reporter:  karsten  |          Owner:  gsathya       
     Type:  defect   |         Status:  needs_revision
 Priority:  normal   |      Milestone:                
Component:  Onionoo  |        Version:                
 Keywords:           |         Parent:                
   Points:           |   Actualpoints:                
---------------------+------------------------------------------------------

Comment(by gsathya):

 Replying to [comment:3 karsten]:
 > Commits eaefe79..fdcf519 look good, but I'm not happy with 92dac32.
 Several reasons:
 >
 >  - Multiple search terms separated by spaces are not supported.

 Yep. I found this a bit tricky. Will do

 >  - Searching by fingerprint or nickname works for partial search terms,
 but searching for partial IP addresses does not work.

 There's no need to validate the IP address then('1' could be a partial
 IP). Will fix

 >  - Some specific search terms can be fingerprint parts or nickname
 (parts), e.g., `"cafe"`, but 92dac32 would in that case only search by
 fingerprint.

 This kind of sounds broken. I don't really see a use case where anyone
 would want to search for parts of a fingerprint and nickname.

 >  - Searches don't include hashed fingerprints.  That is, if a
 fingerprint has (full) fingerprint `fpr`, it should also be included in
 the details if the search is for `SHA1(fpr)`.  The idea is to have
 applications hash all full fingerprints they receive from the user and
 thereby avoid transmitting non-hashed bridge fingerprints to
 Onionoo/Pyonionoo.

 Will fix.

 >  - Pyonionoo shouldn't copy code from stem, but rather include stem as a
 library.  Pyonionoo will need more stem functionality for the back-end
 part anyway.

 These are just 4 line util functions, I don't really want to include stem
 just for these. These aren't copied verbatim either, it's been modified.
 The pyonionoo backend OTOH, will use stem.

 > Anyway, I wonder if there's an easier way to implement searching in
 Pyonionoo: we could simply add a new search column to the SQLite database
 that contains the fingerprint, hashed fingerprint, nickname, and addresses
 in a single text field, separated by spaces.  For example, gabelmoo would
 have `" f2044413dac2e02e3d6bcf4735a19bca1de97281
 16ef359c2fbf50fc08cf9a95717be3060575b67e gabelmoo 212.112.245.170"` as its
 search value (note that everything's lower-case, and note the leading
 space).  Searches would then add a `WHERE` clause for each search term,
 e.g., `"WHERE search LIKE '% gab%' AND search LIKE '% 212.112.%'"` (again,
 note that all search terms need to be lower-cased, and note the leading
 spaces).

 Sounds like a fine idea to me and we can get rid of the addresses and
 flags table. I prefer a single table approach.

 > Merging eaefe79..fdcf519 now, and changing to needs_revision for
 92dac32.  Thanks!

 Great. Thanks!

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6708#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list