java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigBanHelper
Helper for ban configuration page rendering. Displays current ban settings and thresholds.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMilliseconds a bad packet offender stays banned (default 60 minutes).static final StringWhen false, peers seen only as transit next hops are exempt from policy bans.static final StringTwo letter country codes to refuse RouterInfos from, comma or space separated.static final StringCapability ban patterns separated by commas or whitespace; each one bans routers carrying all of its characters, and a trailing '!' group exempts matches, as in "G!f".static final StringSet to true to start banning IPs that send malformed packets; default false.static final StringSet to true to refuse RouterInfos published in our own country; default false.static final StringSet to false to stop loading the subscription blocklist; default true.static final StringSet to true to start banning peers seen with corrupt transport connections; default false.static final StringSet to true to filter out RouterInfos from the blocked country list; default false.static final StringSet to true to start banning peers demanding excess tunnels; default false.static final StringSet to false to stop banning routers advertising more than five introducers on one address; default true.static final StringSet to false to stop banning RouterInfos publishing a version above every released version; default true.static final StringSet to true to start banning unreachable low bandwidth routers; default false.static final StringSet to false to stop banning routers publishing no version; default true.static final StringSet to true to start banning peers abusing port hopping; default false.static final StringSet to false to stop banning RouterInfos with an invalid publication date; default true.static final StringSet to false to stop banning routers publishing both the reachable and unreachable flags; default true.static final StringSet to false to stop merging the Tor exit node list into the blocklist; default true.static final StringSet to true to start banning floodfills that fail to respond; default false.static final StringSet to true to ban XG routers, which take no transit; default false.static final StringOffenses allowed inside the window before an offender is banned, as a count (default 3).static final StringWindow in milliseconds over which offenses accumulate toward a ban (default 15 minutes).static final StringMilliseconds after startup during which offenses are not tracked (default 3 minutes).Fields inherited from class HelperBase
_context, _log, _out, CHECKED, PROP_ADVANCED, SELECTEDModifier and TypeFieldDescriptionprotected RouterContextThe router context.protected LogThe log instance.protected WriterThe writer for output.static final StringChecked attribute for HTML checkboxes.static final StringProperty key for advanced mode.static final StringSelected attribute for HTML select options.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionGet the checked status of the bad packet ban option.Get the bad packet ban duration in minutes.Get the checked status of the next-hop ban option.Get the checked status of the blocklist option.Get the checked status of the block my country option.Get the checked status of the corrupt connection ban option.Get the checked status of the country ban option.Get the custom capability ban patterns.Get the custom country codes for ban filtering.Get the checked status of the excessive tunnel requests ban option.Get the checked status of the introducer-cap ban option.Get the checked status of the fabricated RouterInfo version ban option.Get the checked status of the LU ban option.Get the maximum number of offenses before a peer is banned.Get the checked status of the no version ban option.Get the offense window in minutes.Get the checked status of the port hopping ban option.Get the checked status of the invalid publication date ban option.Get the checked status of the contradictory reachability caps ban option.Get the startup grace period in minutes.Get the checked status of the Tor blocklist option.Get the checked status of the unresponsive floodfill ban option.Get the checked status of the XG ban option.Methods inherited from class HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriterModifier and TypeMethodDescriptionTranslate a string.Translate a string with a parameter.Translate a string with two parameters.static StringMark a string for extraction by xgettext and translation.protected StringgetChecked(String prop) Get the checked attribute for a boolean property.booleanCheck if advanced mode is enabled.Translate a string with plural forms (ngettext).voidsetContextId(String contextId) Configure this bean to query a particular router context.voidstoreWriter(Writer out) Store the writer for output.
Field Details
PROP_MAX_OFFENSES
Offenses allowed inside the window before an offender is banned, as a count (default 3).- See Also:
PROP_OFFENSE_WINDOW
Window in milliseconds over which offenses accumulate toward a ban (default 15 minutes).- See Also:
PROP_STARTUP_GRACE
Milliseconds after startup during which offenses are not tracked (default 3 minutes).- See Also:
PROP_BAD_PACKET_DURATION
Milliseconds a bad packet offender stays banned (default 60 minutes).- See Also:
PROP_ENABLE_BAD_PACKET_BAN
Set to true to start banning IPs that send malformed packets; default false.- See Also:
PROP_ENABLE_CORRUPT_CONNECTION_BAN
Set to true to start banning peers seen with corrupt transport connections; default false.- See Also:
PROP_ENABLE_PORT_HOPPING_BAN
Set to true to start banning peers abusing port hopping; default false.- See Also:
PROP_ENABLE_BLOCKLIST
Set to false to stop loading the subscription blocklist; default true.- See Also:
PROP_ENABLE_TOR_BLOCKLIST
Set to false to stop merging the Tor exit node list into the blocklist; default true.- See Also:
PROP_ENABLE_COUNTRY_BAN
Set to true to filter out RouterInfos from the blocked country list; default false.- See Also:
PROP_ENABLE_XG_BAN
Set to true to ban XG routers, which take no transit; default false.- See Also:
PROP_ENABLE_LU_BAN
Set to true to start banning unreachable low bandwidth routers; default false.- See Also:
PROP_ENABLE_INTRODUCER_BAN
Set to false to stop banning routers advertising more than five introducers on one address; default true.- See Also:
PROP_ENABLE_INVALID_VERSION_BAN
Set to false to stop banning RouterInfos publishing a version above every released version; default true.- See Also:
PROP_ENABLE_PUB_DATE_BAN
Set to false to stop banning RouterInfos with an invalid publication date; default true.- See Also:
PROP_ENABLE_RU_CAPS_BAN
Set to false to stop banning routers publishing both the reachable and unreachable flags; default true.- See Also:
PROP_ENABLE_BLOCK_MY_COUNTRY
Set to true to refuse RouterInfos published in our own country; default false.- See Also:
PROP_CUSTOM_CAPABILITY_BANS
Capability ban patterns separated by commas or whitespace; each one bans routers carrying all of its characters, and a trailing '!' group exempts matches, as in "G!f". Empty bans nothing.- See Also:
PROP_COUNTRY_CODES
Two letter country codes to refuse RouterInfos from, comma or space separated.- See Also:
PROP_ENABLE_UNRESPONSIVE_FLOODFILL_BAN
Set to true to start banning floodfills that fail to respond; default false.- See Also:
PROP_ENABLE_NO_VERSION_BAN
Set to false to stop banning routers publishing no version; default true.- See Also:
PROP_ENABLE_EXCESSIVE_TUNNEL_REQUESTS_BAN
Set to true to start banning peers demanding excess tunnels; default false.- See Also:
PROP_BAN_NEXT_HOP
When false, peers seen only as transit next hops are exempt from policy bans.- See Also:
Constructor Details
ConfigBanHelper
public ConfigBanHelper()Construct a new ConfigBanHelper.
Method Details
getMaxOffenses
Get the maximum number of offenses before a peer is banned.- Returns:
- the max offenses setting value
getOffenseWindow
Get the offense window in minutes.- Returns:
- the offense window in minutes
getStartupGrace
Get the startup grace period in minutes.- Returns:
- the startup grace in minutes
getBadPacketDuration
Get the bad packet ban duration in minutes.- Returns:
- the bad packet ban duration in minutes
getBadPacketBanChecked
Get the checked status of the bad packet ban option.- Returns:
- "checked" if enabled, empty string otherwise
getCorruptConnectionBanChecked
Get the checked status of the corrupt connection ban option.- Returns:
- "checked" if enabled, empty string otherwise
getPortHoppingBanChecked
Get the checked status of the port hopping ban option.- Returns:
- "checked" if enabled, empty string otherwise
getBlocklistChecked
Get the checked status of the blocklist option.- Returns:
- "checked" if enabled, empty string otherwise
getTorBlocklistChecked
Get the checked status of the Tor blocklist option.- Returns:
- "checked" if enabled, empty string otherwise
getCountryBanChecked
Get the checked status of the country ban option.- Returns:
- "checked" if enabled, empty string otherwise
getXgBanChecked
Get the checked status of the XG ban option.- Returns:
- "checked" if enabled, empty string otherwise
getLuBanChecked
Get the checked status of the LU ban option.- Returns:
- "checked" if enabled, empty string otherwise
getIntroducerBanChecked
Get the checked status of the introducer-cap ban option.- Returns:
- "checked" if enabled, empty string otherwise
getInvalidVersionBanChecked
Get the checked status of the fabricated RouterInfo version ban option.- Returns:
- "checked" if enabled, empty string otherwise
getPubDateBanChecked
Get the checked status of the invalid publication date ban option.- Returns:
- "checked" if enabled, empty string otherwise
getRuCapsBanChecked
Get the checked status of the contradictory reachability caps ban option.- Returns:
- "checked" if enabled, empty string otherwise
getBlockMyCountryChecked
Get the checked status of the block my country option.- Returns:
- "checked" if enabled, empty string otherwise
getCustomCapabilityBans
Get the custom capability ban patterns.- Returns:
- the custom capability bans string
getCustomCountryCodes
Get the custom country codes for ban filtering.- Returns:
- the custom country codes string
getUnresponsiveFloodfillBanChecked
Get the checked status of the unresponsive floodfill ban option.- Returns:
- "checked" if enabled, empty string otherwise
getNoVersionBanChecked
Get the checked status of the no version ban option.- Returns:
- "checked" if enabled, empty string otherwise
getExcessiveTunnelRequestsBanChecked
Get the checked status of the excessive tunnel requests ban option.- Returns:
- "checked" if enabled, empty string otherwise
getBanNextHopChecked
Get the checked status of the next-hop ban option.When enabled (default), peers resolved from the network that we are not directly connected to - transit next hops as well as client tunnel endpoints - are subject to policy bans like any other peer. When disabled, such peers are exempt from policy bans unless we are directly connected to them.
- Returns:
- "checked" if enabled, empty string otherwise