merge of '98b80575def2548ebf853a03d8029a40e9546ec8'

and 'e7693976cb5a07bd0477aa2d8fef1ecc9c56c3d8'
This commit is contained in:
zzz
2009-07-21 15:19:37 +00:00
5 changed files with 29 additions and 71 deletions

View File

@ -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.

View File

@ -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) {}
}

View File

@ -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 <a href=\"/" + app + "/\">" + app + "<a> started");
addFormNotice("WebApp <a href=\"/" + app + "/\">" + app + "</a> started");
} catch (Exception ioe) {
addFormError("Failed to start " + app + " " + ioe);
}

View File

@ -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 <code>null</code> if the installation was successful, otherwise
* a <code>String</code> 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 <code>null</code> if the uninstallation was successful, otherwise
* a <code>String</code> 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();
}
}

View File

@ -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.