From 12e49072046c2ac8ee44b8a76af991a5e9663851 Mon Sep 17 00:00:00 2001 From: knaccc Date: Sun, 21 Jul 2019 06:31:40 +0100 Subject: [PATCH] I2P-zero v1.9 - now has version command, to assist integration. Tunnel control port changed as per suggestion by moneromooo --- README.md | 8 ++++++++ bin/zip-all.sh | 12 ++++++------ .../src/org/getmonero/i2p/zero/TunnelControl.java | 9 +++++++-- .../src/org/getmonero/i2p/zero/VERSION | 2 +- resources/tunnel-control.sh | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8d0bf1f..266942b 100755 --- a/README.md +++ b/README.md @@ -188,6 +188,14 @@ or, for pleasant viewing on the command line, automatically updating every 2 sec `watch "tunnel-control.sh router.getBandwidthStats | tr ',' '\n' | sort"` +#### Get the I2P-zero version + +`tunnel-control.sh version` + +example response: + +`i2p-zero 1.8` + ## Watch the I2P log for messages diff --git a/bin/zip-all.sh b/bin/zip-all.sh index fd8322c..b9745c3 100755 --- a/bin/zip-all.sh +++ b/bin/zip-all.sh @@ -47,12 +47,12 @@ getFileSizeMB () { print4ColsJustified "OS" "Uncompressed size (MB)" "Compressed size (MB)" "v$VERSION Reproducible build SHA-256" print4ColsJustified "------------------------" "------------------------" "------------------------" "------------------------------------------------------------------" -print4ColsJustified "Mac" "`getFileSizeMB $basedir/dist/mac`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-mac.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-mac.v${VERSION}.zip`\`" -print4ColsJustified "Windows" "`getFileSizeMB $basedir/dist/win`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-win.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-win.v${VERSION}.zip`\`" -print4ColsJustified "Linux" "`getFileSizeMB $basedir/dist/linux`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-linux.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-linux.v${VERSION}.zip`\`" -print4ColsJustified "Mac GUI" "`getFileSizeMB $basedir/dist/mac-gui`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-mac-gui.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-mac-gui.v${VERSION}.zip`\`" -print4ColsJustified "Windows GUI" "`getFileSizeMB $basedir/dist/win-gui`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-win-gui.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-win-gui.v${VERSION}.zip`\`" -print4ColsJustified "Linux GUI" "`getFileSizeMB $basedir/dist/linux-gui`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-linux-gui.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-linux-gui.v${VERSION}.zip`\`" +print4ColsJustified "Mac" "`getFileSizeMB $basedir/dist/mac`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-mac.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-mac.v${VERSION}.zip`\`" +print4ColsJustified "Windows" "`getFileSizeMB $basedir/dist/win`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-win.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-win.v${VERSION}.zip`\`" +print4ColsJustified "Linux" "`getFileSizeMB $basedir/dist/linux`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-linux.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-linux.v${VERSION}.zip`\`" +print4ColsJustified "Mac GUI" "`getFileSizeMB $basedir/dist/mac-gui`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-mac-gui.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-mac-gui.v${VERSION}.zip`\`" +print4ColsJustified "Windows GUI" "`getFileSizeMB $basedir/dist/win-gui`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-win-gui.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-win-gui.v${VERSION}.zip`\`" +print4ColsJustified "Linux GUI" "`getFileSizeMB $basedir/dist/linux-gui`" "`getFileSizeMB $basedir/dist-zip/i2p-zero-linux-gui.v${VERSION}.zip`" "\``getHash $basedir/dist-zip/i2p-zero-linux-gui.v${VERSION}.zip`\`" echo "" echo "Note: Reproducible builds are currently experimental. Due to JDK differences, Builds on Mac will consistently have different hashes than builds on Linux. Official releases will always be built on Linux (Ubuntu)." \ No newline at end of file diff --git a/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/TunnelControl.java b/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/TunnelControl.java index ea8f48f..cb3e49d 100644 --- a/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/TunnelControl.java +++ b/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/TunnelControl.java @@ -37,7 +37,7 @@ public class TunnelControl implements Runnable { private File tunnelControlTempDir; private TunnelList tunnelList; - private static final int TUNNEL_CONTROL_LISTENING_PORT = 30000; + private static final int TUNNEL_CONTROL_LISTENING_PORT = 31337; public static class TunnelList { private File tunnelControlConfigDir; @@ -475,7 +475,7 @@ public class TunnelControl implements Runnable { for(var t : tunnelList.tunnels) if(t.getEnabled()) t.start(); try { - controlServerSocket = new ServerSocket(30000, 0, InetAddress.getLoopbackAddress()); + controlServerSocket = new ServerSocket(31337, 0, InetAddress.getLoopbackAddress()); while (!stopping) { try (var socket = controlServerSocket.accept()) { var out = new PrintWriter(socket.getOutputStream(), true); @@ -621,6 +621,11 @@ public class TunnelControl implements Runnable { break; } + case "version": { + out.println("i2p-zero " + UpdateCheck.currentVersion); + break; + } + case "router.reachability": { out.println(routerWrapper.getReachability().getMessage()); break; diff --git a/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/VERSION b/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/VERSION index 4684374..872765e 100644 --- a/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/VERSION +++ b/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/VERSION @@ -1 +1 @@ -1.8 \ No newline at end of file +1.9 \ No newline at end of file diff --git a/resources/tunnel-control.sh b/resources/tunnel-control.sh index b3be20c..7906169 100755 --- a/resources/tunnel-control.sh +++ b/resources/tunnel-control.sh @@ -1,3 +1,3 @@ #!/bin/bash -exec 3<>/dev/tcp/localhost/30000; echo "$1 $2 $3 $4" >&3; cat <&3 \ No newline at end of file +exec 3<>/dev/tcp/localhost/31337; echo "$1 $2 $3 $4" >&3; cat <&3 \ No newline at end of file