Opened 5 years ago

Last modified 5 years ago

#1381 testing enhancement

su3 for dev builds

Reported by: zzz Owned by: zzz
Priority: minor Milestone: 0.9.20
Component: router/update Version: 0.9.14.1
Keywords: Cc: killyourtv, Eche|on
Parent Tickets: Sensitive: no

Description

Replace the existing unsigned build update function with an su3 version.

This would be backward-incompatible. Users would need to enter a new update URL.

Update suppliers (kytv and echelon) would need to change their build process. Kytv could use his existing release key, we would copy the cert to a new directory, e.g. certificates/router-dev. Echelon would need to generate a key and check in the cert. For any other suppliers, they would have to post their cert somewhere on their website, and users would have to download and install it manually.

On the router side, the changes should be pretty straightforward.

Subtickets

Change History (14)

comment:1 Changed 5 years ago by killyourtv

As mentioned it in #i2p-dev, I can add the support to the build system (I've already done it; it just needs more local testing before check-in).

Signed devbuild updates could use a target like

 signed-updater200
 signed-updater200WithJavadoc
 signed-updater200WithJavadocAndJetty
 signed-updater200WithJetty
 signed-updater200WithJettyAndGeoIP

or maybe s/signed-(.*)∧1-su3/ would be better.

After the support is added to the build system, changes on my end will be minimal; I'd simply change the updater200WithJetty target to signed-updater200WithJetty and copy over that new file along with the current files.

Last edited 5 years ago by killyourtv (previous) (diff)

comment:2 Changed 5 years ago by zzz

Milestone: 0.9.180.9.20
Owner: set to zzz
Status: newaccepted

I'd like to do this for 0.9.20 if you guys will be ready.

Need public key for each of you and also need to decide if it goes in certificates/router with the rest of them, or keep them separate e.g. certificates/devrouter

comment:3 Changed 5 years ago by zzz

More to decide:

  • Do we bundle the public keys or make the user install them?
  • Do we auto-convert the dev build URL to an su3 variant? (could only do this if we bundle the certs)

comment:4 in reply to:  2 Changed 5 years ago by killyourtv

Replying to zzz:

I'd like to do this for 0.9.20 if you guys will be ready.

On my side I'd just need to change my build command from updater200 to signed-updater200 and copy the .zip and su3 to my webspace.

Need public key for each of you and also need to decide if it goes in certificates/router with the rest of them, or keep them separate e.g. certificates/devrouter

..and I'd possibly need to generate a new certificate, depending on what's chosen here.

Anyway, when/if I need to do something on my side I'll (likely) be ready within 0-4 hours.

comment:5 Changed 5 years ago by zzz

great, one thing I missed is that you checked in the signed-xxx targets from comment 1 above, last November.

comment:6 in reply to:  5 Changed 5 years ago by killyourtv

Replying to zzz:

great, one thing I missed is that you checked in the signed-xxx targets from comment 1 above, last November.

…and they still work. :)

zipit200:
      [zip] Building zip: /home/kytv/mtn/i2p/i2pupdate200.zip

updater200:

-sign-update:
    [input] skipping input as property release.privkey.su3 has already been set.
    [input] skipping input as property release.signer.su3 has already been set.
    [input] skipping input as property release.password.su3 has already been set.
     [java] Enter password for key "killyourtv@mail.i2p": Input file 'i2pupdate200.zip' signed and written to 'i2pupdate.su3'
     [echo] Verify version and VALID signature:
     [java] Signature VALID (signed by killyourtv@mail.i2p RSA_SHA512_4096)
     [java] Version:  0.9.19
     [java] Signer:   killyourtv@mail.i2p
     [java] SigType:  RSA_SHA512_4096
     [java] Content:  ROUTER
     [java] FileType: ZIP

signed-updater200:

BUILD SUCCESSFUL
Total time: 1 minute 29 seconds

comment:7 Changed 5 years ago by zzz

OK started work on this, and made some decisions:

  • Given the common code in build.xml and the update subsystem, it's far easier to use the same SU3 content type (i.e. ROUTER) than to make a new one. This makes more sense anyway, there's only one group to trust for router updates. Users may still add certs.
  • So kytv can use his existing cert in certificates/router to sign dev builds. Still need a cert for echelon, I may have asked him already whether to reuse his reseed cert, can't remember
  • I'm going to add separate fields in the form on /configupdate for a signed dev build, not going to try fancy auto-conversion of URLs, too complex.

I will be testing locally soon, and whenever kytv and echelon have their su3 files built, please pass along a URL so I may test.

comment:8 Changed 5 years ago by zzz

@kytv I think we need an enhancement to build.xml, so the full dev version e.g. 0.9.19-16 is set in the su3 file, not just e.g. 0.9.19. But only for dev su3's.

Either that or we could put in the timestamp instead, like for news and reseed, but that would be less pleasing to the user when we put it in the summary bar. For unsigned updates, we convert the HTTP last-mod date to a timestamp and then convert it back to a formatted date for the summary bar.

I guess it depends if dev builders are posting them only when the -x number increments, or anytime anything is checked in. If the latter, then what version should we put in there? A date stamp, or 0.9.19-16, or 0.9.19-16-b5, or what? We could auto-detect a 10-digit unix date and convert it, else use the version in there? Don't know.

