diff --git a/README.md b/README.md index 09047ca..31b0c15 100755 --- a/README.md +++ b/README.md @@ -51,10 +51,6 @@ Then, retrieve this project from git: `git clone https://github.com/i2p-zero/i2p-zero.git` -Note that the current version of this script uses jdk-13. If this version of Java becomes no longer available for -download, then update the references in java-config.sh to the later version. To locate a recent -JDK download URL, see https://jdk.java.net/13/ - Also note that JDKs for Linux, MacOS and Windows will be downloaded, which will total several hundred megabytes. You may need to ensure your system has zip, unzip and bzip2 installed to run the build script. Run the `bin/build-all-and-zip.sh` script, which will in turn call the following scripts: @@ -70,25 +66,25 @@ the jlink tool to build zero-dependency platform-specific launchers. ## Running the GUI -To run the Linux router, double-click the app located at `dist/linux-gui/router/i2p-zero` +To run the Linux router, double-click the app located at `dist/linux-gui/router/bin/i2p-zero` To run the MacOS router, double-click the app located at `dist/mac-gui/router/i2p-zero.app` -For Windows, double-click the app located at `dist/windows-gui/router/i2p-zero.exe` +For Windows, double-click the app located at `dist/win-gui/router/i2p-zero.exe` ## Running the command line version To run the Linux router, type: -`dist/linux/router/bin/launch.sh` +`dist/linux/router/bin/i2p-zero` To run the MacOS router, type: `dist/mac/router/bin/launch.sh` -For Windows, run: +For Windows, run: (note that the Windows build will run in the background and not show a success message) -`dist/windows/router/bin/launch.bat` +`dist/win/router/i2p-zero.exe` If it launches successfully, you'll see the message: @@ -216,16 +212,14 @@ example response: `tail -f dist/linux/router/i2p.config/wrapper.log` -## Note on bundled windows wrapper.exe executable +## Note on bundled windows launcher.exe executable -There is a bundled resources/wrapper.exe file in the source tree. This allows the windows distributable to be built +There is a bundled `resources/launcher.exe` file in the source tree. This allows the windows distributable to be built even on a non-windows platform. -This file can be deterministically recreated by -downloading javapackager from http://download2.gluonhq.com/jpackager/11/jdk.packager-windows.zip, unzipping it, -unzipping the jar file within that, and obtaining the jdk/packager/internal/resources/windows/papplauncher.exe file. - -Then, on Windows, download Resource Hacker version 5.1.7 from http://www.angusj.com/resourcehacker/ and use it to add the -resources/icons.ico file to the papplauncher.exe file. Finally, verify that the resulting file is identical to the bundled resources/wrapper.exe file. - -The sha256 checksum of the file should be `50c9286b9da7a91b8715de3cbcd141ec44eb199642562f43ce82351609115e06` \ No newline at end of file +#This file can be deterministically recreated by following these steps on a Windows machine: +1. Download AdoptOpenJDK14 from https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk14-2020-03-09-04-56/OpenJDK14-jdk_x64_windows_hotspot_2020-03-09-04-56.zip +2. Create a new folder, and place inside the `resources/icons.ico` file and the `router` folder from an I2P-zero for Windows GUI build +3. Run `\bin\jpackage.exe --type app-image --icon icons.ico --name i2p-zero -m org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.Gui --runtime-image router\runtime +4. Run `certUtil -hashfile i2p-zero/i2p-zero.exe SHA256` to get the SHA256 hash. +5. This hash should exactly match the SHA256 hash of the `resources/launcher.exe` file, which should be `3d5d00eeff5cb9d63ea415c593d67f201a7d024b6378d22d702b001e6693a93a` \ No newline at end of file diff --git a/bin/build-launcher.sh b/bin/build-launcher.sh index 7a41ce7..29e06fb 100755 --- a/bin/build-launcher.sh +++ b/bin/build-launcher.sh @@ -45,15 +45,7 @@ for i in linux mac win; do "$JAVA_HOME"/bin/jlink --module-path "${JAVA_HOME_VARIANT}/jmods":import/javafx-jmods/$i/javafx-jmods-${JAVAFX_VERSION}:target/modules:target/org.getmonero.i2p.zero.jar:target/org.getmonero.i2p.zero.gui.jar --add-modules combined,org.getmonero.i2p.zero,org.getmonero.i2p.zero.gui,javafx.controls,javafx.fxml,java.desktop --output dist/$i-gui/router --compress 2 --no-header-files --no-man-pages --order-resources=**/module-info.class,/java.base/java/lang/**,**javafx** done -for i in linux mac linux-gui mac-gui; do - cp "$basedir/resources/launch.sh" "$basedir/dist/$i/router/bin/" - cp "$basedir/resources/tunnel-control.sh" "$basedir/dist/$i/router/bin/" -done -for i in win; do - cp "$basedir/resources/launch.bat" "$basedir/dist/$i/router/bin/" -done - -for i in linux-gui mac-gui; do +for i in mac-gui; do cp "$basedir/resources/launch-gui.sh" "$basedir/dist/$i/router/bin/" done @@ -82,40 +74,32 @@ mv "$basedir/dist/mac-gui/router-tmp"/* "$basedir/dist/mac-gui/router/i2p-zero.a rm -fr "$basedir/dist/mac-gui/router-tmp" -# build linux gui app structure -mv "$basedir/dist/linux-gui/router" "$basedir/dist/linux-gui/router-tmp" -mkdir -p "$basedir/dist/linux-gui/router/app" -mkdir -p "$basedir/dist/linux-gui/router/resources" - -mv "$basedir/dist/linux-gui/router-tmp" "$basedir/dist/linux-gui/router/runtime" - -cp "$basedir/import/javapackager/linux/jdk/packager/internal/resources/linux/papplauncher" "$basedir/dist/linux-gui/router/i2p-zero" -cp "$basedir/import/javapackager/linux/jdk/packager/internal/resources/linux/libpackager.so" "$basedir/dist/linux-gui/router/" -chmod +x "$basedir/dist/linux-gui/router/i2p-zero" - -cp "$basedir/resources/i2p-zero.linux.cfg" "$basedir/dist/linux-gui/router/app/i2p-zero.cfg" -cp "$basedir/org.getmonero.i2p.zero.gui/src/org/getmonero/i2p/zero/gui/icon.png" "$basedir/dist/linux-gui/router/resources/i2p-zero.png" - - -# build win gui app structure -mv "$basedir/dist/win-gui/router" "$basedir/dist/win-gui/router-tmp" -mkdir -p "$basedir/dist/win-gui/router/app" - -mv "$basedir/dist/win-gui/router-tmp" "$basedir/dist/win-gui/router/runtime" - -cp "$basedir/resources/wrapper.exe" "$basedir/dist/win-gui/router/i2p-zero.exe" - -cp "$basedir/import/javapackager/win/jdk/packager/internal/resources/windows/packager.dll" "$basedir/dist/win-gui/router/" -for i in msvcp140.dll vcruntime140.dll; do - cp "$basedir/dist/win-gui/router/runtime/bin/$i" "$basedir/dist/win-gui/router/" +# build linux and linux-gui app structure +for i in linux linux-gui; do + mv "$basedir/dist/$i/router" "$basedir/dist/$i/router-tmp" + mkdir -p "$basedir/dist/$i/router/bin" + mkdir -p "$basedir/dist/$i/router/lib" + cp "$basedir/import/jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/jpackageapplauncher" "$basedir/dist/$i/router/bin/i2p-zero" + chmod +x "$basedir/dist/$i/router/bin/i2p-zero" + mkdir -p "$basedir/dist/$i/router/lib/app" + cp "$basedir/resources/i2p-zero.$i.cfg" "$basedir/dist/$i/router/lib/app/i2p-zero.cfg" + mv "$basedir/dist/$i/router-tmp" "$basedir/dist/$i/router/lib/runtime" + cp "$basedir/import/jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/libapplauncher.so" "$basedir/dist/$i/router/lib/" done -cp "$basedir/resources/i2p-zero.win.cfg" "$basedir/dist/win-gui/router/app/i2p-zero.cfg" - +# build win and win-gui app structure +for i in win win-gui; do + mv "$basedir/dist/$i/router" "$basedir/dist/$i/router-tmp" + mkdir -p "$basedir/dist/$i/router/app" + cp "$basedir/resources/i2p-zero.$i.cfg" "$basedir/dist/$i/router/app/i2p-zero.cfg" + mv "$basedir/dist/$i/router-tmp" "$basedir/dist/$i/router/runtime" + cp "$basedir/resources/launcher.exe" "$basedir/dist/$i/router/i2p-zero.exe" + cp "$basedir/import/jpackage/win/classes/jdk/incubator/jpackage/internal/resources/applauncher.dll" "$basedir/dist/$i/router/" +done -# linux-gui launcher: fix location of libjli.so due to slight incompatibility with javapackager11 when used with jdk12 hotspot VM -mkdir "$basedir/dist/linux-gui/router/runtime/lib/jli" -cp "$basedir/dist/linux-gui/router/runtime/lib/libjli.so" "$basedir/dist/linux-gui/router/runtime/lib/jli/" +for i in linux mac; do + cp "$basedir/resources/tunnel-control.sh" "$basedir/dist/$i/router/bin/" +done # show distribution sizes @@ -132,10 +116,10 @@ if [ $os_name = Darwin ]; then echo "To run the GUI, double-click: dist/$os_name-gui/router/i2p-zero.app" elif [ $os_name = Linux ]; then os_name=linux - echo "To run from the command line, type: ./dist/$os_name/router/bin/launch.sh" + echo "To run from the command line, type: ./dist/$os_name/router/bin/i2p-zero" echo "To run the GUI, double-click: dist/$os_name-gui/router/i2p-zero" else os_name=win - echo "To run from the command line, type: ./dist/$os_name/router/bin/launch.bat" + echo "To run from the command line, type: ./dist/$os_name/router/i2p-zero.exe" echo "To run the GUI, double-click: dist/$os_name-gui/router/i2p-zero.exe" fi diff --git a/bin/import-packages.sh b/bin/import-packages.sh index d7cf126..d52f3b2 100755 --- a/bin/import-packages.sh +++ b/bin/import-packages.sh @@ -79,16 +79,9 @@ if [ ! -d "$basedir/import/javafx-jmods" ]; then unzip javafx-jmods/win/$JAVAFX_JMODS_DOWNLOAD_FILENAME_WIN -d javafx-jmods/win/ fi -if [ ! -d "$basedir/import/javapackager" ]; then - mkdir -p javapackager - mkdir -p javapackager/linux javapackager/win - wget --directory-prefix=javapackager/linux $JPACKAGER_DOWNLOAD_URL_LINUX - wget --directory-prefix=javapackager/win $JPACKAGER_DOWNLOAD_URL_WIN - - unzip javapackager/linux/$JPACKAGER_DOWNLOAD_FILENAME_LINUX -d javapackager/linux/ - unzip javapackager/win/$JPACKAGER_DOWNLOAD_FILENAME_WIN -d javapackager/win/ - - unzip javapackager/linux/jdk.packager.jar -d javapackager/linux/ - unzip javapackager/win/jdk.packager.jar -d javapackager/win/ +if [ ! -d "$basedir/import/jpackage" ]; then + mkdir -p jpackage/linux jpackage/win + unzip $JAVA_HOME_LINUX/jmods/jdk.incubator.jpackage.jmod -d jpackage/linux/ + unzip $JAVA_HOME_WIN/jmods/jdk.incubator.jpackage.jmod -d jpackage/win/ fi diff --git a/bin/java-config.sh b/bin/java-config.sh index 42b7582..14dad2b 100644 --- a/bin/java-config.sh +++ b/bin/java-config.sh @@ -8,19 +8,23 @@ fi export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 -JDK_DOWNLOAD_FILENAME_LINUX=OpenJDK13U-jdk_x64_linux_hotspot_13_33.tar.gz -JDK_DOWNLOAD_FILENAME_MAC=OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz -JDK_DOWNLOAD_FILENAME_WIN=OpenJDK13U-jdk_x64_windows_hotspot_13_33.zip - -JDK_DOWNLOAD_URL_LINUX=https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jdk_x64_linux_hotspot_13_33.tar.gz -JDK_DOWNLOAD_URL_MAC=https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz -JDK_DOWNLOAD_URL_WIN=https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jdk_x64_windows_hotspot_13_33.zip - -JAVA_HOME_LINUX=$basedir/import/jdks/linux/jdk-13+33 -JAVA_HOME_MAC=$basedir/import/jdks/mac/jdk-13+33/Contents/Home -JAVA_HOME_WIN=$basedir/import/jdks/win/jdk-13+33 - -JAVAFX_VERSION=13 +JDK_MAJOR_VERSION=14 +JDK_VERSION=14.0.1+7 +JDK_VERSION_URL_ENC=`echo "$JDK_VERSION" | sed 's/+/%2B/g'` +JDK_VERSION_URL_ENC2=`echo "$JDK_VERSION" | sed 's/+/_/g'` +JDK_DOWNLOAD_URL_LINUX=https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_linux_hotspot_${JDK_VERSION_URL_ENC2}.tar.gz +JDK_DOWNLOAD_URL_MAC=https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_mac_hotspot_${JDK_VERSION_URL_ENC2}.tar.gz +JDK_DOWNLOAD_URL_WIN=https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_windows_hotspot_${JDK_VERSION_URL_ENC2}.zip + +JDK_DOWNLOAD_FILENAME_LINUX="${JDK_DOWNLOAD_URL_LINUX##*/}" +JDK_DOWNLOAD_FILENAME_MAC="${JDK_DOWNLOAD_URL_MAC##*/}" +JDK_DOWNLOAD_FILENAME_WIN="${JDK_DOWNLOAD_URL_WIN##*/}" + +JAVA_HOME_LINUX=$basedir/import/jdks/linux/jdk-$JDK_VERSION +JAVA_HOME_MAC=$basedir/import/jdks/mac/jdk-$JDK_VERSION/Contents/Home +JAVA_HOME_WIN=$basedir/import/jdks/win/jdk-$JDK_VERSION + +JAVAFX_VERSION=14 JAVAFX_SDK_DOWNLOAD_URL_LINUX=https://download2.gluonhq.com/openjfx/$JAVAFX_VERSION/openjfx-${JAVAFX_VERSION}_linux-x64_bin-sdk.zip JAVAFX_SDK_DOWNLOAD_URL_MAC=https://download2.gluonhq.com/openjfx/$JAVAFX_VERSION/openjfx-${JAVAFX_VERSION}_osx-x64_bin-sdk.zip JAVAFX_SDK_DOWNLOAD_URL_WIN=https://download2.gluonhq.com/openjfx/$JAVAFX_VERSION/openjfx-${JAVAFX_VERSION}_windows-x64_bin-sdk.zip @@ -33,12 +37,6 @@ JAVAFX_JMODS_DOWNLOAD_FILENAME_LINUX=openjfx-${JAVAFX_VERSION}_linux-x64_bin-jmo JAVAFX_JMODS_DOWNLOAD_FILENAME_MAC=openjfx-${JAVAFX_VERSION}_osx-x64_bin-jmods.zip JAVAFX_JMODS_DOWNLOAD_FILENAME_WIN=openjfx-${JAVAFX_VERSION}_windows-x64_bin-jmods.zip -JPACKAGER_DOWNLOAD_URL_LINUX=http://download2.gluonhq.com/jpackager/11/jdk.packager-linux.zip -JPACKAGER_DOWNLOAD_URL_WIN=http://download2.gluonhq.com/jpackager/11/jdk.packager-windows.zip - -JPACKAGER_DOWNLOAD_FILENAME_LINUX=jdk.packager-linux.zip -JPACKAGER_DOWNLOAD_FILENAME_WIN=jdk.packager-windows.zip - OS=`uname -s` if [ $OS = "Darwin" ]; then diff --git a/mipseed.md b/mipseed.md index af8af11..cc58071 100644 --- a/mipseed.md +++ b/mipseed.md @@ -7,7 +7,7 @@ 6. Create a server tunnel for incoming I2P connections by typing: `router/bin/tunnel-control.sh server.create.vanity 127.0.0.1 8061 none xyz` replacing `xyz` with a 3 alphanumeric character vanity prefix for your public b32.i2p address. This command will take a few minutes to complete, depending on how fast your CPU is. If you do not want a vanity prefix, use the command: `router/bin/tunnel-control.sh server.create 127.0.0.1 8061` 7. The command above will result in an I2P address being printed to the command line, which will end with `.b32.i2p`. This is your new I2P address. 8. You now need to keep a backup of your private keys to your I2P address on another computer for safekeeping. Do this by taking a backup of the `~/.i2p-zero/config/tunnels.json` file -9. Run monerod by typing the following, replacing `XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p` with your own I2P address that was printed from step 5: `monerod --tx-proxy i2p,127.0.0.1:8060 --add-peer dsc7fyzzultm7y6pmx2avu6tze3usc7d27nkbzs5qwuujplxcmzq.b32.i2p --anonymous-inbound XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p,127.0.0.1 --prune-blockchain --detach`. +9. Run monerod by typing the following, replacing `XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p` with your own I2P address that was printed from step 5: `monerod --tx-proxy i2p,127.0.0.1:8060 --add-peer dsc7fyzzultm7y6pmx2avu6tze3usc7d27nkbzs5qwuujplxcmzq.b32.i2p --anonymous-inbound XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p,127.0.0.1:8061 --prune-blockchain --detach`. 10. (optional) Use software such as wondershaper for Linux to limit bandwidth usage. See this: https://www.ostechnix.com/how-to-limit-network-bandwidth-in-linux-using-wondershaper/ That's it! Do not replace the dsc****.b32.i2p address with yours, only replace the XXXXXXX.b32.i2p one. You are now running a mipseed, which will itself be seeded by dsc_'s mipseed. diff --git a/org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.iml b/org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.iml index f1d4cf3..8f312aa 100644 --- a/org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.iml +++ b/org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.iml @@ -11,7 +11,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -74,7 +74,7 @@ - + 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 03ff897..68209c0 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.16 \ No newline at end of file +1.17 \ No newline at end of file diff --git a/resources/i2p-zero.linux-gui.cfg b/resources/i2p-zero.linux-gui.cfg new file mode 100644 index 0000000..7586db6 --- /dev/null +++ b/resources/i2p-zero.linux-gui.cfg @@ -0,0 +1,15 @@ +[Application] +app.name=i2p-zero +app.version=1.0 +app.runtime=$ROOTDIR/lib/runtime +app.identifier=org.getmonero.i2p.zero.gui +app.classpath=$ROOTDIR/lib/runtime/i2p.base/jbigi.jar +app.application.instance=single +app.mainmodule=org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.Gui + + +[JVMOptions] + +[JVMUserOptions] + +[ArgOptions] \ No newline at end of file diff --git a/resources/i2p-zero.linux.cfg b/resources/i2p-zero.linux.cfg index 79acb10..14575e3 100644 --- a/resources/i2p-zero.linux.cfg +++ b/resources/i2p-zero.linux.cfg @@ -1,13 +1,12 @@ [Application] app.name=i2p-zero app.version=1.0 -app.preferences.id= -app.runtime=$APPDIR/runtime -app.identifier= -app.classpath=$APPDIR/runtime/i2p.base/jbigi.jar +app.runtime=$ROOTDIR/lib/runtime +app.identifier=org.getmonero.i2p.zero +app.classpath=$ROOTDIR/lib/runtime/i2p.base/jbigi.jar app.application.instance=single -app.mainmodule=org.getmonero.i2p.zero.gui -packager.java.version=11.0.1 +app.mainmodule=org.getmonero.i2p.zero/org.getmonero.i2p.zero.Main + [JVMOptions] diff --git a/resources/i2p-zero.win-gui.cfg b/resources/i2p-zero.win-gui.cfg new file mode 100644 index 0000000..3d7a1be --- /dev/null +++ b/resources/i2p-zero.win-gui.cfg @@ -0,0 +1,15 @@ +[Application] +app.name=i2p-zero +app.version=1.0 +app.runtime=$ROOTDIR\runtime +app.identifier=org.getmonero.i2p.zero.gui +app.classpath=$ROOTDIR/runtime/i2p.base/jbigi.jar +app.application.instance=single +app.mainmodule=org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.Gui + + +[JVMOptions] + +[JVMUserOptions] + +[ArgOptions] \ No newline at end of file diff --git a/resources/i2p-zero.win.cfg b/resources/i2p-zero.win.cfg index 919ab7b..78efa3b 100644 --- a/resources/i2p-zero.win.cfg +++ b/resources/i2p-zero.win.cfg @@ -1,13 +1,12 @@ [Application] app.name=i2p-zero app.version=1.0 -app.preferences.id= -app.runtime=$APPDIR\runtime -app.identifier= -app.classpath=$APPDIR/runtime/i2p.base/jbigi.jar +app.runtime=$ROOTDIR\runtime +app.identifier=org.getmonero.i2p.zero +app.classpath=$ROOTDIR/runtime/i2p.base/jbigi.jar app.application.instance=single -app.mainmodule=org.getmonero.i2p.zero.gui -packager.java.version=11.0.2 +app.mainmodule=org.getmonero.i2p.zero/org.getmonero.i2p.zero.Main + [JVMOptions] diff --git a/resources/launch.sh b/resources/launch.sh deleted file mode 100755 index a74a7d8..0000000 --- a/resources/launch.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ $(uname -s) = Darwin ]; then - basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P)) -else - basedir=$(dirname $(dirname $(readlink -fm $0))) -fi - -"$basedir"/bin/java -cp "$basedir/i2p.base/jbigi.jar" -m org.getmonero.i2p.zero diff --git a/resources/wrapper.exe b/resources/launcher.exe similarity index 71% rename from resources/wrapper.exe rename to resources/launcher.exe index 51972dd..9792a31 100644 Binary files a/resources/wrapper.exe and b/resources/launcher.exe differ