From 949be436a60dd8369d982a0527c6b010a7be159a Mon Sep 17 00:00:00 2001 From: l-n-s Date: Fri, 16 Sep 2016 22:56:51 +0000 Subject: [PATCH] Adding option to configure reseed URLs --- Config.cpp | 17 +++++++++++++++++ Reseed.cpp | 25 +++++-------------------- docs/configuration.md | 1 + 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Config.cpp b/Config.cpp index a629f2d4..33231aa4 100644 --- a/Config.cpp +++ b/Config.cpp @@ -151,6 +151,23 @@ namespace config { options_description reseed("Reseed options"); reseed.add_options() ("reseed.file", value()->default_value(""), "Path to .su3 file") +#ifdef MESHNET + ("reseed.urls", value()->default_value("https://reseed.i2p.rocks:8443/"), "Reseed URLs, separated by comma") +#else + ("reseed.urls", value()->default_value( + "https://reseed.i2p-projekt.de/," + "https://i2p.mooo.com/netDb/," + "https://netdb.i2p2.no/," + "https://us.reseed.i2p2.no:444/," + "https://uk.reseed.i2p2.no:444/," + "https://i2p.manas.ca:8443/," + "https://i2p-0.manas.ca:8443/," + "https://reseed.i2p.vzaws.com:8443/," + "https://user.mx24.eu/," + "https://download.xxlspeed.com/," + "https://reseed-ru.lngserv.ru/" + ), "Reseed URLs, separated by comma") +#endif ; options_description trust("Trust options"); diff --git a/Reseed.cpp b/Reseed.cpp index 21635791..a51dcad4 100644 --- a/Reseed.cpp +++ b/Reseed.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -22,26 +23,6 @@ namespace i2p { namespace data { - static std::vector httpsReseedHostList = - { -#ifdef MESHNET - // meshnet i2p reseeds - "https://reseed.i2p.rocks:8443/" -#else - // mainline i2p reseeds - "https://reseed.i2p-projekt.de/", // Only HTTPS - "https://i2p.mooo.com/netDb/", - "https://netdb.i2p2.no/", // Only SU3 (v3) support, SNI required - "https://us.reseed.i2p2.no:444/", - "https://uk.reseed.i2p2.no:444/", - "https://i2p.manas.ca:8443/", - "https://i2p-0.manas.ca:8443/", - "https://reseed.i2p.vzaws.com:8443/", // Only SU3 (v3) support - "https://user.mx24.eu/", // Only HTTPS and SU3 (v3) support - "https://download.xxlspeed.com/", // Only HTTPS and SU3 (v3) support - "https://reseed-ru.lngserv.ru/" -#endif - }; Reseeder::Reseeder() { @@ -53,6 +34,10 @@ namespace data int Reseeder::ReseedNowSU3 () { + std::string reseedURLs; i2p::config::GetOption("reseed.urls", reseedURLs); + std::vector httpsReseedHostList; + boost::split(httpsReseedHostList, reseedURLs, boost::is_any_of(","), boost::token_compress_on); + std::string filename; i2p::config::GetOption("reseed.file", filename); if (filename.length() > 0) // reseed file is specified { diff --git a/docs/configuration.md b/docs/configuration.md index 32cd7f49..31082dc2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -73,6 +73,7 @@ All options below still possible in cmdline, but better write it in config file: * --precomputation.elgamal= - Use ElGamal precomputated tables. false for x64 and true for other platforms by default * --reseed.file - Full path to SU3 file to reseed from +* --reseed.urls - Reseed URLs, separated by comma * --limits.transittunnels= - Override maximum number of transit tunnels. 2500 by default