comment:9 in reply to:  8 Changed 5 years ago by killyourtv

Replying to zzz:

@kytv I think we need an enhancement to build.xml, so the full dev version e.g. 0.9.19-16 is set in the su3 file, not just e.g. 0.9.19. But only for dev su3's.

I'll have something to check in soon

..

I guess it depends if dev builders are posting them only when the -x number increments, or anytime anything is checked in. If the latter, then what version should we put in there? A date stamp, or 0.9.19-16, or 0.9.19-16-b5, or what? We could auto-detect a 10-digit unix date and convert it, else use the version in there? Don't know.

New devbuilds are not made by my cronjob unless the build number changes.

psi's build system makes new builds hourly. AFAIK echelon made new builds manually.

comment:10 Changed 5 years ago by killyourtv

Assuming we go with build numbers, this would do the right thing.

#
# patch "build.xml"
#  from [e213b3ed89ebccb6e37fe1d4d15afb60de7667c1]
#    to [89719c6332ab1baff8a0598b8d465f93825abe28]
#
============================================================
--- build.xml   e213b3ed89ebccb6e37fe1d4d15afb60de7667c1
+++ build.xml   89719c6332ab1baff8a0598b8d465f93825abe28
@@ -175,6 +175,7 @@
         <attribute name="infile" />
         <attribute name="outfile" />
         <attribute name="sigtype" />
+        <attribute name="su3.ver" />
         <sequential>
         <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
         <fail message="You must enter an existing file path." >
@@ -211,7 +212,7 @@
                 <arg value="@{infile}" />
                 <arg value="@{outfile}" />
                 <arg value="${release.privkey.su3}" />
-                <arg value="${release.number}" />
+                <arg value="@{su3.ver}" />
                 <arg value="${release.signer.su3}" />
             </java>
             <echo message="Verify version and VALID signature:" />
@@ -257,6 +258,14 @@
          so the build will go faster.
       -->
 
+    <target name="-setepoch">
+        <script language="javascript">
+            <![CDATA[
+              property = project.setProperty("epoch",Math.floor((new Date()).getTime()/1000));
+            ]]>
+        </script>
+    </target>
+
     <target name="buildBOB" depends="buildStreaming" >
         <ant dir="apps/BOB/" target="jar" />
         <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
@@ -1219,11 +1228,11 @@
         </fail>
     </target>
 
-    <target name="i2pseeds" depends="-areRouterInfosEnabled, prepRouterInfos">
+    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
         <delete file="i2pseeds.zip" />
         <delete file="i2pseeds.su3" />
         <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
-        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" />
+        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
     </target>
 
     <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
@@ -1289,7 +1298,7 @@
     <target name="updaterRouter" depends="prepupdateRouter, zipit" />
 
     <target name="-sign-update" depends="buildrouter">
-        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" />
+        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
     </target>
 
     <target name="signed-updater200" depends="updater200, -sign-update" />
@@ -1769,7 +1778,7 @@
         <!-- now build and verify the packed su2 from the packed zip -->
         <sudsign infile="i2pupdate200.zip" outfile="i2pupdate.su2" />
         <!-- now build and verify the packed su3 from the packed zip -->
-        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" />
+        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
         <!-- this will use the monotonerc file in the current workspace -->
         <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
         <delete dir="../i2p-${release.number}" />

comment:11 in reply to:  7 Changed 5 years ago by killyourtv

Replying to zzz:

I will be testing locally soon, and whenever kytv and echelon have their su3 files built, please pass along a URL so I may test.

http://update.killyourtv.i2p/mtn/i2pupdate.su3

The current file has the following specs:

-sign-update:
    [input] skipping input as property release.privkey.su3 has already been set.
    [input] skipping input as property release.signer.su3 has already been set.
    [input] skipping input as property release.password.su3 has already been set.
     [java] Enter password for key "killyourtv@mail.i2p": Input file 'i2pupdate200.zip' signed and written to 'i2pupdate.su3'
     [echo] Verify version and VALID signature:
     [java] Signature VALID (signed by killyourtv@mail.i2p RSA_SHA512_4096)
     [java] Version:  0.9.19-16
     [java] Signer:   killyourtv@mail.i2p
     [java] SigType:  RSA_SHA512_4096
     [java] Content:  ROUTER
     [java] FileType: ZIP

comment:12 Changed 5 years ago by zzz

After discussion on IRC I think the build number as version is the best approach.

psi likely does not have any subscribers, and builds hourly even if no checkin at all, so he would need to modify his scripts anyway to provide a useful service.

ech confirmed he wants to reuse his reseed cert. He doesn't do automatic builds and doesn't do them very often.

Your build.xml changes two comments up look fine, thank you.

I tested enough to get the 0.9.19-16 version out of your su3 file but haven't actually downloaded and updated to it yet. More testing to follow.

comment:13 in reply to:  12 Changed 5 years ago by killyourtv

Replying to zzz:

Your build.xml changes two comments up look fine, thank you.

Excellent. I'll go check it in.

comment:14 Changed 5 years ago by zzz

Status: acceptedtesting
Note: See TracTickets for help on using tickets.