java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigBanHelper

public class ConfigBanHelperextends HelperBase
Helper for ban configuration page rendering. Displays current ban settings and thresholds.
  • Field Details

    • PROP_MAX_OFFENSES

      public static final String PROP_MAX_OFFENSES
      Offenses allowed inside the window before an offender is banned, as a count (default 3).
      See Also:
    • PROP_OFFENSE_WINDOW

      public static final String PROP_OFFENSE_WINDOW
      Window in milliseconds over which offenses accumulate toward a ban (default 15 minutes).
      See Also:
    • PROP_STARTUP_GRACE

      public static final String PROP_STARTUP_GRACE
      Milliseconds after startup during which offenses are not tracked (default 3 minutes).
      See Also:
    • PROP_BAD_PACKET_DURATION

      public static final String PROP_BAD_PACKET_DURATION
      Milliseconds a bad packet offender stays banned (default 60 minutes).
      See Also:
    • PROP_ENABLE_BAD_PACKET_BAN

      public static final String 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

      public static final String 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

      public static final String PROP_ENABLE_PORT_HOPPING_BAN
      Set to true to start banning peers abusing port hopping; default false.
      See Also:
    • PROP_ENABLE_BLOCKLIST

      public static final String PROP_ENABLE_BLOCKLIST
      Set to false to stop loading the subscription blocklist; default true.
      See Also:
    • PROP_ENABLE_TOR_BLOCKLIST

      public static final String 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

      public static final String PROP_ENABLE_COUNTRY_BAN
      Set to true to filter out RouterInfos from the blocked country list; default false.
      See Also:
    • PROP_ENABLE_XG_BAN

      public static final String PROP_ENABLE_XG_BAN
      Set to true to ban XG routers, which take no transit; default false.
      See Also:
    • PROP_ENABLE_LU_BAN

      public static final String PROP_ENABLE_LU_BAN
      Set to true to start banning unreachable low bandwidth routers; default false.
      See Also:
    • PROP_ENABLE_INTRODUCER_BAN

      public static final String 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

      public static final String 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

      public static final String 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

      public static final String 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

      public static final String PROP_ENABLE_BLOCK_MY_COUNTRY
      Set to true to refuse RouterInfos published in our own country; default false.
      See Also:
    • PROP_CUSTOM_CAPABILITY_BANS

      public static final String 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

      public static final String PROP_COUNTRY_CODES
      Two letter country codes to refuse RouterInfos from, comma or space separated.
      See Also:
    • PROP_ENABLE_UNRESPONSIVE_FLOODFILL_BAN

      public static final String 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

      public static final String 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

      public static final String PROP_ENABLE_EXCESSIVE_TUNNEL_REQUESTS_BAN
      Set to true to start banning peers demanding excess tunnels; default false.
      See Also:
    • PROP_BAN_NEXT_HOP

      public static final String 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

      public String getMaxOffenses()
      Get the maximum number of offenses before a peer is banned.
      Returns:
      the max offenses setting value
    • getOffenseWindow

      public String getOffenseWindow()
      Get the offense window in minutes.
      Returns:
      the offense window in minutes
    • getStartupGrace

      public String getStartupGrace()
      Get the startup grace period in minutes.
      Returns:
      the startup grace in minutes
    • getBadPacketDuration

      public String getBadPacketDuration()
      Get the bad packet ban duration in minutes.
      Returns:
      the bad packet ban duration in minutes
    • getBadPacketBanChecked

      public String getBadPacketBanChecked()
      Get the checked status of the bad packet ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getCorruptConnectionBanChecked

      public String getCorruptConnectionBanChecked()
      Get the checked status of the corrupt connection ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getPortHoppingBanChecked

      public String getPortHoppingBanChecked()
      Get the checked status of the port hopping ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getBlocklistChecked

      public String getBlocklistChecked()
      Get the checked status of the blocklist option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getTorBlocklistChecked

      public String getTorBlocklistChecked()
      Get the checked status of the Tor blocklist option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getCountryBanChecked

      public String getCountryBanChecked()
      Get the checked status of the country ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getXgBanChecked

      public String getXgBanChecked()
      Get the checked status of the XG ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getLuBanChecked

      public String getLuBanChecked()
      Get the checked status of the LU ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getIntroducerBanChecked

      public String getIntroducerBanChecked()
      Get the checked status of the introducer-cap ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getInvalidVersionBanChecked

      public String getInvalidVersionBanChecked()
      Get the checked status of the fabricated RouterInfo version ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getPubDateBanChecked

      public String getPubDateBanChecked()
      Get the checked status of the invalid publication date ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getRuCapsBanChecked

      public String getRuCapsBanChecked()
      Get the checked status of the contradictory reachability caps ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getBlockMyCountryChecked

      public String getBlockMyCountryChecked()
      Get the checked status of the block my country option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getCustomCapabilityBans

      public String getCustomCapabilityBans()
      Get the custom capability ban patterns.
      Returns:
      the custom capability bans string
    • getCustomCountryCodes

      public String getCustomCountryCodes()
      Get the custom country codes for ban filtering.
      Returns:
      the custom country codes string
    • getUnresponsiveFloodfillBanChecked

      public String getUnresponsiveFloodfillBanChecked()
      Get the checked status of the unresponsive floodfill ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getNoVersionBanChecked

      public String getNoVersionBanChecked()
      Get the checked status of the no version ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getExcessiveTunnelRequestsBanChecked

      public String getExcessiveTunnelRequestsBanChecked()
      Get the checked status of the excessive tunnel requests ban option.
      Returns:
      "checked" if enabled, empty string otherwise
    • getBanNextHopChecked

      public String 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