2008-06-09 zzz

* Reachability: Restrict peers with no SSU address at all from inbound tunnels
    * News:
      - Add display of last updated and last checked time
        on index.jsp and configupdate.jsp
      - Add a function to get update version (unused for now)
    * config.jsp: Add another warning
This commit is contained in:
zzz
2008-06-09 13:14:52 +00:00
parent f3b8c73e96
commit 2404078bfa
8 changed files with 44 additions and 3 deletions

View File

@ -119,4 +119,12 @@ public class ConfigUpdateHelper {
public String getTrustedKeys() { public String getTrustedKeys() {
return new TrustedUpdate(_context).getTrustedKeysString(); return new TrustedUpdate(_context).getTrustedKeysString();
} }
public String getNewsStatus() {
return NewsFetcher.getInstance(_context).status();
}
public String getUpdateVersion() {
return NewsFetcher.getInstance(_context).updateVersion();
}
} }

View File

@ -25,6 +25,8 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
private Log _log; private Log _log;
private boolean _updateAvailable; private boolean _updateAvailable;
private long _lastFetch; private long _lastFetch;
private long _lastUpdated;
private String _updateVersion;
private String _lastModified; private String _lastModified;
private static NewsFetcher _instance; private static NewsFetcher _instance;
//public static final synchronized NewsFetcher getInstance() { return _instance; } //public static final synchronized NewsFetcher getInstance() { return _instance; }
@ -44,6 +46,8 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
_instance = this; _instance = this;
_lastFetch = 0; _lastFetch = 0;
updateLastFetched(); updateLastFetched();
_lastUpdated = _lastFetch;
_updateVersion = "";
} }
private void updateLastFetched() { private void updateLastFetched() {
@ -56,6 +60,14 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
} }
public boolean updateAvailable() { return _updateAvailable; } public boolean updateAvailable() { return _updateAvailable; }
public String updateVersion() { return _updateVersion; }
public String status() {
long now = _context.clock().now();
return
(_lastUpdated > 0 ? "News last updated " + DataHelper.formatDuration(now - _lastUpdated) + " ago" : "") +
(_lastFetch > _lastUpdated ? ", last checked " + DataHelper.formatDuration(now - _lastFetch) + " ago" : "");
}
public void run() { public void run() {
try { Thread.sleep(_context.random().nextLong(5*60*1000)); } catch (InterruptedException ie) {} try { Thread.sleep(_context.random().nextLong(5*60*1000)); } catch (InterruptedException ie) {}
@ -146,6 +158,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
if (TrustedUpdate.needsUpdate(RouterVersion.VERSION, ver)) { if (TrustedUpdate.needsUpdate(RouterVersion.VERSION, ver)) {
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("Our version is out of date, update!"); _log.debug("Our version is out of date, update!");
_updateVersion = ver;
break; break;
} else { } else {
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))

View File

@ -93,6 +93,10 @@
OR use the same port configured for SSU OR use the same port configured for SSU
(currently <jsp:getProperty name="nethelper" property="udpPort" />)? (currently <jsp:getProperty name="nethelper" property="udpPort" />)?
<input type="checkbox" name="ntcpAutoPort" value="true" <jsp:getProperty name="nethelper" property="tcpAutoPortChecked" /> /><br /> <input type="checkbox" name="ntcpAutoPort" value="true" <jsp:getProperty name="nethelper" property="tcpAutoPortChecked" /> /><br />
<p>A hostname entered here will be published in the network database.
It is <b>not private</b>.
Also, <b>do not enter a private IP address</b> like 127.0.0.1 or 192.168.1.1.
</p>
<p>You do <i>not</i> need to allow inbound TCP connections - outbound connections work with no <p>You do <i>not</i> need to allow inbound TCP connections - outbound connections work with no
configuration. However, if you want to receive inbound TCP connections, you <b>must</b> poke a hole configuration. However, if you want to receive inbound TCP connections, you <b>must</b> poke a hole
in your NAT or firewall for unsolicited TCP connections. If you specify the wrong IP address or in your NAT or firewall for unsolicited TCP connections. If you specify the wrong IP address or

View File

@ -22,6 +22,7 @@
<jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" /> <jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" />
<jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<br /><i><jsp:getProperty name="updatehelper" property="newsStatus" /></i><br />&nbsp;<br />
<form action="configupdate.jsp" method="POST"> <form action="configupdate.jsp" method="POST">
<% String prev = System.getProperty("net.i2p.router.web.ConfigUpdateHandler.nonce"); <% String prev = System.getProperty("net.i2p.router.web.ConfigUpdateHandler.nonce");
if (prev != null) System.setProperty("net.i2p.router.web.ConfigUpdateHandler.noncePrev", prev); if (prev != null) System.setProperty("net.i2p.router.web.ConfigUpdateHandler.noncePrev", prev);

View File

@ -21,6 +21,10 @@ if (System.getProperty("router.consoleNonce") == null) {
<jsp:setProperty name="newshelper" property="page" value="docs/news.xml" /> <jsp:setProperty name="newshelper" property="page" value="docs/news.xml" />
<jsp:setProperty name="newshelper" property="maxLines" value="300" /> <jsp:setProperty name="newshelper" property="maxLines" value="300" />
<jsp:getProperty name="newshelper" property="content" /> <jsp:getProperty name="newshelper" property="content" />
<jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" />
<jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<br /><i><font size="-1"><jsp:getProperty name="updatehelper" property="newsStatus" /></font></i><br />
</div> </div>
<div class="main" id="main"> <div class="main" id="main">

View File

@ -1,9 +1,16 @@
2008-06-09 zzz
* Reachability: Restrict peers with no SSU address at all from inbound tunnels
* News:
- Add display of last updated and last checked time
on index.jsp and configupdate.jsp
- Add a function to get update version (unused for now)
* config.jsp: Add another warning
2008-06-07 zzz 2008-06-07 zzz
* NetDb: Tweak some logging on lease problems * NetDb: Tweak some logging on lease problems
* Shitlist: * Shitlist:
- Add shitlistForever() and isShitlistedForever(), unused for now - Add shitlistForever() and isShitlistedForever(), unused for now
- Sort the HTML output by router hash - Sort the HTML output by router hash
* config.jsp: Add another warning
* netdb.jsp: * netdb.jsp:
- Sort the lease HTML output by dest hash, local first - Sort the lease HTML output by dest hash, local first
- Sort the router HTML output by router hash - Sort the router HTML output by router hash

View File

@ -17,7 +17,7 @@ import net.i2p.CoreVersion;
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $"; public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $";
public final static String VERSION = "0.6.1.33"; public final static String VERSION = "0.6.1.33";
public final static long BUILD = 2004; public final static long BUILD = 2005;
public static void main(String args[]) { public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID); System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -459,7 +459,11 @@ public class ProfileOrganizer {
l.add(peer); l.add(peer);
else { else {
RouterAddress ra = info.getTargetAddress("SSU"); RouterAddress ra = info.getTargetAddress("SSU");
if (ra == null) continue; // Definitely don't want peers with no SSU address at all
if (ra == null) {
l.add(peer);
continue;
}
// This is the quick way of doing UDPAddress.getIntroducerCount() > 0 // This is the quick way of doing UDPAddress.getIntroducerCount() > 0
Properties props = ra.getOptions(); Properties props = ra.getOptions();
if (props != null && props.getProperty("ihost0") != null) if (props != null && props.getProperty("ihost0") != null)