forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head eb2151f9d804ec432bfe97214896ee62da08943e)
to branch 'i2p.i2p.zzz.test2' (head 2ea50c5f22fe1e24d37dff2f283b77feaa9190ee)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
<!-- Depend on classes instead of jars where available -->
|
||||
<classpath>
|
||||
<pathelement location="../../../core/java/build/obj" />
|
||||
<pathelement location="../../../core/java/build/gnu-getopt.jar" />
|
||||
<pathelement location="../../ministreaming/java/build/obj" />
|
||||
</classpath>
|
||||
</depend>
|
||||
@@ -38,7 +39,7 @@
|
||||
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
|
||||
destdir="./build/obj"
|
||||
includeAntRuntime="false"
|
||||
classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
|
||||
classpath="../../../core/java/build/i2p.jar:../../../core/java/build/gnu-getopt.jar:../../ministreaming/java/build/mstreaming.jar" >
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
@@ -122,6 +123,7 @@
|
||||
|
||||
<!-- servlet translations go in the war, not the jar -->
|
||||
<target name="bundle" depends="compile, precompilejsp" unless="no.bundle">
|
||||
<mkdir dir="build/messages-src" />
|
||||
<!-- Update the messages_*.po files.
|
||||
We need to supply the bat file for windows, and then change the fail property to true -->
|
||||
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
|
||||
@@ -135,6 +137,11 @@
|
||||
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
|
||||
<arg value="./bundle-messages.sh" />
|
||||
</exec>
|
||||
<javac source="${javac.version}" target="${javac.version}"
|
||||
includeAntRuntime="false"
|
||||
srcdir="build/messages-src" destdir="../jsp/WEB-INF/classes">
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="poupdate" depends="compile, precompilejsp">
|
||||
@@ -155,6 +162,7 @@
|
||||
|
||||
<!-- proxy error page translations go in the jar, not the war -->
|
||||
<target name="bundle-proxy" unless="no.bundle">
|
||||
<mkdir dir="build/messages-proxy-src" />
|
||||
<!-- Update the messages_*.po files.
|
||||
We need to supply the bat file for windows, and then change the fail property to true -->
|
||||
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
|
||||
@@ -168,6 +176,11 @@
|
||||
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
|
||||
<arg value="./bundle-messages-proxy.sh" />
|
||||
</exec>
|
||||
<javac source="${javac.version}" target="${javac.version}"
|
||||
includeAntRuntime="false"
|
||||
srcdir="build/messages-proxy-src" destdir="build/obj">
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="extractProxyTags">
|
||||
@@ -258,12 +271,20 @@
|
||||
<classpath>
|
||||
<pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
|
||||
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
||||
<!-- jsp-api.jar only present for debian builds -->
|
||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||
<!-- tomcat-api.jar only present for debian builds -->
|
||||
<pathelement location="../../jetty/jettylib/tomcat-api.jar" />
|
||||
<!-- jasper-el.jar only present for debian builds -->
|
||||
<pathelement location="../../jetty/jettylib/jasper-el.jar" />
|
||||
<pathelement location="../../jetty/jettylib/commons-logging.jar" />
|
||||
<pathelement location="../../jetty/jettylib/commons-el.jar" />
|
||||
<pathelement location="${ant.home}/lib/ant.jar" />
|
||||
<pathelement location="build/i2ptunnel.jar" />
|
||||
<pathelement location="build/temp-beans.jar" />
|
||||
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||
<!-- required for multipart form handling in register.jsp -->
|
||||
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
||||
</classpath>
|
||||
<arg value="-d" />
|
||||
<arg value="../jsp/WEB-INF/classes" />
|
||||
@@ -282,11 +303,19 @@
|
||||
<classpath>
|
||||
<pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
|
||||
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
||||
<!-- jsp-api.jar only present for debian builds -->
|
||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||
<!-- tomcat-api.jar only present for debian builds -->
|
||||
<pathelement location="../../jetty/jettylib/tomcat-api.jar" />
|
||||
<!-- jasper-el.jar only present for debian builds -->
|
||||
<pathelement location="../../jetty/jettylib/jasper-el.jar" />
|
||||
<pathelement location="../../jetty/jettylib/commons-logging.jar" />
|
||||
<pathelement location="../../jetty/jettylib/commons-el.jar" />
|
||||
<pathelement location="build/i2ptunnel.jar" />
|
||||
<pathelement location="build/temp-beans.jar" />
|
||||
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||
<!-- required for multipart form handling in register.jsp -->
|
||||
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
||||
</classpath>
|
||||
</javac>
|
||||
<copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" />
|
||||
|
@@ -98,15 +98,40 @@ do
|
||||
# only generate for non-source language
|
||||
echo "Generating ${CLASS}_$LG ResourceBundle..."
|
||||
|
||||
# convert to class files in build/obj
|
||||
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
|
||||
msgfmt -V | grep -q '0\.19'
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR - msgfmt failed on ${i}, not updating translations"
|
||||
# msgfmt leaves the class file there so the build would work the next time
|
||||
find build/obj -name messages_${LG}.class -exec rm -f {} \;
|
||||
RC=1
|
||||
break
|
||||
# slow way
|
||||
# convert to class files in build/obj
|
||||
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR - msgfmt failed on ${i}, not updating translations"
|
||||
# msgfmt leaves the class file there so the build would work the next time
|
||||
find build -name messages_${LG}.class -exec rm -f {} \;
|
||||
RC=1
|
||||
break
|
||||
fi
|
||||
else
|
||||
# fast way
|
||||
# convert to java files in build/messages-proxy-src
|
||||
TD=build/messages-proxy-src-tmp
|
||||
TDX=$TD/net/i2p/i2ptunnel/proxy
|
||||
TD2=build/messages-proxy-src
|
||||
TDY=$TD2/net/i2p/i2ptunnel/proxy
|
||||
rm -rf $TD
|
||||
mkdir -p $TD $TDY
|
||||
msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR - msgfmt failed on ${i}, not updating translations"
|
||||
# msgfmt leaves the class file there so the build would work the next time
|
||||
find build/obj -name messages_${LG}.class -exec rm -f {} \;
|
||||
RC=1
|
||||
break
|
||||
fi
|
||||
mv $TDX/messages_$LG.java $TDY
|
||||
rm -rf $TD
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@@ -97,15 +97,40 @@ do
|
||||
# only generate for non-source language
|
||||
echo "Generating ${CLASS}_$LG ResourceBundle..."
|
||||
|
||||
# convert to class files in build/obj
|
||||
msgfmt --java --statistics -r $CLASS -l $LG -d ../jsp/WEB-INF/classes $i
|
||||
msgfmt -V | grep -q '0\.19'
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR - msgfmt failed on ${i}, not updating translations"
|
||||
# msgfmt leaves the class file there so the build would work the next time
|
||||
find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
|
||||
RC=1
|
||||
break
|
||||
# slow way
|
||||
# convert to class files in jsp/WEB-INF/classes
|
||||
msgfmt --java --statistics -r $CLASS -l $LG -d ../jsp/WEB-INF/classes $i
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR - msgfmt failed on ${i}, not updating translations"
|
||||
# msgfmt leaves the class file there so the build would work the next time
|
||||
find build -name messages_${LG}.class -exec rm -f {} \;
|
||||
RC=1
|
||||
break
|
||||
fi
|
||||
else
|
||||
# fast way
|
||||
# convert to java files in build/messages-src
|
||||
TD=build/messages-src-tmp
|
||||
TDX=$TD/net/i2p/i2ptunnel/web
|
||||
TD2=build/messages-src
|
||||
TDY=$TD2/net/i2p/i2ptunnel/web
|
||||
rm -rf $TD
|
||||
mkdir -p $TD $TDY
|
||||
msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "ERROR - msgfmt failed on ${i}, not updating translations"
|
||||
# msgfmt leaves the class file there so the build would work the next time
|
||||
find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
|
||||
RC=1
|
||||
break
|
||||
fi
|
||||
mv $TDX/messages_$LG.java $TDY
|
||||
rm -rf $TD
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@@ -626,7 +626,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
* adding it to the list of connections actually managed by this
|
||||
* tunnel.
|
||||
*
|
||||
* @param dest The destination to connect to
|
||||
* @param dest The destination to connect to, non-null
|
||||
* @return a new I2PSocket
|
||||
*/
|
||||
public I2PSocket createI2PSocket(Destination dest) throws I2PException, ConnectException, NoRouteToHostException, InterruptedIOException {
|
||||
@@ -638,7 +638,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
* adding it to the list of connections actually managed by this
|
||||
* tunnel.
|
||||
*
|
||||
* @param dest The destination to connect to
|
||||
* @param dest The destination to connect to, non-null
|
||||
* @param port The destination port to connect to 0 - 65535
|
||||
* @return a new I2PSocket
|
||||
* @since 0.9.9
|
||||
@@ -656,7 +656,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
* adding it to the list of connections actually managed by this
|
||||
* tunnel.
|
||||
*
|
||||
* @param dest The destination to connect to
|
||||
* @param dest The destination to connect to, non-null
|
||||
* @param opt Option to be used to open when opening the socket
|
||||
* @return a new I2PSocket
|
||||
*
|
||||
@@ -666,6 +666,8 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
* @throws I2PException if there is some other I2P-related problem
|
||||
*/
|
||||
public I2PSocket createI2PSocket(Destination dest, I2PSocketOptions opt) throws I2PException, ConnectException, NoRouteToHostException, InterruptedIOException {
|
||||
if (dest == null)
|
||||
throw new NullPointerException();
|
||||
I2PSocket i2ps;
|
||||
|
||||
verifySocketManager();
|
||||
|
@@ -365,6 +365,11 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
||||
/** @since 0.9.14 */
|
||||
public static final String PROP_INTERNAL_SSL = "i2ptunnel.httpclient.allowInternalSSL";
|
||||
|
||||
/**
|
||||
*
|
||||
* Note: This does not handle RFC 2616 header line splitting,
|
||||
* which is obsoleted in RFC 7230.
|
||||
*/
|
||||
protected void clientConnectionRun(Socket s) {
|
||||
OutputStream out = null;
|
||||
|
||||
|
@@ -463,6 +463,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
|
||||
" realm=\"" + getRealm() + '"' +
|
||||
(isDigest ? ", nonce=\"" + getNonce() + "\"," +
|
||||
" algorithm=MD5," +
|
||||
" charset=UTF-8," + // RFC 7616/7617
|
||||
" qop=\"auth\"" +
|
||||
(isStale ? ", stale=true" : "")
|
||||
: "") +
|
||||
|
@@ -243,7 +243,11 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
|
||||
String portNum = getTunnel().port;
|
||||
if (portNum == null)
|
||||
portNum = "7654";
|
||||
String msg = "Unable to connect to the router at " + getTunnel().host + ':' + portNum +
|
||||
String msg;
|
||||
if (getTunnel().getContext().isRouterContext())
|
||||
msg = "Unable to build tunnels for the server at " + remoteHost.getHostAddress() + ':' + remotePort;
|
||||
else
|
||||
msg = "Unable to connect to the router at " + getTunnel().host + ':' + portNum +
|
||||
" and build tunnels for the server at " + remoteHost.getHostAddress() + ':' + remotePort;
|
||||
if (++retries < MAX_RETRIES) {
|
||||
msg += ", retrying in " + (RETRY_DELAY / 1000) + " seconds";
|
||||
|
@@ -22,6 +22,7 @@ import net.i2p.I2PException;
|
||||
import net.i2p.client.streaming.I2PSocket;
|
||||
import net.i2p.client.streaming.I2PSocketOptions;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.HexDump;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@@ -212,14 +213,22 @@ public class SOCKS4aServer extends SOCKSServer {
|
||||
try {
|
||||
if (connHostName.toLowerCase(Locale.US).endsWith(".i2p") ||
|
||||
connHostName.toLowerCase(Locale.US).endsWith(".onion")) {
|
||||
_log.debug("connecting to " + connHostName + "...");
|
||||
// Let's not due a new Dest for every request, huh?
|
||||
// Let's not do a new Dest for every request, huh?
|
||||
//I2PSocketManager sm = I2PSocketManagerFactory.createManager();
|
||||
//destSock = sm.connect(I2PTunnel.destFromName(connHostName), null);
|
||||
Destination dest = I2PAppContext.getGlobalContext().namingService().lookup(connHostName);
|
||||
if (dest == null) {
|
||||
try {
|
||||
sendRequestReply(Reply.CONNECTION_REFUSED, InetAddress.getByName("127.0.0.1"), 0, out);
|
||||
} catch (IOException ioe) {}
|
||||
throw new SOCKSException("Host not found");
|
||||
}
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("connecting to " + connHostName + "...");
|
||||
Properties overrides = new Properties();
|
||||
I2PSocketOptions sktOpts = t.buildOptions(overrides);
|
||||
sktOpts.setPort(connPort);
|
||||
destSock = t.createI2PSocket(I2PAppContext.getGlobalContext().namingService().lookup(connHostName), sktOpts);
|
||||
destSock = t.createI2PSocket(dest, sktOpts);
|
||||
} else if ("localhost".equals(connHostName) || "127.0.0.1".equals(connHostName)) {
|
||||
String err = "No localhost accesses allowed through the Socks Proxy";
|
||||
_log.error(err);
|
||||
@@ -249,10 +258,18 @@ public class SOCKS4aServer extends SOCKSServer {
|
||||
}
|
||||
int p = I2PAppContext.getGlobalContext().random().nextInt(proxies.size());
|
||||
String proxy = proxies.get(p);
|
||||
_log.debug("connecting to port " + connPort + " proxy " + proxy + " for " + connHostName + "...");
|
||||
Destination dest = I2PAppContext.getGlobalContext().namingService().lookup(proxy);
|
||||
if (dest == null) {
|
||||
try {
|
||||
sendRequestReply(Reply.CONNECTION_REFUSED, InetAddress.getByName("127.0.0.1"), 0, out);
|
||||
} catch (IOException ioe) {}
|
||||
throw new SOCKSException("Outproxy not found");
|
||||
}
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("connecting to port " + connPort + " proxy " + proxy + " for " + connHostName + "...");
|
||||
// this isn't going to work, these need to be socks outproxies so we need
|
||||
// to do a socks session to them?
|
||||
destSock = t.createI2PSocket(I2PAppContext.getGlobalContext().namingService().lookup(proxy));
|
||||
destSock = t.createI2PSocket(dest);
|
||||
}
|
||||
confirmConnection();
|
||||
_log.debug("connection confirmed - exchanging data...");
|
||||
|
@@ -363,8 +363,7 @@ public class SOCKS5Server extends SOCKSServer {
|
||||
|
||||
try {
|
||||
if (connHostName.toLowerCase(Locale.US).endsWith(".i2p")) {
|
||||
_log.debug("connecting to " + connHostName + "...");
|
||||
// Let's not due a new Dest for every request, huh?
|
||||
// Let's not do a new Dest for every request, huh?
|
||||
//I2PSocketManager sm = I2PSocketManagerFactory.createManager();
|
||||
//destSock = sm.connect(I2PTunnel.destFromName(connHostName), null);
|
||||
Destination dest = I2PAppContext.getGlobalContext().namingService().lookup(connHostName);
|
||||
@@ -374,10 +373,12 @@ public class SOCKS5Server extends SOCKSServer {
|
||||
} catch (IOException ioe) {}
|
||||
throw new SOCKSException("Host not found");
|
||||
}
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("connecting to " + connHostName + "...");
|
||||
Properties overrides = new Properties();
|
||||
I2PSocketOptions sktOpts = t.buildOptions(overrides);
|
||||
sktOpts.setPort(connPort);
|
||||
destSock = t.createI2PSocket(I2PAppContext.getGlobalContext().namingService().lookup(connHostName), sktOpts);
|
||||
destSock = t.createI2PSocket(dest, sktOpts);
|
||||
} else if ("localhost".equals(connHostName) || "127.0.0.1".equals(connHostName)) {
|
||||
String err = "No localhost accesses allowed through the Socks Proxy";
|
||||
_log.error(err);
|
||||
@@ -468,7 +469,7 @@ public class SOCKS5Server extends SOCKSServer {
|
||||
Destination dest = I2PAppContext.getGlobalContext().namingService().lookup(proxy);
|
||||
if (dest == null)
|
||||
throw new SOCKSException("Outproxy not found");
|
||||
I2PSocket destSock = tun.createI2PSocket(I2PAppContext.getGlobalContext().namingService().lookup(proxy), proxyOpts);
|
||||
I2PSocket destSock = tun.createI2PSocket(dest, proxyOpts);
|
||||
DataOutputStream out = null;
|
||||
DataInputStream in = null;
|
||||
try {
|
||||
|
@@ -71,6 +71,7 @@ public class EditBean extends IndexBean {
|
||||
return _helper.getPrivateKeyFile(tunnel);
|
||||
}
|
||||
|
||||
/****
|
||||
public String getNameSignature(int tunnel) {
|
||||
String spoof = getSpoofedHost(tunnel);
|
||||
if (spoof.length() <= 0)
|
||||
@@ -100,6 +101,26 @@ public class EditBean extends IndexBean {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
****/
|
||||
|
||||
/**
|
||||
* @since 0.9.26
|
||||
* @return key or null
|
||||
*/
|
||||
public SigningPrivateKey getSigningPrivateKey(int tunnel) {
|
||||
TunnelController tun = getController(tunnel);
|
||||
if (tun == null)
|
||||
return null;
|
||||
String keyFile = tun.getPrivKeyFile();
|
||||
if (keyFile != null && keyFile.trim().length() > 0) {
|
||||
File f = new File(keyFile);
|
||||
if (!f.isAbsolute())
|
||||
f = new File(_context.getConfigDir(), keyFile);
|
||||
PrivateKeyFile pkf = new PrivateKeyFile(f);
|
||||
return pkf.getSigningPrivKey();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean startAutomatically(int tunnel) {
|
||||
return _helper.shouldStartAutomatically(tunnel);
|
||||
|
@@ -40,6 +40,11 @@ public class Messages {
|
||||
return Translate.getString(s, o, _context, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/** @since 0.9.26 */
|
||||
public String _t(String s, Object o1, Object o2) {
|
||||
return Translate.getString(s, o1, o2, _context, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/** translate (ngettext)
|
||||
* @since 0.9.7
|
||||
*/
|
||||
|
Reference in New Issue
Block a user