* config.jsp: Add some reachability help

* configpeer.jsp: Add blocklist info
    * help.jsp: Add link to German FAQ
    * tunnels.jsp: Fix inactive participating count
This commit is contained in:
zzz
2008-09-23 18:48:59 +00:00
parent fbad8a1e8e
commit 52d38e0452
8 changed files with 112 additions and 9 deletions

View File

@ -1,5 +1,9 @@
package net.i2p.router.web;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import net.i2p.data.DataHelper;
import net.i2p.router.RouterContext;
@ -21,4 +25,13 @@ public class ConfigPeerHelper {
public ConfigPeerHelper() {}
public String getBlocklistSummary() {
ByteArrayOutputStream baos = new ByteArrayOutputStream(4*1024);
try {
_context.blocklist().renderStatusHTML(new OutputStreamWriter(baos));
} catch (IOException ioe) {
ioe.printStackTrace();
}
return new String(baos.toByteArray());
}
}

View File

@ -105,6 +105,41 @@
<p><b>Note: changing any of these settings will terminate all of your connections and effectively
restart your router.</b>
<hr />
<b>Reachability Help: </b>
<p>
While I2P will work adequately behind a firewall, your speeds and network integration will generally improve
if you open up your port (generally 8887) to both UDP and TCP, and enable inbound TCP above.
If you think you have opened up your firewall and I2P still thinks you are firewalled, remember
that you may have multiple firewalls, for example both software packages and external hardware routers.
<ul>
<li><b>OK</b> - Your UDP port does not appear to be firewalled.
<li><b>Firewalled</b> - Your UDP port appears to be firewalled.
As the firewall detection methods are not 100% reliable, this may occasionally be displayed in error.
However, if it appears consistently, you should check whether both your external and internal
firewalls are open on port 8887.
<li><b>Testing</b> - The router is currently testing whether your UDP port is firewalled.
<li><b>WARN - Firewalled and Fast</b> - You have configured I2P to share more than 128KBps of bandwidth,
but you are firewalled. While I2P will work fine in this configuration, if you really have
over 128KBps of bandwidth to share, it will be much more helpful to the network if
you open your firewall.
<li><b>WARN - Firewalled and Floodfill</b> - You have configured I2P to be a floodfill router, but
you are firewalled. For best participation as a floodfill router, you should open your firewall.
<li><b>WARN - Firewalled with Inbound TCP Enabled</b> - You have configured inbound TCP, however
your UDP port is firewalled, and therefore it is likely that your TCP port is firewalled as well.
If your TCP port is firewalled with inbound TCP enabled, routers will not be able to contact
you via TCP, which will hurt the network. Please open your firewall or disable inbound TCP above.
<li><b>ERR - Private TCP Address</b> - You must never advertise an unroutable IP address such as
127.0.0.1 or 192.168.1.1 as your external address. Correct the address or disable inbound TCP above.
<li><b>ERR - SymmetricNAT</b> - I2P detected that you are firewalled by a Symmetric NAT.
I2P does not work behind this type of firewall.
<li><b>ERR - UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart</b> -
I2P was unable to bind to port 8887 or other configured port.
Check to see if another program is using port 8887. If so, stop that program or configure
I2P to use a different port. This may be a transient error, if the other program is no longer
using the port. However, a restart is always required after this error.
</ul>
</p>
<hr />
<!--
<b>Dynamic Router Keys: </b>
<input type="checkbox" name="dynamicKeys" value="true" <jsp:getProperty name="nethelper" property="dynamicKeysChecked" /> /><br />

View File

@ -75,6 +75,8 @@
<jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" />
<jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<jsp:getProperty name="profilesHelper" property="shitlistSummary" />
<hr />
<jsp:getProperty name="peerhelper" property="blocklistSummary" />
</div>

View File

@ -13,7 +13,9 @@
<div class="main" id="main">
<h2>Help</h2>
Sorry, there's no help text here yet, so check out the
<a href="http://www.i2p2.i2p/faq.html">FAQ on www.i2p2.i2p</a>.
<a href="http://www.i2p2.i2p/faq.html">FAQ on www.i2p2.i2p</a>
or the
<a href="http://www.i2p2.i2p/faq_de.html">Deutsch FAQ</a>.
<br />
<h2>Legal stuff</h2>

View File

