propagate from branch 'i2p.i2p' (head 5d3776cd03c44f2a7eeb6d844eda8799e35aee99)

to branch 'i2p.i2p.str4d.i2ptunnel' (head 4c2122ea2c66216b219c66b829ff5c05f8af0157)
This commit is contained in:
str4d
2012-02-12 23:53:58 +00:00
6 changed files with 56 additions and 51 deletions

View File

@@ -900,13 +900,14 @@ public class I2PSnarkServlet extends Default {
out.write(trackerLink);
}
String encodedBaseName = urlEncode(snark.getBaseName());
// File type icon column
out.write("</td>\n<td class=\"" + rowClass + "\">");
if (isValid) {
// Link to local details page - note that trailing slash on a single-file torrent
// gets us to the details page instead of the file.
StringBuilder buf = new StringBuilder(128);
buf.append("<a href=\"").append(snark.getBaseName())
buf.append("<a href=\"").append(encodedBaseName)
.append("/\" title=\"").append(_("Torrent details"))
.append("\">");
out.write(buf.toString());
@@ -929,7 +930,7 @@ public class I2PSnarkServlet extends Default {
out.write("</td><td class=\"snarkTorrentName " + rowClass + "\">");
if (remaining == 0 || isMultiFile) {
StringBuilder buf = new StringBuilder(128);
buf.append("<a href=\"").append(snark.getBaseName());
buf.append("<a href=\"").append(encodedBaseName);
if (isMultiFile)
buf.append('/');
buf.append("\" title=\"");
@@ -1623,10 +1624,15 @@ public class I2PSnarkServlet extends Default {
private static String urlify(String s) {
StringBuilder buf = new StringBuilder(256);
// browsers seem to work without doing this but let's be strict
String link = s.replace("&", "&amp;").replace(" ", "%20");
String link = urlEncode(s);
buf.append("<a href=\"").append(link).append("\">").append(link).append("</a>");
return buf.toString();
}
/** @since 0.8.13 */
private static String urlEncode(String s) {
return s.replace("&", "&amp;").replace(" ", "%20").replace(":", "%3A").replace("/", "%2F").replace(";", "%3B");
}
private static final String DOCTYPE = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
private static final String HEADER_A = "<link href=\"";
@@ -1761,6 +1767,12 @@ public class I2PSnarkServlet extends Default {
// .append(MAGGOT).append(hex).append(':').append(hex).append("</a>");
buf.append("<br>").append(_("Torrent file")).append(": ").append(snark.getName());
buf.append("</div></th></tr>");
} else {
// shouldn't happen
buf.append("<tr><th>Not found<br>resource=\"").append(r.toString())
.append("\"<br>base=\"").append(base)
.append("\"<br>torrent=\"").append(torrentName)
.append("\"</th></tr>");
}
if (ls == null) {
// We are only showing the torrent info section
@@ -2068,7 +2080,7 @@ private static class FetchAndAdd implements Runnable {
//if (peerParam != null)
// buf.append("<input type=\"hidden\" name=\"p\" value=\"").append(peerParam).append("\" >\n");
buf.append(_("Torrent was not retrieved from {0}", urlify(_url)));
String link = _url.replace("&", "&amp;").replace(" ", "%20").replace(":", "%3A").replace("/", "%2F");
String link = urlEncode(_url);
/**** FIXME ticket #575
buf.append(" - [<a href=\"/i2psnark/?newURL=").append(link).append("#add\" >");
buf.append(_("Retry"));

View File

@@ -23,18 +23,7 @@ Debian wrapper.config to try to prevent confusion.
java -cp "$I2P/lib/i2p.jar" net.i2p.util.EepGet "$@"
--- a/installer/resources/i2prouter
+++ b/installer/resources/i2prouter
@@ -28,8 +28,8 @@
# Note that (percent)INSTALL_PATH and (percent)SYSTEM_java_io_tmpdir
# should have been replaced by the izpack installer.
# If you did not run the installer, replace them with the appropriate path.
-I2P="%INSTALL_PATH"
-I2PTEMP="%SYSTEM_java_io_tmpdir"
+I2P="/usr/share/i2p"
+I2PTEMP="/tmp"
# PORTABLE installation:
# Use the following instead.
#I2PTEMP="%INSTALL_PATH"
@@ -53,8 +53,8 @@
@@ -55,8 +55,8 @@
#RUN_AS_USER=
# Wrapper
@@ -114,46 +103,45 @@ Debian wrapper.config to try to prevent confusion.
wrapper.java.additional.4.stripquotes=TRUE
# On some IPv6 enabled systems, I2P and other network-enabled java applications
@@ -133,13 +125,7 @@
wrapper.console.loglevel=INFO
# Log file to use for wrapper output logging.
-# You may wish to change this on linux so the log is
-# preserved across OS restarts.
@@ -137,11 +129,7 @@
# NOTE: On Linux/Mac this is overridden in the i2prouter script; changes here will have no effect.
# Windows users may wish to change this to %APPDATA%\I2P\wrapper.log
# System temp directory:
-wrapper.logfile=$SYSTEM_java_io_tmpdir/wrapper.log
-# PORTABLE installation:
-# Use the following instead. I2P will find the logfile here,
-# no need for a wrapper.java.additional line too.
-#wrapper.logfile=$INSTALL_PATH/wrapper.log
+wrapper.logfile=/tmp/wrapper.log
+#wrapper.logfile=/tmp/wrapper.log
# Format of output for the log file.
# The format consists of the tokens 'L' for log level, 'P' for prefix, 'D' for thread,
@@ -205,10 +191,7 @@
# you should copy this file, change the location or file name,
# and edit the i2prouter script to change the WRAPPER_CONF setting
# to point to the new wrapper.config location.
-wrapper.java.pidfile=$SYSTEM_java_io_tmpdir/routerjvm.pid
@@ -211,11 +199,7 @@
# Linux/Mac users, do not set here, see settings in the i2prouter script.
# Directory must exist or the wrapper will fail to start.
# System temp directory:
-#wrapper.java.pidfile=$SYSTEM_java_io_tmpdir/routerjvm.pid
-# PORTABLE installation:
-# Use the following instead.
-#wrapper.java.pidfile=$INSTALL_PATH/routerjvm.pid
+wrapper.java.pidfile=/tmp/routerjvm.pid
# pid file for the service monitoring the JVM
-# pid file for the service monitoring the JVM
+#wrapper.java.pidfile=/tmp/routerjvm.pid
#
# From i2prouter:
@@ -219,10 +202,7 @@
#
# This means i2prouter looks for './i2p.pid'.
# See comments above for wrapper.java.pidfile
-wrapper.pidfile=$SYSTEM_java_io_tmpdir/i2p.pid
@@ -229,10 +213,7 @@
# Linux/Mac users, do not set here, see settings in the i2prouter script.
# Directory must exist or the wrapper will fail to start.
# System temp directory:
-#wrapper.pidfile=$SYSTEM_java_io_tmpdir/i2p.pid
-# PORTABLE installation:
-# Use the following instead.
-#wrapper.pidfile=$INSTALL_PATH/i2p.pid
+wrapper.pidfile=/tmp/i2p.pid
+#wrapper.pidfile=/tmp/i2p.pid
#********************************************************************
# Wrapper General Properties
@@ -239,30 +219,3 @@
@@ -249,30 +230,3 @@
wrapper.umask=0022
wrapper.java.umask=0022
wrapper.logfile.umask=077

View File

@@ -1,3 +1,9 @@
2012-02-10 zzz
* WorkingDir: Fix detection of migrated directory
2012-02-09 zzz
* i2psnark: Escape semicolons
2012-02-04 zzz
* Deprecate util classes used only by installer
* ProfileOrganizer: Add profileOrganizer.sameCountryBonus config

View File

@@ -41,7 +41,7 @@ APP_LONG_NAME="I2P Service"
# gettext - we look for it in the path
# fallback to echo is below, we can't set it to echo here.
GETTEXT=$(which gettext)
GETTEXT=$(which gettext > /dev/null 2>&1)
# If specified, the Wrapper will be run as the specified user.
# IMPORTANT - Make sure that the user has the required privileges to write
@@ -306,11 +306,7 @@ ANCHORFILE="$PIDDIR/$APP_NAME.anchor"
COMMANDFILE="$PIDDIR/$APP_NAME.command"
STATUSFILE="$PIDDIR/$APP_NAME.status"
JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status"
if [ $(which awk) ]; then
PIDFILE="$(awk -F'=' '/^ *wrapper\.pidfile/{print $2}' "$WRAPPER_CONF")"
else
PIDFILE="$PIDDIR/$APP_NAME.pid"
fi
PIDFILE="$PIDDIR/$APP_NAME.pid"
LOCKDIR="/var/lock/subsys"
LOCKFILE="$LOCKDIR/$APP_NAME"
pid=""
@@ -480,7 +476,7 @@ gettext() {
# Call external gettext using our own translation files.
# Don't attempt to translate via the wrapper,
# it probably isn't supported in the community edition.
if [ "X${LANG#en}" = "X$LANG" ] && [ $(which $GETTEXT) ] ; then
if [ "X${LANG#en}" = "X$LANG" ] && [ $(which $GETTEXT > /dev/null 2>&1) ] ; then
TEXTDOMAINDIR=$I2P/locale $GETTEXT -d i2prouter "$1"
if [ $? != 0 ] ; then
echo "$1"

View File

@@ -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 = 11;
public final static long BUILD = 12;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -184,20 +184,23 @@ public class WorkingDir {
/**
* Tests if <code>dir</code> has been set up as a I2P working directory.<br/>
* Returns <code>false</code> if a directory is empty, or contains nothing besides
* subdirectories named <code>plugins</code> and/or <code>logs</code>.<br/>
* Returns <code>true</code> if the directory contains something not named
* <code>plugins</code> or <code>logs</code>.</br>
* Returns <code>false</code> if a directory is empty, or contains nothing that
* is usually migrated from the base install.
* This allows to pre-install plugins before the first router start.
* @return true if already set up
*/
private static boolean isSetup(File dir) {
if (dir.isDirectory()) {
String[] files = dir.list();
if (files == null)
return false;
for (String file: files)
if (!"plugins".equals(file) && !"logs".equals(file))
return true;
String migrated[] = MIGRATE_BASE.split(",");
for (String file: files) {
for (int i = 0; i < migrated.length; i++) {
if (file.equals(migrated[i]))
return true;
}
}
}
return false;
}