forked from I2P_Developers/i2p.i2p
- Fix jetty.xml migrate quote handling
- Fix I2PRequestLog javadoc - Rename jetty-threadpool.jar to jetty-java5-threadpool.jar to match ubuntu symlink - Bundle jetty-rewrite-handler.jar (20KB) and .xml config to make it easier to do rewrites (unused by I2P)
This commit is contained in:
@ -75,26 +75,29 @@
|
||||
<mkdir dir="jettylib" />
|
||||
<!-- We copy everything to names without the version numbers so we
|
||||
can update them later. Where there was something similar in Jetty 5,
|
||||
we use the same names.
|
||||
we use the same names so they will overwrite the Jetty 5 jar on upgrade.
|
||||
Otherwise we use the same name as the symlink in Ubuntu /usr/share/java.
|
||||
Reasons for inclusion:
|
||||
start.jar: Needed for clients.config startup of eepsites
|
||||
jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
|
||||
jetty-sslengine-xxx.jar: SSL NIO Connector for console
|
||||
jetty-java5-threadpool-xxx.jar: Concurrent thread pool for eepsite
|
||||
commons-logging.jar: JspC compiler
|
||||
TODO which of these are available in the Ubuntu packages?
|
||||
jasper*, commons-logging.jar: JspC compiler, webapp runtime
|
||||
jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
|
||||
All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
|
||||
-->
|
||||
<copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/servlet-api-2.5-20081211.jar" tofile="jettylib/javax.servlet.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-threadpool.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jsp-2.0/ant-1.6.5.jar" tofile="jettylib/ant.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jsp-2.0/commons-el-1.0.jar" tofile="jettylib/commons-el.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jsp-2.0/jasper-compiler-5.5.15.jar" tofile="jettylib/jasper-compiler.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jsp-2.0/jasper-runtime-5.5.15.jar" tofile="jettylib/jasper-runtime.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jsp-2.0/jsp-api-2.0.jar" tofile="jettylib/jsp-api.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/servlet-api-2.5-20081211.jar" tofile="jettylib/javax.servlet.jar" />
|
||||
<delete file="jetty.tar" />
|
||||
<delete dir="${jetty.base}" />
|
||||
<!-- commons-logging.jar not in Jetty 6 but we have it in launch4j so copy it over, we need it
|
||||
|
@ -502,8 +502,8 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Set the log file date format.
|
||||
* @see {@link RolloverFileOutputStream#RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)}
|
||||
* @param logFileDateFormat the logFileDateFormat to pass to {@link RolloverFileOutputStream}
|
||||
* see RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)
|
||||
* @param logFileDateFormat the logFileDateFormat to pass to RolloverFileOutputStream
|
||||
*/
|
||||
public void setFilenameDateFormat(String logFileDateFormat)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
||||
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-threadpool.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
|
||||
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
||||
@ -60,7 +60,7 @@
|
||||
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-threadpool.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
|
||||
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
||||
@ -280,7 +280,7 @@
|
||||
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-threadpool.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
||||
<pathelement location="../../systray/java/build/obj" />
|
||||
|
@ -418,7 +418,7 @@
|
||||
<pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
|
||||
<pathelement location="apps/jetty/jettylib/jetty-sslengine.jar" />
|
||||
<pathelement location="apps/jetty/jettylib/jetty-start.jar" />
|
||||
<pathelement location="apps/jetty/jettylib/jetty-threadpool.jar" />
|
||||
<pathelement location="apps/jetty/jettylib/jetty-java5-threadpool.jar" />
|
||||
<pathelement location="apps/jetty/jettylib/jetty-util.jar" />
|
||||
<pathelement location="apps/jetty/jettylib/jsp-api.jar" />
|
||||
<pathelement location="apps/systray/java/lib/systray4j.jar" />
|
||||
@ -941,7 +941,7 @@
|
||||
can't overwrite an existing eepsite dir in a non-split configuration.
|
||||
-->
|
||||
<copy todir="pkg-temp/eepsite-jetty6" >
|
||||
<fileset dir="installer/resources/eepsite" includes="jetty.xml jetty-ssl.xml contexts/* etc/*" />
|
||||
<fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
@ -42,6 +42,10 @@ clientApp.2.startOnLoad=true
|
||||
# run our own eepsite with a seperate jetty instance
|
||||
clientApp.3.main=org.mortbay.start.Main
|
||||
clientApp.3.name=I2P webserver (eepsite)
|
||||
## To use the rewrite handler, edit jetty-rewrite.xml and use:
|
||||
#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-rewrite.xml"
|
||||
## To use local SSL, edit jetty-ssl.xml and use:
|
||||
#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-ssl.xml"
|
||||
clientApp.3.args="eepsite/jetty.xml"
|
||||
clientApp.3.delay=30
|
||||
clientApp.3.startOnLoad=true
|
||||
|
149
installer/resources/eepsite/jetty-rewrite.xml
Normal file
149
installer/resources/eepsite/jetty-rewrite.xml
Normal file
@ -0,0 +1,149 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- Mixin the RewriteHandler -->
|
||||
<!-- =============================================================== -->
|
||||
|
||||
|
||||
<Configure id="Server" class="org.mortbay.jetty.Server">
|
||||
|
||||
<!-- =========================================================== -->
|
||||
<!-- Configure Rewrite Handler -->
|
||||
<!-- =========================================================== -->
|
||||
<Get id="oldhandler" name="handler"/>
|
||||
|
||||
<Set name="handler">
|
||||
<New id="Rewrite" class="org.mortbay.jetty.handler.rewrite.RewriteHandler">
|
||||
|
||||
<Set name="handler"><Ref id="oldhandler"/></Set>
|
||||
<Set name="rewriteRequestURI">true</Set>
|
||||
<Set name="rewritePathInfo">false</Set>
|
||||
<Set name="originalPathAttribute">requestedPath</Set>
|
||||
|
||||
<Set name="rules">
|
||||
<Array type="org.mortbay.jetty.handler.rewrite.Rule">
|
||||
|
||||
<!-- return an error message if low on threads; put this at the top so it will be processed first -->
|
||||
<Item>
|
||||
<New id="lowThreads" class="org.mortbay.jetty.handler.rewrite.LowThreadsRuleContainer">
|
||||
<!-- set the trigger for low threads ridiculously low
|
||||
uncomment the block below to see it in action -->
|
||||
<!--Ref id="Server">
|
||||
<Get id="serverThreadPool" name="threadPool">
|
||||
<Set name="minThreads">3</Set>
|
||||
<Set name="maxThreads">4</Set>
|
||||
<Set name="lowThreads">0</Set>
|
||||
</Get>
|
||||
</Ref>
|
||||
|
||||
<Set name="threadPool"><Ref id="serverThreadPool"/></Set-->
|
||||
|
||||
<Call name="addRule">
|
||||
<Arg>
|
||||
<New id="busyresponse" class="org.mortbay.jetty.handler.rewrite.ResponsePatternRule">
|
||||
<Set name="pattern">/*</Set>
|
||||
<Set name="code">500</Set>
|
||||
<Set name="reason">Server busy</Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<!-- Add rule to protect against IE ssl bug -->
|
||||
<Item>
|
||||
<New class="org.mortbay.jetty.handler.rewrite.MsieSslRule"/>
|
||||
</Item>
|
||||
|
||||
<!-- protect favicon handling -->
|
||||
<Item>
|
||||
<New class="org.mortbay.jetty.handler.rewrite.HeaderPatternRule">
|
||||
<Set name="pattern">/favicon.ico</Set>
|
||||
<Set name="name">Cache-Control</Set>
|
||||
<Set name="value">Max-Age=3600,public</Set>
|
||||
<Set name="terminating">true</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
|
||||
<!-- add a regex rule -->
|
||||
<Item>
|
||||
<New class="org.mortbay.jetty.handler.rewrite.RewriteRegexRule">
|
||||
<Set name="regex">/rewrite/dump/regex/([^/]*)/(.*)</Set>
|
||||
<Set name="replacement">/test/dump/$2/$1</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<!-- add a rewrite rule -->
|
||||
<Item>
|
||||
<New id="" class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
||||
<Set name="pattern">/rewrite</Set>
|
||||
<Set name="replacement">/rewrittento</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<!-- add a response rule -->
|
||||
<Item>
|
||||
<New id="response" class="org.mortbay.jetty.handler.rewrite.ResponsePatternRule">
|
||||
<Set name="pattern">/rewrite/session/</Set>
|
||||
<Set name="code">401</Set>
|
||||
<Set name="reason">Setting error code 401</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<!-- add a header pattern rule -->
|
||||
<Item>
|
||||
<New id="header" class="org.mortbay.jetty.handler.rewrite.HeaderPatternRule">
|
||||
<Set name="pattern">*.jsp</Set>
|
||||
<Set name="name">Server</Set>
|
||||
<Set name="value">Server for JSP</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<!-- add a redirect -->
|
||||
<Item>
|
||||
<New id="redirect" class="org.mortbay.jetty.handler.rewrite.RedirectPatternRule">
|
||||
<Set name="pattern">/rewrite/dispatch</Set>
|
||||
<Set name="location">http://jetty.mortbay.org</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<Item>
|
||||
<New id="forwardedHttps" class="org.mortbay.jetty.handler.rewrite.ForwardedSchemeHeaderRule">
|
||||
<Set name="header">X-Forwarded-Scheme</Set>
|
||||
<Set name="headerValue">https</Set>
|
||||
<Set name="scheme">https</Set>
|
||||
</New>
|
||||
</Item>
|
||||
|
||||
<Item>
|
||||
<New id="virtualHost" class="org.mortbay.jetty.handler.rewrite.VirtualHostRuleContainer">
|
||||
|
||||
<Set name="virtualHosts">
|
||||
<Array type="java.lang.String">
|
||||
<Item>mortbay.com</Item>
|
||||
<Item>www.mortbay.com</Item>
|
||||
<Item>mortbay.org</Item>
|
||||
<Item>www.mortbay.org</Item>
|
||||
</Array>
|
||||
</Set>
|
||||
|
||||
<Call name="addRule">
|
||||
<Arg>
|
||||
<New class="org.mortbay.jetty.handler.rewrite.CookiePatternRule">
|
||||
<Set name="pattern">/*</Set>
|
||||
<Set name="name">CookiePatternRule</Set>
|
||||
<Set name="value">1</Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
|
||||
</New>
|
||||
</Item>
|
||||
</Array>
|
||||
</Set>
|
||||
</New>
|
||||
</Set>
|
||||
|
||||
</Configure>
|
@ -20,6 +20,7 @@ import net.i2p.router.RouterContext;
|
||||
* Saves $D/jetty.xml to $D/jetty5.xml
|
||||
* Copies $I2P/eepsite-jetty6/jetty.xml to $D/jetty.xml, edited for $D
|
||||
* Copies $I2P/eepsite-jetty6/jetty-ssl.xml to $D/jetty-ssl.xml, edited for $D
|
||||
* Copies $I2P/eepsite-jetty6/jetty-rewrite.xml to $D/jetty-rewrite.xml
|
||||
* Copies $I2P/eepsite-jetty6/context/base-context.xml to $D/jetty.xml, edited for $D
|
||||
* Copies $I2P/eepsite-jetty6/context/cgi-context.xml to $D/jetty.xml, edited for $D
|
||||
* Copies $I2P/eepsite-jetty6/etc/* to $D/etc
|
||||
@ -56,9 +57,13 @@ abstract class MigrateJetty {
|
||||
System.err.println("WARNING: Jetty 6 unavailable, cannot migrate " + client);
|
||||
continue;
|
||||
}
|
||||
String xml = app.args;
|
||||
if (xml == null)
|
||||
if (app.args == null)
|
||||
continue;
|
||||
// remove quotes
|
||||
String args[] = LoadClientAppsJob.parseArgs(app.args);
|
||||
if (args.length == 0)
|
||||
continue;
|
||||
String xml = args[0];
|
||||
File xmlFile = new File(xml);
|
||||
if (!xmlFile.isAbsolute())
|
||||
xmlFile = new File(ctx.getAppDir(), xml);
|
||||
@ -98,6 +103,7 @@ abstract class MigrateJetty {
|
||||
(new File(eepsite, "contexts")).mkdir();
|
||||
WorkingDir.migrateJettyXml(baseEep, eepsite, BASE_CONTEXT, "./eepsite/", newPath);
|
||||
WorkingDir.migrateJettyXml(baseEep, eepsite, CGI_CONTEXT, "./eepsite/", newPath);
|
||||
WorkingDir.copyFile(new File(baseEep, "jetty-rewrite.xml"), new File(eepsite, "jetty-rewrite.xml"));
|
||||
(new File(eepsite, "etc")).mkdir();
|
||||
File to = new File(eepsite, "etc/realm.properties");
|
||||
if (!to.exists())
|
||||
|
Reference in New Issue
Block a user