@ -1,3 +1,11 @@
2008-09-23 zzz
* config.jsp: Add some reachability help
* configpeer.jsp: Add blocklist info
* help.jsp: Add link to German FAQ
* tunnels.jsp: Fix inactive participating count
* SearchReplyJob: Don't look up references to shitlisted peers
* TunnelPeerSelector: Avoid a peer for 20s after a reject or timeout
2008-09-20 zzz
* NetDb: Fix the totally broken "check new routers against blocklist"
code from 3 checkins ago

View File

@ -631,7 +631,7 @@ public class Blocklist {
}
private String toStr(long entry) {
StringBuffer buf = new StringBuffer(128);
StringBuffer buf = new StringBuffer(32);
for (int i = 7; i >= 0; i--) {
buf.append((entry >> (8*i)) & 0xff);
if (i == 4)
@ -642,6 +642,16 @@ public class Blocklist {
return buf.toString();
}
private String toStr(int ip) {
StringBuffer buf = new StringBuffer(16);
for (int i = 3; i >= 0; i--) {
buf.append((ip >> (8*i)) & 0xff);
if (i > 0)
buf.append('.');
}
return buf.toString();
}
/**
* We don't keep the comment field in-memory,
* so we have to go back out to the file to find it.
@ -744,6 +754,40 @@ public class Blocklist {
// We already shitlisted in shitlist(peer), that's good enough
}
public void renderStatusHTML(Writer out) throws IOException {
StringBuffer buf = new StringBuffer(1024);
buf.append("<h2>IP Blocklist</h2>");
Set singles = new TreeSet();
synchronized(_singleIPBlocklist) {
singles.addAll(_singleIPBlocklist);
}
if (singles.size() > 0) {
buf.append("<table><tr><td><b>Transient IPs</b></td></tr>");
for (Iterator iter = singles.iterator(); iter.hasNext(); ) {
int ip = ((Integer) iter.next()).intValue();
buf.append("<tr><td>").append(toStr(ip)).append("</td></tr>\n");
}
buf.append("</table>");
}
if (_blocklistSize > 0) {
buf.append("<table><tr><td align=center colspan=2><b>IPs from Blocklist File</b></td></tr><tr><td align=center><b>From</b></td><td align=center><b>To</b></td></tr>");
for (int i = 0; i < _blocklistSize; i++) {
int from = getFrom(_blocklist[i]);
buf.append("<tr><td align=right>").append(toStr(from)).append("</td><td align=right>");
int to = getTo(_blocklist[i]);
if (to != from)
buf.append(toStr(to)).append("</td></tr>\n");
else
buf.append("&nbsp</td></tr>\n");
}
buf.append("</table>");
} else {
buf.append("<br>No blocklist file entries");
}
out.write(buf.toString());
out.flush();
}
public static void main(String args[]) {
Blocklist b = new Blocklist();
if ( (args != null) && (args.length == 1) )

View File

@ -17,7 +17,7 @@ import net.i2p.CoreVersion;
public class RouterVersion {
public final static String ID = "$Revision: 1.548 $ $Date: 2008-06-07 23:00:00 $";
public final static String VERSION = "0.6.3";
public final static long BUILD = 8;
public final static long BUILD = 9;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -3,13 +3,12 @@ package net.i2p.router.tunnel.pool;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import net.i2p.data.DataHelper;
import net.i2p.data.Destination;
@ -447,8 +446,8 @@ public class TunnelPoolManager implements TunnelManagerFacade {
renderPool(out, in, outPool);
}
Set participating = new TreeSet(new TunnelComparator());
participating.addAll(_context.tunnelDispatcher().listParticipatingTunnels());
List participating = _context.tunnelDispatcher().listParticipatingTunnels();
Collections.sort(participating, new TunnelComparator());
out.write("<h2><a name=\"participating\">Participating tunnels</a>:</h2><table border=\"1\">\n");
out.write("<tr><td><b>Receive on</b></td><td><b>From</b></td><td>"
+ "<b>Send on</b></td><td><b>To</b></td><td><b>Expiration</b></td>"
@ -458,8 +457,8 @@ public class TunnelPoolManager implements TunnelManagerFacade {
if (rs != null)
processed = (long)rs.getRate(10*60*1000).getLifetimeTotalValue();
int inactive = 0;
for (Iterator iter = participating.iterator(); iter.hasNext(); ) {
HopConfig cfg = (HopConfig)iter.next();
for (int i = 0; i < participating.size(); i++) {
HopConfig cfg = (HopConfig)participating.get(i);
if (cfg.getProcessedMessagesCount() <= 0) {
inactive++;
continue;