core: Refactor server bootstrap process
authorKristian Fiskerstrand <kf@sumptuouscapital.com>
Mon, 9 Jul 2018 14:25:17 +0000 (16:25 +0200)
committerKristian Fiskerstrand <kf@sumptuouscapital.com>
Mon, 9 Jul 2018 14:25:17 +0000 (16:25 +0200)
sks-keyservers.net/status-srv/sks.inc.php

index 05b0af0..d0e6d6d 100755 (executable)
   public function sks_stats()
   {
    $servers = new sks_servercollection;
-   $sadd = new sks_peer($servers, "keys2.kfwebs.net");
-   $servers->add_server($sadd);
    
-   if(count($servers->get_servers())<3)
-   {
-    $sadd = new sks_peer($servers, "zimmermann.mayfirst.org");
-    $servers->add_server($sadd);
-   }
-   
-   if(count($servers->get_servers())<3)
-   {
-    $sadd = new sks_peer($servers, "keyserver.ccc-hanau.de");
-    $servers->add_server($sadd);
-   }
-
-   if(count($servers->get_servers())<3)
-   {
-    $sadd = new sks_peer($servers, "pgp.mit.edu");
-    $servers->add_server($sadd);
-   }
+   $initial_servers = array("keys2.kfwebs.net", "zimmermann.mayfirst.org", "keyserver.ubuntu.com", "sks.undergrid.net", "sks.b4ckbone.de");
 
-   if(count($servers->get_servers())<3)
+        foreach($initial_servers as $s)
    {
-    $sadd = new sks_peer($servers, "sks.undergrid.net");
-    $servers->add_server($sadd);
+      $sadd = new sks_peer($servers, $s);
+      $servers->add_server($sadd);
    }
    
    echo "Done adding primaries\n";