diff --git a/apps/jetty/build.xml b/apps/jetty/build.xml index 3e24fad189044f3912b149bd7611605960f02b5f..2cce85311f803bfd9c10710b6d3e20fbbc478d75 100644 --- a/apps/jetty/build.xml +++ b/apps/jetty/build.xml @@ -545,7 +545,7 @@ <jar destfile="./build/servlet-i2p-${release.number}.jar" basedir="./build/obj" includes="net/i2p/servlet/filters/*.class" > <manifest> <attribute name="Specification-Title" value="I2P Servlet classes" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Servlet classes" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -609,7 +609,7 @@ <fileset dir="./build/servlet-i2p-javadoc" /> <manifest> <attribute name="Specification-Title" value="I2P Servlet classes" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Servlet classes" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -626,7 +626,7 @@ <fileset dir="./java/src" includes="net/i2p/servlet/filters/**" /> <manifest> <attribute name="Specification-Title" value="I2P Servlet classes" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Servlet classes" /> <attribute name="Implementation-Version" value="${full.version}" /> diff --git a/apps/ministreaming/java/build.xml b/apps/ministreaming/java/build.xml index 63b8ff54d4c82feafcb9dccf112aa5ee786edae3..c7224b3ba7f513343b4fdc2a6cd2a6efbfc9dd6a 100644 --- a/apps/ministreaming/java/build.xml +++ b/apps/ministreaming/java/build.xml @@ -84,7 +84,7 @@ <manifest> <attribute name="${manifest.classpath.name}" value="i2p.jar streaming.jar" /> <attribute name="Specification-Title" value="I2P Streaming API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Streaming API" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -193,7 +193,7 @@ <fileset dir="./build/javadoc" /> <manifest> <attribute name="Specification-Title" value="I2P Streaming API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Streaming API" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -209,7 +209,7 @@ <fileset dir="./src" /> <manifest> <attribute name="Specification-Title" value="I2P Streaming API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Streaming API" /> <attribute name="Implementation-Version" value="${full.version}" /> diff --git a/apps/streaming/java/build.xml b/apps/streaming/java/build.xml index a6e27f945a08f2a33ecdad41df532e3b85982554..914867ae93f82c59f6d6325198dac548c7b8bbaf 100644 --- a/apps/streaming/java/build.xml +++ b/apps/streaming/java/build.xml @@ -210,7 +210,7 @@ <jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*.class" > <manifest> <attribute name="Specification-Title" value="I2P Streaming Implementation" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Streaming Implementation" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -282,7 +282,7 @@ <fileset dir="./build/javadoc" /> <manifest> <attribute name="Specification-Title" value="I2P Streaming Implementation" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Streaming Implementation" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -299,7 +299,7 @@ <fileset dir="./src" /> <manifest> <attribute name="Specification-Title" value="I2P Streaming Implementation" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Streaming Implementation" /> <attribute name="Implementation-Version" value="${full.version}" /> diff --git a/build.xml b/build.xml index bfce629f0c748a6f95e70a8f1d7e3eaa14e6423c..19e66aa236fe906f7e595da4fa9719cba0e91dd9 100644 --- a/build.xml +++ b/build.xml @@ -1085,6 +1085,7 @@ <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" /> </target> + <!-- sets release.number and api.version --> <target name="getReleaseNumber"> <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number"> <filterchain> @@ -1098,8 +1099,41 @@ <trim/> </filterchain> </loadfile> + <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="api.version"> + <filterchain> + <linecontains> + <contains value="public final static String PUBLISHED_VERSION"/> + </linecontains> + <tokenfilter> + <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" /> + </tokenfilter> + <striplinebreaks/> + <trim/> + </filterchain> + </loadfile> <property name="release.number" value="unknown" /> - <echo message="Release number is ${release.number}" /> + <property name="api.version" value="unknown" /> + <echo message="Release number: ${release.number}" /> + <echo message="API version: ${api.version}" /> + <fail message="Bad API version, must start with 0.9." > + <condition> + <not> + <matches pattern="^0\.9\." string="${api.version}" /> + </not> + </condition> + </fail> + <fail message="Release number / API version mismatch" > + <condition> + <and> + <not> + <equals arg1="${release.number}" arg2="${api.version}"/> + </not> + <not> + <matches pattern="^1\." string="${release.number}" /> + </not> + </and> + </condition> + </fail> </target> <target name="getBuildNumber"> diff --git a/core/java/build.xml b/core/java/build.xml index 4bb8bd6b2cf271414deef7fc1345302354684d94..2b02912f302912f6a13b54d6501d1abc9607306f 100644 --- a/core/java/build.xml +++ b/core/java/build.xml @@ -120,7 +120,7 @@ <manifest> <attribute name="${manifest.classpath.name}" value="${gettext.jar} ${getopt.jar} ${httpclient.jar}" /> <attribute name="Specification-Title" value="I2P Core API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Core API" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -228,7 +228,7 @@ <fileset dir="./build/javadoc" /> <manifest> <attribute name="Specification-Title" value="I2P Core API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Core API" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -245,7 +245,7 @@ <fileset dir="./src" /> <manifest> <attribute name="Specification-Title" value="I2P Core API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Core API" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -342,7 +342,7 @@ <manifest> <attribute name="${manifest.classpath.name}" value="${gettext.jar} ${getopt.jar} ${httpclient.jar}" /> <attribute name="Specification-Title" value="I2P Core API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Core API" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -368,7 +368,7 @@ <manifest> <attribute name="${manifest.classpath.name}" value="${gettext.jar} ${getopt.jar} ${httpclient.jar}" /> <attribute name="Specification-Title" value="I2P Core API" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Core API" /> <attribute name="Implementation-Version" value="${full.version}" /> diff --git a/core/java/src/net/i2p/CoreVersion.java b/core/java/src/net/i2p/CoreVersion.java index 4687ffad2c9cc710a982d509e1f19617995b4957..7f851b27a4fa54b05f1f6b0697770493fad7edea 100644 --- a/core/java/src/net/i2p/CoreVersion.java +++ b/core/java/src/net/i2p/CoreVersion.java @@ -18,11 +18,13 @@ package net.i2p; public class CoreVersion { /** deprecated */ - public final static String ID = "Monotone"; + public final static String ID = "Git"; /** * The version used when checking for router updates, * and exchanged between router and client over I2CP. + * This is the marketing and user-visible version. + * * If we ever need a point release for a specific * architecture only, append ".1" to VERSION * and leave PUBLISHED_VERSION unchanged. @@ -33,6 +35,11 @@ public class CoreVersion { /** * The version published in the netdb via StatisticsManager. + * This is the API version. + * It must not go to 1.x for several years, because through + * 0.9.49, the Sybil analyzer blocked releases that didn't + * start with "0.9." + * * If we ever need a point release for a specific * architecture only, append ".1" to VERSION * and leave PUBLISHED_VERSION unchanged. @@ -41,7 +48,7 @@ public class CoreVersion { * * @since 0.9.46 */ - public final static String PUBLISHED_VERSION = VERSION; + public final static String PUBLISHED_VERSION = "0.9.49"; /** * For Vuze. @@ -54,6 +61,7 @@ public class CoreVersion { public static void main(String args[]) { System.out.println("I2P Core version: " + VERSION); + System.out.println("I2P API version: " + PUBLISHED_VERSION); System.out.println("ID: " + ID); } } diff --git a/core/java/src/net/i2p/client/impl/I2PSessionImpl.java b/core/java/src/net/i2p/client/impl/I2PSessionImpl.java index cb4190d6c9ad13baf78da2ed8787f8c84c1cad99..5d902c302fed23df11dc9ffae691ab711b053ed7 100644 --- a/core/java/src/net/i2p/client/impl/I2PSessionImpl.java +++ b/core/java/src/net/i2p/client/impl/I2PSessionImpl.java @@ -769,7 +769,7 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2 auth.setProperty(I2PClient.PROP_USER, _options.getProperty(I2PClient.PROP_USER)); auth.setProperty(I2PClient.PROP_PW, _options.getProperty(I2PClient.PROP_PW)); } - sendMessage_unchecked(new GetDateMessage(CoreVersion.VERSION, auth)); + sendMessage_unchecked(new GetDateMessage(CoreVersion.PUBLISHED_VERSION, auth)); waitForDate(); if (_log.shouldLog(Log.DEBUG)) _log.debug(getPrefix() + "Before producer.connect()"); @@ -1880,7 +1880,7 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2 */ public String getRouterVersion() { if (_context.isRouterContext()) - return CoreVersion.VERSION; + return CoreVersion.PUBLISHED_VERSION; return _routerVersion; } diff --git a/core/java/src/net/i2p/client/impl/I2PSimpleSession.java b/core/java/src/net/i2p/client/impl/I2PSimpleSession.java index 3c332ae0ade61d9171691dc3848b7aa5d9b7f504..ade2afbe902ed5007374a422c3ee80ffeec6a2a2 100644 --- a/core/java/src/net/i2p/client/impl/I2PSimpleSession.java +++ b/core/java/src/net/i2p/client/impl/I2PSimpleSession.java @@ -123,11 +123,11 @@ public class I2PSimpleSession extends I2PSessionImpl2 { Properties auth = new OrderedProperties(); auth.setProperty(I2PClient.PROP_USER, opts.getProperty(I2PClient.PROP_USER)); auth.setProperty(I2PClient.PROP_PW, opts.getProperty(I2PClient.PROP_PW)); - sendMessage_unchecked(new GetDateMessage(CoreVersion.VERSION, auth)); + sendMessage_unchecked(new GetDateMessage(CoreVersion.PUBLISHED_VERSION, auth)); } else { // we must now send a GetDate even in SimpleSession, or we won't know // what version we are talking with and cannot use HostLookup - sendMessage_unchecked(new GetDateMessage(CoreVersion.VERSION)); + sendMessage_unchecked(new GetDateMessage(CoreVersion.PUBLISHED_VERSION)); } waitForDate(); } diff --git a/router/java/build.xml b/router/java/build.xml index 8ff50285ea85947974d69efc9d082d7ce11a5497..22133cb46142863eed807959ad5014ea13d15487 100644 --- a/router/java/build.xml +++ b/router/java/build.xml @@ -79,7 +79,7 @@ <!-- so people with very old wrapper.config files will still work with Jetty 6 --> <attribute name="${manifest.classpath.name}" value="i2p.jar addressbook.jar jetty-i2p.jar jetty-rewrite-handler.jar jetty-start.jar jetty-util.jar" /> <attribute name="Specification-Title" value="I2P Router" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Router" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -189,7 +189,7 @@ <fileset dir="./build/javadoc" /> <manifest> <attribute name="Specification-Title" value="I2P Router" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Router" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -206,7 +206,7 @@ <fileset dir="./src" /> <manifest> <attribute name="Specification-Title" value="I2P Router" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Router" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -300,7 +300,7 @@ <manifest> <attribute name="${manifest.classpath.name}" value="i2p.jar" /> <attribute name="Specification-Title" value="I2P Router" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Router" /> <attribute name="Implementation-Version" value="${full.version}" /> @@ -320,7 +320,7 @@ <manifest> <attribute name="${manifest.classpath.name}" value="i2p.jar" /> <attribute name="Specification-Title" value="I2P Router" /> - <attribute name="Specification-Version" value="${release.number}" /> + <attribute name="Specification-Version" value="${api.version}" /> <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" /> <attribute name="Implementation-Title" value="I2P Java Router" /> <attribute name="Implementation-Version" value="${full.version}" /> diff --git a/router/java/src/net/i2p/router/client/ClientManager.java b/router/java/src/net/i2p/router/client/ClientManager.java index fc94b17b8b872b0bdfab18afd30bc00183345c19..b4757d032085e1010ff78b6f0c8224e1adc8afdb 100644 --- a/router/java/src/net/i2p/router/client/ClientManager.java +++ b/router/java/src/net/i2p/router/client/ClientManager.java @@ -835,7 +835,7 @@ class ClientManager { try { // only send version if the client can handle it (0.8.7 or greater) runner.doSend(new SetDateMessage(runner.getClientVersion() != null ? - CoreVersion.VERSION : null)); + CoreVersion.PUBLISHED_VERSION : null)); } catch (I2CPMessageException ime) {} } if (_isStarted) diff --git a/router/java/src/net/i2p/router/sybil/Analysis.java b/router/java/src/net/i2p/router/sybil/Analysis.java index c3f86ae190b8770a79103782df240855936175f0..a8e655e2702a35e5f51ede1a39b8643a24eaf493 100644 --- a/router/java/src/net/i2p/router/sybil/Analysis.java +++ b/router/java/src/net/i2p/router/sybil/Analysis.java @@ -89,10 +89,12 @@ public class Analysis extends JobImpl implements RouterApp { private static final double PAIR_DISTANCE_FACTOR = 2.0; private static final double OUR_KEY_FACTOR = 4.0; private static final double VERSION_FACTOR = 1.0; - private static final double POINTS_BAD_VERSION = 50.0; + private static final double POINTS_BAD_VERSION = 20.0; private static final double POINTS_UNREACHABLE = 4.0; private static final double POINTS_NEW = 4.0; - private static final double POINTS_BANLIST = 25.0; + // since we're blocking by default now, don't make this too high, + // so we don't always turn a temporary block into a permanent one. + private static final double POINTS_BANLIST = 10.0; public static final boolean DEFAULT_BLOCK = true; public static final double DEFAULT_BLOCK_THRESHOLD = 50.0; public static final long DEFAULT_BLOCK_TIME = 7*24*60*60*1000L; @@ -775,6 +777,7 @@ public class Analysis extends JobImpl implements RouterApp { RouterInfo us = _context.router().getRouterInfo(); if (us == null) return; String ourVer = us.getVersion(); + // TODO do the math once we hit version 1.0.0 if (!ourVer.startsWith("0.9.")) return; ourVer = ourVer.substring(4); int dot = ourVer.indexOf('.'); @@ -793,7 +796,9 @@ public class Analysis extends JobImpl implements RouterApp { addPoints(points, h, POINTS_NONFF, "Non-floodfill"); String hisFullVer = info.getVersion(); if (!hisFullVer.startsWith("0.9.")) { - addPoints(points, h, POINTS_BAD_VERSION, "Strange version " + DataHelper.escapeHTML(hisFullVer)); + if (!hisFullVer.startsWith("1.")) + addPoints(points, h, POINTS_BAD_VERSION, "Strange version " + DataHelper.escapeHTML(hisFullVer)); + // TODO do the math once we hit version 1.0.0 continue; } String hisVer = hisFullVer.substring(4);