diff --git a/router/java/src/net/i2p/router/admin/AdminListener.java b/apps/admin/java/src/net/i2p/router/admin/AdminListener.java
similarity index 100%
rename from router/java/src/net/i2p/router/admin/AdminListener.java
rename to apps/admin/java/src/net/i2p/router/admin/AdminListener.java
diff --git a/router/java/src/net/i2p/router/admin/AdminManager.java b/apps/admin/java/src/net/i2p/router/admin/AdminManager.java
similarity index 100%
rename from router/java/src/net/i2p/router/admin/AdminManager.java
rename to apps/admin/java/src/net/i2p/router/admin/AdminManager.java
diff --git a/router/java/src/net/i2p/router/admin/AdminRunner.java b/apps/admin/java/src/net/i2p/router/admin/AdminRunner.java
similarity index 100%
rename from router/java/src/net/i2p/router/admin/AdminRunner.java
rename to apps/admin/java/src/net/i2p/router/admin/AdminRunner.java
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java
index 68f46d204..48ec6e443 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java
@@ -20,22 +20,22 @@ public class ConfigPeerHandler extends FormHandler {
if ("Save Configuration".equals(_action)) {
_context.router().saveConfig();
addFormNotice("Settings saved - not really!!!!!");
- } else if (_action.startsWith("Shitlist")) {
+ } else if (_action.startsWith("Ban")) {
Hash h = getHash();
if (h != null) {
- _context.shitlist().shitlistRouterForever(h, "Manually shitlisted via configpeer.jsp");
- addFormNotice("Peer " + _peer + " shitlisted forever");
+ _context.shitlist().shitlistRouterForever(h, "Manually banned via configpeer.jsp");
+ addFormNotice("Peer " + _peer + " banned until restart");
return;
}
addFormError("Invalid peer");
- } else if (_action.startsWith("Unshitlist")) {
+ } else if (_action.startsWith("Unban")) {
Hash h = getHash();
if (h != null) {
if (_context.shitlist().isShitlisted(h)) {
_context.shitlist().unshitlistRouter(h);
- addFormNotice("Peer " + _peer + " unshitlisted");
+ addFormNotice("Peer " + _peer + " unbanned");
} else
- addFormNotice("Peer " + _peer + " is not currently shitlisted");
+ addFormNotice("Peer " + _peer + " is not currently banned");
return;
}
addFormError("Invalid peer");
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java
index 5216c3d58..f7aa13064 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java
@@ -6,7 +6,6 @@ import java.io.OutputStreamWriter;
import java.io.Writer;
import net.i2p.router.RouterContext;
-import net.i2p.router.admin.StatsGenerator;
public class OldConsoleHelper extends HelperBase {
public OldConsoleHelper() {}
diff --git a/router/java/src/net/i2p/router/admin/StatsGenerator.java b/apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java
similarity index 99%
rename from router/java/src/net/i2p/router/admin/StatsGenerator.java
rename to apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java
index ce7c31613..3838245f5 100644
--- a/router/java/src/net/i2p/router/admin/StatsGenerator.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java
@@ -1,4 +1,4 @@
-package net.i2p.router.admin;
+package net.i2p.router.web;
import java.io.IOException;
import java.io.Writer;
diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp
index debe2676b..cc759d936 100644
--- a/apps/routerconsole/jsp/configpeer.jsp
+++ b/apps/routerconsole/jsp/configpeer.jsp
@@ -39,12 +39,12 @@
Manual Peer Controls
Router Hash:
- Manually Shitlist / Unshitlist a Router
+ Manually Ban / Unban a Peer
Shitlisting will prevent the participation of this peer in tunnels you create.
-
-
+
+
<% if (! "".equals(peer)) { %>
<% } %>
diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp
index 71eef1de2..6be164560 100644
--- a/apps/routerconsole/jsp/summaryframe.jsp
+++ b/apps/routerconsole/jsp/summaryframe.jsp
@@ -1,15 +1,14 @@
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
-
<%
/*
* All links in the summary bar must have target="_top"
* so they don't load in the iframe
*/
%>
-
+<%@include file="css.jsp" %>
Summary Bar
<%
@@ -50,7 +49,6 @@
}
}
%>
-<%@include file="css.jsp" %>
diff --git a/apps/systray/java/src/net/i2p/apps/systray/ConfigFile.java b/apps/systray/java/src/net/i2p/apps/systray/ConfigFile.java
index 3a1a3edb4..642bea630 100644
--- a/apps/systray/java/src/net/i2p/apps/systray/ConfigFile.java
+++ b/apps/systray/java/src/net/i2p/apps/systray/ConfigFile.java
@@ -17,6 +17,10 @@ import java.util.Properties;
/**
* Simple config file handler.
*
+ * Warning - browser needs double quotes and double backslashes on Windows
+ * e.g.
+ * browser="C:\\Program Files\\Mozilla Firefox\\firefox.exe"
+ *
* @author hypercubus
*/
public class ConfigFile {
diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java
index 56528a46b..ef0b89fc2 100644
--- a/core/java/src/net/i2p/data/DataHelper.java
+++ b/core/java/src/net/i2p/data/DataHelper.java
@@ -212,6 +212,11 @@ public class DataHelper {
/**
* A more efficient Properties.load
*
+ * Some of the other differences:
+ * - This does not process or drop backslashes
+ * - '#' or ';' starts a comment line, but '!' does not
+ * - Leading whitespace is not trimmed
+ * - '=' is the only key-termination character (not ':' or whitespace)
*/
public static void loadProps(Properties props, File file) throws IOException {
loadProps(props, file, false);
diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java
index a166939b4..b50017ca5 100644
--- a/router/java/src/net/i2p/router/Blocklist.java
+++ b/router/java/src/net/i2p/router/Blocklist.java
@@ -111,7 +111,7 @@ public class Blocklist {
}
for (Iterator iter = _peerBlocklist.keySet().iterator(); iter.hasNext(); ) {
Hash peer = (Hash) iter.next();
- String reason = "Blocklisted by router hash";
+ String reason = "Banned by router hash";
String comment = (String) _peerBlocklist.get(peer);
if (comment != null)
reason = reason + ": " + comment;
@@ -659,7 +659,7 @@ public class Blocklist {
*/
public void shitlist(Hash peer) {
// Temporary reason, until the job finishes
- _context.shitlist().shitlistRouterForever(peer, "IP Blocklisted");
+ _context.shitlist().shitlistRouterForever(peer, "IP Banned");
if (! "true".equals( _context.getProperty(PROP_BLOCKLIST_DETAIL, "true")))
return;
boolean shouldRunJob;
@@ -682,7 +682,7 @@ public class Blocklist {
super(_context);
_peer = p;
}
- public String getName() { return "Shitlist Peer Forever"; }
+ public String getName() { return "Ban Peer by IP"; }
public void runJob() {
shitlistForever(_peer);
synchronized (_inProcess) {
@@ -735,7 +735,7 @@ public class Blocklist {
if (i != 3)
reason = reason + '.';
}
- reason = reason + " blocklisted by entry \"" + buf + "\"";
+ reason = reason + " banned by " + BLOCKLIST_FILE_DEFAULT + " entry \"" + buf + "\"";
if (_log.shouldLog(Log.WARN))
_log.warn("Shitlisting " + peer + " " + reason);
_context.shitlist().shitlistRouterForever(peer, reason);
@@ -755,7 +755,7 @@ public class Blocklist {
/** write directly to the stream so we don't OOM on a huge list */
public void renderStatusHTML(Writer out) throws IOException {
- out.write("
IP Blocklist
");
+ out.write("
Banned IPs
");
Set singles = new TreeSet();
singles.addAll(_singleIPBlocklist);
if (singles.size() > 0) {
diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java
index 0729211bf..bbfd6f4fc 100644
--- a/router/java/src/net/i2p/router/Router.java
+++ b/router/java/src/net/i2p/router/Router.java
@@ -771,14 +771,15 @@ public class Router {
out.flush();
}
- private static int MAX_MSG_LENGTH = 120;
+ //private static int MAX_MSG_LENGTH = 120;
private static final void appendLogMessage(StringBuilder buf, String msg) {
// disable this code for the moment because i think it
// looks ugly (on the router console)
- if (true) {
+ //if (true) {
buf.append(msg);
return;
- }
+ //}
+/******
if (msg.length() < MAX_MSG_LENGTH) {
buf.append(msg);
return;
@@ -810,9 +811,11 @@ public class Router {
newline = msg.indexOf('\n');
len = msg.length();
}
+******/
}
/** main-ish method for testing appendLogMessage */
+/******
private static final void testAppendLog() {
StringBuilder buf = new StringBuilder(1024);
Router.appendLogMessage(buf, "hi\nhow are you\nh0h0h0");
@@ -846,6 +849,7 @@ public class Router {
System.out.println("line: [" + buf.toString() + "]");
buf.setLength(0);
}
+******/
public static final int EXIT_GRACEFUL = 2;
public static final int EXIT_HARD = 3;
diff --git a/router/java/src/net/i2p/router/RouterContext.java b/router/java/src/net/i2p/router/RouterContext.java
index 6dd7282b0..467338eb2 100644
--- a/router/java/src/net/i2p/router/RouterContext.java
+++ b/router/java/src/net/i2p/router/RouterContext.java
@@ -6,7 +6,6 @@ import java.util.Properties;
import net.i2p.I2PAppContext;
import net.i2p.data.Hash;
-import net.i2p.router.admin.AdminManager;
import net.i2p.router.client.ClientManagerFacadeImpl;
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
import net.i2p.router.peermanager.Calculator;
@@ -35,7 +34,6 @@ import net.i2p.util.KeyRing;
*/
public class RouterContext extends I2PAppContext {
private Router _router;
- private AdminManager _adminManager;
private ClientManagerFacade _clientManagerFacade;
private ClientMessagePool _clientMessagePool;
private JobQueue _jobQueue;
@@ -91,7 +89,6 @@ public class RouterContext extends I2PAppContext {
return envProps;
}
public void initAll() {
- //_adminManager = new AdminManager(this);
if ("false".equals(getProperty("i2p.dummyClientFacade", "false")))
_clientManagerFacade = new ClientManagerFacadeImpl(this);
else
@@ -149,11 +146,6 @@ public class RouterContext extends I2PAppContext {
/** convenience method for querying the router's ident */
public Hash routerHash() { return _router.getRouterInfo().getIdentity().getHash(); }
- /**
- * Controls a basic admin interface
- *
- */
- public AdminManager adminManager() { return _adminManager; }
/**
* How are we coordinating clients for the router?
*/
diff --git a/router/java/src/net/i2p/router/Shitlist.java b/router/java/src/net/i2p/router/Shitlist.java
index 6f38826b3..d1307fdea 100644
--- a/router/java/src/net/i2p/router/Shitlist.java
+++ b/router/java/src/net/i2p/router/Shitlist.java
@@ -65,7 +65,7 @@ public class Shitlist {
_toUnshitlist = new ArrayList(4);
getTiming().setStartAfter(ctx.clock().now() + SHITLIST_CLEANER_START_DELAY);
}
- public String getName() { return "Cleanup shitlist"; }
+ public String getName() { return "Expire banned peers"; }
public void runJob() {
_toUnshitlist.clear();
long now = getContext().clock().now();
@@ -253,7 +253,7 @@ public class Shitlist {
public void renderStatusHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(1024);
- buf.append("
Shitlist
");
+ buf.append("
Banned Peers
");
Map
entries = new TreeMap(new HashComparator());
entries.putAll(_entries);
@@ -273,7 +273,7 @@ public class Shitlist {
buf.append("
\n");
buf.append(entry.cause);
}
- buf.append(" (unshitlist now)");
+ buf.append(" (unban now)");
buf.append("\n");
}
buf.append("\n");
diff --git a/router/java/src/net/i2p/router/StatisticsManager.java b/router/java/src/net/i2p/router/StatisticsManager.java
index eb49ae002..86b0ee113 100644
--- a/router/java/src/net/i2p/router/StatisticsManager.java
+++ b/router/java/src/net/i2p/router/StatisticsManager.java
@@ -121,7 +121,9 @@ public class StatisticsManager implements Service {
//includeRate("transport.sendProcessingTime", stats, new long[] { 60*60*1000 });
//includeRate("jobQueue.jobRunSlow", stats, new long[] { 10*60*1000l, 60*60*1000l });
//includeRate("crypto.elGamal.encrypt", stats, new long[] { 60*60*1000 });
- includeRate("tunnel.participatingTunnels", stats, new long[] { 60*60*1000 });
+ // total event count can be used to track uptime
+ boolean hideTotals = ! RouterVersion.VERSION.equals("0.7.6");
+ includeRate("tunnel.participatingTunnels", stats, new long[] { 60*60*1000 }, hideTotals);
//includeRate("tunnel.testSuccessTime", stats, new long[] { 10*60*1000l });
//includeRate("client.sendAckTime", stats, new long[] { 60*60*1000 }, true);
//includeRate("udp.sendConfirmTime", stats, new long[] { 10*60*1000 });
diff --git a/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java b/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java
index fecda29d0..65e22814d 100644
--- a/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java
+++ b/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java
@@ -138,7 +138,7 @@ class ProfileOrganizerRenderer {
}
buf.append("").append(num(prof.getIntegrationValue()));
buf.append(" | ");
- if (_context.shitlist().isShitlisted(peer)) buf.append("Shitlist");
+ if (_context.shitlist().isShitlisted(peer)) buf.append("Banned");
if (prof.getIsFailing()) buf.append(" Failing");
if (_context.commSystem().wasUnreachable(peer)) buf.append(" Unreachable");
Rate failed = prof.getTunnelHistory().getFailedRate().getRate(30*60*1000);
|