* 2005-09-29 0.6.1 released

2005-09-29  jrandom
    * Let syndie users modify their metadata.
    * Reseed the router on startup if there aren't enough peer references
      known locally.  This can be disabled by creating the file .i2pnoreseed
      in your home directory, and the existing detection and reseed handling
      on the web interface is unchanged.
This commit is contained in:
jrandom
2005-09-29 19:19:22 +00:00
committed by zzz
parent 1b8419b9b5
commit 848ead7683
13 changed files with 158 additions and 39 deletions

View File

@ -28,14 +28,19 @@ public class ReseedHandler {
if (nonce == null) return;
if (nonce.equals(System.getProperty("net.i2p.router.web.ReseedHandler.nonce")) ||
nonce.equals(System.getProperty("net.i2p.router.web.ReseedHandler.noncePrev"))) {
synchronized (_reseedRunner) {
if (_reseedRunner.isRunning()) {
return;
} else {
System.setProperty("net.i2p.router.web.ReseedHandler.reseedInProgress", "true");
I2PThread reseed = new I2PThread(_reseedRunner, "Reseed");
reseed.start();
}
requestReseed();
}
}
public static void requestReseed() {
synchronized (_reseedRunner) {
if (_reseedRunner.isRunning()) {
return;
} else {
System.setProperty("net.i2p.router.web.ReseedHandler.reseedInProgress", "true");
System.out.println("Reseeding");
I2PThread reseed = new I2PThread(_reseedRunner, "Reseed");
reseed.start();
}
}
}
@ -46,7 +51,8 @@ public class ReseedHandler {
public boolean isRunning() { return _isRunning; }
public void run() {
_isRunning = true;
reseed();
reseed(false);
System.out.println("Reseeding complete");
System.setProperty("net.i2p.router.web.ReseedHandler.reseedInProgress", "false");
_isRunning = false;
}
@ -59,7 +65,7 @@ public class ReseedHandler {
* save them into this router's netDb dir.
*
*/
private static void reseed() {
private static void reseed(boolean echoStatus) {
String seedURL = System.getProperty("i2p.reseedURL", DEFAULT_SEED_URL);
if ( (seedURL == null) || (seedURL.trim().length() <= 0) )
seedURL = DEFAULT_SEED_URL;
@ -85,10 +91,16 @@ public class ReseedHandler {
try {
fetchSeed(seedURL, (String)iter.next());
fetched++;
if (echoStatus) {
System.out.print(".");
if (fetched % 60 == 0)
System.out.println();
}
} catch (Exception e) {
errors++;
}
}
if (echoStatus) System.out.println();
} catch (Throwable t) {
I2PAppContext.getGlobalContext().logManager().getLog(ReseedHandler.class).error("Error reseeding", t);
}
@ -172,7 +184,11 @@ public class ReseedHandler {
}
public static void main(String args[]) {
reseed();
//System.out.println("Done reseeding");
if ( (args != null) && (args.length == 1) && (!Boolean.valueOf(args[0]).booleanValue()) ) {
System.out.println("Not reseeding, as requested");
return; // not reseeding on request
}
System.out.println("Reseeding");
reseed(true);
}
}

View File

@ -73,6 +73,14 @@ public class RouterConsoleRunner {
t.printStackTrace();
}
File noReseedFile = new File(new File(System.getProperty("user.home")), ".i2pnoreseed");
if (!noReseedFile.exists()) {
RouterContext ctx = (RouterContext)RouterContext.listContexts().get(0);
if (ctx.netDb().getKnownRouters() < 15) {
ReseedHandler.requestReseed();
}
}
NewsFetcher fetcher = NewsFetcher.getInstance(I2PAppContext.getGlobalContext());
I2PThread t = new I2PThread(fetcher, "NewsFetcher");
t.setDaemon(true);

View File

@ -94,7 +94,7 @@ public class UpdateHandler {
public void run() {
_isRunning = true;
update();
System.setProperty("net.i2p.router.web.ReseedHandler.updateInProgress", "false");
System.setProperty("net.i2p.router.web.UpdateHandler.updateInProgress", "false");
_isRunning = false;
}
private void update() {

View File

@ -143,6 +143,27 @@ public class BlogManager {
return info;
}
public boolean updateMetadata(User user, Hash blog, Properties opts) {
if (!user.getAuthenticated()) return false;
BlogInfo oldInfo = getArchive().getBlogInfo(blog);
if (oldInfo == null) return false;
if (!user.getBlog().equals(oldInfo.getKey().calculateHash())) return false;
int oldEdition = 0;
try {
String ed = oldInfo.getProperty("Edition");
if (ed != null)
oldEdition = Integer.parseInt(ed);
} catch (NumberFormatException nfe) {}
opts.setProperty("Edition", oldEdition + 1 + "");
BlogInfo info = new BlogInfo(oldInfo.getKey(), oldInfo.getPosters(), opts);
SigningPrivateKey key = getMyPrivateKey(oldInfo);
info.sign(_context, key);
getArchive().storeBlogInfo(info);
user.setLastMetaEntry(oldEdition+1);
saveUser(user);
return true;
}
public Archive getArchive() { return _archive; }
public File getTempDir() { return _tempDir; }

View File

@ -672,7 +672,60 @@ public class ArchiveViewerBean {
out.write(DataHelper.getUTF8("<span class=\"b_msgErr\">No such entry, or no such attachment</span>"));
}
public static void renderMetadata(Map parameters, Writer out) throws IOException {
private static String getURL(String uri, Map parameters) {
StringBuffer rv = new StringBuffer(128);
rv.append(uri);
rv.append('?');
if (parameters != null) {
for (Iterator iter = parameters.keySet().iterator(); iter.hasNext(); ) {
String key = (String)iter.next();
String vals[] = getStrings(parameters, key);
// we are already looking at the page with the given parameters, no need to further sanitize
if ( (key != null) && (vals != null) )
for (int i = 0; i < vals.length; i++)
rv.append(key).append('=').append(vals[i]).append('&');
}
}
return rv.toString();
}
private static void updateMetadata(User viewer, Map parameters, Writer out) throws IOException {
if ( (viewer == null) || (!viewer.getAuthenticated()) )
return;
String blogStr = getString(parameters, PARAM_BLOG);
if (blogStr != null) {
Hash blog = new Hash(Base64.decode(blogStr));
Archive archive = BlogManager.instance().getArchive();
BlogInfo info = archive.getBlogInfo(blog);
if (info != null) {
boolean isUser = viewer.getBlog().equals(info.getKey().calculateHash());
if (!isUser)
return;
Properties toSave = new Properties();
String existing[] = info.getProperties();
for (int i = 0; i < existing.length; i++) {
String newVal = getString(parameters, existing[i]);
if ( (newVal != null) && (newVal.length() > 0) )
toSave.setProperty(existing[i], newVal.trim());
else
toSave.setProperty(existing[i], info.getProperty(existing[i]));
}
boolean saved = BlogManager.instance().updateMetadata(viewer, blog, toSave);
if (saved)
out.write("<p><em class=\"b_msgOk\">Blog metadata saved</em></p>\n");
else
out.write("<p><em class=\"b_msgErr\">Blog metadata could not be saved</em></p>\n");
}
}
}
/**
* @param currentURI URI of the with current page without any parameters tacked on
*/
public static void renderMetadata(User viewer, String currentURI, Map parameters, Writer out) throws IOException {
if (parameters.get("action") != null) {
updateMetadata(viewer, parameters, out);
}
String blogStr = getString(parameters, PARAM_BLOG);
if (blogStr != null) {
Hash blog = new Hash(Base64.decode(blogStr));
@ -682,7 +735,12 @@ public class ArchiveViewerBean {
out.write("Blog " + blog.toBase64() + " does not exist");
return;
}
boolean isUser = ( (viewer != null) && (viewer.getAuthenticated()) && (viewer.getBlog().equals(info.getKey().calculateHash())) );
String props[] = info.getProperties();
if (isUser) {
out.write("<form action=\"" + getURL(currentURI, parameters) + "\" method=\"GET\">\n");
out.write("<input type=\"hidden\" name=\"submit_blog\" value=\"" + blog.toBase64() + "\" />\n");
}
out.write("<table class=\"b_meta\" border=\"0\">");
for (int i = 0; i < props.length; i++) {
if (props[i].equals(BlogInfo.OWNER_KEY)) {
@ -704,8 +762,15 @@ public class ArchiveViewerBean {
out.write("</td></tr>\n");
}
} else {
out.write("<tr class=\"b_metaField\"><td class=\"b_metaField\"><span class=\"b_metaField\">" + HTMLRenderer.sanitizeString(props[i])
+ ":</span></td><td class=\"b_metaValue\"><span class=\"b_metaValue\">" + HTMLRenderer.sanitizeString(info.getProperty(props[i])) + "</span></td></tr>\n");
String field = HTMLRenderer.sanitizeString(props[i]);
String val = HTMLRenderer.sanitizeString(info.getProperty(props[i]));
out.write("<tr class=\"b_metaField\"><td class=\"b_metaField\"><span class=\"b_metaField\">" + field
+ ":</span></td><td class=\"b_metaValue\"><span class=\"b_metaValue\">" + val + "</span></td></tr>\n");
if (isUser && (!field.equals("Edition")))
out.write("<tr class=\"b_metaField\"><td>&nbsp;</td><td class=\"b_metaValue\"><input type=\"text\" name=\""
+ HTMLRenderer.sanitizeTagParam(props[i]) + "\" value=\""
+ HTMLRenderer.sanitizeTagParam(info.getProperty(props[i])) + "\" size=\"40\" ></td></tr>");
}
}
List tags = BlogManager.instance().getArchive().getIndex().getBlogTags(blog);
@ -718,6 +783,8 @@ public class ArchiveViewerBean {
}
out.write("</td></tr>");
}
if (isUser)
out.write("<tr class=\"b_metaField\"><td colspan=\"2\" class=\"b_metaField\"><input type=\"submit\" name=\"action\" value=\"Save changes\" class=\"b_metaSave\" /></td></tr>\n");
out.write("</table>");
} else {
out.write("<span class=\"b_metaMsgErr\">Blog not specified</span>");

View File

@ -14,7 +14,7 @@ request.setCharacterEncoding("UTF-8");
<jsp:include page="_topnav.jsp" />
<td valign="top" align="left" rowspan="2" class="b_rightnav"><jsp:include page="_rightnav.jsp" /></td></tr>
<tr class="b_content"><td valign="top" align="left" colspan="3" class="b_content"><%
ArchiveViewerBean.renderMetadata(request.getParameterMap(), out);
ArchiveViewerBean.renderMetadata(user, request.getRequestURI(), request.getParameterMap(), out);
if (user.getAuthenticated()) {
if ("Authorize".equals(request.getParameter("action"))) {
%><span class="b_metaStatus"><%=BlogManager.instance().authorizeRemoteAccess(user, request.getParameter("password"))%></span><%

View File

@ -14,8 +14,8 @@ package net.i2p;
*
*/
public class CoreVersion {
public final static String ID = "$Revision: 1.41 $ $Date: 2005/09/02 14:10:08 $";
public final static String VERSION = "0.6.0.6";
public final static String ID = "$Revision: 1.42 $ $Date: 2005/09/17 20:29:59 $";
public final static String VERSION = "0.6.1";
public static void main(String args[]) {
System.out.println("I2P Core version: " + VERSION);

View File

@ -1,4 +1,13 @@
$Id: history.txt,v 1.268 2005/09/27 17:42:49 jrandom Exp $
$Id: history.txt,v 1.269 2005/09/28 04:17:55 jrandom Exp $
* 2005-09-29 0.6.1 released
2005-09-29 jrandom
* Let syndie users modify their metadata.
* Reseed the router on startup if there aren't enough peer references
known locally. This can be disabled by creating the file .i2pnoreseed
in your home directory, and the existing detection and reseed handling
on the web interface is unchanged.
2005-09-28 jrandom
* Fix for at least some (all?) of the wrong stream errors in the streaming

View File

@ -1,5 +1,5 @@
<i2p.news date="$Date: 2005/09/02 14:10:05 $">
<i2p.release version="0.6.0.6" date="2005/09/17" minVersion="0.6"
<i2p.news date="$Date: 2005/09/17 20:30:00 $">
<i2p.release version="0.6.1" date="2005/09/29" minVersion="0.6"
anonurl="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/i2p/i2pupdate.sud"
publicurl="http://dev.i2p.net/i2p/i2pupdate.sud"
anonannouncement="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/pipermail/i2p/2005-September/000878.html"

View File

@ -1,17 +1,18 @@
$Id: install-headless.txt,v 1.3 2004/09/29 14:38:15 jrandom Exp $
$Id: install-headless.txt,v 1.4 2004/12/21 11:32:50 jrandom Exp $
Headless I2P installation instructions
1) tar xjf i2p.tar.bz2 (you've already done this)
2) cd i2p ; vi install-headless.txt (you're doing this now)
3) sh postinstall.sh (this launches the router)
4) lynx http://localhost:7657/index.jsp (configure the router)
3) java -jar lib/reseed.jar (optional)
4) sh postinstall.sh (this launches the router)
5) lynx http://localhost:7657/index.jsp (configure the router)
If you're having trouble, swing by http://forum.i2p.net/, check the
website at http://www.i2p.net/, or get on irc://irc.freenode.net/#i2p
To run I2P explicitly:
(*nix): sh i2prouter start
(win*): I2Psvc.exe -c wrapper.config
(win*): I2P.exe
To stop the router (gracefully):
lynx http://localhost:7657/configservice.jsp ("Shutdown gracefully")

View File

@ -1,5 +1,5 @@
<i2p.news date="$Date: 2005/09/17 20:30:00 $">
<i2p.release version="0.6.0.6" date="2005/09/17" minVersion="0.6"
<i2p.news date="$Date: 2005/09/23 23:08:42 $">
<i2p.release version="0.6.1" date="2005/09/29" minVersion="0.6"
anonurl="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/i2p/i2pupdate.sud"
publicurl="http://dev.i2p.net/i2p/i2pupdate.sud"
anonannouncement="http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/pipermail/i2p/2005-September/000878.html"
@ -9,7 +9,5 @@
publicurl="http://dev.i2p.net/pipermail/i2p/2005-July/000826.html"
anonlogs="http://i2p/Nf3ab-ZFkmI-LyMt7GjgT-jfvZ3zKDl0L96pmGQXF1B82W2Bfjf0n7~288vafocjFLnQnVcmZd~-p0-Oolfo9aW2Rm-AhyqxnxyLlPBqGxsJBXjPhm1JBT4Ia8FB-VXt0BuY0fMKdAfWwN61-tj4zIcQWRxv3DFquwEf035K~Ra4SWOqiuJgTRJu7~o~DzHVljVgWIzwf8Z84cz0X33pv-mdG~~y0Bsc2qJVnYwjjR178YMcRSmNE0FVMcs6f17c6zqhMw-11qjKpY~EJfHYCx4lBWF37CD0obbWqTNUIbL~78vxqZRT3dgAgnLixog9nqTO-0Rh~NpVUZnoUi7fNR~awW5U3Cf7rU7nNEKKobLue78hjvRcWn7upHUF45QqTDuaM3yZa7OsjbcH-I909DOub2Q0Dno6vIwuA7yrysccN1sbnkwZbKlf4T6~iDdhaSLJd97QCyPOlbyUfYy9QLNExlRqKgNVJcMJRrIual~Lb1CLbnzt0uvobM57UpqSAAAA/meeting141"
publiclogs="http://www.i2p.net/meeting141" />
&#149; Thanks everyone for upgrading to 0.6.0.6 so quickly (and hope its going well for you!)<br />
&#149; Just a note regarding syndie - there's a bug in 0.6.0.6-0, so you should try syncing off
<a href="http://gloinsblog.i2p/?i2paddresshelper=~yIGbO5q5Nw5wRAtZVh57IQr-f1ygwjJGCX2gaSldFi~T45ys0CllBqI-6z-Cpzx2iHzyXyFcp3yyU-MeNcILk1y8Ukgr-~0lN2JFzUVmwPOWjoMaAuhIejCd-iliVhwpqfHbwdujO10QYuLP4i3dtcsRh7uONUOtB-w9Iq0womgMPcski07fTD94pqAAf9LyIi3piI9-Y59HGnCaZ~N~anQrRyd0rYoimltgMEqHA~sIuqYRqQtLYQmDqYcCphSgrmy9YXKFn1INLBQMcCa0JTJwujDluAnckiJ0Hic70WOpTinX8V~1FqKsq8M9N3iESN~jDiieFRgzc2KslxFrCph9jFfeU6wgQ4~mxIparIyG8CYmnp2xy1iGfipHa1ZevsARTpad0YB7xDaRCqyNzXGaTmuC0Eb2WCox5Ci7qN8N3bTKtZjD4VeFZ7tTwKGkVKif6ywVe7U8v3KmXR5K2qG74d281YrC2r3ACn0X9E2uR0AuDb3x75loyXMg00IAAAA">gloinsblog.i2p</a> or another syndie node instead of syndiemedia for the moment.<br />
&#149; There's a new 0.6.1 release out, and while its backwards compatible, upgrading is recommended! Thanks<br />
</i2p.news>

View File

@ -1,8 +1,7 @@
<p>If this is your first time running I2P, you will see a link on the left hand
side telling you to "reseed" - click that to get connected to the network (you
only need to do it if that link shows up). Within 5 minutes, you should see
the number of "Active: " peers rise, and you should see some local "destinations"
listed (if not, <a href="#trouble">see below</a>). Once those are up, you can:</p>
<p>If you've just started I2P, the Active: number on the left should start to
grow over the next few minutes and you'll see some local "destinations" listed
on the left (if not, <a href="#trouble">see below</a>). Once those show up,
you can:</p>
<ul>
<li><b>blog anonymously</b> - check out <a href="/syndie/">Syndie</a></li>
<li><b>chat anonymously</b> - fire up your own IRC client and connect to the

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.248 $ $Date: 2005/09/27 17:42:49 $";
public final static String VERSION = "0.6.0.6";
public final static long BUILD = 8;
public final static String ID = "$Revision: 1.249 $ $Date: 2005/09/28 04:17:54 $";
public final static String VERSION = "0.6.1";
public final static long BUILD = 0;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);