Changeset d84b0e44
- Timestamp:
- Jun 11, 2016 1:47:12 PM (5 years ago)
- Branches:
- master
- Children:
- 16a52951
- Parents:
- 471ff5b9 (diff), bb8e0504 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2psnark/java/build.xml
r471ff5b9 rd84b0e44 51 51 <!-- jsp-api.jar only present for debian builds --> 52 52 <pathelement location="../../jetty/jettylib/jsp-api.jar" /> 53 <!-- jetty-i2p.jar only for RunStandalone --> 54 <pathelement location="../../jetty/jettylib/jetty-i2p.jar" /> 55 <!-- systray.jar only for RunStandalone --> 56 <pathelement location="../../systray/java/build/systray.jar" /> 53 57 </classpath> 54 58 </javac> … … 72 76 <!-- set if unset --> 73 77 <property name="workspace.changes.tr" value="" /> 74 <jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/web/* **/messages_*.class ">78 <jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/web/* **/messages_*.class, **/standalone/*"> 75 79 <manifest> 76 80 <attribute name="Main-Class" value="org.klomp.snark.CommandLine" /> … … 180 184 </zip> 181 185 </target> 182 <target name="standalone_prep" depends="war"> 186 187 <!-- make a fat jar for standalone --> 188 <target name="standalone_jar" depends="war"> 189 <jar destfile="build/i2psnark-standalone.jar"> 190 <fileset dir="build/obj" includes="**/standalone/*.class" /> 191 <zipfileset src="build/i2psnark.jar" /> 192 <zipfileset src="../../../core/java/build/i2p.jar" /> 193 <zipfileset src="../../jetty/jettylib/commons-logging.jar" /> 194 <!-- without this we get a warning about 'no JSP support' but that's it 195 <zipfileset src="../../jetty/jettylib/jasper-runtime.jar" /> 196 --> 197 <zipfileset src="../../jetty/jettylib/javax.servlet.jar" /> 198 <zipfileset src="../../jetty/jettylib/jetty-continuation.jar" /> 199 <zipfileset src="../../jetty/jettylib/jetty-deploy.jar" /> 200 <zipfileset src="../../jetty/jettylib/jetty-http.jar" /> 201 <zipfileset src="../../jetty/jettylib/jetty-i2p.jar" /> 202 <zipfileset src="../../jetty/jettylib/jetty-io.jar" /> 203 <zipfileset src="../../jetty/jettylib/jetty-security.jar" /> 204 <zipfileset src="../../jetty/jettylib/jetty-servlet.jar" /> 205 <zipfileset src="../../jetty/jettylib/jetty-util.jar" /> 206 <zipfileset src="../../jetty/jettylib/jetty-webapp.jar" /> 207 <zipfileset src="../../jetty/jettylib/jetty-xml.jar" /> 208 <zipfileset src="../../jetty/jettylib/org.mortbay.jetty.jar" /> 209 <zipfileset src="../../ministreaming/java/build/mstreaming.jar" /> 210 <zipfileset src="../../streaming/java/build/streaming.jar" /> 211 <zipfileset src="../../systray/java/build/systray.jar" /> 212 <manifest> 213 <attribute name="Main-Class" value="org.klomp.snark.standalone.RunStandalone"/> 214 <attribute name="Implementation-Version" value="${full.version}" /> 215 <attribute name="Built-By" value="${build.built-by}" /> 216 <attribute name="Build-Date" value="${build.timestamp}" /> 217 <attribute name="Base-Revision" value="${workspace.version}" /> 218 <attribute name="Workspace-Changes" value="${workspace.changes.tr}" /> 219 </manifest> 220 </jar> 221 </target> 222 223 <!-- add css, image, and js files for standalone snark to the war --> 224 <target name="standalone_war" depends="war"> 225 <mkdir dir="build/standalone-resources/.resources/themes/snark" /> 226 <copy todir="build/standalone-resources/.resources/themes/snark" > 227 <fileset dir="../../../installer/resources/themes/snark/" /> 228 </copy> 229 <replace dir="build/standalone-resources/.resources/themes/snark" 230 summary="true" 231 token="url('/themes/" 232 value="url('/i2psnark/.resources/themes/" > 233 <include name="**/*.css" /> 234 </replace> 235 <replace dir="build/standalone-resources/.resources/themes/snark" 236 summary="true" 237 token="url('../../console/images/" 238 value="url('/i2psnark/.resources/themes/snark/ubergine/images/" > 239 <include name="**/*.css" /> 240 </replace> 241 <replace dir="build/standalone-resources/.resources/themes/snark" 242 summary="true" 243 token="url('../../console/dark/images/" 244 value="url('/i2psnark/.resources/themes/snark/ubergine/images/" > 245 <include name="**/*.css" /> 246 </replace> 247 <replace dir="build/standalone-resources/.resources/themes/snark" 248 summary="true" 249 token="url('../../console/light/images/" 250 value="url('/i2psnark/.resources/themes/snark/ubergine/images/" > 251 <include name="**/*.css" /> 252 </replace> 253 <replace dir="build/standalone-resources/.resources/themes/snark" 254 summary="true" 255 token="url('images/" 256 value="url('/i2psnark/.resources/themes/snark/ubergine/images/" > 257 <include name="**/*.css" /> 258 </replace> 259 <copy todir="build/standalone-resources/.resources/themes/snark/ubergine/images" > 260 <!-- we really don't need all of these --> 261 <fileset dir="../../../installer/resources/themes/console/images/" /> 262 </copy> 263 <copy file="../../../installer/resources/themes/console/dark/images/transparent.gif" 264 todir="build/standalone-resources/.resources/themes/snark/ubergine/images" /> 265 <copy file="../../../installer/resources/themes/console/dark/images/header.png" 266 todir="build/standalone-resources/.resources/themes/snark/ubergine/images" /> 267 <mkdir dir="build/standalone-resources/.resources/js" /> 268 <copy file="../../routerconsole/jsp/js/ajax.js" todir="build/standalone-resources/.resources/js" /> 269 <zip destfile="../i2psnark.war" update="true" duplicate="preserve" > 270 <fileset dir="build/standalone-resources" /> 271 </zip> 272 </target> 273 274 <target name="standalone_prep" depends="standalone_jar, standalone_war"> 183 275 <delete dir="./dist" /> 184 276 <mkdir dir="./dist" /> 185 277 <copy file="../launch-i2psnark" todir="./dist/" /> 278 <mkdir dir="./dist/contexts" /> 279 <!-- todo put in root context.xml --> 280 <mkdir dir="./dist/docroot" /> 281 <!-- todo put in index.html to redirect --> 186 282 <mkdir dir="./dist/webapps" /> 187 283 <copy file="../i2psnark.war" tofile="./dist/webapps/i2psnark.war" /> 188 <mkdir dir="./dist/lib" />189 <copy file="./build/i2psnark.jar" tofile="./dist/lib/i2psnark.jar" />190 <copy file="../../../core/java/build/i2p.jar" tofile="./dist/lib/i2p.jar" />191 <copy file="../../jetty/jettylib/commons-el.jar" tofile="./dist/lib/commons-el.jar" />192 <copy file="../../jetty/jettylib/commons-logging.jar" tofile="./dist/lib/commons-logging.jar" />193 <copy file="../../jetty/jettylib/javax.servlet.jar" tofile="./dist/lib/javax.servlet.jar" />194 <copy file="../../jetty/jettylib/org.mortbay.jetty.jar" tofile="./dist/lib/org.mortbay.jetty.jar" />195 <copy file="../../jetty/jettylib/jasper-runtime.jar" tofile="./dist/lib/jasper-runtime.jar" />196 <copy file="../../ministreaming/java/build/mstreaming.jar" tofile="./dist/lib/mstreaming.jar" />197 <copy file="../../streaming/java/build/streaming.jar" tofile="./dist/lib/streaming.jar" />198 284 <copy file="../jetty-i2psnark.xml" tofile="./dist/jetty-i2psnark.xml" /> 285 <copy file="./build/i2psnark-standalone.jar" tofile="./dist/i2psnark.jar" /> 199 286 <copy file="../readme-standalone.txt" tofile="./dist/readme.txt" /> 287 <!-- temp so announces work --> 288 <copy file="../../../installer/resources/hosts.txt" tofile="./dist/hosts.txt" /> 289 <copy todir="./dist/licenses" > 290 <fileset dir="../../../licenses" includes="LICENSE-GPLv2.txt, ABOUT-Jetty.html" /> 291 </copy> 200 292 <mkdir dir="./dist/logs" /> 201 202 <zip destfile="i2psnark-standalone.zip">203 <zipfileset dir="./dist/" prefix="i2psnark/" />204 </zip>205 293 </target> 206 294 -
apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java
r471ff5b9 rd84b0e44 234 234 _trackerMap = new ConcurrentHashMap<String, Tracker>(4); 235 235 loadConfig(null); 236 if (!ctx.isRouterContext()) 237 Runtime.getRuntime().addShutdownHook(new Thread(new TempDeleter(_util.getTempDir()), "Snark Temp Dir Deleter")); 236 238 } 237 239 … … 246 248 _monitor.start(); 247 249 // only if default instance 248 if ( "i2psnark".equals(_contextName))250 if (_context.isRouterContext() && "i2psnark".equals(_contextName)) 249 251 // delay until UpdateManager is there 250 252 _context.simpleTimer2().addEvent(new Register(), 4*60*1000); … … 253 255 _idleChecker = new IdleChecker(this, _peerCoordinatorSet); 254 256 _idleChecker.schedule(5*60*1000); 257 } 258 259 /** 260 * Only used in app context 261 * @since 0.9.27 262 */ 263 private static class TempDeleter implements Runnable { 264 private final File file; 265 public TempDeleter(File f) { file = f; } 266 public void run() { FileUtil.rmdir(file, false); } 255 267 } 256 268 … … 389 401 390 402 private int getStartupDelayMinutes() { 403 if (!_context.isRouterContext()) 404 return 0; 391 405 try { 392 406 return Integer.parseInt(_config.getProperty(PROP_STARTUP_DELAY)); … … 676 690 */ 677 691 public String[] getThemes() { 678 String[] themes; 692 String[] themes; 693 if (_context.isRouterContext()) { 679 694 // "docs/themes/snark/" 680 695 File dir = new File(_context.getBaseDir(), "docs/themes/snark"); … … 690 705 themes = new String[0]; 691 706 } 692 // return the map. 693 return themes; 707 } else { 708 themes = new String[] { "light", "ubergine", "vanilla" }; 709 } 710 return themes; 694 711 } 695 712 … … 816 833 } 817 834 818 if (startDelay != null ){835 if (startDelay != null && _context.isRouterContext()) { 819 836 int minutes = _util.getStartupDelay(); 820 837 try { minutes = Integer.parseInt(startDelay.trim()); } catch (NumberFormatException nfe) {} -
apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
r471ff5b9 rd84b0e44 5 5 import java.io.PrintWriter; 6 6 import java.io.Serializable; 7 import java.text.Collator;8 7 import java.text.DecimalFormat; 9 8 import java.text.SimpleDateFormat; … … 193 192 } 194 193 195 _themePath = "/themes/snark/" + _manager.getTheme() + '/'; 194 if (_context.isRouterContext()) 195 _themePath = "/themes/snark/" + _manager.getTheme() + '/'; 196 else 197 _themePath = _contextPath + WARBASE + "themes/snark/" + _manager.getTheme() + '/'; 196 198 _imgPath = _themePath + "images/"; 197 199 req.setCharacterEncoding("UTF-8"); … … 286 288 delay = _manager.getRefreshDelaySeconds(); 287 289 if (delay > 0) { 290 String jsPfx = _context.isRouterContext() ? "" : ".resources"; 288 291 //out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n"); 289 out.write("<script src=\" /js/ajax.js\" type=\"text/javascript\"></script>\n" +292 out.write("<script src=\"" + jsPfx + "/js/ajax.js\" type=\"text/javascript\"></script>\n" + 290 293 "<script type=\"text/javascript\">\n" + 291 294 "var failMessage = \"<div class=\\\"routerdown\\\"><b>" + _t("Router is down") + "<\\/b><\\/div>\";\n" + … … 325 328 else 326 329 out.write(_contextName); 327 out.write("</a> <a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">");328 out.write(_t("Forum"));329 330 out.write("</a>\n"); 330 331 331 sortedTrackers = _manager.getSortedTrackers(); 332 for (Tracker t : sortedTrackers) { 333 if (t.baseURL == null || !t.baseURL.startsWith("http")) 334 continue; 335 if (_manager.util().isKnownOpenTracker(t.announceURL)) 336 continue; 337 out.write(" <a href=\"" + t.baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + t.name + "</a>"); 332 if (_context.isRouterContext()) { 333 out.write("<a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">"); 334 out.write(_t("Forum")); 335 out.write("</a>\n"); 336 for (Tracker t : sortedTrackers) { 337 if (t.baseURL == null || !t.baseURL.startsWith("http")) 338 continue; 339 if (_manager.util().isKnownOpenTracker(t.announceURL)) 340 continue; 341 out.write(" <a href=\"" + t.baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + t.name + "</a>"); 342 } 338 343 } 339 344 } … … 2230 2235 2231 2236 "<tr><td>"); 2232 out.write(_t("Startup delay")); 2233 out.write(": <td><input name=\"startupDelay\" size=\"4\" class=\"r\" value=\"" + _manager.util().getStartupDelay() + "\"> "); 2234 out.write(_t("minutes")); 2235 out.write("<br>\n" + 2236 2237 "<tr><td>"); 2237 if (_context.isRouterContext()) { 2238 out.write(_t("Startup delay")); 2239 out.write(": <td><input name=\"startupDelay\" size=\"4\" class=\"r\" value=\"" + _manager.util().getStartupDelay() + "\"> "); 2240 out.write(_t("minutes")); 2241 out.write("<br>\n" + 2242 2243 "<tr><td>"); 2244 } 2238 2245 out.write(_t("Page size")); 2239 2246 out.write(": <td><input name=\"pageSize\" size=\"4\" maxlength=\"6\" class=\"r\" value=\"" + _manager.getPageSize() + "\"> "); -
apps/i2psnark/jetty-i2psnark.xml
r471ff5b9 rd84b0e44 1 <?xml version="1.0" encoding=" ISO-8859-1" ?>2 <!DOCTYPE Configure PUBLIC "-// Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> 3 3 4 4 <!-- =============================================================== --> … … 12 12 <!-- Configure the Jetty Server --> 13 13 <!-- =============================================================== --> 14 <Configure class="org.mortbay.jetty.Server">14 <Configure id="Server" class="org.eclipse.jetty.server.Server"> 15 15 16 16 <!-- =============================================================== --> … … 21 21 <!-- Add and configure a HTTP listener to port 8002 --> 22 22 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> 23 <Call name="add Listener">23 <Call name="addConnector"> 24 24 <Arg> 25 <New class="org.mortbay.http.SocketListener"> 26 <Arg> 27 <New class="org.mortbay.util.InetAddrPort"> 28 <Set name="host">127.0.0.1</Set> 29 <Set name="port">8002</Set> 30 </New> 31 </Arg> 32 <Set name="MinThreads">1</Set> 33 <Set name="MaxThreads">10</Set> 34 <Set name="MaxIdleTimeMs">30000</Set> 35 <Set name="LowResourcePersistTimeMs">1000</Set> 36 <Set name="ConfidentialPort">8443</Set> 37 <Set name="IntegralPort">8443</Set> 38 <Set name="PoolName">main</Set> 39 </New> 25 <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> 26 <Set name="host">127.0.0.1</Set> 27 <Set name="port">8002</Set> 28 <Set name="maxIdleTime">600000</Set> 29 <Set name="Acceptors">1</Set> 30 <Set name="statsOn">false</Set> 31 <Set name="lowResourcesConnections">5000</Set> 32 <Set name="lowResourcesMaxIdleTime">5000</Set> 33 <Set name="useDirectBuffers">false</Set> 34 </New> 40 35 </Arg> 41 36 </Call> … … 45 40 <!-- =============================================================== --> 46 41 42 <!-- =========================================================== --> 43 <!-- Set handler Collection Structure --> 44 <!-- =========================================================== --> 45 <Set name="handler"> 46 <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"> 47 <Set name="handlers"> 48 <Array type="org.eclipse.jetty.server.Handler"> 49 <Item> 50 <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/> 51 </Item> 52 <Item> 53 <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/> 54 </Item> 55 </Array> 56 </Set> 57 </New> 58 </Set> 47 59 48 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> 49 <!-- Add a all web application within the webapps directory. --> 50 <!-- + No virtual host specified --> 51 <!-- + Look in the webapps directory relative to jetty.home or . --> 52 <!-- + Use the default webdefault.xml in jetty's install --> 53 <!-- + Upack the war file --> 54 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> 55 <Set name="rootWebApp">i2psnark</Set> 56 <Call name="addWebApplication"> 57 <Arg>/</Arg> 58 <Arg>webapps/i2psnark.war</Arg> 59 </Call> 60 <!-- =============================================================== --> 61 <!-- Create the deployment manager --> 62 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> 63 <!-- The deplyment manager handles the lifecycle of deploying web --> 64 <!-- applications. Apps are provided by instances of the --> 65 <!-- AppProvider interface. Typically these are provided by --> 66 <!-- one or more of: --> 67 <!-- jetty-webapps.xml - monitors webapps for wars and dirs --> 68 <!-- jetty-contexts.xml - monitors contexts for context xml --> 69 <!-- jetty-templates.xml - monitors contexts and templates --> 70 <!-- =============================================================== --> 71 <Call name="addBean"> 72 <Arg> 73 <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager"> 74 <Set name="contexts"> 75 <Ref id="Contexts" /> 76 </Set> 77 <Call name="setContextAttribute"> 78 <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> 79 <Arg>.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</Arg> 80 </Call> 81 </New> 82 </Arg> 83 </Call> 60 84 61 <!-- this is so we can find the css --> 62 <Call name="addContext"> 63 <Arg> 64 <New class="org.mortbay.http.HttpContext"> 65 <Set name="contextPath">/themes</Set> 66 <Set name="resourceBase">./docs/themes</Set> 67 <Call name="addHandler"> 68 <Arg> 69 <New class="org.mortbay.http.handler.ResourceHandler"> 70 <Set name="redirectWelcome">FALSE</Set> 71 </New> 72 </Arg> 73 </Call> 74 </New> 75 </Arg> 76 </Call> 77 78 <!-- =============================================================== --> 79 <!-- Configure the Other Server Options --> 80 <!-- =============================================================== --> 81 <Set name="requestsPerGC">2000</Set> 82 <Set name="statsOn">false</Set> 85 <!-- =========================================================== --> 86 <!-- Configure the context deployer --> 87 <!-- A context deployer will deploy contexts described in --> 88 <!-- configuration files discovered in a directory. --> 89 <!-- The configuration directory can be scanned for hot --> 90 <!-- deployments at the configured scanInterval. --> 91 <!-- --> 92 <!-- This deployer is configured to deploy contexts configured --> 93 <!-- in the $JETTY_HOME/contexts directory --> 94 <!-- --> 95 <!-- =========================================================== --> 96 <Ref id="DeploymentManager"> 97 <Call name="addAppProvider"> 98 <Arg> 99 <New class="org.eclipse.jetty.deploy.providers.ContextProvider"> 100 <Set name="monitoredDirName">./contexts</Set> 101 <Set name="scanInterval">0</Set> 102 </New> 103 </Arg> 104 </Call> 105 </Ref> 106 107 <!-- =========================================================== --> 108 <!-- Configure the webapp deployer. --> 109 <!-- A webapp deployer will deploy standard webapps discovered --> 110 <!-- in a directory at startup, without the need for additional --> 111 <!-- configuration files. It does not support hot deploy or --> 112 <!-- non standard contexts (see ContextDeployer above). --> 113 <!-- --> 114 <!-- This deployer is configured to deploy webapps from the --> 115 <!-- $JETTY_HOME/webapps directory --> 116 <!-- --> 117 <!-- Normally only one type of deployer need be used. --> 118 <!-- --> 119 <!-- =========================================================== --> 120 <Ref id="DeploymentManager"> 121 <Call id="webappprovider" name="addAppProvider"> 122 <Arg> 123 <New class="org.eclipse.jetty.deploy.providers.WebAppProvider"> 124 <Set name="monitoredDirName">./webapps</Set> 125 <Set name="parentLoaderPriority">false</Set> 126 <Set name="extractWars">false</Set> 127 <Set name="scanInterval">0</Set> 128 </New> 129 </Arg> 130 </Call> 131 </Ref> 132 133 <!-- ===================== --> 134 <!-- DefaultHandler config --> 135 <!-- http://stackoverflow.com/questions/4202275/how-to-prevent-jetty-from-showing-context-related-information --> 136 <!-- ===================== --> 137 <Ref id="DefaultHandler"> 138 <Set name="showContexts">false</Set> 139 </Ref> 83 140 84 141 </Configure> -
apps/i2psnark/launch-i2psnark
r471ff5b9 rd84b0e44 6 6 # 7 7 I2P="." 8 java - cp "$I2P/lib/i2psnark.jar:$I2P/lib/i2p.jar:$I2P/lib/mstreaming.jar:$I2P/lib/streaming.jar:$I2P/lib/commons-el.jar:$I2P/lib/commons-logging.jar:$I2P/lib/jasper-compiler.jar:$I2P/lib/jasper-runtime.jar:$I2P/lib/javax.servlet.jar:$I2P/lib/org.mortbay.jetty.jar" org.klomp.snark.web.RunStandalone "$@"8 java -jar "$I2P/i2psnark.jar" -
apps/i2psnark/readme-standalone.txt
r471ff5b9 rd84b0e44 1 i2psnark is packaged as a webapp running in the router console. 2 Command line and standalone operation of i2psnark are not currently supported. 3 See http://trac.i2p2.i2p/ticket/1191 or http://trac.i2p2.de/ticket/1191 4 for the status of restoring standalone support. 1 To run i2psnark's standalone mode make sure you have an i2p router running in the background, then run: 2 3 java -jar i2psnark.jar 4 5 I2PSnark web ui will be at http://127.0.0.1:8002/i2psnark/ 6 7 Please note that http://127.0.0.1:8002/ will 404, to be fixed 8 9 I2PSnark is GPL'ed software, based on Snark (http://www.klomp.org/) to run on top of I2P 10 (https://geti2p.net/) within a webserver (such as the bundled Jetty from 11 https://www.eclipse.org/jetty/). For more information about I2PSnark, get in touch 12 with the folks at http://forum.i2p2.de/ -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java
r471ff5b9 rd84b0e44 1339 1339 if (i < args.length) { 1340 1340 host = args[i++]; 1341 listenHost = host;1342 1341 } 1343 1342 if (i < args.length) -
build.xml
r471ff5b9 rd84b0e44 302 302 </target> 303 303 304 <target name="buildI2PSnark" depends="buildStreaming, buildJetty " >304 <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" > 305 305 <ant dir="apps/i2psnark/java/" target="war" /> 306 306 <copy file="apps/i2psnark/i2psnark.war" todir="build/" /> … … 326 326 </target> 327 327 328 <target name="buildI2PTunnel" depends="buildStreaming, buildJetty " >328 <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" > 329 329 <ant dir="apps/i2ptunnel/java/" target="build" /> 330 330 <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" /> … … 1810 1810 <copy file="apps/syndie/java/syndie-standalone.zip" todir="." /> 1811 1811 </target> --> 1812 <target name="i2psnark" depends="buildProperties" > 1812 1813 <!-- standalone i2psnark zip --> 1814 <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" > 1813 1815 <ant dir="apps/i2psnark/java" target="standalone" /> 1814 1816 <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." /> 1815 1817 </target> 1818 1816 1819 <target name="slackpkg"> 1817 1820 <ant dir="Slackware/i2p/" target="slackpkg" /> -
core/c/jbigi/jbigi/src/jbigi.c
r471ff5b9 rd84b0e44 1 1 #include <stdio.h> 2 #include <string.h> 2 3 #include <gmp.h> 3 4 #include "jbigi.h" … … 16 17 * Removed nativeDoubleValue() 17 18 * 18 * 3: (I2P 0.9. 18)19 * 3: (I2P 0.9.26) 19 20 * Added: 20 21 * nativeJbigiVersion() … … 27 28 * Throw ArithmeticException for bad arguments in modPow() 28 29 * 29 */ 30 #define JBIGI_VERSION 3 30 * 4: (I2P 0.9.27) 31 * Fix nativeGMPMajorVersion(), nativeGMPMinorVersion(), and nativeGMPPatchVersion() 32 * when built as a shared library 33 * 34 */ 35 #define JBIGI_VERSION 4 31 36 32 37 /***************************************** … … 40 45 } 41 46 42 /* since version 3 */47 /* since version 3, fixed for dynamic builds in version 4 */ 43 48 JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMajorVersion 44 49 (JNIEnv* env, jclass cls) { 45 return (jint) __GNU_MP_VERSION; 46 } 47 48 /* since version 3 */ 50 int v = gmp_version[0] - '0'; 51 return (jint) v; 52 } 53 54 /* since version 3, fixed for dynamic builds in version 4 */ 49 55 JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMinorVersion 50 56 (JNIEnv* env, jclass cls) { 51 return (jint) __GNU_MP_VERSION_MINOR; 52 } 53 54 /* since version 3 */ 57 int v = 0; 58 if (strlen(gmp_version) > 2) { 59 v = gmp_version[2] - '0'; 60 } 61 return (jint) v; 62 } 63 64 /* since version 3, fixed for dynamic builds in version 4 */ 55 65 JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPPatchVersion 56 66 (JNIEnv* env, jclass cls) { 57 return (jint) __GNU_MP_VERSION_PATCHLEVEL; 67 int v = 0; 68 if (strlen(gmp_version) > 4) { 69 v = gmp_version[4] - '0'; 70 } 71 return (jint) v; 58 72 } 59 73 -
core/c/jbigi/mbuild-all.sh
r471ff5b9 rd84b0e44 80 80 81 81 if ! command -v m4 > /dev/null; then 82 printf "\aWARNING: \`m4\` not found. I f this process fails to complete, install m4 " >&282 printf "\aWARNING: \`m4\` not found. Install m4 " >&2 83 83 printf "and re-run this script.\n\n\n\a" >&2 84 84 exit 1 … … 87 87 88 88 if [ -z $BITS ]; then 89 UNAME="$(uname - a)"90 if test "${UNAME#*x86_64}" != " x86_&4"; then89 UNAME="$(uname -m)" 90 if test "${UNAME#*x86_64}" != "$UNAME"; then 91 91 BITS=64 92 elif test "${UNAME#*i386}" != " i386"; then93 BITS=32 94 elif test "${UNAME#*i686}" != " i686"; then95 BITS=32 96 elif test "${UNAME#*armv6}" != " armv6"; then97 BITS=32 98 elif test "${UNAME#*armv7}" != " armv7"; then99 BITS=32 100 elif test "${UNAME#*aarch32}" != " aarch32"; then101 BITS=32 102 elif test "${UNAME#*aarch64}" != " aarch64"; then92 elif test "${UNAME#*i386}" != "$UNAME"; then 93 BITS=32 94 elif test "${UNAME#*i686}" != "$UNAME"; then 95 BITS=32 96 elif test "${UNAME#*armv6}" != "$UNAME"; then 97 BITS=32 98 elif test "${UNAME#*armv7}" != "$UNAME"; then 99 BITS=32 100 elif test "${UNAME#*aarch32}" != "$UNAME"; then 101 BITS=32 102 elif test "${UNAME#*aarch64}" != "$UNAME"; then 103 103 BITS=64 104 104 else 105 106 105 echo "Unable to detect default setting for BITS variable" 107 exit 106 exit 1 108 107 fi 109 110 108 printf "\aBITS variable not set, $BITS bit system detected\n\a" >&2 111 109 fi … … 117 115 fi 118 116 117 # FIXME -m32 and -m64 are only for x86 119 118 if [ $BITS -eq 32 ]; then 120 119 export ABI=32 -
core/java/src/freenet/support/CPUInformation/AMDCPUInfo.java
r471ff5b9 rd84b0e44 42 42 /** 43 43 * @return true if the CPU present in the machine is at least an 'k10' CPU 44 * @since 0.9.26 44 45 */ 45 46 public boolean IsK10Compatible(); … … 50 51 /** 51 52 * @return true if the CPU present in the machine is at least an 'jaguar' CPU 53 * @since 0.9.26 52 54 */ 53 55 public boolean IsJaguarCompatible(); … … 58 60 /** 59 61 * @return true if the CPU present in the machine is at least a 'piledriver' CPU 62 * @since 0.9.26 60 63 */ 61 64 public boolean IsPiledriverCompatible(); 62 65 /** 63 66 * @return true if the CPU present in the machine is at least a 'steamroller' CPU 67 * @since 0.9.26 64 68 */ 65 69 public boolean IsSteamrollerCompatible(); 66 70 /** 67 71 * @return true if the CPU present in the machine is at least a 'excavator' CPU 72 * @since 0.9.26 68 73 */ 69 74 public boolean IsExcavatorCompatible(); -
core/java/src/freenet/support/CPUInformation/CPUID.java
r471ff5b9 rd84b0e44 377 377 if(c instanceof IntelCPUInfo){ 378 378 System.out.println("\n **Intel-info**"); 379 System.out.println("Is PII-compatible: "+((IntelCPUInfo)c).IsPentium2Compatible());380 System.out.println("Is PIII-compatible: "+((IntelCPUInfo)c).IsPentium3Compatible());381 System.out.println("Is PIV-compatible: "+((IntelCPUInfo)c).IsPentium4Compatible());382 System.out.println("Is Atom-compatible: "+((IntelCPUInfo)c).IsAtomCompatible());379 System.out.println("Is PII-compatible: "+((IntelCPUInfo)c).IsPentium2Compatible()); 380 System.out.println("Is PIII-compatible: "+((IntelCPUInfo)c).IsPentium3Compatible()); 381 System.out.println("Is PIV-compatible: "+((IntelCPUInfo)c).IsPentium4Compatible()); 382 System.out.println("Is Atom-compatible: "+((IntelCPUInfo)c).IsAtomCompatible()); 383 383 System.out.println("Is Pentium M compatible: "+((IntelCPUInfo)c).IsPentiumMCompatible()); 384 System.out.println("Is Core2-compatible: "+((IntelCPUInfo)c).IsCore2Compatible());385 System.out.println("Is Corei-compatible: "+((IntelCPUInfo)c).IsCoreiCompatible());386 System.out.println("Is Sandy-compatible: "+((IntelCPUInfo)c).IsSandyCompatible());387 System.out.println("Is Ivy-compatible: "+((IntelCPUInfo)c).IsIvyCompatible());388 System.out.println("Is Haswell-compatible: "+((IntelCPUInfo)c).IsHaswellCompatible());384 System.out.println("Is Core2-compatible: "+((IntelCPUInfo)c).IsCore2Compatible()); 385 System.out.println("Is Corei-compatible: "+((IntelCPUInfo)c).IsCoreiCompatible()); 386 System.out.println("Is Sandy-compatible: "+((IntelCPUInfo)c).IsSandyCompatible()); 387 System.out.println("Is Ivy-compatible: "+((IntelCPUInfo)c).IsIvyCompatible()); 388 System.out.println("Is Haswell-compatible: "+((IntelCPUInfo)c).IsHaswellCompatible()); 389 389 System.out.println("Is Broadwell-compatible: "+((IntelCPUInfo)c).IsBroadwellCompatible()); 390 390 } 391 391 if(c instanceof AMDCPUInfo){ 392 392 System.out.println("\n **AMD-info**"); 393 System.out.println("Is K6-compatible: "+((AMDCPUInfo)c).IsK6Compatible()); 394 System.out.println("Is K6_2-compatible: "+((AMDCPUInfo)c).IsK6_2_Compatible()); 395 System.out.println("Is K6_3-compatible: "+((AMDCPUInfo)c).IsK6_3_Compatible()); 396 System.out.println("Is Geode-compatible: "+((AMDCPUInfo)c).IsGeodeCompatible()); 397 System.out.println("Is Athlon-compatible: "+((AMDCPUInfo)c).IsAthlonCompatible()); 398 System.out.println("Is Athlon64-compatible: "+((AMDCPUInfo)c).IsAthlon64Compatible()); 399 System.out.println("Is Bobcat-compatible: "+((AMDCPUInfo)c).IsBobcatCompatible()); 393 System.out.println("Is K6-compatible: "+((AMDCPUInfo)c).IsK6Compatible()); 394 System.out.println("Is K6_2-compatible: "+((AMDCPUInfo)c).IsK6_2_Compatible()); 395 System.out.println("Is K6_3-compatible: "+((AMDCPUInfo)c).IsK6_3_Compatible()); 396 System.out.println("Is Geode-compatible: "+((AMDCPUInfo)c).IsGeodeCompatible()); 397 System.out.println("Is Athlon-compatible: "+((AMDCPUInfo)c).IsAthlonCompatible()); 398 System.out.println("Is Athlon64-compatible: "+((AMDCPUInfo)c).IsAthlon64Compatible()); 399 System.out.println("Is Bobcat-compatible: "+((AMDCPUInfo)c).IsBobcatCompatible()); 400 System.out.println("Is K10-compatible: "+((AMDCPUInfo)c).IsK10Compatible()); 401 System.out.println("Is Jaguar-compatible: "+((AMDCPUInfo)c).IsJaguarCompatible()); 402 System.out.println("Is Bulldozer-compatible: "+((AMDCPUInfo)c).IsBulldozerCompatible()); 403 System.out.println("Is Piledriver-compatible: "+((AMDCPUInfo)c).IsPiledriverCompatible()); 404 System.out.println("Is Steamroller-compatible: "+((AMDCPUInfo)c).IsSteamrollerCompatible()); 405 System.out.println("Is Excavator-compatible: "+((AMDCPUInfo)c).IsExcavatorCompatible()); 400 406 } 401 407 } -
core/java/src/net/i2p/crypto/KeyGenerator.java
r471ff5b9 rd84b0e44 16 16 import java.security.KeyPair; 17 17 import java.security.KeyPairGenerator; 18 import java.security.MessageDigest; 18 19 import java.security.ProviderException; 19 20 import java.security.interfaces.ECPrivateKey; … … 417 418 System.out.println(type + " private-to-public test FAILED"); 418 419 //System.out.println("privkey " + keys[1]); 420 MessageDigest md = type.getDigestInstance(); 419 421 for (int i = 0; i < runs; i++) { 420 422 RandomSource.getInstance().nextBytes(src); 423 md.update(src); 424 byte[] sha = md.digest(); 425 SimpleDataStructure hash = type.getHashInstance(); 426 hash.setData(sha); 421 427 long start = System.nanoTime(); 422 428 Signature sig = DSAEngine.getInstance().sign(src, privkey); 429 Signature sig2 = DSAEngine.getInstance().sign(hash, privkey); 423 430 if (sig == null) 424 431 throw new GeneralSecurityException("signature generation failed"); 432 if (sig2 == null) 433 throw new GeneralSecurityException("signature generation (H) failed"); 425 434 long mid = System.nanoTime(); 426 435 boolean ok = DSAEngine.getInstance().verifySignature(sig, src, pubkey); 436 boolean ok2 = DSAEngine.getInstance().verifySignature(sig2, hash, pubkey); 427 437 long end = System.nanoTime(); 428 438 stime += mid - start; … … 430 440 if (!ok) 431 441 throw new GeneralSecurityException(type + " V(S(data)) fail"); 442 if (!ok2) 443 throw new GeneralSecurityException(type + " V(S(H(data))) fail"); 432 444 } 433 445 stime /= 1000*1000; -
installer/resources/themes/snark/light/snark.css
r471ff5b9 rd84b0e44 30 30 font-size: 9pt; 31 31 color: #559; 32 background: #fff url( "../../console/light/images/header.png") repeat-x scroll center center;32 background: #fff url('../../console/light/images/header.png') repeat-x scroll center center; 33 33 -moz-border-radius: 0px; 34 34 -khtml-border-radius: 3px; … … 168 168 color: #001; 169 169 whitespace: nowrap; 170 background: #fff url( "../../console/light/images/header.png") repeat-x scroll center center;170 background: #fff url('../../console/light/images/header.png') repeat-x scroll center center; 171 171 } 172 172 … … 415 415 border-top: 0; 416 416 text-shadow: 0 1px 0 #aaa; 417 background: #fff url( "../../console/light/images/header.png") repeat-x scroll center center;417 background: #fff url('../../console/light/images/header.png') repeat-x scroll center center; 418 418 font-variant: small-caps !important; 419 419 box-shadow: 0 1px 3px #999; -
installer/resources/themes/snark/vanilla/snark.css
r471ff5b9 rd84b0e44 167 167 168 168 thead, tfoot { 169 background: url( "images/bling2.png") repeat-x scroll center center #867;169 background: url('images/bling2.png') repeat-x scroll center center #867; 170 170 font-weight: bold; 171 171 color: #503; -
router/java/src/net/i2p/router/StatisticsManager.java
r471ff5b9 rd84b0e44 72 72 Properties stats = new Properties(); 73 73 stats.setProperty("router.version", RouterVersion.VERSION); 74 // scheduled for removal, never used 75 if (CoreVersion.VERSION.equals("0.9.23")) 76 stats.setProperty("coreVersion", CoreVersion.VERSION); 74 // never used 75 //stats.setProperty("coreVersion", CoreVersion.VERSION); 77 76 stats.setProperty(RouterInfo.PROP_NETWORK_ID, _networkID); 78 77 stats.setProperty(RouterInfo.PROP_CAPABILITIES, _context.router().getCapabilities()); … … 169 168 170 169 // So that we will still get build requests - not required since 0.7.9 2010-01-12 171 // scheduled for removal 172 if (CoreVersion.VERSION.equals("0.9.23")) 173 stats.setProperty("stat_uptime", "90m"); 170 //stats.setProperty("stat_uptime", "90m"); 174 171 if (FloodfillNetworkDatabaseFacade.isFloodfill(_context.router().getRouterInfo())) { 175 172 int ri = _context.router().getUptime() > 30*60*1000 ? -
router/java/src/net/i2p/router/networkdb/kademlia/FloodOnlySearchJob.java
r471ff5b9 rd84b0e44 233 233 if (_dead) return; 234 234 _dead = true; 235 super.success(); 235 236 } 236 237 if (_log.shouldLog(Log.INFO)) -
router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java
r471ff5b9 rd84b0e44 34 34 protected volatile boolean _dead; 35 35 protected final long _created; 36 protected boolean _success; 36 37 37 38 /** … … 70 71 */ 71 72 void addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease) { 73 boolean success; 72 74 synchronized (this) { 73 75 if (!_dead) { … … 78 80 return; 79 81 } 82 success = _success; 80 83 } 81 84 // outside synch to avoid deadlock with job queue 82 getContext().jobQueue().addJob(onFailed); 85 if (success && onFind != null) 86 getContext().jobQueue().addJob(onFind); 87 else if (!success && onFailed != null) 88 getContext().jobQueue().addJob(onFailed); 83 89 } 84 90 … … 194 200 */ 195 201 void success() { 202 synchronized(this) { 203 _success = true; 204 } 205 /**** 196 206 throw new UnsupportedOperationException("use override"); 197 /****198 207 if (_dead) return; 199 208 if (_log.shouldLog(Log.INFO)) -
router/java/src/net/i2p/router/networkdb/kademlia/IterativeSearchJob.java
r471ff5b9 rd84b0e44 588 588 if (_dead) return; 589 589 _dead = true; 590 _success = true; 590 591 tries = _unheardFrom.size() + _failedPeers.size(); 591 592 if (_unheardFrom.size() == 1) {
Note: See TracChangeset
for help on using the changeset viewer.