From 8de560981709863847cfc90755de697a3d56dc40 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 3 Apr 2009 21:42:48 +0000 Subject: [PATCH] * Update: - Change default to "Download and verify" - Change news fetch default to 24h (was 12h) --- .../src/net/i2p/router/web/ConfigUpdateHandler.java | 4 ++-- .../java/src/net/i2p/router/web/UpdateHandler.java | 2 ++ core/java/src/net/i2p/crypto/TrustedUpdate.java | 13 +++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java index 818b748a7..3c6e1692c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java @@ -21,9 +21,9 @@ public class ConfigUpdateHandler extends FormHandler { // public static final String DEFAULT_NEWS_URL = "http://dev.i2p.net/cgi-bin/cvsweb.cgi/i2p/news.xml?rev=HEAD"; public static final String DEFAULT_NEWS_URL = "http://complication.i2p/news.xml"; public static final String PROP_REFRESH_FREQUENCY = "router.newsRefreshFrequency"; - public static final String DEFAULT_REFRESH_FREQUENCY = 12*60*60*1000 + ""; + public static final String DEFAULT_REFRESH_FREQUENCY = 24*60*60*1000 + ""; public static final String PROP_UPDATE_POLICY = "router.updatePolicy"; - public static final String DEFAULT_UPDATE_POLICY = "notify"; + public static final String DEFAULT_UPDATE_POLICY = "download"; public static final String PROP_SHOULD_PROXY = "router.updateThroughProxy"; public static final String DEFAULT_SHOULD_PROXY = Boolean.TRUE.toString(); public static final String PROP_PROXY_HOST = "router.updateProxyHost"; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java index 83495f33e..81f8d6e8d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java @@ -166,6 +166,8 @@ public class UpdateHandler { } else { _log.log(Log.CRIT, "Update was VERIFIED, will be installed at next restart"); _status = "Update downloaded
Click Restart to Install"; + if (up.newVersion() != null) + _status += " Version " + up.newVersion(); } } else { err = err + " from " + url; diff --git a/core/java/src/net/i2p/crypto/TrustedUpdate.java b/core/java/src/net/i2p/crypto/TrustedUpdate.java index dfd055382..06e37544b 100644 --- a/core/java/src/net/i2p/crypto/TrustedUpdate.java +++ b/core/java/src/net/i2p/crypto/TrustedUpdate.java @@ -108,6 +108,7 @@ D8usM7Dxp5yrDrCYZ5AIijc= private Log _log; private ArrayList _trustedKeys; + private String _newVersion; /** * Constructs a new TrustedUpdate with the default global @@ -127,6 +128,7 @@ D8usM7Dxp5yrDrCYZ5AIijc= _context = context; _log = _context.logManager().getLog(TrustedUpdate.class); _trustedKeys = new ArrayList(); + _newVersion = null; String propertyTrustedKeys = context.getProperty(PROP_TRUSTED_KEYS); @@ -379,6 +381,11 @@ D8usM7Dxp5yrDrCYZ5AIijc= } } + /** version in the .sud file, valid only after calling migrateVerified() */ + public String newVersion() { + return _newVersion; + } + /** * Verifies that the version of the given signed update file is newer than * currentVersion. @@ -390,10 +397,8 @@ D8usM7Dxp5yrDrCYZ5AIijc= * than the current version, otherwise false. */ public boolean isUpdatedVersion(String currentVersion, String signedFile) { - if (needsUpdate(currentVersion, getVersionString(signedFile))) - return true; - else - return false; + _newVersion = getVersionString(signedFile); + return needsUpdate(currentVersion, getVersionString(signedFile)); } /**