Package net.i2p.i2ptunnel.web
Class IndexBean
java.lang.Object
net.i2p.i2ptunnel.web.IndexBean
- Direct Known Subclasses:
EditBean
Simple accessor for exposing tunnel info, but also an ugly form handler
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.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final I2PAppContext
protected final TunnelControllerGroup
protected final GeneralHelper
protected final Log
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
Encrypt a property using an in-memory key, for interaction with the UI only, using ChaCha20.getAltDestHashBase32
(int tunnel) Works even if tunnel is not running.protected Destination
getAltDestination
(int tunnel) Works even if tunnel is not running.getAltDestinationBase64
(int tunnel) Works even if tunnel is not running.getClientDestination
(int tunnel) getClientInterface
(int tunnel) getClientPort
(int tunnel) No validationgetClientPort2
(int tunnel) Returns error message if blank or invalidprotected TunnelController
getController
(int tunnel) getDestHashBase32
(int tunnel) Works even if tunnel is not running.protected Destination
getDestination
(int tunnel) Works even if tunnel is not running.getDestinationBase64
(int tunnel) Works even if tunnel is not running.getEncryptedBase32
(int tunnel) Works even if tunnel is not running.getInternalType
(int tunnel) boolean
getIsOfflineKeys
(int tunnel) Works even if tunnel is not running.boolean
getIsUsingOutproxyPlugin
(int tunnel) For index.jspint
The last stored message IDExecutes any action requested (start/stop/etc) and dump out the messages.static String
getServerTarget
(int tunnel) getSharedClient
(int tunnel) getSpoofedHost
(int tunnel) getTheme()
int
getTunnelDescription
(int tunnel) getTunnelName
(int tunnel) int
getTunnelStatus
(int tunnel) getTunnelType
(int tunnel) (package private) String
getType()
getTypeName
(String internalType) static boolean
do we know this nonce?boolean
isClient
(int tunnelNum) 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.static boolean
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.boolean
boolean
isRejectInproxy
(int tunnel) boolean
isRejectReferer
(int tunnel) boolean
isRejectUserAgents
(int tunnel) boolean
isServerTargetLinkValid
(int tunnel) Call this to see if it is ok to linkify getServerTarget()boolean
isSharedClient
(int tunnel) boolean
isSSLEnabled
(int tunnel) protected String
translate (ngettext)void
setAccessList
(String val) void
setAccessMode
(String val) void
void
setAddClient
(String moo) void
setAllowAccept
(String moo) void
void
setAllowReferer
(String moo) void
setAllowUserAgent
(String moo) void
setAltPrivKeyFile
(String file) What filename is this server tunnel's alternate private keys stored invoid
void
setClientHost
(String host) I2CP host the router is on, ignored when in router contextvoid
setclientKey
(String[] s) Multiple entries in formvoid
setClientport
(String port) I2CP port the router is on, ignored when in router contextvoid
void
setCloseTime
(String val) void
setConnectDelay
(String moo) void
void
setDelayOpen
(String moo) void
params needed for hashcash and dest modificationvoid
setEncrypt
(String moo) void
setEncryptKey
(String val) void
setEncryptMode
(String val) void
setEncType
(String s) Adds to existing, comma separatedvoid
void
setJumpList
(String val) void
Random keys, hidden in formsvoid
void
void
void
void
void
void
void
void
setMultihome
(String moo) void
Short name of the tunnelvoid
void
setNewDest
(String val) void
void
Multiple entries in formvoid
setNofilter_customOptions
(String customOptions) what I2P session overrides should be usedvoid
setNofilter_description
(String description) one line descriptionvoid
void
void
void
void
void
void
void
what port should this client/httpclient/ircclient listen onvoid
void
void
setPostMax
(String s) POST limitsvoid
void
void
setPrivKeyFile
(String file) What filename is this server tunnel's private keys stored invoid
setProfile
(String profile) void
all proxy auth @since 0.8.2void
setProxyList
(String proxyList) what HTTP outproxies should be used (httpclient specific)void
void
setReachableBy
(String reachableBy) what interface should this client/httpclient/ircclient listen onvoid
void
setReduceCount
(String val) void
setReduceTime
(String val) void
setRejectInproxy
(String moo) void
setRejectReferer
(String moo) void
void
setRemoveConfirm
(String moo) If called with any value (and the form submitted with action=Remove), we really do want to stop and remove the tunnel.void
setRevokeClient
(String[] s) Multiple entries in form Values are integersvoid
setShared
(boolean val) void
void
void
setSigType
(String val) void
setSpoofedHost
(String host) What host does this http server tunnel spoofvoid
void
setStartOnLoad
(String moo) If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up)void
setTargetDestination
(String dest) What peer does this client tunnel point atvoid
setTargetHost
(String host) What host does this server tunnel point atvoid
setTargetPort
(String port) What port does this server tunnel point atvoid
void
void
void
void
setTunnelBackupQuantity
(String tunnelBackupQuantity) how many tunnels to hold in reserve to guard against failures In or both in/outvoid
setTunnelBackupQuantityOut
(String tunnelBackupQuantity) how many outbound tunnels to hold in reserve to guard against failuresvoid
setTunnelDepth
(String tunnelDepth) how many hops to use for inbound tunnels In or both in/outvoid
setTunnelDepthOut
(String tunnelDepth) how many hops to use for outbound tunnelsvoid
setTunnelQuantity
(String tunnelQuantity) how many parallel inbound tunnels to use In or both in/outvoid
setTunnelQuantityOut
(String tunnelQuantity) how many parallel outbound tunnels to usevoid
setTunnelVariance
(String tunnelVariance) how much randomisation to apply to the depth of tunnels In or both in/outvoid
setTunnelVarianceOut
(String tunnelVariance) how much randomisation to apply to the depth of outbound tunnelsvoid
What type of tunnel (httpclient, ircclient, client, or server).void
setUniqueLocal
(String moo) void
void
setUserAgents
(String agents) void
-
Field Details
-
_context
-
_log
-
_group
-
_helper
-
RUNNING
public static final int RUNNING- See Also:
-
STARTING
public static final int STARTING- See Also:
-
NOT_RUNNING
public static final int NOT_RUNNING- See Also:
-
STANDBY
public static final int STANDBY- See Also:
-
-
Constructor Details
-
IndexBean
public IndexBean()
-
-
Method Details
-
isInitialized
public boolean isInitialized()- Since:
- 0.9.4
-
getNextNonce
-
setNonce
-
haveNonce
do we know this nonce?- Since:
- 0.8.1 public since 0.9.35
-
setAction
-
setTunnel
-
setMsgid
- Since:
- 0.9.33
-
getMessages
Executes any action requested (start/stop/etc) and dump out the messages. Only call this ONCE! Or you will get duplicate tunnels on save.- Returns:
- HTML escaped or "" if empty
-
getLastMessageID
public int getLastMessageID()The last stored message ID- Since:
- 0.9.33
-
getTheme
-
getTunnelCount
public int getTunnelCount() -
isClient
public boolean isClient(int tunnelNum) 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. -
isClient
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. -
getTunnelName
-
getClientPort
No validation -
getClientPort2
Returns error message if blank or invalid- Since:
- 0.9.3
-
getTunnelType
-
getTypeName
-
getInternalType
-
getClientInterface
-
getTunnelStatus
public int getTunnelStatus(int tunnel) -
getTunnelDescription
-
getClientDestination
-
isServerTargetLinkValid
public boolean isServerTargetLinkValid(int tunnel) Call this to see if it is ok to linkify getServerTarget()- Since:
- 0.8.3
-
getServerTarget
- Returns:
- valid host:port only if isServerTargetLinkValid() is true
-
getDestination
Works even if tunnel is not running.- Returns:
- Destination or null
- Since:
- 0.9.17
-
getDestinationBase64
Works even if tunnel is not running.- Returns:
- Base64 or ""
-
getDestHashBase32
Works even if tunnel is not running.- Returns:
- "{52 chars}.b32.i2p" or ""
-
getEncryptedBase32
Works even if tunnel is not running.- Returns:
- "{56 chars}.b32.i2p" or "" if not blinded
- Since:
- 0.9.40
-
getAltDestination
Works even if tunnel is not running.- Returns:
- Destination or null
- Since:
- 0.9.30
-
getAltDestinationBase64
Works even if tunnel is not running.- Returns:
- Base64 or ""
- Since:
- 0.9.30
-
getAltDestHashBase32
Works even if tunnel is not running.- Returns:
- "{52 chars}.b32.i2p" or ""
- Since:
- 0.9.30
-
getIsOfflineKeys
public boolean getIsOfflineKeys(int tunnel) Works even if tunnel is not running.- Returns:
- true if offline keys
- Since:
- 0.9.40
-
getIsUsingOutproxyPlugin
public boolean getIsUsingOutproxyPlugin(int tunnel) For index.jsp- Returns:
- true if the plugin is enabled, installed, and running
- Since:
- 0.9.11
-
getSpoofedHost
- Since:
- 0.9.32 moved from EditBean
-
setType
What type of tunnel (httpclient, ircclient, client, or server). This is required when adding a new tunnel. -
getType
String getType() -
setName
Short name of the tunnel -
setNofilter_description
one line description -
setClientHost
I2CP host the router is on, ignored when in router context -
setClientport
I2CP port the router is on, ignored when in router context -
setTunnelDepth
how many hops to use for inbound tunnels In or both in/out -
setTunnelQuantity
how many parallel inbound tunnels to use In or both in/out -
setTunnelVariance
how much randomisation to apply to the depth of tunnels In or both in/out -
setTunnelBackupQuantity
how many tunnels to hold in reserve to guard against failures In or both in/out -
setTunnelDepthOut
how many hops to use for outbound tunnels- Since:
- 0.9.33
-
setTunnelQuantityOut
how many parallel outbound tunnels to use- Since:
- 0.9.33
-
setTunnelVarianceOut
how much randomisation to apply to the depth of outbound tunnels- Since:
- 0.9.33
-
setTunnelBackupQuantityOut
how many outbound tunnels to hold in reserve to guard against failures- Since:
- 0.9.33
-
setNofilter_customOptions
what I2P session overrides should be used -
setProxyList
what HTTP outproxies should be used (httpclient specific) -
setPort
what port should this client/httpclient/ircclient listen on -
setReachableBy
what interface should this client/httpclient/ircclient listen on -
setTargetDestination
What peer does this client tunnel point at -
setTargetHost
What host does this server tunnel point at -
setTargetPort
What port does this server tunnel point at -
setSpoofedHost
What host does this http server tunnel spoof -
setPrivKeyFile
What filename is this server tunnel's private keys stored in -
setAltPrivKeyFile
What filename is this server tunnel's alternate private keys stored in- Since:
- 0.9.30
-
setRemoveConfirm
If called with any value (and the form submitted with action=Remove), we really do want to stop and remove the tunnel. -
setStartOnLoad
If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up) -
setConnectDelay
-
setProfile
-
setReduce
-
setClose
-
setEncrypt
-
setEncryptMode
- Since:
- 0.9.40
-
setNofilter_blindedPassword
- Since:
- 0.9.40
-
setNofilter_clientName
Multiple entries in form- Since:
- 0.9.41
-
setclientKey
Multiple entries in form- Since:
- 0.9.41
-
setRevokeClient
Multiple entries in form Values are integers- Since:
- 0.9.41
-
setNofilter_newClientName
- Since:
- 0.9.41
-
setNewClientKey
- Since:
- 0.9.41
-
setAddClient
- Since:
- 0.9.41
-
setDCC
- Since:
- 0.8.9
-
setUseSSL
- Since:
- 0.9.9
-
isSSLEnabled
public boolean isSSLEnabled(int tunnel) - Since:
- 0.9.9
-
setRejectInproxy
- Since:
- 0.9.12
-
isRejectInproxy
public boolean isRejectInproxy(int tunnel) - Since:
- 0.9.12
-
setRejectReferer
- Since:
- 0.9.25
-
isRejectReferer
public boolean isRejectReferer(int tunnel) - Since:
- 0.9.25
-
setRejectUserAgents
- Since:
- 0.9.25
-
isRejectUserAgents
public boolean isRejectUserAgents(int tunnel) - Since:
- 0.9.25
-
setUserAgents
- Since:
- 0.9.25
-
setUniqueLocal
- Since:
- 0.9.13
-
setAccessMode
-
setFilterDefinition
- Since:
- 0.9.40
-
setDelayOpen
-
setNewDest
-
setReduceTime
-
setReduceCount
-
setEncryptKey
-
setAccessList
-
setJumpList
-
setCloseTime
-
setAllowUserAgent
- Since:
- 0.9.14
-
setAllowReferer
- Since:
- 0.9.14
-
setAllowAccept
- Since:
- 0.9.14
-
setAllowInternalSSL
- Since:
- 0.9.14
-
setMultihome
- Since:
- 0.9.18
-
setProxyAuth
all proxy auth @since 0.8.2 -
setProxyUsername
-
setNofilter_proxyPassword
-
setOutproxyAuth
-
setOutproxyUsername
-
setNofilter_outproxyPassword
-
setSslProxies
- Since:
- 0.9.11
-
setUseOutproxyPlugin
- Since:
- 0.9.11
-
setOutproxyType
- Parameters:
s
- "connect" or "socks"- Since:
- 0.9.57
-
setLimitMinute
-
setLimitHour
-
setLimitDay
-
setTotalMinute
-
setTotalHour
-
setTotalDay
-
setMaxStreams
-
setPostMax
POST limits- Since:
- 0.9.9
-
setPostTotalMax
-
setPostCheckTime
-
setPostBanTime
-
setPostTotalBanTime
-
setEffort
params needed for hashcash and dest modification -
setCert
-
setSigner
-
setSigType
- Since:
- 0.9.12
-
setEncType
Adds to existing, comma separated- Since:
- 0.9.44
-
setKey1
Random keys, hidden in forms- Since:
- 0.9.18
-
setKey2
-
setKey3
-
setKey4
-
encrypt
Encrypt a property using an in-memory key, for interaction with the UI only, using ChaCha20. IV is SHA256(k). These are transient keys by design, but are persisted to hide restarts. They are hidden inputs in the edit form. Storage in config files is not encrypted.- Parameters:
k
- non-nullv
- may be empty or null- Returns:
- Base64, or empty, or null
- Since:
- 0.9.46
-
getController
-
_t
-
ngettext
translate (ngettext)- Since:
- 0.9.7
-