Compare commits
12 Commits
zzzot-0.7
...
zzzot-0.11
Author | SHA1 | Date | |
---|---|---|---|
8a9094cd8e | |||
7f4394aa0f | |||
38f38398ef | |||
8317e3ce9a | |||
c1f6a14367 | |||
7e36455b05 | |||
a85aa6af31 | |||
f33303f394 | |||
ab882f8582 | |||
ce7562c547 | |||
52d8e26ffc | |||
284d7a58d6 |
55
CHANGES.txt
Normal file
55
CHANGES.txt
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
0.11.0
|
||||||
|
2014-11-11
|
||||||
|
Critical fix for announce parameter decoding, triggered by recent Jetty versions
|
||||||
|
Change request queueing in jetty.xml (new installs only)
|
||||||
|
SU3 plugin file format
|
||||||
|
|
||||||
|
0.10.0
|
||||||
|
2013-04-14
|
||||||
|
Updates and migration for Jetty 7 (I2P 0.9.6)
|
||||||
|
|
||||||
|
0.9.0
|
||||||
|
2013-01-25
|
||||||
|
Add cache-control directives
|
||||||
|
Set max Jetty to 6.99999
|
||||||
|
|
||||||
|
0.8
|
||||||
|
2012-03-10
|
||||||
|
fix comment in jetty.xml
|
||||||
|
|
||||||
|
0.7
|
||||||
|
2012-03-10
|
||||||
|
Port to Jetty 6
|
||||||
|
Replace QForwardHandler with RewriteHandler
|
||||||
|
Use ${ant.home}/lib/ant.jar instead of pulling ant.jar from Jetty
|
||||||
|
|
||||||
|
0.6
|
||||||
|
2011-12-31
|
||||||
|
Set max jetty version 5.99999
|
||||||
|
Add throttle options
|
||||||
|
Stub out announce-to-seedless
|
||||||
|
Seedless fixes, untested
|
||||||
|
|
||||||
|
0.5
|
||||||
|
2010-07-11
|
||||||
|
Final compact response format
|
||||||
|
|
||||||
|
0.4
|
||||||
|
2010-07-09
|
||||||
|
Compact request/response support - may not be final format
|
||||||
|
Fix NPE if no ip parameter
|
||||||
|
|
||||||
|
0.3
|
||||||
|
2010-04-13
|
||||||
|
Verify dest
|
||||||
|
Add xfs check
|
||||||
|
|
||||||
|
0.2
|
||||||
|
2010-03-23
|
||||||
|
Cache b64 dest strings
|
||||||
|
Help typo fix (thx duck)
|
||||||
|
Lots of seedless fixes
|
||||||
|
Build cleanups
|
||||||
|
|
||||||
|
0.1
|
||||||
|
2010-03-23
|
17
build.xml
17
build.xml
@ -11,7 +11,7 @@
|
|||||||
<delete file="plugin/i2ptunnel.config" />
|
<delete file="plugin/i2ptunnel.config" />
|
||||||
<!-- get version number -->
|
<!-- get version number -->
|
||||||
<buildnumber file="scripts/build.number" />
|
<buildnumber file="scripts/build.number" />
|
||||||
<property name="release.number" value="0.7" />
|
<property name="release.number" value="0.11.0" />
|
||||||
|
|
||||||
<!-- make the update xpi2p -->
|
<!-- make the update xpi2p -->
|
||||||
<!-- this contains everything except i2ptunnel.config -->
|
<!-- this contains everything except i2ptunnel.config -->
|
||||||
@ -34,10 +34,18 @@
|
|||||||
<arg value="plugin/eepsite/webapps/tracker.war.pack" />
|
<arg value="plugin/eepsite/webapps/tracker.war.pack" />
|
||||||
<arg value="src/build/tracker.war.jar" />
|
<arg value="src/build/tracker.war.jar" />
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="scripts/makeplugin.sh" failonerror="true" >
|
<input message="Enter su3 signing key password:" addproperty="release.password.su3" />
|
||||||
|
<fail message="You must enter a password." >
|
||||||
|
<condition>
|
||||||
|
<equals arg1="${release.password.su3}" arg2=""/>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
|
<!-- this will fail if no su3 keys exist, as it needs the password twice -->
|
||||||
|
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
|
||||||
<arg value="plugin" />
|
<arg value="plugin" />
|
||||||
</exec>
|
</exec>
|
||||||
<move file="zzzot.xpi2p" tofile="zzzot-update.xpi2p" overwrite="true" />
|
<move file="zzzot.xpi2p" tofile="zzzot-update.xpi2p" overwrite="true" />
|
||||||
|
<move file="zzzot.su3" tofile="zzzot-update.su3" overwrite="true" />
|
||||||
|
|
||||||
<!-- make the install xpi2p -->
|
<!-- make the install xpi2p -->
|
||||||
<copy file="scripts/i2ptunnel.config" todir="plugin/" overwrite="true" />
|
<copy file="scripts/i2ptunnel.config" todir="plugin/" overwrite="true" />
|
||||||
@ -45,7 +53,7 @@
|
|||||||
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
|
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
|
||||||
<arg value="version=${release.number}-b${build.number}" />
|
<arg value="version=${release.number}-b${build.number}" />
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="scripts/makeplugin.sh" failonerror="true" >
|
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
|
||||||
<arg value="plugin" />
|
<arg value="plugin" />
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
@ -62,6 +70,9 @@
|
|||||||
<delete file="plugin/README.txt" />
|
<delete file="plugin/README.txt" />
|
||||||
<delete file="zzzot.xpi2p" />
|
<delete file="zzzot.xpi2p" />
|
||||||
<delete file="zzzot-update.xpi2p" />
|
<delete file="zzzot-update.xpi2p" />
|
||||||
|
<delete file="zzzot.su3" />
|
||||||
|
<delete file="zzzot-update.su3" />
|
||||||
|
<delete file="plugin.zip" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,18 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
|
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Configure a custom context for the eepsite.
|
Configure a custom context for the eepsite.
|
||||||
|
|
||||||
This context contains only a Context with a default servlet
|
This context contains only a ServletContextHandler with a default servlet
|
||||||
to serve static html files and images.
|
to serve static html files and images.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Configure class="org.mortbay.jetty.servlet.Context">
|
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
|
||||||
<Set name="contextPath">/</Set>
|
<Set name="contextPath">/</Set>
|
||||||
<Set name="resourceBase">$PLUGIN/eepsite/docroot/</Set>
|
<Set name="resourceBase">$PLUGIN/eepsite/docroot/</Set>
|
||||||
|
<Call name="setInitParameter">
|
||||||
|
<Arg>cacheControl</Arg>
|
||||||
|
<Arg>max-age=3600,public</Arg>
|
||||||
|
</Call>
|
||||||
<Call name="addServlet">
|
<Call name="addServlet">
|
||||||
<Arg>org.mortbay.jetty.servlet.DefaultServlet</Arg>
|
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
|
||||||
<Arg>/</Arg>
|
<Arg>/</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
</Configure>
|
</Configure>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
|
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Configure a custom context for the eepsite.
|
Configure a custom context for the eepsite.
|
||||||
@ -22,21 +22,15 @@ Configure a custom context for the eepsite.
|
|||||||
* parameter value.
|
* parameter value.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Configure class="org.mortbay.jetty.servlet.Context">
|
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
|
||||||
<Set name="contextPath">/cgi-bin</Set>
|
<Set name="contextPath">/cgi-bin</Set>
|
||||||
<Set name="resourceBase">$PLUGIN/eepsite/cgi-bin/</Set>
|
<Set name="resourceBase">$PLUGIN/eepsite/cgi-bin/</Set>
|
||||||
<Call name="setInitParams">
|
<Call name="setInitParameter">
|
||||||
<Arg>
|
<Arg>Path</Arg>
|
||||||
<Map>
|
<Arg>/usr/local/bin:/bin:/usr/bin</Arg>
|
||||||
<Entry>
|
|
||||||
<Item>Path</Item>
|
|
||||||
<Item>/usr/local/bin:/bin:/usr/bin</Item>
|
|
||||||
</Entry>
|
|
||||||
</Map>
|
|
||||||
</Arg>
|
|
||||||
</Call>
|
</Call>
|
||||||
<Call name="addServlet">
|
<Call name="addServlet">
|
||||||
<Arg>org.mortbay.servlet.CGI</Arg>
|
<Arg>org.eclipse.jetty.servlets.CGI</Arg>
|
||||||
<Arg>/</Arg>
|
<Arg>/</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
</Configure>
|
</Configure>
|
||||||
|
@ -35,23 +35,23 @@
|
|||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
<!-- UNCOMMENT TO ACTIVATE
|
<!-- UNCOMMENT TO ACTIVATE
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
|
<param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
|
||||||
<param-value>127.0.0.1</param-value>
|
<param-value>127.0.0.1</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
|
<param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
|
||||||
<param-value>/</param-value>
|
<param-value>/</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
|
<param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
|
||||||
<param-value>-1</param-value>
|
<param-value>-1</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
|
<param-name>org.eclipse.jetty.webapp.NoTLDJarPattern</param-name>
|
||||||
<param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
|
<param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
@ -112,7 +112,7 @@
|
|||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>default</servlet-name>
|
<servlet-name>default</servlet-name>
|
||||||
<servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
|
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>acceptRanges</param-name>
|
<param-name>acceptRanges</param-name>
|
||||||
<param-value>true</param-value>
|
<param-value>true</param-value>
|
||||||
@ -153,12 +153,10 @@
|
|||||||
<param-name>useFileMappedBuffer</param-name>
|
<param-name>useFileMappedBuffer</param-name>
|
||||||
<param-value>true</param-value>
|
<param-value>true</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
<!--
|
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>cacheControl</param-name>
|
<param-name>cacheControl</param-name>
|
||||||
<param-value>max-age=3600,public</param-value>
|
<param-value>max-age=3600,public</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
-->
|
|
||||||
<load-on-startup>0</load-on-startup>
|
<load-on-startup>0</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
@ -308,7 +306,7 @@
|
|||||||
<!-- Uncomment for dynamic invocation
|
<!-- Uncomment for dynamic invocation
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>invoker</servlet-name>
|
<servlet-name>invoker</servlet-name>
|
||||||
<servlet-class>org.mortbay.jetty.servlet.Invoker</servlet-class>
|
<servlet-class>org.eclipse.jetty.servlet.Invoker</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>verbose</param-name>
|
<param-name>verbose</param-name>
|
||||||
<param-value>false</param-value>
|
<param-value>false</param-value>
|
||||||
|
@ -10,6 +10,9 @@ This link is also at the top of your router console when ZzzOT is running.
|
|||||||
<p>Report bugs or add comments on
|
<p>Report bugs or add comments on
|
||||||
<a href="http://zzz.i2p//forums/16">the plugin forum on zzz.i2p</a>.
|
<a href="http://zzz.i2p//forums/16">the plugin forum on zzz.i2p</a>.
|
||||||
|
|
||||||
|
<p><b>This help file is $PLUGIN/eepsite/docroot/help.html, you should probably move it
|
||||||
|
outside of the document root before you announce your eepsite as it may contain your user name.</b>
|
||||||
|
|
||||||
<h3>Eepsite Key and Helpful Hints for I2P</h3>
|
<h3>Eepsite Key and Helpful Hints for I2P</h3>
|
||||||
|
|
||||||
<p>Your Base 32 address is <a href="http://$B32/">$B32</a>.
|
<p>Your Base 32 address is <a href="http://$B32/">$B32</a>.
|
||||||
@ -47,8 +50,6 @@ This link is also at the top of your router console when ZzzOT is running.
|
|||||||
If your tracker gets over 1000 peers, you will probably want to increase the number of tunnels.
|
If your tracker gets over 1000 peers, you will probably want to increase the number of tunnels.
|
||||||
<p>The Jetty webserver port is 7662. If you must change it, edit jetty.xml, i2ptunnel.config, and plugins.config
|
<p>The Jetty webserver port is 7662. If you must change it, edit jetty.xml, i2ptunnel.config, and plugins.config
|
||||||
in the directory $PLUGIN. Then stop and restart the plugin.
|
in the directory $PLUGIN. Then stop and restart the plugin.
|
||||||
<p>This help file is $PLUGIN/eepsite/docroot/help.html, you should probably move it
|
|
||||||
outside of the document root before you announce your eepsite as it may contain your user name.
|
|
||||||
<p>As you probably know, an open tracker does not require torrents to be registered,
|
<p>As you probably know, an open tracker does not require torrents to be registered,
|
||||||
and it does not host torrent files. You can, however, host torrent files elsewhere on
|
and it does not host torrent files. You can, however, host torrent files elsewhere on
|
||||||
the eepsite, for example at <a href="http://$B32/torrents/">/torrents</a>.
|
the eepsite, for example at <a href="http://$B32/torrents/">/torrents</a>.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
|
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
|
||||||
|
|
||||||
<!-- ========================================================================= -->
|
<!-- ========================================================================= -->
|
||||||
<!-- This file configures the Jetty server. -->
|
<!-- This file configures the Jetty server. -->
|
||||||
@ -8,21 +8,21 @@
|
|||||||
<!-- Commonly changed settings: -->
|
<!-- Commonly changed settings: -->
|
||||||
<!-- * host: Change 127.0.0.1 to 0.0.0.0 in the addListener section -->
|
<!-- * host: Change 127.0.0.1 to 0.0.0.0 in the addListener section -->
|
||||||
<!-- to access the server directly (bypassing i2p) -->
|
<!-- to access the server directly (bypassing i2p) -->
|
||||||
<!-- from other computers.
|
<!-- from other computers. -->
|
||||||
<!-- * port: Default 7662 in the addConnector section -->
|
<!-- * port: Default 7662 in the addConnector section -->
|
||||||
<!-- * docroot: Change the ResourceBase in the addContext section -->
|
<!-- * docroot: Change the ResourceBase in the contexts/base-context.xml file -->
|
||||||
<!-- to serve files from a different location. -->
|
<!-- to serve files from a different location. -->
|
||||||
<!-- * threads: Raise MinThreads and/or MaxThreads in the addListener section -->
|
<!-- * threads: Raise maximumPoolSize in the ThreadPool section -->
|
||||||
<!-- if you have a high-traffic site and get a lot of warnings. -->
|
<!-- if you have a high-traffic site and get a lot of warnings. -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- I2P uses Jetty 6.1.26. If you need web server features not found -->
|
<!-- I2P uses Jetty 7. If you need web server features not found -->
|
||||||
<!-- in Jetty 6, you may install and run Jetty 7 or 8 in a different JVM -->
|
<!-- in Jetty 7, you may install and run Jetty 7 or 8 in a different JVM -->
|
||||||
<!-- or run any other web server such as Apache. If you do run another web -->
|
<!-- or run any other web server such as Apache. If you do run another web -->
|
||||||
<!-- server instead, be sure and disable the Jetty 6 server for your -->
|
<!-- server instead, be sure and disable the Jetty 6 server for your -->
|
||||||
<!-- eepsite on http://127.0.0.1:7657/configclients.jsp . -->
|
<!-- eepsite on http://127.0.0.1:7657/configclients.jsp . -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- Jetty now uses the I2P logging system rather than wrapper.log. -->
|
<!-- Jetty now uses the I2P logging system rather than wrapper.log. -->
|
||||||
<!-- Use the log override org.mortbay.jetty.Server to adjust the log level. -->
|
<!-- Use the log override org.eclipse.jetty.server.Server to adjust the log level. -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- Note that the XML encoding for this file is UTF-8. -->
|
<!-- Note that the XML encoding for this file is UTF-8. -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<!-- =============================================================== -->
|
<!-- =============================================================== -->
|
||||||
|
|
||||||
|
|
||||||
<Configure id="Server" class="org.mortbay.jetty.Server">
|
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Server Thread Pool -->
|
<!-- Server Thread Pool -->
|
||||||
@ -46,30 +46,57 @@
|
|||||||
|
|
||||||
<!-- PICK ONE -->
|
<!-- PICK ONE -->
|
||||||
|
|
||||||
<!-- If you don't have or want threadpool
|
<!--
|
||||||
Requests above the max will be queued
|
Recommended.
|
||||||
|
Requests above the maxThreads + queue_size will be rejected and logged.
|
||||||
|
ref:
|
||||||
|
https://wiki.eclipse.org/Jetty/Howto/High_Load
|
||||||
|
http://trac.i2p2.i2p/ticket/1395
|
||||||
-->
|
-->
|
||||||
<!--
|
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
|
||||||
<New class="org.mortbay.thread.QueuedThreadPool">
|
<Arg>
|
||||||
<Set name="minThreads">1</Set>
|
<New class="java.util.concurrent.LinkedBlockingQueue">
|
||||||
<Set name="maxThreads">16</Set>
|
<Arg type="int">50</Arg>
|
||||||
<Set name="lowThreads">2</Set>
|
</New>
|
||||||
|
</Arg>
|
||||||
|
<Set name="minThreads">4</Set>
|
||||||
|
<Set name="maxThreads">20</Set>
|
||||||
|
<Set name="maxIdleTimeMs">60000</Set>
|
||||||
|
<Set name="daemon">true</Set>
|
||||||
|
<Set name="name">Zzzot Jetty</Set>
|
||||||
</New>
|
</New>
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Optional Java 5 bounded threadpool with job queue
|
<!-- Optional Java 5 bounded threadpool with job queue
|
||||||
Requests above the max will be rejected
|
Requests above the max will be rejected and logged.
|
||||||
TODO: would be nice to use the 5-arg constructor but
|
High-traffic sites should increase maximumPoolSize.
|
||||||
how do you use an Enum as the TimeUnit argument?
|
|
||||||
Alternatively, make a custom class where we can
|
Args are:
|
||||||
set the thread name, set daemon, etc.
|
corePoolSize (should be at least 3)
|
||||||
See RouterConsoleRunner.
|
maximumPoolSize
|
||||||
|
keepAliveTime (milliseconds)
|
||||||
|
timeout (TimeUnit)
|
||||||
|
queue (BlockingQueue)
|
||||||
|
|
||||||
|
Not recommended.
|
||||||
|
ref:
|
||||||
|
http://trac.i2p2.i2p/ticket/1395
|
||||||
|
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html
|
||||||
-->
|
-->
|
||||||
<New class="org.mortbay.thread.concurrent.ThreadPool">
|
<!--
|
||||||
<Arg type="int">0</Arg>
|
<New class="org.eclipse.jetty.util.thread.ExecutorThreadPool">
|
||||||
<Set name="corePoolSize">1</Set>
|
<Arg type="int">3</Arg>
|
||||||
<Set name="maximumPoolSize">16</Set>
|
<Arg type="int">20</Arg>
|
||||||
|
<Arg type="long">60000</Arg>
|
||||||
|
<Arg>
|
||||||
|
<Call class="java.util.concurrent.TimeUnit" name="valueOf" >
|
||||||
|
<Arg>MILLISECONDS</Arg>
|
||||||
|
</Call>
|
||||||
|
</Arg>
|
||||||
|
<Arg>
|
||||||
|
<New class="java.util.concurrent.SynchronousQueue" />
|
||||||
|
</Arg>
|
||||||
</New>
|
</New>
|
||||||
|
-->
|
||||||
</Set>
|
</Set>
|
||||||
|
|
||||||
|
|
||||||
@ -82,10 +109,14 @@
|
|||||||
|
|
||||||
<!-- Use this connector for many frequently idle connections
|
<!-- Use this connector for many frequently idle connections
|
||||||
and for threadless continuations.
|
and for threadless continuations.
|
||||||
|
Not recommended on Java 5 - comment this out, and uncomment the
|
||||||
|
SocketConnector below.
|
||||||
|
Do not use for gij or JamVM - comment this out, and uncomment the
|
||||||
|
SocketConnector below.
|
||||||
-->
|
-->
|
||||||
<Call name="addConnector">
|
<Call name="addConnector">
|
||||||
<Arg>
|
<Arg>
|
||||||
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
|
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
|
||||||
<Set name="host">127.0.0.1</Set>
|
<Set name="host">127.0.0.1</Set>
|
||||||
<Set name="port">7662</Set>
|
<Set name="port">7662</Set>
|
||||||
<Set name="maxIdleTime">60000</Set>
|
<Set name="maxIdleTime">60000</Set>
|
||||||
@ -94,16 +125,35 @@
|
|||||||
<Set name="confidentialPort">8443</Set>
|
<Set name="confidentialPort">8443</Set>
|
||||||
<Set name="lowResourcesConnections">5000</Set>
|
<Set name="lowResourcesConnections">5000</Set>
|
||||||
<Set name="lowResourcesMaxIdleTime">5000</Set>
|
<Set name="lowResourcesMaxIdleTime">5000</Set>
|
||||||
|
<Set name="useDirectBuffers">false</Set>
|
||||||
</New>
|
</New>
|
||||||
</Arg>
|
</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
|
|
||||||
|
<!-- Recommended to use this connector on Java 5, as
|
||||||
|
Jetty 6 and Java 5 NIO don't play well together.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
<Call name="addConnector">
|
||||||
|
<Arg>
|
||||||
|
<New class="org.eclipse.jetty.server.bio.SocketConnector">
|
||||||
|
<Set name="host">127.0.0.1</Set>
|
||||||
|
<Set name="port">7662</Set>
|
||||||
|
<Set name="maxIdleTime">60000</Set>
|
||||||
|
<Set name="Acceptors">1</Set>
|
||||||
|
<Set name="statsOn">false</Set>
|
||||||
|
<Set name="confidentialPort">8443</Set>
|
||||||
|
</New>
|
||||||
|
</Arg>
|
||||||
|
</Call>
|
||||||
|
-->
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Set up global session ID manager -->
|
<!-- Set up global session ID manager -->
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!--
|
<!--
|
||||||
<Set name="sessionIdManager">
|
<Set name="sessionIdManager">
|
||||||
<New class="org.mortbay.jetty.servlet.HashSessionIdManager">
|
<New class="org.eclipse.jetty.server.session.HashSessionIdManager">
|
||||||
<Set name="workerName">node1</Set>
|
<Set name="workerName">node1</Set>
|
||||||
</New>
|
</New>
|
||||||
</Set>
|
</Set>
|
||||||
@ -118,74 +168,74 @@
|
|||||||
<!-- that is hosted on the same eepsite. -->
|
<!-- that is hosted on the same eepsite. -->
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<Set name="handler">
|
<Set name="handler">
|
||||||
<New id="Rewrite" class="org.mortbay.jetty.handler.rewrite.RewriteHandler">
|
<New id="Rewrite" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
|
||||||
<Set name="rewriteRequestURI">true</Set>
|
<Set name="rewriteRequestURI">true</Set>
|
||||||
<Set name="rewritePathInfo">false</Set>
|
<Set name="rewritePathInfo">false</Set>
|
||||||
<Set name="originalPathAttribute">requestedPath</Set>
|
<Set name="originalPathAttribute">requestedPath</Set>
|
||||||
<Set name="rules">
|
<Set name="rules">
|
||||||
<Array type="org.mortbay.jetty.handler.rewrite.Rule">
|
<Array type="org.eclipse.jetty.rewrite.handler.Rule">
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/a</Set>
|
<Set name="pattern">/a</Set>
|
||||||
<Set name="replacement">/tracker/announce.jsp</Set>
|
<Set name="replacement">/tracker/announce.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/announce</Set>
|
<Set name="pattern">/announce</Set>
|
||||||
<Set name="replacement">/tracker/announce.jsp</Set>
|
<Set name="replacement">/tracker/announce.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/announce.jsp</Set>
|
<Set name="pattern">/announce.jsp</Set>
|
||||||
<Set name="replacement">/tracker/announce.jsp</Set>
|
<Set name="replacement">/tracker/announce.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/announce.php</Set>
|
<Set name="pattern">/announce.php</Set>
|
||||||
<Set name="replacement">/tracker/announce.jsp</Set>
|
<Set name="replacement">/tracker/announce.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/scrape</Set>
|
<Set name="pattern">/scrape</Set>
|
||||||
<Set name="replacement">/tracker/scrape.jsp</Set>
|
<Set name="replacement">/tracker/scrape.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/scrape.jsp</Set>
|
<Set name="pattern">/scrape.jsp</Set>
|
||||||
<Set name="replacement">/tracker/scrape.jsp</Set>
|
<Set name="replacement">/tracker/scrape.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/scrape.php</Set>
|
<Set name="pattern">/scrape.php</Set>
|
||||||
<Set name="replacement">/tracker/scrape.jsp</Set>
|
<Set name="replacement">/tracker/scrape.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/Seedless</Set>
|
<Set name="pattern">/Seedless</Set>
|
||||||
<Set name="replacement">/tracker/seedless.jsp</Set>
|
<Set name="replacement">/tracker/seedless.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/Seedless/</Set>
|
<Set name="pattern">/Seedless/</Set>
|
||||||
<Set name="replacement">/tracker/seedless.jsp</Set>
|
<Set name="replacement">/tracker/seedless.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/Seedless/index.jsp</Set>
|
<Set name="pattern">/Seedless/index.jsp</Set>
|
||||||
<Set name="replacement">/tracker/seedless.jsp</Set>
|
<Set name="replacement">/tracker/seedless.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
|
<New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
||||||
<Set name="pattern">/Seedless/seedless</Set>
|
<Set name="pattern">/Seedless/seedless</Set>
|
||||||
<Set name="replacement">/tracker/seedless.jsp</Set>
|
<Set name="replacement">/tracker/seedless.jsp</Set>
|
||||||
</New>
|
</New>
|
||||||
@ -193,17 +243,17 @@
|
|||||||
</Array>
|
</Array>
|
||||||
</Set>
|
</Set>
|
||||||
<Set name="handler">
|
<Set name="handler">
|
||||||
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
|
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
|
||||||
<Set name="handlers">
|
<Set name="handlers">
|
||||||
<Array type="org.mortbay.jetty.Handler">
|
<Array type="org.eclipse.jetty.server.Handler">
|
||||||
<Item>
|
<Item>
|
||||||
<New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
|
<New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
|
<New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
|
||||||
</Item>
|
</Item>
|
||||||
<Item>
|
<Item>
|
||||||
<New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
|
<New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
|
||||||
</Item>
|
</Item>
|
||||||
</Array>
|
</Array>
|
||||||
</Set>
|
</Set>
|
||||||
@ -211,7 +261,32 @@
|
|||||||
</Set>
|
</Set>
|
||||||
</New>
|
</New>
|
||||||
</Set>
|
</Set>
|
||||||
|
|
||||||
|
<!-- =============================================================== -->
|
||||||
|
<!-- Create the deployment manager -->
|
||||||
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||||
|
<!-- The deplyment manager handles the lifecycle of deploying web -->
|
||||||
|
<!-- applications. Apps are provided by instances of the -->
|
||||||
|
<!-- AppProvider interface. Typically these are provided by -->
|
||||||
|
<!-- one or more of: -->
|
||||||
|
<!-- jetty-webapps.xml - monitors webapps for wars and dirs -->
|
||||||
|
<!-- jetty-contexts.xml - monitors contexts for context xml -->
|
||||||
|
<!-- jetty-templates.xml - monitors contexts and templates -->
|
||||||
|
<!-- =============================================================== -->
|
||||||
|
<Call name="addBean">
|
||||||
|
<Arg>
|
||||||
|
<New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
|
||||||
|
<Set name="contexts">
|
||||||
|
<Ref id="Contexts" />
|
||||||
|
</Set>
|
||||||
|
<Call name="setContextAttribute">
|
||||||
|
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
||||||
|
<Arg>.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</Arg>
|
||||||
|
</Call>
|
||||||
|
</New>
|
||||||
|
</Arg>
|
||||||
|
</Call>
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Configure the context deployer -->
|
<!-- Configure the context deployer -->
|
||||||
<!-- A context deployer will deploy contexts described in -->
|
<!-- A context deployer will deploy contexts described in -->
|
||||||
@ -223,15 +298,16 @@
|
|||||||
<!-- in the $JETTY_HOME/contexts directory -->
|
<!-- in the $JETTY_HOME/contexts directory -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<Call name="addLifeCycle">
|
<Ref id="DeploymentManager">
|
||||||
<Arg>
|
<Call name="addAppProvider">
|
||||||
<New class="org.mortbay.jetty.deployer.ContextDeployer">
|
<Arg>
|
||||||
<Set name="contexts"><Ref id="Contexts"/></Set>
|
<New class="org.eclipse.jetty.deploy.providers.ContextProvider">
|
||||||
<Set name="configurationDir">$PLUGIN/contexts</Set>
|
<Set name="monitoredDirName">$PLUGIN/contexts</Set>
|
||||||
<Set name="scanInterval">0</Set>
|
<Set name="scanInterval">120</Set>
|
||||||
</New>
|
</New>
|
||||||
</Arg>
|
</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
|
</Ref>
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Configure the webapp deployer. -->
|
<!-- Configure the webapp deployer. -->
|
||||||
@ -246,18 +322,18 @@
|
|||||||
<!-- Normally only one type of deployer need be used. -->
|
<!-- Normally only one type of deployer need be used. -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<Call name="addLifeCycle">
|
<Ref id="DeploymentManager">
|
||||||
<Arg>
|
<Call id="webappprovider" name="addAppProvider">
|
||||||
<New class="org.mortbay.jetty.deployer.WebAppDeployer">
|
<Arg>
|
||||||
<Set name="contexts"><Ref id="Contexts"/></Set>
|
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
|
||||||
<Set name="webAppDir">$PLUGIN/eepsite/webapps</Set>
|
<Set name="monitoredDirName">$PLUGIN/eepsite/webapps</Set>
|
||||||
<Set name="parentLoaderPriority">false</Set>
|
<Set name="parentLoaderPriority">false</Set>
|
||||||
<Set name="extract">true</Set>
|
<Set name="extractWars">false</Set>
|
||||||
<Set name="allowDuplicates">false</Set>
|
<Set name="defaultsDescriptor">$PLUGIN/etc/webdefault.xml</Set>
|
||||||
<Set name="defaultsDescriptor">$PLUGIN/etc/webdefault.xml</Set>
|
</New>
|
||||||
</New>
|
</Arg>
|
||||||
</Arg>
|
</Call>
|
||||||
</Call>
|
</Ref>
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Configure Authentication Realms -->
|
<!-- Configure Authentication Realms -->
|
||||||
@ -268,9 +344,9 @@
|
|||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- UNCOMMENT TO ACTIVATE
|
<!-- UNCOMMENT TO ACTIVATE
|
||||||
<Set name="UserRealms">
|
<Set name="UserRealms">
|
||||||
<Array type="org.mortbay.jetty.security.UserRealm">
|
<Array type="org.eclipse.jetty.security.LoginService">
|
||||||
<Item>
|
<Item>
|
||||||
<New class="org.mortbay.jetty.security.HashUserRealm">
|
<New class="org.eclipse.jetty.security.HashLoginService">
|
||||||
<Set name="name">Test Realm</Set>
|
<Set name="name">Test Realm</Set>
|
||||||
<Set name="config">$PLUGIN/etc/realm.properties</Set>
|
<Set name="config">$PLUGIN/etc/realm.properties</Set>
|
||||||
<Set name="refreshInterval">0</Set>
|
<Set name="refreshInterval">0</Set>
|
||||||
|
@ -5,11 +5,16 @@
|
|||||||
# usage: makeplugin.sh plugindir
|
# usage: makeplugin.sh plugindir
|
||||||
#
|
#
|
||||||
# zzz 2010-02
|
# zzz 2010-02
|
||||||
|
# zzz 2014-08 added support for su3 files
|
||||||
#
|
#
|
||||||
PUBKEYDIR=$HOME/.i2p-plugin-keys
|
PUBKEYDIR=$HOME/.i2p-plugin-keys
|
||||||
PUBKEYFILE=$PUBKEYDIR/plugin-public-signing.key
|
PUBKEYFILE=$PUBKEYDIR/plugin-public-signing.key
|
||||||
PRIVKEYFILE=$PUBKEYDIR/plugin-private-signing.key
|
PRIVKEYFILE=$PUBKEYDIR/plugin-private-signing.key
|
||||||
B64KEYFILE=$PUBKEYDIR/plugin-public-signing.txt
|
B64KEYFILE=$PUBKEYDIR/plugin-public-signing.txt
|
||||||
|
PUBKEYSTORE=$PUBKEYDIR/plugin-su3-public-signing.crt
|
||||||
|
PRIVKEYSTORE=$PUBKEYDIR/plugin-su3-keystore.ks
|
||||||
|
KEYTYPE=RSA_SHA512_4096
|
||||||
|
|
||||||
export I2P=../i2p/pkg-temp
|
export I2P=../i2p/pkg-temp
|
||||||
|
|
||||||
PLUGINDIR=${1:-plugin}
|
PLUGINDIR=${1:-plugin}
|
||||||
@ -17,46 +22,67 @@ PLUGINDIR=${1:-plugin}
|
|||||||
PC=plugin.config
|
PC=plugin.config
|
||||||
PCT=${PC}.tmp
|
PCT=${PC}.tmp
|
||||||
|
|
||||||
if [ ! -f $PRIVKEYFILE ]
|
|
||||||
then
|
|
||||||
mkdir -p $PUBKEYDIR
|
|
||||||
java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate keygen $PUBKEYFILE $PRIVKEYFILE || exit 1
|
|
||||||
java -cp $I2P/lib/i2p.jar net.i2p.data.Base64 encode $PUBKEYFILE $B64KEYFILE || exit 1
|
|
||||||
rm -rf logs/
|
|
||||||
chmod 444 $PUBKEYFILE $B64KEYFILE
|
|
||||||
chmod 400 $PRIVKEYFILE
|
|
||||||
echo "Created new keys: $PUBKEYFILE $PRIVKEYFILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f plugin.zip
|
|
||||||
if [ ! -d $PLUGINDIR ]
|
if [ ! -d $PLUGINDIR ]
|
||||||
then
|
then
|
||||||
echo "You must have a $PLUGINDIR directory"
|
echo "You must have a $PLUGINDIR directory"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OPWD=$PWD
|
if [ ! -f $PLUGINDIR/$PC ]
|
||||||
cd $PLUGINDIR
|
|
||||||
|
|
||||||
if [ ! -f $PC ]
|
|
||||||
then
|
then
|
||||||
echo "You must have a $PC file"
|
echo "You must have a $PLUGINDIR/$PC file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep -q '^signer=' $PC
|
SIGNER=`grep '^signer=' $PLUGINDIR/$PC`
|
||||||
if [ "$?" -ne "0" ]
|
if [ "$?" -ne "0" ]
|
||||||
then
|
then
|
||||||
echo "You must have a signer in $PC"
|
echo "You must have a plugin name in $PC"
|
||||||
echo 'For example signer=joe@mail.i2p'
|
echo 'For example name=foo'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
SIGNER=`echo $SIGNER | cut -f 2 -d '='`
|
||||||
|
|
||||||
|
if [ ! -f $PRIVKEYFILE ]
|
||||||
|
then
|
||||||
|
echo "Creating new XPI2P DSA keys"
|
||||||
|
mkdir -p $PUBKEYDIR || exit 1
|
||||||
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate keygen $PUBKEYFILE $PRIVKEYFILE || exit 1
|
||||||
|
java -cp $I2P/lib/i2p.jar net.i2p.data.Base64 encode $PUBKEYFILE $B64KEYFILE || exit 1
|
||||||
|
rm -rf logs/
|
||||||
|
chmod 444 $PUBKEYFILE $B64KEYFILE
|
||||||
|
chmod 400 $PRIVKEYFILE
|
||||||
|
echo "Created new XPI2P keys: $PUBKEYFILE $PRIVKEYFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $PRIVKEYSTORE ]
|
||||||
|
then
|
||||||
|
echo "Creating new SU3 $KEYTYPE keys for $SIGNER"
|
||||||
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.SU3File keygen -t $KEYTYPE $PUBKEYSTORE $PRIVKEYSTORE $SIGNER || exit 1
|
||||||
|
echo '*** Save your password in a safe place!!! ***'
|
||||||
|
rm -rf logs/
|
||||||
|
# copy to the router dir so verify will work
|
||||||
|
CDIR=$I2P/certificates/plugin
|
||||||
|
mkdir -p $CDIR || exit 1
|
||||||
|
CFILE=$CDIR/`echo $SIGNER | sed s/@/_at_/`.crt
|
||||||
|
cp $PUBKEYSTORE $CFILE
|
||||||
|
chmod 444 $PUBKEYSTORE
|
||||||
|
chmod 400 $PRIVKEYSTORE
|
||||||
|
chmod 644 $CFILE
|
||||||
|
echo "Created new SU3 keys: $PUBKEYSTORE $PRIVKEYSTORE"
|
||||||
|
echo "Copied public key to $CFILE for testing"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f plugin.zip
|
||||||
|
|
||||||
|
OPWD=$PWD
|
||||||
|
cd $PLUGINDIR
|
||||||
|
|
||||||
grep -q '^name=' $PC
|
grep -q '^name=' $PC
|
||||||
if [ "$?" -ne "0" ]
|
if [ "$?" -ne "0" ]
|
||||||
then
|
then
|
||||||
echo "You must have a plugin name in $PC"
|
echo "You must have a plugin name in $PC"
|
||||||
echo 'For example name=foo'
|
echo 'For example name=foo'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -64,7 +90,7 @@ grep -q '^version=' $PC
|
|||||||
if [ "$?" -ne "0" ]
|
if [ "$?" -ne "0" ]
|
||||||
then
|
then
|
||||||
echo "You must have a version in $PC"
|
echo "You must have a version in $PC"
|
||||||
echo 'For example version=0.1.2'
|
echo 'For example version=0.1.2'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -72,33 +98,41 @@ fi
|
|||||||
grep -v '^date=' $PC > $PCT
|
grep -v '^date=' $PC > $PCT
|
||||||
DATE=`date '+%s000'`
|
DATE=`date '+%s000'`
|
||||||
echo "date=$DATE" >> $PCT
|
echo "date=$DATE" >> $PCT
|
||||||
mv $PCT $PC
|
mv $PCT $PC || exit 1
|
||||||
|
|
||||||
# add our Base64 key
|
# add our Base64 key
|
||||||
grep -v '^key=' $PC > $PCT
|
grep -v '^key=' $PC > $PCT
|
||||||
B64KEY=`cat $B64KEYFILE`
|
B64KEY=`cat $B64KEYFILE`
|
||||||
echo "key=$B64KEY" >> $PCT || exit 1
|
echo "key=$B64KEY" >> $PCT || exit 1
|
||||||
mv $PCT $PC
|
mv $PCT $PC || exit 1
|
||||||
|
|
||||||
# zip it
|
# zip it
|
||||||
zip -r $OPWD/plugin.zip * -x \*.jar || exit 1
|
zip -r $OPWD/plugin.zip * || exit 1
|
||||||
|
|
||||||
# get the version and use it for the sud header
|
# get the version and use it for the sud header
|
||||||
VERSION=`grep '^version=' $PC | cut -f 2 -d '='`
|
VERSION=`grep '^version=' $PC | cut -f 2 -d '='`
|
||||||
# get the name and use it for the file name
|
# get the name and use it for the file name
|
||||||
NAME=`grep '^name=' $PC | cut -f 2 -d '='`
|
NAME=`grep '^name=' $PC | cut -f 2 -d '='`
|
||||||
XPI2P=${NAME}.xpi2p
|
XPI2P=${NAME}.xpi2p
|
||||||
|
SU3=${NAME}.su3
|
||||||
cd $OPWD
|
cd $OPWD
|
||||||
|
|
||||||
# sign it
|
# sign it
|
||||||
|
echo 'Signing. ...'
|
||||||
java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate sign plugin.zip $XPI2P $PRIVKEYFILE $VERSION || exit 1
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate sign plugin.zip $XPI2P $PRIVKEYFILE $VERSION || exit 1
|
||||||
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.SU3File sign -c PLUGIN -t $KEYTYPE plugin.zip $SU3 $PRIVKEYSTORE $VERSION $SIGNER || exit 1
|
||||||
rm -f plugin.zip
|
rm -f plugin.zip
|
||||||
|
|
||||||
# verify
|
# verify
|
||||||
echo 'Verifying. ...'
|
echo 'Verifying. ...'
|
||||||
java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate showversion $XPI2P || exit 1
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate showversion $XPI2P || exit 1
|
||||||
java -cp $I2P/lib/i2p.jar -Drouter.trustedUpdateKeys=$B64KEY net.i2p.crypto.TrustedUpdate verifysig $XPI2P || exit 1
|
java -cp $I2P/lib/i2p.jar -Drouter.trustedUpdateKeys=$B64KEY net.i2p.crypto.TrustedUpdate verifysig $XPI2P || exit 1
|
||||||
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.SU3File showversion $SU3 || exit 1
|
||||||
|
java -cp $I2P/lib/i2p.jar net.i2p.crypto.SU3File verifysig -k $PUBKEYSTORE $SU3 || exit 1
|
||||||
rm -rf logs/
|
rm -rf logs/
|
||||||
|
|
||||||
echo -n 'Plugin created: '
|
echo 'Plugin files created: '
|
||||||
wc -c $XPI2P
|
wc -c $XPI2P
|
||||||
|
wc -c $SU3
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
@ -5,6 +5,9 @@ consoleLinkURL=http://127.0.0.1:7662/tracker/index.jsp
|
|||||||
description=Open tracker
|
description=Open tracker
|
||||||
author=zzz
|
author=zzz
|
||||||
updateURL=http://stats.i2p/i2p/plugins/zzzot-update.xpi2p
|
updateURL=http://stats.i2p/i2p/plugins/zzzot-update.xpi2p
|
||||||
|
updateURL.su3=http://stats.i2p/i2p/plugins/zzzot-update.su3
|
||||||
websiteURL=http://zzz.i2p/forums/16
|
websiteURL=http://zzz.i2p/forums/16
|
||||||
license=Apache 2.0
|
license=Apache 2.0
|
||||||
min-jetty-version=6
|
min-jetty-version=7
|
||||||
|
max-jetty-version=8.9999
|
||||||
|
min-i2p-version=0.9.9
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
<pathelement location="${i2plib}/mstreaming.jar" />
|
<pathelement location="${i2plib}/mstreaming.jar" />
|
||||||
<pathelement location="${ant.home}/lib/ant.jar"/>
|
<pathelement location="${ant.home}/lib/ant.jar"/>
|
||||||
<pathelement location="${jettylib}/org.mortbay.jetty.jar"/>
|
<pathelement location="${jettylib}/org.mortbay.jetty.jar"/>
|
||||||
<pathelement location="${jettylib}/jasper-compiler.jar" />
|
|
||||||
<pathelement location="${jettylib}/jasper-runtime.jar" />
|
<pathelement location="${jettylib}/jasper-runtime.jar" />
|
||||||
<pathelement location="${jettylib}/javax.servlet.jar" />
|
<pathelement location="${jettylib}/javax.servlet.jar" />
|
||||||
<pathelement location="${jettylib}/jetty-util.jar" />
|
<pathelement location="${jettylib}/jetty-util.jar" />
|
||||||
|
<pathelement location="${jettylib}/jetty-xml.jar" />
|
||||||
<pathelement location="${jettylib}/commons-logging.jar" />
|
<pathelement location="${jettylib}/commons-logging.jar" />
|
||||||
<pathelement location="${jettylib}/commons-el.jar" />
|
<pathelement location="${jettylib}/commons-el.jar" />
|
||||||
</path>
|
</path>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
debug="true" deprecation="on" source="1.5" target="1.5"
|
debug="true" deprecation="on" source="1.5" target="1.5"
|
||||||
destdir="./build/obj"
|
destdir="./build/obj"
|
||||||
includeAntRuntime="false"
|
includeAntRuntime="false"
|
||||||
classpath="${i2plib}/i2p.jar:${i2plib}/i2ptunnel.jar:${i2plib}/i2psnark.jar:${i2plib}/mstreaming.jar:${i2plib}/systray.jar:${jettylib}/org.mortbay.jetty.jar:${jettylib}/jetty-util.jar" >
|
classpath="${i2plib}/i2p.jar:${i2plib}/i2ptunnel.jar:${i2plib}/i2psnark.jar:${i2plib}/mstreaming.jar:${i2plib}/systray.jar:${jettylib}/org.mortbay.jetty.jar:${jettylib}/jetty-util.jar:${jettylib}/jetty-xml.jar" >
|
||||||
<compilerarg line="${javac.compilerargs}" />
|
<compilerarg line="${javac.compilerargs}" />
|
||||||
</javac>
|
</javac>
|
||||||
</target>
|
</target>
|
||||||
|
@ -33,8 +33,8 @@ import net.i2p.util.Log;
|
|||||||
import net.i2p.i2ptunnel.TunnelController;
|
import net.i2p.i2ptunnel.TunnelController;
|
||||||
import net.i2p.apps.systray.UrlLauncher;
|
import net.i2p.apps.systray.UrlLauncher;
|
||||||
|
|
||||||
import org.mortbay.jetty.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.mortbay.xml.XmlConfiguration;
|
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This handles the starting and stopping of an eepsite tunnel and jetty
|
* This handles the starting and stopping of an eepsite tunnel and jetty
|
||||||
@ -54,7 +54,7 @@ public class ZzzOTController {
|
|||||||
private static ZzzOT _zzzot;
|
private static ZzzOT _zzzot;
|
||||||
private static Object _lock = new Object();
|
private static Object _lock = new Object();
|
||||||
|
|
||||||
private static final String BACKUP = "jetty5.xml";
|
private static final String BACKUP_SUFFIX = ".jetty6";
|
||||||
private static final String[] xmlFiles = {
|
private static final String[] xmlFiles = {
|
||||||
"jetty.xml", "contexts/base-context.xml", "contexts/cgi-context.xml",
|
"jetty.xml", "contexts/base-context.xml", "contexts/cgi-context.xml",
|
||||||
"etc/realm.properties", "etc/webdefault.xml" };
|
"etc/realm.properties", "etc/webdefault.xml" };
|
||||||
@ -96,12 +96,12 @@ public class ZzzOTController {
|
|||||||
_log.error("Unable to create " + key.getAbsolutePath() + ' ' + e);
|
_log.error("Unable to create " + key.getAbsolutePath() + ' ' + e);
|
||||||
throw new IllegalArgumentException("Unable to create " + key.getAbsolutePath() + ' ' + e);
|
throw new IllegalArgumentException("Unable to create " + key.getAbsolutePath() + ' ' + e);
|
||||||
}
|
}
|
||||||
_log.error("NOTICE: ZzzOT: New eepsite keys created in " + key.getAbsolutePath());
|
_log.logAlways(Log.INFO, "NOTICE: ZzzOT: New eepsite keys created in " + key.getAbsolutePath());
|
||||||
_log.error("NOTICE: ZzzOT: You should back up this file!");
|
_log.logAlways(Log.INFO, "NOTICE: ZzzOT: You should back up this file!");
|
||||||
String b32 = Base32.encode(dest.calculateHash().getData()) + ".b32.i2p";
|
String b32 = Base32.encode(dest.calculateHash().getData()) + ".b32.i2p";
|
||||||
String b64 = dest.toBase64();
|
String b64 = dest.toBase64();
|
||||||
_log.error("NOTICE: ZzzOT: Your base 32 address is " + b32);
|
_log.logAlways(Log.INFO, "NOTICE: ZzzOT: Your base 32 address is " + b32);
|
||||||
_log.error("NOTICE: ZzzOT: Your base 64 address is " + b64);
|
_log.logAlways(Log.INFO, "NOTICE: ZzzOT: Your base 64 address is " + b64);
|
||||||
}
|
}
|
||||||
startJetty(pluginDir, dest);
|
startJetty(pluginDir, dest);
|
||||||
startI2PTunnel(pluginDir, dest);
|
startI2PTunnel(pluginDir, dest);
|
||||||
@ -193,32 +193,63 @@ public class ZzzOTController {
|
|||||||
private static void migrateJettyXML(File pluginDir) {
|
private static void migrateJettyXML(File pluginDir) {
|
||||||
// contexts dir does not exist in Jetty 5
|
// contexts dir does not exist in Jetty 5
|
||||||
File file = new File(pluginDir, "contexts");
|
File file = new File(pluginDir, "contexts");
|
||||||
if (file.exists())
|
|
||||||
return;
|
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
file = new File(pluginDir, "etc");
|
file = new File(pluginDir, "etc");
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
file = new File(pluginDir, "jetty.xml");
|
file = new File(pluginDir, "jetty.xml");
|
||||||
if (file.exists()) {
|
if (!shouldMigrate(file))
|
||||||
File backup = new File(pluginDir, BACKUP);
|
return;
|
||||||
if (backup.exists()) {
|
|
||||||
I2PAppContext ctx = I2PAppContext.getGlobalContext();
|
|
||||||
backup = new File(pluginDir, BACKUP + ctx.random().nextInt());
|
|
||||||
}
|
|
||||||
boolean ok = FileUtil.copy(file, backup, false, true);
|
|
||||||
if (!ok) {
|
|
||||||
_log.error("WARNING: Failed to back up " + file + " to " + backup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 0; i < xmlFiles.length; i++) {
|
for (int i = 0; i < xmlFiles.length; i++) {
|
||||||
migrateJettyFile(pluginDir, xmlFiles[i]);
|
backupAndMigrateFile(pluginDir, xmlFiles[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return should we copy over all the files, based on the contents of this one
|
||||||
|
* @since 0.10 (Jetty 7)
|
||||||
|
*/
|
||||||
|
private static boolean shouldMigrate(File f) {
|
||||||
|
String xml = FileUtil.readTextFile(f.getAbsolutePath(), 100, true);
|
||||||
|
if (xml == null)
|
||||||
|
return true;
|
||||||
|
return xml.contains("class=\"org.mortbay.jetty.Server\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backup a file and migrate new XML
|
||||||
|
* @return success
|
||||||
|
* @since Jetty 7
|
||||||
|
*/
|
||||||
|
private static boolean backupAndMigrateFile(File toDir, String filename) {
|
||||||
|
File to = new File(toDir, filename);
|
||||||
|
boolean rv = backupFile(to);
|
||||||
|
boolean rv2 = migrateJettyFile(toDir, filename);
|
||||||
|
return rv && rv2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backup a file
|
||||||
|
* @return success
|
||||||
|
* @since Jetty 7
|
||||||
|
*/
|
||||||
|
private static boolean backupFile(File from) {
|
||||||
|
if (!from.exists())
|
||||||
|
return true;
|
||||||
|
File to = new File(from.getAbsolutePath() + BACKUP_SUFFIX);
|
||||||
|
if (to.exists())
|
||||||
|
to = new File(to.getAbsolutePath() + "." + System.currentTimeMillis());
|
||||||
|
boolean rv = FileUtil.copy(from, to, false, true);
|
||||||
|
if (rv)
|
||||||
|
System.err.println("Backed up file " + from + " to " + to);
|
||||||
|
else
|
||||||
|
System.err.println("WARNING: Failed to back up file " + from + " to " + to);
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migate a single jetty config file, replacing $PLUGIN as we copy it.
|
* Migate a single jetty config file, replacing $PLUGIN as we copy it.
|
||||||
*/
|
*/
|
||||||
private static void migrateJettyFile(File pluginDir, String name) {
|
private static boolean migrateJettyFile(File pluginDir, String name) {
|
||||||
File templateDir = new File(pluginDir, "templates");
|
File templateDir = new File(pluginDir, "templates");
|
||||||
File fileTmpl = new File(templateDir, name);
|
File fileTmpl = new File(templateDir, name);
|
||||||
File outFile = new File(pluginDir, name);
|
File outFile = new File(pluginDir, name);
|
||||||
@ -230,8 +261,10 @@ public class ZzzOTController {
|
|||||||
props = props.replace("$PLUGIN", pluginDir.getAbsolutePath());
|
props = props.replace("$PLUGIN", pluginDir.getAbsolutePath());
|
||||||
os = new FileOutputStream(outFile);
|
os = new FileOutputStream(outFile);
|
||||||
os.write(props.getBytes("UTF-8"));
|
os.write(props.getBytes("UTF-8"));
|
||||||
|
return true;
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
_log.error(outFile + " migrate failed", ioe);
|
_log.error(outFile + " migrate failed", ioe);
|
||||||
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
if (os != null) try { os.close(); } catch (IOException ioe) {}
|
if (os != null) try { os.close(); } catch (IOException ioe) {}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<%@page import="java.util.ArrayList" %><%@page import="java.util.Collections" %><%@page import="java.util.List" %><%@page import="java.util.Map" %><%@page import="java.util.HashMap" %><%@page import="net.i2p.data.Base64" %><%@page import="net.i2p.data.Destination" %><%@page import="net.i2p.zzzot.*" %><%@page import="org.klomp.snark.bencode.BEncoder" %><%
|
<%@page import="java.io.ByteArrayInputStream,java.util.ArrayList,java.util.Collections,java.util.List,java.util.Map,java.util.HashMap,net.i2p.data.Base64,net.i2p.data.Destination,net.i2p.zzzot.*,org.klomp.snark.bencode.BEncoder" %><%
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Above one-liner is so there is no whitespace -> IllegalStateException
|
* Above one-liner is so there is no whitespace -> IllegalStateException
|
||||||
@ -33,6 +33,10 @@
|
|||||||
|
|
||||||
// so the chars will turn into bytes correctly
|
// so the chars will turn into bytes correctly
|
||||||
request.setCharacterEncoding("ISO-8859-1");
|
request.setCharacterEncoding("ISO-8859-1");
|
||||||
|
// above doesn't work for the query string
|
||||||
|
// https://wiki.eclipse.org/Jetty/Howto/International_Characters
|
||||||
|
// we could also do ((org.eclipse.jetty.server.Request) request).setQueryEncoding("ISO-8859-1")
|
||||||
|
request.setAttribute("org.eclipse.jetty.server.Request.queryEncoding", "ISO-8859-1");
|
||||||
java.io.OutputStream cout = response.getOutputStream();
|
java.io.OutputStream cout = response.getOutputStream();
|
||||||
response.setCharacterEncoding("ISO-8859-1");
|
response.setCharacterEncoding("ISO-8859-1");
|
||||||
response.setContentType("text/plain");
|
response.setContentType("text/plain");
|
||||||
@ -94,7 +98,10 @@
|
|||||||
try {
|
try {
|
||||||
if (ip.endsWith(".i2p"))
|
if (ip.endsWith(".i2p"))
|
||||||
ip = ip.substring(0, ip.length() - 4);
|
ip = ip.substring(0, ip.length() - 4);
|
||||||
d = new Destination(ip); // from b64 string
|
byte[] b = Base64.decode(ip);
|
||||||
|
if (b == null)
|
||||||
|
throw new Exception();
|
||||||
|
d = Destination.create(new ByteArrayInputStream(b)); // cache
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
fail = true;
|
fail = true;
|
||||||
msg = "bad dest " + e;
|
msg = "bad dest " + e;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<%@page import="java.util.ArrayList" %><%@page import="java.util.List" %><%@page import="java.util.Map" %><%@page import="java.util.HashMap" %><%@page import="net.i2p.zzzot.*" %><%@page import="org.klomp.snark.bencode.BEncoder" %><%
|
<%@page import="java.util.ArrayList,java.util.List,java.util.Map,java.util.HashMap,net.i2p.zzzot.*,org.klomp.snark.bencode.BEncoder" %><%
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Above one-liner is so there is no whitespace -> IllegalStateException
|
* Above one-liner is so there is no whitespace -> IllegalStateException
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<%@page import="net.i2p.crypto.SHA256Generator" %><%@page import="net.i2p.data.Base32" %><%@page import="net.i2p.data.Base64" %><%@page import="net.i2p.data.DataHelper" %><%@page import="net.i2p.zzzot.*" %><%
|
<%@page import="net.i2p.crypto.SHA256Generator,net.i2p.data.Base32,net.i2p.data.Base64,net.i2p.data.DataHelper,net.i2p.zzzot.*" %><%
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 zzz (zzz@mail.i2p)
|
* Copyright 2010 zzz (zzz@mail.i2p)
|
||||||
|
Reference in New Issue
Block a user