op=stats hostname needs to use configuration value not request

Bug #1313096 reported by Kristian Fiskerstrand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hockeypuck
Fix Committed
High
Casey Marshall

Bug Description

curl -H "Host:pool.sks-keyservers.net" "http://keys.cmarstech.com:11371/pks/lookup?op=stats" and curl -H "Host:pool.sks-keyservers.net" "http://keys.cmarstech.com:11371/pks/lookup?op=stats&options=mr" returns pool.sks-keyservers.net as the hostname for the server, whereby this should be keys.cmarstech.com. This value needs to be read from the server configuration, not on a request basis.

Revision history for this message
Kristian Fiskerstrand (kf-u) wrote :

Additionally http_port ends up at 0

curl -H "Host:pool.sks-keyservers.net" "http://keys.cmarstech.com:11371/pks/lookup?op=stats&options=mr"
{"hostname":"pool.sks-keyservers.net","http_port":0,

Revision history for this message
Brian Minton (bjmgeek) wrote :
Download full text (3.6 KiB)

This seems to be fixed in the most recent version (2.0b3), which I'm also running on one of my servers:

$ curl -H "Host:pool.sks-keyservers.net" "http://keyserver2.brian.minton.name:11371/pks/lookup?op=stats"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hockeypuck OpenPGP Keyserver Statistics</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link href='/assets/css/pks.min.css' rel='stylesheet' type='text/css'>
<style>
table, th, td {
    border: 1px solid;
}
</style></head><body><h1>Hockeypuck OpenPGP Keyserver Statistics</h1>
Taken at 2015-05-21T17:09:39Z
<h2>Settings</h2>
<table>
<tr><th>Version</th><td>~unreleased </td></tr>
<tr><th>Server Contact</th><td>0x0424DC19B678A1A9 </td></tr>
<tr><th>HTTP</th><td>ip6-localhost:11371 </td></tr>
<tr><th>Recon</th><td>:11370 </td></tr>
</table>

<h3>Gossip Peers</h3>
<table><tr><th>Name</th><th>HTTP</th><th>Recon</th></tr>
<tr><td>peer1</td><td><a href="http://keyserver.brian.minton.name:11371/pks/lookup?op=stats">keyserver.brian.minton.name:11371</a></td><td>keyserver.brian.minton.name:11370</td></tr>
<tr><td>peer2</td><td><a href="http://keys.jhcloos.com:11371/pks/lookup?op=stats">keys.jhcloos.com:11371</a></td><td>keys.jhcloos.com:11370</td></tr>
<tr><td>peer3</td><td><a href="http://pgpkeys.mallos.nl:11371/pks/lookup?op=stats">pgpkeys.mallos.nl:11371</a></td><td>pgpkeys.mallos.nl:11370</td></tr>
<tr><td>peer4</td><td><a href="http://keyserver.erat.systems:11371/pks/lookup?op=stats">keyserver.erat.systems:11371</a></td><td>keyserver.erat.systems:11370</td></tr>
<tr><td>peer5</td><td><a href="http://keyserver.pch.net:11371/pks/lookup?op=stats">keyserver.pch.net:11371</a></td><td>keyserver.pch.net:11370</td></tr>
<tr><td>peer6</td><td><a href="http://aes.keys.peer.sh:11371/pks/lookup?op=stats">aes.keys.peer.sh:11371</a></td><td>aes.keys.peer.sh:11370</td></tr>
</table>

<h2>Statistics</h2>
Total number of keys: 3941740

<h3>Daily Histogram</h3>
<table><tr><th>Day</th><th>New Keys</th><th>Updated Keys</th></tr>
<tr><td>2015-05-21</td><td>112</td><td>208</td></tr>
</table>

<h3>Hourly Histogram</h3>
<table><tr><th>Hour</th><th>New Keys</th><th>Updated Keys</th></tr>
<tr><td>2015-05-21 14</td><td>15</td><td>38</td></tr>
<tr><td>2015-05-21 15</td><td>32</td><td>66</td></tr>
<tr><td>2015-05-21 16</td><td>55</td><td>96</td></tr>
<tr><td>2015-05-21 17</td><td>10</td><td>8</td></tr>
</table>

</body></html>

$ curl -H "Host:pool.sks-keyservers.net" "http://keyserver2.brian.minton.name:11371/pks/lookup?op=stats&options=mr"
{"now":"2015-05-21T17:11:31Z","version":"~unreleased","contact":"0x0424DC19B678A1A9","httpAddr":"ip6-localhost:11371","reconAddr":":11370","peers":[{"Name":"peer1","httpAddr":"keyserver.brian.minton.name:11371","reconAddr":"keyserver.brian.minton.name:11370"},{"Name":"peer2","httpAddr":"keys.jhcloos.com:11371","reconAddr":"keys.jhcloos.com:11370"},{"Name":"peer3","httpAddr":"pgpkeys.mallos.nl:11371","reconAddr":"pgpkeys.mallos.nl:11370"},{"Name":"peer4","httpAddr":"keyserver.erat.systems:11371","reconAddr":"keyserver.erat.systems:11370"},...

Read more...

Revision history for this message
Casey Marshall (cmars) wrote :
Changed in hockeypuck:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Casey Marshall (cmars)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.