Changeset d84b0e44


Ignore:
Timestamp:
Jun 11, 2016 1:47:12 PM (4 years ago)
Author:
zzz <zzz@…>
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.
Message:

propagate from branch 'i2p.i2p.zzz.test2' (head ee7dbea07e8ad7e01cb8012a1540aca8346ee7d2)

to branch 'i2p.i2p' (head 2cb447c64ae706c6cead619c9428083fce6f1d46)

Files:
1 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/build.xml

    r471ff5b9 rd84b0e44  
    5151                <!-- jsp-api.jar only present for debian builds -->
    5252                <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" />
    5357            </classpath>
    5458        </javac>
     
    7276        <!-- set if unset -->
    7377        <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/*">
    7579            <manifest>
    7680                <attribute name="Main-Class" value="org.klomp.snark.CommandLine" />
     
    180184        </zip>
    181185    </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">
    183275        <delete dir="./dist" />
    184276        <mkdir dir="./dist" />
    185277        <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 -->
    186282        <mkdir dir="./dist/webapps" />
    187283        <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" />
    198284        <copy file="../jetty-i2psnark.xml" tofile="./dist/jetty-i2psnark.xml" />
     285        <copy file="./build/i2psnark-standalone.jar" tofile="./dist/i2psnark.jar" />
    199286        <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>
    200292        <mkdir dir="./dist/logs" />
    201 
    202         <zip destfile="i2psnark-standalone.zip">
    203          <zipfileset dir="./dist/" prefix="i2psnark/" />
    204         </zip>
    205293    </target>
    206294
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r471ff5b9 rd84b0e44  
    234234        _trackerMap = new ConcurrentHashMap<String, Tracker>(4);
    235235        loadConfig(null);
     236        if (!ctx.isRouterContext())
     237            Runtime.getRuntime().addShutdownHook(new Thread(new TempDeleter(_util.getTempDir()), "Snark Temp Dir Deleter"));
    236238    }
    237239
     
    246248        _monitor.start();
    247249        // only if default instance
    248         if ("i2psnark".equals(_contextName))
     250        if (_context.isRouterContext() && "i2psnark".equals(_contextName))
    249251            // delay until UpdateManager is there
    250252            _context.simpleTimer2().addEvent(new Register(), 4*60*1000);
     
    253255        _idleChecker = new IdleChecker(this, _peerCoordinatorSet);
    254256        _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); }
    255267    }
    256268
     
    389401
    390402    private int getStartupDelayMinutes() {
     403        if (!_context.isRouterContext())
     404            return 0;
    391405        try {
    392406            return Integer.parseInt(_config.getProperty(PROP_STARTUP_DELAY));
     
    676690     */
    677691    public String[] getThemes() {
    678             String[] themes;
     692         String[] themes;
     693         if (_context.isRouterContext()) {
    679694            // "docs/themes/snark/"
    680695            File dir = new File(_context.getBaseDir(), "docs/themes/snark");
     
    690705                themes = new String[0];
    691706            }
    692             // return the map.
    693             return themes;
     707        } else {
     708            themes = new String[] { "light", "ubergine", "vanilla" };
     709        }
     710        return themes;
    694711    }
    695712
     
    816833        }
    817834       
    818         if (startDelay != null){
     835        if (startDelay != null && _context.isRouterContext()) {
    819836                int minutes = _util.getStartupDelay();
    820837                try { minutes = Integer.parseInt(startDelay.trim()); } catch (NumberFormatException nfe) {}
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r471ff5b9 rd84b0e44  
    55import java.io.PrintWriter;
    66import java.io.Serializable;
    7 import java.text.Collator;
    87import java.text.DecimalFormat;
    98import java.text.SimpleDateFormat;
     
    193192        }
    194193
    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() + '/';
    196198        _imgPath = _themePath + "images/";
    197199        req.setCharacterEncoding("UTF-8");
     
    286288            delay = _manager.getRefreshDelaySeconds();
    287289            if (delay > 0) {
     290                String jsPfx = _context.isRouterContext() ? "" : ".resources";
    288291                //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" +
    290293                          "<script type=\"text/javascript\">\n"  +
    291294                          "var failMessage = \"<div class=\\\"routerdown\\\"><b>" + _t("Router is down") + "<\\/b><\\/div>\";\n" +
     
    325328            else
    326329                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"));
    329330            out.write("</a>\n");
    330 
    331331            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                }
    338343            }
    339344        }
     
    22302235
    22312236                  "<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        }
    22382245        out.write(_t("Page size"));
    22392246        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">
    33
    44<!-- =============================================================== -->
     
    1212<!-- Configure the Jetty Server                                      -->
    1313<!-- =============================================================== -->
    14 <Configure class="org.mortbay.jetty.Server">
     14<Configure id="Server" class="org.eclipse.jetty.server.Server">
    1515
    1616  <!-- =============================================================== -->
     
    2121  <!-- Add and configure a HTTP listener to port 8002                  -->
    2222  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    23   <Call name="addListener">
     23  <Call name="addConnector">
    2424    <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>
    4035    </Arg>
    4136  </Call>
     
    4540  <!-- =============================================================== -->
    4641
     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>
    4759
    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>
    6084
    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>
    83140
    84141</Configure>
  • apps/i2psnark/launch-i2psnark

    r471ff5b9 rd84b0e44  
    66#
    77I2P="."
    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 "$@"
     8java -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.
     1To run i2psnark's standalone mode make sure you have an i2p router running in the background, then run:
     2
     3java -jar i2psnark.jar
     4
     5I2PSnark web ui will be at http://127.0.0.1:8002/i2psnark/
     6
     7Please note that http://127.0.0.1:8002/ will 404, to be fixed
     8
     9I2PSnark 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
     11https://www.eclipse.org/jetty/).  For more information about I2PSnark, get in touch
     12with the folks at http://forum.i2p2.de/
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java

    r471ff5b9 rd84b0e44  
    13391339            if (i < args.length) {
    13401340                host = args[i++];
    1341                 listenHost = host;
    13421341            }
    13431342            if (i < args.length)
  • build.xml

    r471ff5b9 rd84b0e44  
    302302    </target>
    303303
    304     <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
     304    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
    305305        <ant dir="apps/i2psnark/java/" target="war" />
    306306        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
     
    326326    </target>
    327327
    328     <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
     328    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
    329329        <ant dir="apps/i2ptunnel/java/" target="build" />
    330330        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
     
    18101810        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
    18111811    </target> -->
    1812     <target name="i2psnark" depends="buildProperties" >
     1812
     1813    <!-- standalone i2psnark zip -->
     1814    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
    18131815        <ant dir="apps/i2psnark/java" target="standalone" />
    18141816        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
    18151817    </target>
     1818
    18161819    <target name="slackpkg">
    18171820        <ant dir="Slackware/i2p/" target="slackpkg" />
  • core/c/jbigi/jbigi/src/jbigi.c

    r471ff5b9 rd84b0e44  
    11#include <stdio.h>
     2#include <string.h>
    23#include <gmp.h>
    34#include "jbigi.h"
     
    1617 *    Removed nativeDoubleValue()
    1718 *
    18  * 3: (I2P 0.9.18)
     19 * 3: (I2P 0.9.26)
    1920 *    Added:
    2021 *      nativeJbigiVersion()
     
    2728 *    Throw ArithmeticException for bad arguments in modPow()
    2829 *
    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
    3136
    3237/*****************************************
     
    4045}
    4146
    42 /* since version 3 */
     47/* since version 3, fixed for dynamic builds in version 4 */
    4348JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMajorVersion
    4449        (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 */
    4955JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPMinorVersion
    5056        (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 */
    5565JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeGMPPatchVersion
    5666        (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;
    5872}
    5973
  • core/c/jbigi/mbuild-all.sh

    r471ff5b9 rd84b0e44  
    8080
    8181if ! command -v m4 > /dev/null; then
    82     printf "\aWARNING: \`m4\` not found. If this process fails to complete, install m4 " >&2
     82    printf "\aWARNING: \`m4\` not found. Install m4 " >&2
    8383    printf "and re-run this script.\n\n\n\a" >&2
    8484    exit 1
     
    8787
    8888if [ -z $BITS ]; then
    89   UNAME="$(uname -a)"
    90   if test "${UNAME#*x86_64}" != "x86_&4"; then
     89  UNAME="$(uname -m)"
     90  if test "${UNAME#*x86_64}" != "$UNAME"; then
    9191    BITS=64
    92   elif test "${UNAME#*i386}" != "i386"; then
    93     BITS=32
    94   elif test "${UNAME#*i686}" != "i686"; then
    95     BITS=32
    96   elif test "${UNAME#*armv6}" != "armv6"; then
    97     BITS=32
    98   elif test "${UNAME#*armv7}" != "armv7"; then
    99     BITS=32
    100   elif test "${UNAME#*aarch32}" != "aarch32"; then
    101     BITS=32
    102   elif test "${UNAME#*aarch64}" != "aarch64"; then
     92  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
    103103    BITS=64
    104104  else
    105  
    106105    echo "Unable to detect default setting for BITS variable"
    107     exit
     106    exit 1
    108107  fi
    109 
    110108  printf "\aBITS variable not set, $BITS bit system detected\n\a" >&2
    111109fi
     
    117115fi
    118116
     117# FIXME -m32 and -m64 are only for x86
    119118if [ $BITS -eq 32 ]; then
    120119  export ABI=32
  • core/java/src/freenet/support/CPUInformation/AMDCPUInfo.java

    r471ff5b9 rd84b0e44  
    4242    /**
    4343     * @return true if the CPU present in the machine is at least an 'k10' CPU
     44     * @since 0.9.26
    4445     */
    4546    public boolean IsK10Compatible();
     
    5051    /**
    5152     * @return true if the CPU present in the machine is at least an 'jaguar' CPU
     53     * @since 0.9.26
    5254     */
    5355        public boolean IsJaguarCompatible();
     
    5860    /**
    5961     * @return true if the CPU present in the machine is at least a 'piledriver' CPU
     62     * @since 0.9.26
    6063     */
    6164        public boolean IsPiledriverCompatible();
    6265    /**
    6366     * @return true if the CPU present in the machine is at least a 'steamroller' CPU
     67     * @since 0.9.26
    6468     */
    6569        public boolean IsSteamrollerCompatible();
    6670    /**
    6771     * @return true if the CPU present in the machine is at least a 'excavator' CPU
     72     * @since 0.9.26
    6873     */
    6974        public boolean IsExcavatorCompatible();
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    r471ff5b9 rd84b0e44  
    377377        if(c instanceof IntelCPUInfo){
    378378            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());
    383383            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());
    389389            System.out.println("Is Broadwell-compatible: "+((IntelCPUInfo)c).IsBroadwellCompatible());
    390390        }
    391391        if(c instanceof AMDCPUInfo){
    392392            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());
    400406        }
    401407    }
  • core/java/src/net/i2p/crypto/KeyGenerator.java

    r471ff5b9 rd84b0e44  
    1616import java.security.KeyPair;
    1717import java.security.KeyPairGenerator;
     18import java.security.MessageDigest;
    1819import java.security.ProviderException;
    1920import java.security.interfaces.ECPrivateKey;
     
    417418            System.out.println(type + " private-to-public test FAILED");
    418419        //System.out.println("privkey " + keys[1]);
     420          MessageDigest md = type.getDigestInstance();
    419421        for (int i = 0; i < runs; i++) {
    420422            RandomSource.getInstance().nextBytes(src);
     423              md.update(src);
     424              byte[] sha = md.digest();
     425              SimpleDataStructure hash = type.getHashInstance();
     426              hash.setData(sha);
    421427            long start = System.nanoTime();
    422428            Signature sig = DSAEngine.getInstance().sign(src, privkey);
     429            Signature sig2 = DSAEngine.getInstance().sign(hash, privkey);
    423430            if (sig == null)
    424431                throw new GeneralSecurityException("signature generation failed");
     432            if (sig2 == null)
     433                throw new GeneralSecurityException("signature generation (H) failed");
    425434            long mid = System.nanoTime();
    426435            boolean ok = DSAEngine.getInstance().verifySignature(sig, src, pubkey);
     436            boolean ok2 = DSAEngine.getInstance().verifySignature(sig2, hash, pubkey);
    427437            long end = System.nanoTime();
    428438            stime += mid - start;
     
    430440            if (!ok)
    431441                throw new GeneralSecurityException(type + " V(S(data)) fail");
     442            if (!ok2)
     443                throw new GeneralSecurityException(type + " V(S(H(data))) fail");
    432444        }
    433445        stime /= 1000*1000;
  • installer/resources/themes/snark/light/snark.css

    r471ff5b9 rd84b0e44  
    3030     font-size: 9pt;
    3131     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;
    3333     -moz-border-radius: 0px;
    3434     -khtml-border-radius: 3px;
     
    168168     color: #001;
    169169      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;
    171171}
    172172
     
    415415     border-top: 0;
    416416     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;
    418418     font-variant: small-caps !important;
    419419     box-shadow: 0 1px 3px #999;
  • installer/resources/themes/snark/vanilla/snark.css

    r471ff5b9 rd84b0e44  
    167167
    168168thead, 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;
    170170     font-weight: bold;
    171171     color: #503;
  • router/java/src/net/i2p/router/StatisticsManager.java

    r471ff5b9 rd84b0e44  
    7272        Properties stats = new Properties();
    7373        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);
    7776        stats.setProperty(RouterInfo.PROP_NETWORK_ID, _networkID);
    7877        stats.setProperty(RouterInfo.PROP_CAPABILITIES, _context.router().getCapabilities());
     
    169168
    170169        // 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");
    174171        if (FloodfillNetworkDatabaseFacade.isFloodfill(_context.router().getRouterInfo())) {
    175172            int ri = _context.router().getUptime() > 30*60*1000 ?
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodOnlySearchJob.java

    r471ff5b9 rd84b0e44  
    233233            if (_dead) return;
    234234            _dead = true;
     235            super.success();
    235236        }
    236237        if (_log.shouldLog(Log.INFO))
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java

    r471ff5b9 rd84b0e44  
    3434    protected volatile boolean _dead;
    3535    protected final long _created;
     36    protected boolean _success;
    3637
    3738    /**
     
    7071     */
    7172    void addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease) {
     73        boolean success;
    7274        synchronized (this) {
    7375            if (!_dead) {
     
    7880                return;
    7981            }
     82            success = _success;
    8083        }
    8184        // 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);
    8389    }
    8490
     
    194200     */
    195201    void success() {
     202        synchronized(this) {
     203            _success = true;
     204        }
     205/****
    196206        throw new UnsupportedOperationException("use override");
    197 /****
    198207        if (_dead) return;
    199208        if (_log.shouldLog(Log.INFO))
  • router/java/src/net/i2p/router/networkdb/kademlia/IterativeSearchJob.java

    r471ff5b9 rd84b0e44  
    588588            if (_dead) return;
    589589            _dead = true;
     590            _success = true;
    590591            tries = _unheardFrom.size() + _failedPeers.size();
    591592            if (_unheardFrom.size() == 1) {
Note: See TracChangeset for help on using the changeset viewer.