From e2b0e14771c610160eb3a75700461610cf76e640 Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 20 Jul 2009 17:22:44 +0000 Subject: [PATCH 1/4] drop unused class --- .../net/i2p/router/web/ServiceManager.java | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 apps/routerconsole/java/src/net/i2p/router/web/ServiceManager.java diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ServiceManager.java b/apps/routerconsole/java/src/net/i2p/router/web/ServiceManager.java deleted file mode 100644 index 55f104f027..0000000000 --- a/apps/routerconsole/java/src/net/i2p/router/web/ServiceManager.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * I2P - An anonymous, secure, and fully-distributed communication network. - * - * ServiceManager.java - * 2004 The I2P Project - * http://www.i2p.net - * This code is public domain. - */ - -package net.i2p.router.web; - -//import java.io.InputStream; - -import net.i2p.util.ShellCommand; - -/** - * Handles installation and uninstallation of I2P as a service. - * - * @author hypercubus - */ -public class ServiceManager { - - private static final boolean IS_WINDOWS = System.getProperty("os.name").startsWith("Windows") ? true : false; - - private ShellCommand _shellCommand = new ShellCommand(); - - /** - * Invokes the service wrapper installation script via a shell process. - * - * @return null if the installation was successful, otherwise - * a String containing the shell output including error - * messages is returned. - */ - public String installService() { - return exec("install_i2p_service_" + (IS_WINDOWS ? "winnt.bat" : "unix")); - } - - /** - * Invokes the service wrapper uninstallation script via a shell process. - * - * @return null if the uninstallation was successful, otherwise - * a String containing the shell output including error - * messages is returned. - */ - public String uninstallService() { - return exec("uninstall_i2p_service_" + (IS_WINDOWS ? "winnt.bat" : "unix")); - } - - private String exec(String command) { - -// InputStream StdoutStream = _shellCommand.getInputStream(); -// InputStream StderrStream = _shellCommand.getErrorStream(); - StringBuilder result = null; - - if (_shellCommand.executeAndWait(command)) - return null; - - else - if (result.toString().equals("")) - return null; - - else - return result.toString(); - } -} From 7d5042c5071488f30f224685592cdfe8d5d6a0ac Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 20 Jul 2009 17:23:20 +0000 Subject: [PATCH 2/4] add geoip license (thx Arsene) --- LICENSE.txt | 6 +++++- licenses/LICENSE-GeoIP.txt | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 licenses/LICENSE-GeoIP.txt diff --git a/LICENSE.txt b/LICENSE.txt index 1ce8412e6c..c8667b006f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -177,7 +177,11 @@ Applications: Router console: Public domain. - Flag icons public domain, courtesy mjames@gmail.com http://www.famfamfam.com/ + Flag icons: public domain, courtesy mjames@gmail.com http://www.famfamfam.com/ + + GeoIP Data: + Copyright (c) 2003 Direct Information Pvt. Ltd. All Rights Reserved. + See licenses/LICENSE-GeoIP.txt SAM: Public domain. diff --git a/licenses/LICENSE-GeoIP.txt b/licenses/LICENSE-GeoIP.txt new file mode 100644 index 0000000000..20670107ef --- /dev/null +++ b/licenses/LICENSE-GeoIP.txt @@ -0,0 +1,18 @@ +Copyright (c) 2003 Direct Information Pvt. Ltd. All Rights Reserved. + +This application uses the IP-to-Country Database +provided by WebHosting.Info (http://www.webhosting.info), +available from http://ip-to-country.webhosting.info. + +BECAUSE THE DATABASE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE DATABASE, +TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE +COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE DATABASE "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR ANY WARRANTIES +REGARDING THE CONTENTS OR ACCURACY OF THE WORK. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT +HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE DATABASE AS PERMITTED +ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE DATABASE, EVEN +IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. From 71d72b426f87b1c190d104901c4e4c4c348d7b1f Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 20 Jul 2009 17:24:26 +0000 Subject: [PATCH 3/4] close anchor --- .../java/src/net/i2p/router/web/ConfigClientsHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java index da79249ed8..5fc3679e0c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java @@ -116,7 +116,7 @@ public class ConfigClientsHandler extends FormHandler { path = new File(path, app + ".war"); s.addWebApplication("/"+ app, path.getAbsolutePath()).start(); // no passwords... initialize(wac); - addFormNotice("WebApp " + app + " started"); + addFormNotice("WebApp " + app + " started"); } catch (Exception ioe) { addFormError("Failed to start " + app + " " + ioe); } From 6039f3931db37fe5c5d94f4b140429a9777d6168 Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 20 Jul 2009 17:29:25 +0000 Subject: [PATCH 4/4] additional proxy.i2p defenses --- .../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 71f5f2b3e3..8fbba7ff31 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -830,12 +830,13 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable int space = targetRequest.indexOf(' '); String filename = null; try { - filename = targetRequest.substring(10, space); + filename = targetRequest.substring(17, space); // "proxy.i2p/themes/".length } catch (IndexOutOfBoundsException ioobe) {} // theme hack - if (filename.startsWith("themes/console/default/")) + if (filename.startsWith("console/default/")) filename = filename.replaceFirst("default", I2PAppContext.getGlobalContext().getProperty("routerconsole.theme", "light")); - File file = new File(_errorDir, filename); + File themesDir = new File(_errorDir, "themes"); + File file = new File(themesDir, filename); if (file.exists() && !file.isDirectory()) { String type; if (filename.endsWith(".css")) @@ -849,7 +850,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable out.write("HTTP/1.1 200 OK\r\nContent-Type: ".getBytes()); out.write(type.getBytes()); out.write("\r\nCache-Control: max-age=86400\r\n\r\n".getBytes()); - FileUtil.readFile(filename, _errorDir.getAbsolutePath(), out); + FileUtil.readFile(filename, themesDir.getAbsolutePath(), out); return; } catch (IOException ioe) {} }