forked from I2P_Developers/i2p.i2p
* i2ptunnel:
- Better privkey backup file name - Revert increment of privkey tunnel name - Move deleted privkeys to backup dir - Fix jsp build dependencies - Fix layout issue on Chrome (ticket #757)
This commit is contained in:
@@ -179,6 +179,7 @@
|
|||||||
<pathelement location="${ant.home}/lib/ant.jar" />
|
<pathelement location="${ant.home}/lib/ant.jar" />
|
||||||
<pathelement location="build/i2ptunnel.jar" />
|
<pathelement location="build/i2ptunnel.jar" />
|
||||||
<pathelement location="build/temp-beans.jar" />
|
<pathelement location="build/temp-beans.jar" />
|
||||||
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||||
</classpath>
|
</classpath>
|
||||||
<arg value="-d" />
|
<arg value="-d" />
|
||||||
<arg value="../jsp/WEB-INF/classes" />
|
<arg value="../jsp/WEB-INF/classes" />
|
||||||
@@ -202,6 +203,7 @@
|
|||||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||||
<pathelement location="build/i2ptunnel.jar" />
|
<pathelement location="build/i2ptunnel.jar" />
|
||||||
<pathelement location="build/temp-beans.jar" />
|
<pathelement location="build/temp-beans.jar" />
|
||||||
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" />
|
<copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" />
|
||||||
@@ -213,6 +215,7 @@
|
|||||||
|
|
||||||
<uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
|
<uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
|
||||||
<srcfiles dir= "../jsp" includes="*.jsp, *.html, web.xml"/>
|
<srcfiles dir= "../jsp" includes="*.jsp, *.html, web.xml"/>
|
||||||
|
<srcfiles dir= "src/net/i2p/i2ptunnel/web" includes="*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="javadoc">
|
<target name="javadoc">
|
||||||
|
@@ -45,7 +45,7 @@ public class TunnelController implements Logging {
|
|||||||
private boolean _running;
|
private boolean _running;
|
||||||
private boolean _starting;
|
private boolean _starting;
|
||||||
|
|
||||||
private static final String KEY_BACKUP_DIR = "i2ptunnel-keyBackup";
|
public static final String KEY_BACKUP_DIR = "i2ptunnel-keyBackup";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller for a tunnel out of the specific config options.
|
* Create a new controller for a tunnel out of the specific config options.
|
||||||
@@ -108,13 +108,11 @@ public class TunnelController implements Logging {
|
|||||||
log("Private key created and saved in " + keyFile.getAbsolutePath());
|
log("Private key created and saved in " + keyFile.getAbsolutePath());
|
||||||
log("You should backup this file in a secure place.");
|
log("You should backup this file in a secure place.");
|
||||||
log("New destination: " + destStr);
|
log("New destination: " + destStr);
|
||||||
log("Base32: " + Base32.encode(dest.calculateHash().getData()) + ".b32.i2p");
|
String b32 = Base32.encode(dest.calculateHash().getData()) + ".b32.i2p";
|
||||||
|
log("Base32: " + b32);
|
||||||
File backupDir = new SecureFile(I2PAppContext.getGlobalContext().getConfigDir(), KEY_BACKUP_DIR);
|
File backupDir = new SecureFile(I2PAppContext.getGlobalContext().getConfigDir(), KEY_BACKUP_DIR);
|
||||||
if (backupDir.exists() || backupDir.mkdir()) {
|
if (backupDir.isDirectory() || backupDir.mkdir()) {
|
||||||
String name = keyFile.getName();
|
String name = b32 + '-' + I2PAppContext.getGlobalContext().clock().now() + ".dat";
|
||||||
if (name.endsWith(".dat"))
|
|
||||||
name = name.substring(0, name.length() - 4);
|
|
||||||
name += "-" + I2PAppContext.getGlobalContext().clock().now() + ".dat";
|
|
||||||
File backup = new File(backupDir, name);
|
File backup = new File(backupDir, name);
|
||||||
if (FileUtil.copy(keyFile, backup, false, true))
|
if (FileUtil.copy(keyFile, backup, false, true))
|
||||||
log("Private key backup saved to " + backup.getAbsolutePath());
|
log("Private key backup saved to " + backup.getAbsolutePath());
|
||||||
|
@@ -79,7 +79,7 @@ public class EditBean extends IndexBean {
|
|||||||
if (tun != null && tun.getPrivKeyFile() != null)
|
if (tun != null && tun.getPrivKeyFile() != null)
|
||||||
return tun.getPrivKeyFile();
|
return tun.getPrivKeyFile();
|
||||||
if (tunnel < 0)
|
if (tunnel < 0)
|
||||||
tunnel = _group == null ? 1 : _group.getControllers().size() + 1;
|
tunnel = _group == null ? 999 : _group.getControllers().size();
|
||||||
return "i2ptunnel" + tunnel + "-privKeys.dat";
|
return "i2ptunnel" + tunnel + "-privKeys.dat";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,6 +38,7 @@ import net.i2p.util.ConcurrentHashSet;
|
|||||||
import net.i2p.util.FileUtil;
|
import net.i2p.util.FileUtil;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
import net.i2p.util.PasswordManager;
|
import net.i2p.util.PasswordManager;
|
||||||
|
import net.i2p.util.SecureFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple accessor for exposing tunnel info, but also an ugly form handler
|
* Simple accessor for exposing tunnel info, but also an ugly form handler
|
||||||
@@ -373,10 +374,13 @@ public class IndexBean {
|
|||||||
name = Long.toString(_context.clock().now());
|
name = Long.toString(_context.clock().now());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
name = "i2ptunnel-deleted-" + name.replace(' ', '_') + "-privkeys.dat";
|
name = "i2ptunnel-deleted-" + name.replace(' ', '_') + '-' + _context.clock().now() + "-privkeys.dat";
|
||||||
File to = new File(_context.getConfigDir(), name);
|
File backupDir = new SecureFile(_context.getConfigDir(), TunnelController.KEY_BACKUP_DIR);
|
||||||
if (to.exists())
|
File to;
|
||||||
to = new File(_context.getConfigDir(), name + '-' + _context.clock().now());
|
if (backupDir.isDirectory() || backupDir.mkdir())
|
||||||
|
to = new File(backupDir, name);
|
||||||
|
else
|
||||||
|
to = new File(_context.getConfigDir(), name);
|
||||||
boolean success = FileUtil.rename(pkf, to);
|
boolean success = FileUtil.rename(pkf, to);
|
||||||
if (success)
|
if (success)
|
||||||
msgs.add("Private key file " + pkf.getAbsolutePath() +
|
msgs.add("Private key file " + pkf.getAbsolutePath() +
|
||||||
|
@@ -433,7 +433,7 @@
|
|||||||
<label>
|
<label>
|
||||||
<%=intl._("Enable")%>:
|
<%=intl._("Enable")%>:
|
||||||
</label>
|
</label>
|
||||||
<input value="1" type="checkbox" id="proxyAuth" name="proxyAuth" title="Check to require authorization for this service"<%=(editBean.getProxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
<input value="1" type="checkbox" id="startOnLoad" name="proxyAuth" title="Check to require authorization for this service"<%=(editBean.getProxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||||
</div>
|
</div>
|
||||||
<div id="portField" class="rowItem">
|
<div id="portField" class="rowItem">
|
||||||
<label>
|
<label>
|
||||||
@@ -457,7 +457,7 @@
|
|||||||
<label>
|
<label>
|
||||||
<%=intl._("Enable")%>:
|
<%=intl._("Enable")%>:
|
||||||
</label>
|
</label>
|
||||||
<input value="1" type="checkbox" id="outproxyAuth" name="outproxyAuth" title="Check if the outproxy requires authorization"<%=(editBean.getOutproxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
<input value="1" type="checkbox" id="startOnLoad" name="outproxyAuth" title="Check if the outproxy requires authorization"<%=(editBean.getOutproxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||||
</div>
|
</div>
|
||||||
<div id="portField" class="rowItem">
|
<div id="portField" class="rowItem">
|
||||||
<label>
|
<label>
|
||||||
|
Reference in New Issue
Block a user