diff --git a/apps/routerconsole/java/src/net/i2p/router/sybil/Analysis.java b/apps/routerconsole/java/src/net/i2p/router/sybil/Analysis.java index 919f0624be..056789cdc8 100644 --- a/apps/routerconsole/java/src/net/i2p/router/sybil/Analysis.java +++ b/apps/routerconsole/java/src/net/i2p/router/sybil/Analysis.java @@ -64,9 +64,9 @@ public class Analysis extends JobImpl implements RouterApp { public static final String APP_NAME = "sybil"; public static final String PROP_FREQUENCY = "router.sybilFrequency"; public static final String PROP_THRESHOLD = "router.sybilThreshold"; - public static final String PROP_BLOCK = "router.sybilBlock.enable"; - public static final String PROP_NONFF = "router.sybilIncludeAll"; - public static final String PROP_BLOCKTIME = "router.sybilBlock.period"; + public static final String PROP_BLOCK = "router.sybilEnableBlocking"; + public static final String PROP_NONFF = "router.sybilAnalyzeAll"; + public static final String PROP_BLOCKTIME = "router.sybilBlockPeriod"; private static final long MIN_FREQUENCY = 60*60*1000L; private static final long MIN_UPTIME = 75*60*1000L; @@ -267,6 +267,20 @@ public class Analysis extends JobImpl implements RouterApp { return ris; } + /** + * All the routers, not including us + * @since 0.9.41 + */ + public List getAllRouters(Hash us) { + Set set = _context.netDb().getRouters(); + List ris = new ArrayList(set.size()); + for (RouterInfo ri : set) { + if (!ri.getIdentity().getHash().equals(us)) + ris.add(ri); + } + return ris; + } + public double getAvgMinDist(List ris) { double tot = 0; int count = 200; @@ -295,12 +309,7 @@ public class Analysis extends JobImpl implements RouterApp { return points; List ris; if (includeAll) { - Set set = _context.netDb().getRouters(); - ris = new ArrayList(set.size()); - for (RouterInfo ri : set) { - if (!ri.getIdentity().getHash().equals(us)) - ris.add(ri); - } + ris = getAllRouters(us); } else { ris = getFloodfills(us); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java index 11dbcc450c..0f413732e4 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java @@ -135,9 +135,14 @@ public class SybilRenderer { Analysis analysis = Analysis.getInstance(_context); List ris = null; if (mode != 0 && mode != 12 && mode != 13 && mode != 14 && mode != 16) { - ris = analysis.getFloodfills(us); + if (mode >= 2 && mode <= 6) { + // review all routers for family and IP analysis + ris = analysis.getAllRouters(us); + } else { + ris = analysis.getFloodfills(us); + } if (ris.isEmpty()) { - out.write("

No known floodfills

"); + out.write("

No known routers

"); return; } } @@ -565,7 +570,7 @@ public class SybilRenderer { */ private void renderIPGroupsUs(Writer out, StringBuilder buf, List ri32, List ri24, List ri16) throws IOException { - buf.append("

Floodfills close to Our IP

"); + buf.append("

Routers close to Our IP

"); boolean found = false; for (RouterInfo info : ri32) { buf.append("

"); @@ -597,7 +602,7 @@ public class SybilRenderer { * */ private void renderIPGroups32(Writer out, StringBuilder buf, Map> map) throws IOException { - buf.append("

Floodfills with the Same IP

"); + buf.append("

Routers with the Same IP

"); List foo = new ArrayList(map.keySet()); Collections.sort(foo, new FooComparator(map)); boolean found = false; @@ -610,7 +615,7 @@ public class SybilRenderer { int i2 = (i >> 8) & 0xff; int i3 = i & 0xff; String sip = i0 + "." + i1 + '.' + i2 + '.' + i3; - buf.append("

").append(count).append(" floodfills with IP ").append(count).append(" routers with IP ").append(sip) .append(":

"); for (RouterInfo info : ris) { @@ -627,7 +632,7 @@ public class SybilRenderer { * */ private void renderIPGroups24(Writer out, StringBuilder buf, Map> map) throws IOException { - buf.append("

Floodfills in the Same /24 (2 minimum)

"); + buf.append("

Routers in the Same /24 (2 minimum)

"); List foo = new ArrayList(map.keySet()); Collections.sort(foo, new FooComparator(map)); boolean found = false; @@ -639,7 +644,7 @@ public class SybilRenderer { int i1 = (i >> 8) & 0xff; int i2 = i & 0xff; String sip = i0 + "." + i1 + '.' + i2 + ".0/24"; - buf.append("

").append(count).append(" floodfills with IP ").append(count).append(" routers with IP ").append(sip) .append(":

"); for (RouterInfo info : ris) { @@ -656,7 +661,7 @@ public class SybilRenderer { * */ private void renderIPGroups16(Writer out, StringBuilder buf, Map> map) throws IOException { - buf.append("

Floodfills in the Same /16 (4 minimum)

"); + buf.append("

Routers in the Same /16 (4 minimum)

"); List foo = new ArrayList(map.keySet()); Collections.sort(foo, new FooComparator(map)); boolean found = false; @@ -668,7 +673,7 @@ public class SybilRenderer { int i1 = i & 0xff; String sip = i0 + "." + i1 + ".0.0/16"; if (buf != null) { - buf.append("

").append(count).append(" floodfills with IP ").append(count).append(" routers with IP ").append(sip) .append("

"); } @@ -686,7 +691,7 @@ public class SybilRenderer { * */ private void renderIPGroupsFamily(Writer out, StringBuilder buf, Map> map) throws IOException { - buf.append("

Floodfills in the same Family

"); + buf.append("

Routers in the same Family

"); List foo = new ArrayList(map.keySet()); Collections.sort(foo, new FoofComparator(map)); FamilyKeyCrypto fkc = _context.router().getFamilyKeyCrypto(); @@ -697,7 +702,7 @@ public class SybilRenderer { int count = list.size(); String ss = DataHelper.escapeHTML(s); if (count > 1) { - buf.append("

").append(count).append(" floodfills in family:  ").append(count).append(" routers in family:  ").append(ss).append("

"); found = true; } @@ -828,14 +833,14 @@ public class SybilRenderer { ; if (kr != null) { buf.append("

Routers: ").append(DataHelper.stripHTML(kr)).append("

"); - } else { - buf.append("

Routers: ").append(_t("n/a")).append("

"); + //} else { + // buf.append("

Routers: ").append(_t("n/a")).append("

"); } String kls = info.getOption("netdb.knownLeaseSets"); if (kls != null) { buf.append("

").append(_t("LeaseSets")).append(": ").append(DataHelper.stripHTML(kls)).append("

\n"); - } else { - buf.append("

").append(_t("LeaseSets")).append(": ").append(_t("n/a")).append("

"); + //} else { + // buf.append("

").append(_t("LeaseSets")).append(": ").append(_t("n/a")).append("

"); } String fam = info.getOption("family"); if (fam != null) { @@ -872,29 +877,29 @@ public class SybilRenderer { if (heard > 0) { long age = Math.max(now - heard, 1); buf.append("

").append(_t("Last Good Lookup")).append(": ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("

"); - } else { - buf.append("

").append(_t("Last Good Lookup")).append(": ").append(_t("n/a")).append("

"); + //} else { + // buf.append("

").append(_t("Last Good Lookup")).append(": ").append(_t("n/a")).append("

"); } heard = dbh.getLastLookupFailed(); if (heard > 0) { long age = Math.max(now - heard, 1); buf.append("

").append(_t("Last Bad Lookup")).append(": ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("

"); - } else { - buf.append("

").append(_t("Last Bad Lookup")).append(": ").append(_t("n/a")).append("

"); + //} else { + // buf.append("

").append(_t("Last Bad Lookup")).append(": ").append(_t("n/a")).append("

"); } heard = dbh.getLastStoreSuccessful(); if (heard > 0) { long age = Math.max(now - heard, 1); buf.append("

").append(_t("Last Good Store")).append(": ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("

"); - } else { - buf.append("

").append(_t("Last Good Store")).append(": ").append(_t("n/a")).append("

"); + //} else { + // buf.append("

").append(_t("Last Good Store")).append(": ").append(_t("n/a")).append("

"); } heard = dbh.getLastStoreFailed(); if (heard > 0) { long age = Math.max(now - heard, 1); buf.append("

").append(_t("Last Bad Store")).append(": ").append(_t("{0} ago", DataHelper.formatDuration2(age))).append("

"); - } else { - buf.append("

").append(_t("Last Bad Store")).append(": ").append(_t("n/a")).append("

"); + //} else { + // buf.append("

").append(_t("Last Bad Store")).append(": ").append(_t("n/a")).append("

"); } } // any other profile stuff? diff --git a/history.txt b/history.txt index 514353ec53..893dd704fb 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,26 @@ +2019-05-19 zzz + * Sybil: Run IP and family tests on all routers + +2019-05-18 zzz + * Javadoc: fixes from FreeBSD ports + * Sybil: + - Option to run on non-floodfills too + - Show routers in analysis even if no RI available + - Date format and reason text fixes + - Add link to banlist + +2019-05-15 zzz + * EepGet: Don't continue when requested a partial but didn't + get it, and the output is to a stream + * Streaming: Fix NPE in debug logging (ticket #2504) + +2019-05-14 zzz + * Util: Don't set restrictive permissions on exported certs + 2019-05-13 zzz - * Console: Hide transport table unless advanced + * Console: + - Hide transport table unless advanced + - Prevent editing a client while it's starting * Sybil: Add support for auto-blocking * Tunnels: Fix connection checker for NTCP2 diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 0725033fa6..f6e6df3a5c 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 3; + public final static long BUILD = 4; /** for example "-test" */ public final static String EXTRA = "";