2010-08-14 17:27:15 +00:00
|
|
|
{% extends "_layout.html" %}
|
|
|
|
{% block title %}I2P Software Update Specification{% endblock %}
|
|
|
|
{% block content %}
|
2011-11-28 17:56:29 +00:00
|
|
|
Page last updated November 2011, current as of router version 0.8.12
|
2010-08-14 17:27:15 +00:00
|
|
|
<h3>Overview</h3>
|
|
|
|
<p>
|
|
|
|
I2P uses a simple, yet secure, system for automated software update.
|
|
|
|
The router console periodically pulls a news file from a configurable I2P URL.
|
|
|
|
There is a hardcoded backup URL pointing to the project website, in case
|
|
|
|
the default project news host goes down.
|
|
|
|
</p><p>
|
|
|
|
The contents of the news file are displayed on the home page of the router console.
|
|
|
|
In addition, the news file contains the most recent version number of the software.
|
|
|
|
If the version is higher than the router's version number, it will
|
|
|
|
display an indication to the user that an update is available.
|
|
|
|
</p><p>
|
|
|
|
The router may optionally download, or download and install, the new version
|
|
|
|
if configured to do so.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3>News File Specification</h3>
|
|
|
|
<p>
|
|
|
|
The news.xml file may contain the following elements:
|
|
|
|
</p>
|
|
|
|
<pre>
|
|
|
|
<i2p.news date="$Date: 2010-01-22 00:00:00 $" />
|
|
|
|
<i2p.release version="0.7.14" date="2010/01/22" minVersion="0.6" />
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The elements may be included inside XML comments to prevent interpretation by browsers.
|
|
|
|
The i2p.release element and version are required. All others are optional and are
|
|
|
|
currently unused.
|
|
|
|
</p><p>
|
|
|
|
The news source is trusted only to indicate that a new version is available.
|
|
|
|
It does not specify the URL of the update, the checksum, or any other information.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Update File Specification</h3>
|
|
|
|
<p>
|
|
|
|
The signed update file, traditionally named i2pupdate.sud,
|
|
|
|
is simply a zip file with a prepended 56 byte header.
|
|
|
|
The header contains:
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
A 40-byte <a href="common_structures_spec.html#type_signature">DSA signature</a>
|
|
|
|
</li><li>
|
2010-08-28 14:55:11 +00:00
|
|
|
A 16-byte I2P version in UTF-8, padded with trailing zeroes if necessary
|
2010-08-14 17:27:15 +00:00
|
|
|
</li></ul>
|
|
|
|
</p><p>
|
|
|
|
The signature covers only the zip archive - not the prepended version.
|
|
|
|
The signature must match one of the <a href="common_structures_spec.html#type_SigningPublicKey">DSA public keys</a> configured into the router,
|
|
|
|
which has a hardcoded default list of keys of the current project release managers.
|
|
|
|
</p><p>
|
|
|
|
For version comparison purposes, version fields contain [0-9]*, field separators are
|
|
|
|
'-', '_', and '.', and all other characters are ignored.
|
2011-06-15 14:22:18 +00:00
|
|
|
</p><p>
|
2011-06-19 21:53:34 +00:00
|
|
|
As of version 0.8.8, the version must also be specified as a zip file comment in UTF-8,
|
2011-06-15 14:22:18 +00:00
|
|
|
without the trailing zeroes.
|
|
|
|
The updating router verifes that the version in the header (not covered by the signature)
|
|
|
|
matches the version in the zip file comment, which is covered by the signature.
|
|
|
|
This prevents spoofing of the version number in the header.
|
2010-08-14 17:27:15 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3>Download and Installation</h3>
|
|
|
|
<p>
|
2011-06-15 14:22:18 +00:00
|
|
|
The router first downloads the header of the update file from one in a configurable list of I2P URLs,
|
|
|
|
using the built-in HTTP client and proxy,
|
|
|
|
and checks that the version is newer.
|
|
|
|
This prevents the problem of update hosts that do not have the latest file.
|
|
|
|
The router then downloads the full update file.
|
2010-08-14 17:27:15 +00:00
|
|
|
The router verifies that the update file version is newer before installation.
|
2011-06-15 14:22:18 +00:00
|
|
|
It also, of course, verifies the signature, and
|
|
|
|
verifes that the zip file comment matches the header version, as explained above.
|
2010-08-14 17:27:15 +00:00
|
|
|
</p><p>
|
|
|
|
The zip file is extracted in the base $I2P installation directory.
|
|
|
|
</p><p>
|
2011-11-28 17:56:29 +00:00
|
|
|
As of release 0.7.12, the router supports Pack200 decompression.
|
2010-08-14 17:27:15 +00:00
|
|
|
Files inside the zip archive with a .jar.pack or .war.pack suffix
|
|
|
|
are transparently decompressed to a .jar or .war file.
|
|
|
|
Update files containing .pack files are traditionally named with a '.su2' suffix.
|
|
|
|
Pack200 shrinks the update files by about 60%.
|
2011-11-28 17:56:29 +00:00
|
|
|
</p><p>
|
|
|
|
As of release 0.8.7, the router will delete the libjbigi.so and libjcpuid.so files
|
|
|
|
if the zip archive contains a lib/jbigi.jar file, so that the new files will
|
|
|
|
be extracted from jbigi.jar.
|
|
|
|
</p><p>
|
|
|
|
As of release 0.8.12, if the zip archive contains a file deletelist.txt, the router will
|
|
|
|
delete the files listed there. The format is:
|
|
|
|
<ul><li>
|
|
|
|
One file name per line
|
|
|
|
</li><li>
|
|
|
|
All file names are relative to the installation directory; no absolute file names allowed, no files starting with ".."
|
|
|
|
</li><li>
|
|
|
|
Comments start with '#'
|
|
|
|
</li></ul>
|
|
|
|
The router will then delete the deletelist.txt file.
|
2010-08-14 17:27:15 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Future Work</h3>
|
|
|
|
<ul><li>
|
|
|
|
When a new update file specification is defined, it should use a larger
|
|
|
|
DSA signature, and the signature should cover the version.
|
|
|
|
A file format version number might be a good idea too.
|
|
|
|
</li><li>
|
|
|
|
The network will eventually grow too large for update over HTTP.
|
2010-08-15 20:55:21 +00:00
|
|
|
The built-in BitTorrent client, i2psnark, may be used as a distributed update method.
|
2010-08-14 17:27:15 +00:00
|
|
|
This development effort was started in 2009 but is on hold until it is required.
|
|
|
|
</li><li>
|
|
|
|
The router update mechanism is part of the web router console.
|
|
|
|
There is currently no provision for updates of an embedded router lacking the router console.
|
|
|
|
</li></ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|