Build: More prep for different release and API versions
Use API version as manifest Specification-Version Use API version in I2CP Reduce sybil penalty for version and banlist
This commit is contained in:
@@ -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}" />
|
||||
|
@@ -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}" />
|
||||
|
@@ -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}" />
|
||||
|
36
build.xml
36
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">
|
||||
|
@@ -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}" />
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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}" />
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user