4 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Kristian Fiskerstrand
6 * This file is part of SKS Keyserver Pool (http://sks-keyservers.net)
8 * The Author can be reached by electronic mail at kf@sumptuouscapital.com
9 * Communication using OpenPGP is preferred - a copy of the public key 0x0B7F8B60E3EDFAE3
10 * is available in all the common keyservers or in hkp://pool.sks-keyservers.net
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 $title = "Status pages";
28 include($dir."inc/header.inc.php");
29 include_once("exclude.inc.php");
30 require("sks.inc.php");
31 require("sks-status.inc.php");
32 date_default_timezone_set("UTC");
33 $servers = unserialize(file_get_contents(dirname(__FILE__
)."/sks_cache.serialized"));
34 $status_collection = unserialize(file_get_contents(dirname(__FILE__
)."/sks_cache_status_collection.serialized"));
35 $servercolarr = $status_collection->get_servers();
36 $stats = $status_collection->get_statistics_data();
37 $pools = array("EU", "NA", "OC");
39 echo "<p>These statistics were last updated: ".date("Y-m-d H:i",$servers->get_time())." (".date_default_timezone_get().")</p>";
40 echo "<table><tr><td>Lower bound of keys:</td><td>".((int)$stats['numkeys'])."</td></tr><tr><td>Mean:</td><td>".((int)$stats['mean'])."</td></tr><tr><td>Median:</td><td>".((int)$stats['median'])."</td></tr><tr><td>Max difference:</td><td>".((int)$stats['diff'])."</td></tr><tr><td>Max keys:</td><td>".(int)$stats['max_keys']."</td></tr></table>";
41 echo "<h1>Servers in the pool</h1>";
42 echo "<p>Information about the various pools is <a href=\"/overview-of-pools.php\">found here</a><br /></p>";
43 echo "<table id=\"mainpool\" class=\"list\">\n";
44 echo "<thead><tr><th> </th><th>Hostname</th><th>IPv6</th><th>RProx</th><th>Port 80</th><th>hkps</th><th>Tor</th><th>Software</th><th>ΔKeys</th>";
47 echo "<th>SRV ({$p})</th>";
50 echo "<th>Stats</th><th>Meta</th></tr></thead><tbody>\n";
51 $serverarr = $servers->get_servers();
53 $nonrespserver = array();
55 $mean = ((int)$stats['mean']);
69 $pool[$p] = $status_collection->get_pool($p);
70 $sum[$p] = array_sum($pool[$p]->get_top_servers());
73 foreach($serverarr as $server)
75 if(!isset($servercolarr[$server->get_hostname()]['last_status']) ||
$servercolarr[$server->get_hostname()]['last_status']!=1)
77 $nonrespserver[] = array(
78 $server->get_hostname(),
81 $server->get_version(),
82 $server->get_numkeys(),
83 $server->get_software(),
84 $server->get_is_reverse_proxy(),
85 $server->get_server_contact(),
86 $server->get_is_loadbalanced()
91 if(ServerIsExcluded($server->get_hostname())) continue;
92 $cu = (($c==1) ?
$c2 : $c1);
95 echo "<td style=\"background-color: {$cu};\">{$counter}</td>";
96 echo "<td style=\"background-color: {$cu};\"><a href=\"http://{$server->get_hostname()}:{$server->get_port()}\">{$server->get_hostname()}</a>".(($server->get_server_contact() != ""&& preg_match("/^0x[0-9a-fA-F]{8,40}$/", $server->get_server_contact())) ?
"<a title=\"OpenPGP Key: {$server->get_server_contact()}\" style=\"font-weight: bold; color: blue;\" href=\"/pks/lookup?op=get&search={$server->get_server_contact()}\">[@]</a>" : "")."</td>";
97 echo "<td style=\"background-color: ".(($server->get_ipv6() === true) ?
"green" : "red")."; margin:none; padding:none;\"></td>";
98 echo "<td style=\"background-color: ".(($server->get_is_reverse_proxy()) ?
(($server->get_is_loadbalanced()) ?
"#336699" : "green") : "red")."; margin:none; padding:none;\"></td>";
99 echo "<td style=\"background-color: ".(($server->get_port80()) ?
"green" : "red")."; margin:none; padding:none;\"></td>";
100 echo "<td style=\"background-color: ".($server->get_has_hkps() && (!$server->get_affected_cve2014_3207()) ?
"green" : "red")."; margin:none; padding:none;\"></td>";
101 echo "<td style=\"background-color: ".(($server->get_tor_addresse()) ?
"green" : "red")."; margin:none; padding:none;\"></td>";
103 * Software name and version
105 $sw = $server->get_software();
109 if($server->version_satisfy_min("1.1.6", 0)) // In subset pool
110 $sw_color = "#334499";
112 $sw_color = "#336699";
115 $sw_color = "#993399";
120 echo "<td style=\"background-color: {$sw_color}; color: white; text-align: center;\" title=\"{$sw}\">{$server->get_version()}</td>";
124 $nk = ($server->get_numkeys() - $mean);
128 $nk_bgcolor = "#FFFFCC";
135 echo "<td style=\"background-color: {$nk_bgcolor}; color: {$nk_color}; text-align: right;\">".number_format($nk)."</td>";
137 * SRV weights for various pools
139 foreach($pools as $p)
141 $included = array_key_exists($server->get_hostname(), $pool[$p]->get_top_servers());
142 echo "<td style=\"". ($included ?
"background-color: green; color: white;" : "background-color: {$cu}" )."; text-align: right;\"".($included ?
" title=\"".number_format($pool[$p]->get_srvweight($server->get_hostname()) / $sum[$p] * 100, 2)."%\"" : "").">".number_format($pool[$p]->get_srvweight($server->get_hostname()))."</td>";
144 echo "<td style=\"background-color: {$cu};\"><a href=\"http://{$server->get_hostname()}:{$server->get_port()}/pks/lookup?op=stats\">Stats</a></td>";
145 echo "<td style=\"background-color: {$cu};\"><a href=\"info/{$server->get_hostname()}\">Meta</a></td>";
147 $c = (($c==1) ?
0 : 1);
151 echo "</tbody></table>\n";
153 echo "<h1>Servers currently not in the pool</h1>";
154 echo "<p>These servers were detected when iterating though keyserver synchronisation peers, but did not qualify for inclusion in the main pool.</p>";
155 echo "<table class=\"list\">\n";
156 echo "<tr><th> </th><th>Hostname</th><th>IPv6</th><th>RProx</th><th>Version</th><th>ΔKeys</th><th>Stats</th><th>Meta</th></tr>\n";
161 foreach($nonrespserver as $server)
163 if(ServerIsExcluded($server[0])) continue;
164 $cu = (($c==1) ?
$c2 : $c1);
165 echo "<tr><td style=\"background-color: {$cu};\">{$counter}</td>";
166 echo "<td style=\"background-color: {$cu};\">".(($server[2]==1) ?
"<a href=\"http://{$server[0]}:{$server[1]}/\">{$server[0]}</a>" : $server[0])."".(($server[7] != ""&& preg_match("/^0x[0-9a-fA-F]{8,40}$/", $server[7])) ?
"<a title=\"OpenPGP Key: {$server[7]}\" style=\"font-weight: bold; color: blue;\" href=\"/pks/lookup?op=get&search={$server[7]}\">[@]</a>" : "")."</td>";
167 echo "<td style=\"background-color: ".(($server[2]==1) ?
"green" : "red").";\"></td>";
168 echo "<td style=\"background-color: ".(($server[6]==1) ?
(($server[8]==1) ?
"#336699" : "green") : "red").";\"></td>";
170 * Software name and version
176 $sw_color = "#336699";
179 $sw_color = "#993399";
182 $sw_color = "#999966";
187 echo "<td style=\"background-color: {$sw_color}; color: white; text-align: center;\" title=\"{$sw}\">{$server[3]}</td>";
188 echo "<td style=\"background-color: {$cu}; text-align: right;\">".(($server[4] != "") ?
number_format($server[4] - $mean) : "")."</td>";
189 echo "<td style=\"background-color: {$cu};\"><a href=\"http://{$server[0]}:{$server[1]}/pks/lookup?op=stats\">Stats</a></td>";
190 echo "<td style=\"background-color: {$cu};\"><a href=\"info/{$server[0]}\">Meta</a></td>";
192 $c = (($c==1) ?
0 : 1);
196 include($dir."inc/footer.inc.php");