Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) better handling of port forwarding - button is disabled if libx is not installed - bugfix for disconnect
theli8558000bd93c
diff --git a/build.xml b/build.xmlindex 84b3845f9..3e78008e7 100644--- a/build.xml+++ b/build.xml@@ -172,7 +172,10 @@<filter token="REPL_DATE" value="${DSTAMP}"/><filter token="REPL_RELEASE" value="${releaseFile}"/><filter token="REPL_VERSION" value="${releaseVersion}" />- <copy file="${src}/yacy.java" tofile="${build}/yacy.java" filtering="true" />++ <!-- deleting old file -->+ <delete file="${build}/yacy.java" failonerror="false"/>+ <copy file="${src}/yacy.java" tofile="${build}/yacy.java" overwrite="true" filtering="true" /><copy file="${doc}/Download.html" tofile="${doc}/Download.html.up" filtering="true" /></target>@@ -527,6 +530,7 @@<target name="clean" description="make clean"><delete dir="${release_main}" failonerror="false"/><delete dir="${release_ext}" failonerror="false"/>+ <delete file="${build}/yacy.java" failonerror="false"/><delete failonerror="false"><fileset dir="${src}" includes="**/*.class" /><fileset dir="${build}" includes="**/*.class" />diff --git a/htroot/Settings_PortForwarding.inc b/htroot/Settings_PortForwarding.incindex a057b4cc6..5e650d1cc 100644--- a/htroot/Settings_PortForwarding.inc+++ b/htroot/Settings_PortForwarding.inc@@ -3,10 +3,11 @@<p>You can use a remote server running a ssh demon to forward your server/proxy port.This is useful if you want to tunnel throug a NAT/router.Alternatively, you can simply set a virtual server port on your NAT/Server to enable connections from outside.</p>+<p><font color="red">You need to install libx to use this feature</font></p><table border="0" cellspacing="5"><tr valign="top"><td>Enable port forwarding:</td>- <td><input type="checkbox" name="portForwardingEnabled" align="top" #(portForwardingEnabled)#::checked#(/portForwardingEnabled)#></td>+ <td><input type="checkbox" name="portForwardingEnabled" align="top" #(portForwardingEnabled)#::checked#(/portForwardingEnabled)##(portForwardingAvailable)# disabled="disabled"::#(/portForwardingAvailable)#></td><td>Enabling disabling port forwarding via secure channel.</td></tr><tr valign="top">@@ -41,7 +42,7 @@ Alternatively, you can simply set a virtual server port on your NAT/Server to en<td> </td></tr><tr valign="top">- <td colspan="3"><input type="submit" name="portForwarding" value="Submit"> <i>Changes will take effect immediately.</i></td>+ <td colspan="3"><input type="submit" name="portForwarding" value="Submit"#(portForwardingAvailable)# disabled="disabled"::#(/portForwardingAvailable)#> <i>Changes will take effect immediately.</i></td></tr></table></fieldset>diff --git a/htroot/Settings_p.java b/htroot/Settings_p.javaindex 24f10ccca..d0c5b7a3e 100644--- a/htroot/Settings_p.java+++ b/htroot/Settings_p.java@@ -119,6 +119,14 @@ public final class Settings_p {prop.put("proxy.sendViaHeader", env.getConfig("proxy.sendViaHeader", "false").equals("true") ? 1 : 0);// remote port forwarding settings+ boolean portForwardingAvailable = false;+ try {+ Class.forName("de.anomic.server.serverPortForwardingSch");+ portForwardingAvailable = true;+ } catch (Exception e) {+ } catch (Error e) {}++ prop.put("portForwardingAvailable",portForwardingAvailable? 1:0);prop.put("portForwardingEnabled",env.getConfig("portForwardingEnabled","false").equals("true")? 1 : 0);prop.put("portForwardingUseProxy",env.getConfig("portForwardingUseProxy", "false").equals("true")? 1 : 0);prop.put("portForwardingPort",env.getConfig("portForwardingPort", ""));diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.javaindex a3bf4f688..af3d6bc77 100644--- a/source/de/anomic/server/serverCore.java+++ b/source/de/anomic/server/serverCore.java@@ -353,6 +353,11 @@ public final class serverCore extends serverAbstractThread implements serverThrethis.switchboard.setConfig("portForwardingEnabled", "false");throw e;}+ } else {+ serverCore.portForwardingEnabled = false;+ serverCore.portForwarding = null;+ yacyCore.seedDB.mySeed.put(yacySeed.IP,publicIP());+ yacyCore.seedDB.mySeed.put(yacySeed.PORT,Integer.toString(serverCore.getPortNr(this.switchboard.getConfig("port", "8080"))));}}