Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added checkbox (near port) to switch on ssl support (https access) to the admin interface.
Michael Peter Christen7095446ad349
diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.htmlindex 6ae0ab39b..dacc4fd97 100644--- a/htroot/ConfigBasic.html+++ b/htroot/ConfigBasic.html@@ -92,7 +92,8 @@<dl><dt><label for="port">Peer Port: </label></dt><dd>- <input type="text" name="port" id="port" value="#[defaultPort]#" size="5" maxlength="5" />+ <input type="text" name="port" id="port" value="#[defaultPort]#" size="5" maxlength="5" /> + <input type="checkbox" name="withssl" id="withssl" #(withsslenabled)#::checked="checked"#(/withsslenabled)#>with SSL (https enabled)</dd>#(upnp)#::<dt><label for="enableUpnp">Configure your router for YaCy: </label>@@ -124,7 +125,7 @@<!-- [3]: port not proper --><p>You did not open a port in your firewall or your router does not forward the server port to your peer. This is needed if you want to fully participate in the YaCy network. You can also use your peer without opening it, but this is not recomended.</p>::<!-- [4]: reconnect to different port -->- <p>The peer port was changed successfully. Your browser will be redirected to the new <a href="#(sslSupport)#http::https#(/sslSupport)#://#[host]#:#[port]#/ConfigBasic.html">location</a> in 10 seconds.</p>+ <p>The peer port was changed successfully. Your browser will be redirected to the new <a href="#(sslSupport)#http::https#(/sslSupport)#://#[host]#:#[port]#/ConfigBasic.html">location</a> in 5 seconds.</p>#(/nextStep)##%env/templates/footer.template%#</body>diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.javaindex 2306954d1..14f7bbf61 100644--- a/htroot/ConfigBasic.java+++ b/htroot/ConfigBasic.java@@ -94,10 +94,13 @@ public class ConfigBasic {// port settingsfinal long port;+ boolean ssl;if (post != null && post.getInt("port", 0) > 1023) {port = post.getLong("port", 8090);+ ssl = post.getBoolean("withssl", false);} else {port = env.getConfigLong("port", 8090); //this allows a low port, but it will only get one, if the user edits the config himself.+ ssl = env.getConfigBool("server.https", false);}// check if peer name already exists@@ -124,12 +127,13 @@ public class ConfigBasic {upnp = false;}- // check port+ // check port and ssl connectionfinal boolean reconnect;- if (!(env.getConfigLong("port", port) == port)) {+ if (!(env.getConfigLong("port", port) == port) || env.getConfigBool("server.https", false) != ssl) {// validate portfinal serverCore theServerCore = (serverCore) env.getThread("10_httpd");env.setConfig("port", port);+ env.setConfig("server.https", ssl);// redirect the browser to the new portreconnect = true;@@ -160,8 +164,8 @@ public class ConfigBasic {//yacyAccessible.setNewPortBat(Integer.parseInt(port));//yacyAccessible.setNewPortLink(Integer.parseInt(port));- // force reconnection in 7 seconds- theServerCore.reconnect(7000);+ // force reconnection in 5 seconds+ theServerCore.reconnect(5000);} else {reconnect = false;prop.put("reconnect", "0");@@ -263,6 +267,7 @@ public class ConfigBasic {// set default valuesprop.putHTML("defaultName", sb.peers.mySeed().getName());prop.putHTML("defaultPort", env.getConfig("port", "8090"));+ prop.put("withsslenabled", env.getConfigBool("server.https", false) ? 1 : 0);lang = env.getConfig("locale.language", "default"); // re-assign lang, may have changedprop.put("lang_de", "0");prop.put("lang_fr", "0");