java.lang.Object
net.i2p.router.networkdb.reseed.Reseeder
Reseed handler that fetches router infos from configured seed URLs. Uses the built-in URL list unless "
i2p.reseedURL" is overridden. Writes results to ./netDb/. Logs to console, router log, and wrapper log. Moved from ReseedHandler in routerconsole; see ReseedChecker for additional validation.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classRuns one reseed download attempt.Field Summary
Modifier and TypeFieldDescriptionprivate final ReseedCheckerChecker watching for reseed updates.private final RouterContextThe router context.private final LogLogger for reseeding.private static final StringBundle holding the translated console strings.static final StringNOTE - URLs that are in both the standard and SSL groups must use the same hostname, so the reseed process will not download from both.static final StringThe I2P reseed servers are managed by backup (backup@mail.i2p).private static final booleanDon't disable this!private static final longLimit per host to avoid getting stuck on one that is seriously overloaded.private static final longLargest SU3 download accepted, in bytes.private static final intReseed URLs required before downloading.private static final intIf false, use SU3 only; disable fallback to directory index and individual dat files.private static final StringURL parameter carrying the network id.private static final PatternMatches a parenthesised comment in a reseed URL list.static final StringIf true, skip reseeding entirely.static final StringIf true, enable HTTP proxy authentication.static final StringIf true, route reseed fetches through the HTTP proxy.static final StringHost for the HTTP proxy used during reseed.static final StringPassword for HTTP proxy authentication.static final StringPort for the HTTP proxy used during reseed.static final StringUsername for HTTP proxy authentication.static final StringComma-separated list of reseed URLs to try in order.static final StringIf true, enable SSL proxy authentication.static final StringIf true, enable SSL proxy for reseed.static final StringHost for the SSL proxy used during reseed.static final StringPassword for SSL proxy authentication.static final StringPort for the SSL proxy used during reseed.static final StringType of SSL proxy to use, e.g.static final StringUsername for SSL proxy authentication.static final StringIf true, do not attempt SSL when fetching a reseed URL.static final StringIf true, only fetch reseed URLs over SSL.private static final StringFilename prefix of router infos.private static final StringFilename suffix of router infos.private static final StringName of the downloaded reseed file.private static final PatternSplits the reseed URL list entries.private static final PatternMatches a signature verification failure line.Constructor Summary
ConstructorsConstructorDescriptionReseeder(RouterContext ctx, ReseedChecker rc) Holds context and checker references for reseed operations.Method Summary
Modifier and TypeMethodDescriptionprivate StringLook up a localized string from the router console bundle.private StringLook up a localized string with one {0} substitution.private StringLook up a localized string with {0} and {1} substitutions.private static booleanWhether the current JVM supports Server Name Indication (SNI).private StringLook up a localized string with singular/plural forms.(package private) voidStart a reseed using the default reseed URLs.(package private) intStart a reseed from a zip or su3 input stream.(package private) voidrequestReseed(URI url) Start a reseed from a single zip or su3 URL only.
Field Details
_context
The router context._log
Logger for reseeding._checker
Checker watching for reseed updates.MAX_SU3_RESPONSE_SIZE
private static final long MAX_SU3_RESPONSE_SIZELargest SU3 download accepted, in bytes.- See Also:
MAX_FILE_AGE
private static final long MAX_FILE_AGELimit per host to avoid getting stuck on one that is seriously overloaded.- See Also:
ENABLE_SU3
MIN_RI_WANTED
private static final int MIN_RI_WANTEDIf false, use SU3 only; disable fallback to directory index and individual dat files.- See Also:
MIN_RESEED_SERVERS
private static final int MIN_RESEED_SERVERSReseed URLs required before downloading.- See Also:
NETID_PARAM
URL parameter carrying the network id.- See Also:
DEFAULT_SEED_URL
NOTE - URLs that are in both the standard and SSL groups must use the same hostname, so the reseed process will not download from both. Ports are supported as of 0.9.14.NOTE - Each seedURL must be a directory, it must end with a '/', it can't end with 'index.html', for example. Both because of how individual file URLs are constructed, and because SSLEepGet doesn't follow redirects.
- See Also:
DEFAULT_SSL_SEED_URL
The I2P reseed servers are managed by backup (backup@mail.i2p). Please contact him for support, change requests, or issues. See also the reseed forum http://zzz.i2p/forums/18 and the reseed setup and testing guide https://i2p.net/en/docs/guides/reseed-server/All supported reseed hosts need a corresponding reseed (SU3) signing certificate installed in the router.
All supported reseed hosts with selfsigned SSL certificates need the corresponding SSL certificate installed in the router.
While this implementation supports SNI, others may not, so SNI requirements are noted.
- See Also:
SU3_FILENAME
Name of the downloaded reseed file.- See Also:
PROP_PROXY_HOST
Host for the HTTP proxy used during reseed.- See Also:
PROP_PROXY_PORT
Port for the HTTP proxy used during reseed.- See Also:
PROP_PROXY_ENABLE
If true, route reseed fetches through the HTTP proxy.- See Also:
PROP_SSL_DISABLE
If true, do not attempt SSL when fetching a reseed URL.- See Also:
PROP_SSL_REQUIRED
If true, only fetch reseed URLs over SSL.- See Also:
PROP_RESEED_URL
Comma-separated list of reseed URLs to try in order.- See Also:
PROP_PROXY_USERNAME
Username for HTTP proxy authentication.- See Also:
PROP_PROXY_PASSWORD
Password for HTTP proxy authentication.- See Also:
PROP_PROXY_AUTH_ENABLE
If true, enable HTTP proxy authentication.- See Also:
PROP_SPROXY_HOST
Host for the SSL proxy used during reseed.- See Also:
PROP_SPROXY_PORT
Port for the SSL proxy used during reseed.- See Also:
PROP_SPROXY_ENABLE
If true, enable SSL proxy for reseed.- See Also:
PROP_SPROXY_USERNAME
Username for SSL proxy authentication.- See Also:
PROP_SPROXY_PASSWORD
Password for SSL proxy authentication.- See Also:
PROP_SPROXY_AUTH_ENABLE
If true, enable SSL proxy authentication.- See Also:
PROP_SPROXY_TYPE
Type of SSL proxy to use, e.g. HTTP or SOCKS.- See Also:
PROP_DISABLE
If true, skip reseeding entirely.- See Also:
ROUTERINFO_PREFIX
Filename prefix of router infos.- See Also:
ROUTERINFO_SUFFIX
Filename suffix of router infos.- See Also:
PAREN_PATTERN
Matches a parenthesised comment in a reseed URL list.VERIFY_FAIL_PATTERN
Matches a signature verification failure line.URL_SPLIT_PATTERN
Splits the reseed URL list entries.BUNDLE_NAME
Bundle holding the translated console strings.- See Also:
Constructor Details
Reseeder
Reseeder(RouterContext ctx, ReseedChecker rc) Holds context and checker references for reseed operations.- Parameters:
ctx- the router contextrc- status and error reporting
Method Details
requestReseed
void requestReseed()Start a reseed using the default reseed URLs. Supports su3 and directories. Threaded, nonblocking.requestReseed
Start a reseed from a single zip or su3 URL only. Threaded, nonblocking.- Parameters:
url- the zip or su3 resource to fetch; must end with .zip or .su3- Throws:
IllegalArgumentException- if it doesn't end with zip or su3
requestReseed
Start a reseed from a zip or su3 input stream. Blocking, inline. Should be fast. This will close the stream.- Parameters:
in- the stream to read the zip or su3 data from; it is closed by this call- Returns:
- number of valid routerinfos imported
- Throws:
IOException- on most errors
isSNISupported
private static boolean isSNISupported()Whether the current JVM supports Server Name Indication (SNI). True for Java 7+ and Android 2.3+ (API 9). Not guaranteed on all platforms, e.g. FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201446- Returns:
- true if SNI is supported
_t
_t
_t
Look up a localized string with {0} and {1} substitutions.- Parameters:
s- the message key, with {0} and {1} where the arguments goo- the argument substituted for {0}o2- the argument substituted for {1}- Returns:
- the localized string with both substitutions applied
ngettext
Look up a localized string with singular/plural forms.- Parameters:
s- the singular form, may contain {0} for the countp- the plural form, may contain {0} for the countn- the count, used to choose between s and p- Returns:
- the localized form matching the count