public class EditBeanextends IndexBean
Web interface bean for editing and configuring I2P tunnel settings.

Warning - This class is not part of the i2ptunnel API, it has been moved from the jar to the war. Usage by classes outside of i2ptunnel.war is deprecated.

  • Constructor Details

    • EditBean

      public EditBean()
      Constructs the edit-page bean.
  • Method Details

    • staticIsClient

      public static boolean staticIsClient(int tunnel)
      Is it a client or server in the UI and I2P side? Note that a streamr client is a UI and I2P client but a server on the localhost side. Note that a streamr server is a UI and I2P server but a client on the localhost side.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the tunnel is a client type
    • getTargetHost

      public String getTargetHost(int tunnel)
      The target host for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the target host for the tunnel
    • getTargetPort

      public String getTargetPort(int tunnel)
      The target port for the tunnel, or empty string if none.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the target port, or "" if none
    • getPrivateKeyFile

      public String getPrivateKeyFile(int tunnel)
      The private key file for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the private key file
    • getAltPrivateKeyFile

      public String getAltPrivateKeyFile(int tunnel)
      The alternate private key file for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      path or ""
    • getSigningPrivateKey

      public SigningPrivateKey getSigningPrivateKey(int tunnel)
      The signing private key for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      key or null
    • startAutomatically

      public boolean startAutomatically(int tunnel)
      Whether the tunnel is configured to start when the router starts.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the tunnel starts automatically
    • getStartupDelayMin

      public int getStartupDelayMin(int tunnel)
      The minimum startup delay in seconds for server tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the minimum startup delay in seconds
    • getStartupDelayMax

      public int getStartupDelayMax(int tunnel)
      The maximum startup delay in seconds for server tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the maximum startup delay in seconds
    • getShutdownDelayMin

      public int getShutdownDelayMin(int tunnel)
      The minimum shutdown delay in seconds for server tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the minimum shutdown delay in seconds
    • getShutdownDelayMax

      public int getShutdownDelayMax(int tunnel)
      The maximum shutdown delay in seconds for server tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the maximum shutdown delay in seconds
    • shouldDelay

      public boolean shouldDelay(int tunnel)
      Whether the tunnel connection should be delayed until the first client connects.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the connection is delayed
    • isInteractive

      public boolean isInteractive(int tunnel)
      Whether the tunnel is interactive (requires immediate response).
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the tunnel is interactive
    • getTunnelDepth

      public int getTunnelDepth(int tunnel, int defaultLength)
      Gets the tunnel depth (number of hops) for inbound tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultLength - the default depth if not configured
      Returns:
      the tunnel depth, or -1 for default
    • getTunnelQuantity

      public int getTunnelQuantity(int tunnel, int defaultQuantity)
      Gets the tunnel quantity for inbound or both in/out.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultQuantity - the default quantity if not configured
      Returns:
      the tunnel quantity
    • getTunnelBackupQuantity

      public int getTunnelBackupQuantity(int tunnel, int defaultBackupQuantity)
      Gets the backup tunnel quantity for inbound or both in/out.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultBackupQuantity - the default backup quantity if not configured
      Returns:
      the backup tunnel quantity
    • getTunnelVariance

      public int getTunnelVariance(int tunnel, int defaultVariance)
      Gets the tunnel variance for inbound or both in/out.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultVariance - the default variance if not configured
      Returns:
      the tunnel variance
    • getTunnelDepthOut

      public int getTunnelDepthOut(int tunnel, int defaultLength)
      Configured hop count for the tunnel's outbound (client-side) tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultLength - the default depth if not configured
      Returns:
      the outbound tunnel depth, or -1 for default
    • getTunnelQuantityOut

      public int getTunnelQuantityOut(int tunnel, int defaultQuantity)
      Configured number of primary outbound tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultQuantity - the default quantity if not configured
      Returns:
      the outbound tunnel quantity
    • getTunnelBackupQuantityOut

      public int getTunnelBackupQuantityOut(int tunnel, int defaultBackupQuantity)
      Configured number of backup outbound tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultBackupQuantity - the default backup quantity if not configured
      Returns:
      the outbound backup tunnel quantity
    • getTunnelVarianceOut

      public int getTunnelVarianceOut(int tunnel, int defaultVariance)
      Configured length variance allowed for outbound tunnels.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      defaultVariance - the default variance if not configured
      Returns:
      the outbound tunnel variance
    • getReduce

      public boolean getReduce(int tunnel)
      Whether the tunnel should reduce on idle.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if the tunnel should reduce on idle
    • getReduceCount

      public int getReduceCount(int tunnel)
      The reduce count for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the reduce count for the tunnel
    • getReduceTime

      public int getReduceTime(int tunnel)
      The reduce time in minutes for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the reduce time in minutes for the tunnel
    • getCert

      public int getCert(int tunnel)
      The certificate for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the certificate for the tunnel
    • getEffort

      public int getEffort(int tunnel)
      The encryption effort for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the encryption effort for the tunnel
    • getSigner

      public String getSigner(int tunnel)
      The signer for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the signer for the tunnel
    • getEncrypt

      public boolean getEncrypt(int tunnel)
      Whether encryption is enabled for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if encryption is enabled for the tunnel
    • getEncryptMode

      public String getEncryptMode(int tunnel)
      Configured encryption mode for the tunnel, as a numeric string.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the encryption mode as a string
    • getBlindedPassword

      public String getBlindedPassword(int tunnel)
      Configured blinded password used to authenticate to the tunnel peer.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the blinded password, or empty string if none
    • getClientAuths

      public List<String> getClientAuths(int tunnel, boolean isDH)
      List of b64 name : b64key Pubkeys for DH, privkeys for PSK.
      Parameters:
      tunnel - index of the tunnel in the configured list
      isDH - true for DH, false for PSK
      Returns:
      non-null
    • getSigType

      public int getSigType(int tunnel, String newTunnelType)
      Configured signature type for the tunnel's destination.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      newTunnelType - used if tunnel < 0
      Returns:
      the signature type code
    • isSigTypeAvailable

      public boolean isSigTypeAvailable(int code)
      Returns whether the given signature type is available.
      Parameters:
      code - the signature type code
      Returns:
      true if available
    • canChangeSigType

      public boolean canChangeSigType(int tunnel)
      Returns whether the tunnel signature type can be changed. The type is fixed if the tunnel has an existing destination.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the signature type can be changed
    • canChangeEncType

      public boolean canChangeEncType(int tunnel)
      Returns whether the tunnel encryption type can be changed.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the encryption type can be changed
    • canChangePort

      public boolean canChangePort(int tunnel)
      Returns whether the tunnel port setting can be changed.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if the port can be changed
    • hasEncType

      public boolean hasEncType(int tunnel, int encType)
      Returns whether the tunnel supports the specified encryption type.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      encType - the encryption type code
      Returns:
      true if the tunnel has the encryption type
    • getKey1

      public String getKey1(int tunnel)
      Returns the encrypted inbound random key, hidden in forms.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the encrypted inbound random key
    • getKey2

      public String getKey2(int tunnel)
      The encrypted outbound random key.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the encrypted outbound random key
    • getKey3

      public String getKey3(int tunnel)
      The encrypted lease set signing private key.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the encrypted lease set signing private key
    • getKey4

      public String getKey4(int tunnel)
      The encrypted lease set private key.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the encrypted lease set private key
    • getDCC

      public boolean getDCC(int tunnel)
      Whether DCC is enabled for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if DCC is enabled for the tunnel
    • getEncryptKey

      public String getEncryptKey(int tunnel)
      The encryption key for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the encryption key for the tunnel
    • getAccessMode

      public String getAccessMode(int tunnel)
      The access mode for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the access mode for the tunnel
    • getAccessList

      public String getAccessList(int tunnel)
      The access list for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the access list for the tunnel
    • getFilterDefinition

      public String getFilterDefinition(int tunnel)
      Configured peer filter definition for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      the filter definition, or empty string if none
    • getJumpList

      public String getJumpList(int tunnel)
      The jump list for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the jump list for the tunnel
    • getClose

      public boolean getClose(int tunnel)
      Whether the tunnel should close on idle.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if the tunnel should close on idle
    • getCloseTime

      public int getCloseTime(int tunnel)
      The close time in minutes for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the close time in minutes for the tunnel
    • getNewDest

      public boolean getNewDest(int tunnel)
      Whether a new destination should be created.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if a new destination should be created
    • getPersistentClientKey

      public boolean getPersistentClientKey(int tunnel)
      Whether the client key should be persistent.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if the client key should be persistent
    • getDelayOpen

      public boolean getDelayOpen(int tunnel)
      Whether the tunnel open should be delayed.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if the tunnel open should be delayed
    • getAllowUserAgent

      public boolean getAllowUserAgent(int tunnel)
      Returns whether User-Agent header passthrough is allowed.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if User-Agent passthrough is allowed
    • getAllowReferer

      public boolean getAllowReferer(int tunnel)
      Returns whether Referer header passthrough is allowed.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if Referer passthrough is allowed
    • getAllowAccept

      public boolean getAllowAccept(int tunnel)
      Returns whether Accept header passthrough is allowed.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if Accept passthrough is allowed
    • getAllowInternalSSL

      public boolean getAllowInternalSSL(int tunnel)
      Returns whether internal SSL connections are allowed.
      Parameters:
      tunnel - index of the tunnel in the configured list, or -1 for a new tunnel
      Returns:
      true if internal SSL is allowed
    • getMultihome

      public boolean getMultihome(int tunnel)
      Whether multihoming is enabled.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if multihoming is enabled
    • getUserAgents

      public String getUserAgents(int tunnel)
      The user agents string.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the user agents string
    • getProxyAuth

      public boolean getProxyAuth(int tunnel)
      Whether proxy authentication is enabled.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if proxy authentication is enabled
    • getOutproxyAuth

      public boolean getOutproxyAuth(int tunnel)
      Whether outproxy authentication is enabled.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if outproxy authentication is enabled
    • getOutproxyUsername

      public String getOutproxyUsername(int tunnel)
      The outproxy username.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the username, or empty string if none
    • getOutproxyPassword

      public String getOutproxyPassword(int tunnel)
      The outproxy password.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the password, or empty string if none
    • getSslProxies

      public String getSslProxies(int tunnel)
      The SSL proxies string.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the SSL proxies string
    • getUseOutproxyPlugin

      public boolean getUseOutproxyPlugin(int tunnel)
      Whether the outproxy plugin should be used.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if the outproxy plugin should be used
    • getOutproxyType

      public String getOutproxyType(int tunnel)
      The outproxy type.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the proxy type as configured for the tunnel
    • getLimitMinute

      public int getLimitMinute(int tunnel)
      The per-minute limit for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the per-minute limit for the tunnel
    • getLimitHour

      public int getLimitHour(int tunnel)
      The per-hour limit for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the per-hour limit for the tunnel
    • getLimitDay

      public int getLimitDay(int tunnel)
      The per-day limit for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the per-day limit for the tunnel
    • getTotalMinute

      public int getTotalMinute(int tunnel)
      The per-minute total for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the per-minute total for the tunnel
    • getTotalHour

      public int getTotalHour(int tunnel)
      The per-hour total for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the per-hour total for the tunnel
    • getTotalDay

      public int getTotalDay(int tunnel)
      The per-day total for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the per-day total for the tunnel
    • getMaxStreams

      public int getMaxStreams(int tunnel)
      The maximum number of streams for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the maximum number of streams for the tunnel
    • getPostMax

      public int getPostMax(int tunnel)
      POST limits.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the post max
    • getPostTotalMax

      public int getPostTotalMax(int tunnel)
      The POST total max for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the POST total max for the tunnel
    • getPostCheckTime

      public int getPostCheckTime(int tunnel)
      The POST check time for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the POST check time for the tunnel
    • getPostBanTime

      public int getPostBanTime(int tunnel)
      The POST ban time for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the POST ban time for the tunnel
    • getPostTotalBanTime

      public int getPostTotalBanTime(int tunnel)
      The POST total ban time for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the POST total ban time for the tunnel
    • getUniqueLocal

      public boolean getUniqueLocal(int tunnel)
      Whether unique local addresses should be used.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      true if unique local addresses should be used
    • isRouterContext

      public boolean isRouterContext()
      Whether running in router context.
      Returns:
      true if running in router context
    • interfaceSet

      public Set<String> interfaceSet()
      The set of network interfaces.
      Returns:
      the set of network interfaces
    • isAdvanced

      public boolean isAdvanced()
      Whether advanced mode is enabled.
      Returns:
      true if advanced mode is enabled
    • getI2CPHost

      public String getI2CPHost(int tunnel)
      The I2CP host for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the I2CP host for the tunnel
    • getI2CPPort

      public String getI2CPPort(int tunnel)
      The I2CP port for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the I2CP port for the tunnel
    • getCustomOptions

      public String getCustomOptions(int tunnel)
      The custom options string for the tunnel.
      Parameters:
      tunnel - index of the tunnel in the configured list
      Returns:
      the custom options string for the tunnel
    • getQuantityOptions

      public String getQuantityOptions(int tunnel, int mode)
      The quantity options for the tunnel, as HTML.
      Parameters:
      tunnel - index of the tunnel in the configured list
      mode - 0=both, 1=in, 2=out
      Returns:
      the quantity options
    • unlessAdvanced

      public String unlessAdvanced(String s)
      The translated string wrapped in parentheses, or empty in advanced mode.
      Parameters:
      s - the string to translate
      Returns:
      translated s or ""