Compare commits
113 Commits
Author | SHA1 | Date | |
---|---|---|---|
a5c7bac581 | |||
7eeb2e4523 | |||
9cae0f78ad | |||
99438cfc33 | |||
eba4ebe3d0 | |||
7f24838725 | |||
673725304c | |||
7cf2bf455a | |||
d177435b50 | |||
33fb6ab6d5 | |||
29827366fb | |||
edfe44bc3b | |||
432e2c54f8 | |||
8894c946bc | |||
bc9b4a0250 | |||
35841c7887 | |||
e3afb9de1d | |||
3b11def66c | |||
e152513043 | |||
81dd3ed5ef | |||
0630f77a4c | |||
204fda1a11 | |||
9e1ef2d546 | |||
688bc1b0f3 | |||
dd566165dd | |||
57833edc36 | |||
a19fcd9ea5 | |||
bfddc378cd | |||
fd712293b4 | |||
068fbee70e | |||
377c836887 | |||
99a4959c12 | |||
922ec66f95 | |||
298c87f457 | |||
fcacf59a48 | |||
8d06c9079b | |||
c0fb7dcf67 | |||
019581479b | |||
65fb9e1847 | |||
402cede106 | |||
673d6b469f | |||
dd47ffd902 | |||
b2f92840e5 | |||
0cffa15047 | |||
0a6dae1aac | |||
6e3fcd3285 | |||
57fa862f01 | |||
2225b47459 | |||
78989a8bbd | |||
e7025ae941 | |||
d7423eb595 | |||
4cb8febe3b | |||
039faf8280 | |||
3a17a3926d | |||
e09d2a41ec | |||
848fabd27c | |||
da58c26935 | |||
c84522a244 | |||
d8953824c5 | |||
b67235b2a9 | |||
00bf0f267e | |||
a1d07cffee | |||
c678c6eca2 | |||
2a162fb4c1 | |||
e594ce9bb5 | |||
4a312198ff | |||
f0fb375e13 | |||
f19a5ca002 | |||
45deb5ac28 | |||
7403cf2e8f | |||
046090ea11 | |||
00098cbf53 | |||
c4980a61f0 | |||
20b5ffdb17 | |||
4a6926fcbf | |||
5b12f20406 | |||
da29268898 | |||
79f016cb1c | |||
e19ce19368 | |||
2e4f110c30 | |||
1bb8238e68 | |||
6bfec5d6ef | |||
f7c6251f30 | |||
1a1e25a52f | |||
b8b19786b1 | |||
8c2c839337 | |||
f56771ac8a | |||
e0d5d61518 | |||
c4c40eee8f | |||
2db71e402d | |||
6e9df08473 | |||
b98b488f70 | |||
52b34a5d6a | |||
c1b20d4f2b | |||
c656b80674 | |||
4ceddb976d | |||
8f14378aee | |||
c5af86adfd | |||
9469293bcf | |||
44ce8335a1 | |||
8a9ce211f3 | |||
037250ae46 | |||
f93c4660da | |||
2f516f0c11 | |||
f3d871d64b | |||
51a82601f0 | |||
85e30d36d7 | |||
7e21d86ab4 | |||
6fbe64d8e2 | |||
91beec4f75 | |||
5f3a3d46f6 | |||
23d013765a | |||
b3ff2dfdbf |
8
.gitignore
vendored
8
.gitignore
vendored
@ -21,4 +21,10 @@ cmd
|
|||||||
*.jar
|
*.jar
|
||||||
*.zip
|
*.zip
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
config_override.sh
|
config_override.sh
|
||||||
|
i2pkeys
|
||||||
|
onionkeys
|
||||||
|
tlskeys
|
||||||
|
tmp
|
||||||
|
/.stfolder/
|
||||||
|
/.vscode/
|
87
Makefile
87
Makefile
@ -7,27 +7,18 @@ preset=`rm .version; make version`
|
|||||||
|
|
||||||
-include .version
|
-include .version
|
||||||
|
|
||||||
PROFILE_VERSION=$(MAJOR).$(MINOR).$(BUILD)
|
PROFILE_VERSION=$(VERSIONMAJOR).$(VERSIONMINOR).$(VERSIONBUILD)
|
||||||
|
|
||||||
all: version prep install.exe
|
all: version install.exe
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
find . -name '*.java' -exec clang-format -i {} \;
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
git tag $(PROFILE_VERSION)
|
git tag $(PROFILE_VERSION)
|
||||||
|
|
||||||
version:
|
version:
|
||||||
echo !define VERSIONMAJOR $(VERSIONMAJOR) > src/nsis/i2pbrowser-version.nsi
|
./buildscripts/version.sh
|
||||||
echo !define VERSIONMINOR $(VERSIONMINOR) >> src/nsis/i2pbrowser-version.nsi
|
|
||||||
echo !define VERSIONBUILD $(VERSIONBUILD) >> src/nsis/i2pbrowser-version.nsi
|
|
||||||
sed 's|!define VERSION||g' src/nsis/i2pbrowser-version.nsi | sed 's| |=|g' > .version
|
|
||||||
rm -f version.txt
|
|
||||||
make version.txt i2pbrowser-jpackage.nsi
|
|
||||||
|
|
||||||
version.txt: build
|
|
||||||
echo "$(PROFILE_VERSION)" > build/version.txt
|
|
||||||
echo "$(PROFILE_VERSION)" > build/version.txt
|
|
||||||
|
|
||||||
i2pbrowser-jpackage.nsi:
|
|
||||||
echo "!define I2P_VERSION $(PROFILE_VERSION)" > src/nsis/i2pbrowser-jpackage.nsi
|
|
||||||
|
|
||||||
jpackage: version I2P build/I2P/config all
|
jpackage: version I2P build/I2P/config all
|
||||||
|
|
||||||
@ -39,56 +30,25 @@ help: version
|
|||||||
@echo "$(preset)"
|
@echo "$(preset)"
|
||||||
|
|
||||||
prep:
|
prep:
|
||||||
make build/licenses
|
|
||||||
echo "licenses" >>make.log
|
|
||||||
make build/I2P
|
|
||||||
echo "buildi2p" >>make.log
|
|
||||||
make build/I2P/config
|
|
||||||
echo "buildi2pconfig" >>make.log
|
|
||||||
cp src/nsis/*.nsi build
|
|
||||||
echo "nsi1" >>make.log
|
|
||||||
cp src/nsis/*.nsh build
|
|
||||||
echo "nsi2" >>make.log
|
|
||||||
cp src/icons/*.ico build
|
|
||||||
|
|
||||||
install.exe: #build/licenses
|
install.exe:
|
||||||
cd build && makensis i2pbrowser-installer.nsi && cp I2P-Easy-Install-Bundle-*.exe ../ && echo "built windows installer"
|
./buildscripts/nsis.sh
|
||||||
|
|
||||||
export RES_DIR="../i2p.i2p.jpackage-build/installer/resources"
|
export RES_DIR="../i2p.i2p.jpackage-build/installer/resources"
|
||||||
export PKG_DIR="../i2p.i2p.jpackage-build/pkg-temp"
|
export PKG_DIR="../i2p.i2p.jpackage-build/pkg-temp"
|
||||||
export I2P_JBIGI="../i2p.i2p.jpackage-build/installer/lib/jbigi"
|
#export I2P_JBIGI="../i2p.i2p.jpackage-build/installer/lib/jbigi"
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -rf I2P
|
rm -rf I2P
|
||||||
|
|
||||||
I2P:
|
I2P:
|
||||||
./build.sh
|
./buildscripts/build.sh
|
||||||
|
|
||||||
build/I2P: I2P build
|
build/I2P: I2P build
|
||||||
rm -rf build/I2P
|
|
||||||
cp -rv I2P build/I2P ; true
|
|
||||||
cp "$(I2P_JBIGI)"/*windows*.dll build/I2P/runtime/lib; true
|
|
||||||
|
|
||||||
src/I2P/config:
|
src/I2P/config:
|
||||||
mkdir -p src/I2P/config
|
|
||||||
rm -rf src/I2P/config/geoip src/I2P/config/webapps src/I2P/config/certificates
|
|
||||||
cp -v $(RES_DIR)/clients.config src/I2P/config/
|
|
||||||
cp -v $(RES_DIR)/wrapper.config src/I2P/config/
|
|
||||||
#grep -v 'router.updateURL' $(RES_DIR)/router.config > src/I2P/config/router.config
|
|
||||||
cat router.config > src/I2P/config/router.config
|
|
||||||
cat i2ptunnel.config > src/I2P/config/i2ptunnel.config
|
|
||||||
cp -v $(RES_DIR)/hosts.txt src/I2P/config/hosts.txt
|
|
||||||
cp -R $(RES_DIR)/certificates src/I2P/config/certificates
|
|
||||||
cp -R $(RES_DIR)/eepsite src/I2P/config/eepsite
|
|
||||||
mkdir -p src/I2P/config/geoip
|
|
||||||
cp -v $(RES_DIR)/GeoLite2-Country.mmdb.gz src/I2P/config/geoip/GeoLite2-Country.mmdb.gz
|
|
||||||
cp -R "$(PKG_DIR)"/webapps src/I2P/config/webapps
|
|
||||||
cd src/I2P/config/geoip && gunzip GeoLite2-Country.mmdb.gz; cd ../../..
|
|
||||||
|
|
||||||
build/I2P/config: src/I2P/config build/I2P
|
build/I2P/config: src/I2P/config build/I2P
|
||||||
cp -rv src/I2P/config build/I2P/config
|
|
||||||
# cp -rv build/I2P/* I2P/
|
|
||||||
# cp -rv src/I2P/config build/I2P/.i2p
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Warning: a displayed license file of more than 28752 bytes
|
# Warning: a displayed license file of more than 28752 bytes
|
||||||
@ -96,24 +56,10 @@ build/I2P/config: src/I2P/config build/I2P
|
|||||||
# Possibly related: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895064
|
# Possibly related: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895064
|
||||||
#
|
#
|
||||||
build/licenses: build
|
build/licenses: build
|
||||||
mkdir -p build/licenses
|
./buildscripts/licenses.sh
|
||||||
cp license/* build/licenses
|
|
||||||
cp LICENSE.md build/licenses/MIT.txt
|
|
||||||
cat build/licenses/LICENSE.index \
|
|
||||||
build/licenses/EPL.txt \
|
|
||||||
build/licenses/GPL+CLASSPATH.txt \
|
|
||||||
build/licenses/HTTPS-Everywhere.txt \
|
|
||||||
build/licenses/LICENSE.tor \
|
|
||||||
build/licenses/MIT.txt \
|
|
||||||
build/licenses/MPL2.txt \
|
|
||||||
build/licenses/NoScript.txt \
|
|
||||||
build/licenses/NSS.txt \
|
|
||||||
build/licenses/I2P.txt > build/licenses/LICENSE.txt
|
|
||||||
unix2dos build/licenses/LICENSE.txt
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build app-profile-*.tgz profile-*.tgz I2P-Easy-Install-Bundle-*.exe *.deb src/I2P/config *.su3 .version *.url make.log
|
./buildscripts/clean.sh
|
||||||
git clean -fdx src build
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@echo "creating build directory"
|
@echo "creating build directory"
|
||||||
@ -123,12 +69,13 @@ include makefiles/su.mk
|
|||||||
|
|
||||||
include makefiles/su-unsigned.mk
|
include makefiles/su-unsigned.mk
|
||||||
|
|
||||||
include makefiles/debian.mk
|
|
||||||
|
|
||||||
I2P_DATE=`date +%Y-%m-%d`
|
I2P_DATE=`date +%Y-%m-%d`
|
||||||
|
|
||||||
MAGNET=`bttools torrent printinfo i2pwinupdate.su3.torrent | grep 'MagNet' | sed 's|MagNet: ||g' | sed 's|%3A|:|g'| sed 's|%2F|/|g'`
|
MAGNET=`bttools torrent dumpinfo i2pwinupdate.su3.torrent | grep 'Magnet' | sed 's|Magnet: ||g' | sed 's|%3A|:|g'| sed 's|%2F|/|g'`
|
||||||
MAGNET_TESTING=`bttools torrent printinfo i2pwinupdate-testing.su3.torrent | grep 'MagNet' | sed 's|MagNet: ||g' | sed 's|%3A|:|g'| sed 's|%2F|/|g'`
|
MAGNET_TESTING=`bttools torrent dumpinfo i2pwinupdate-testing.su3.torrent | grep 'MagNet' | sed 's|MagNet: ||g' | sed 's|%3A|:|g'| sed 's|%2F|/|g'`
|
||||||
|
|
||||||
|
magnet:
|
||||||
|
echo "$(MAGNET)"
|
||||||
|
|
||||||
BLANK=`awk '! NF { print NR; exit }' changelog.txt`
|
BLANK=`awk '! NF { print NR; exit }' changelog.txt`
|
||||||
|
|
||||||
|
25
README.md
25
README.md
@ -57,7 +57,7 @@ The Windows build tools listed above must be installed on the Windows host machi
|
|||||||
TODO: Add links to the respective instructions for each of these.
|
TODO: Add links to the respective instructions for each of these.
|
||||||
|
|
||||||
**Note that after the dependencies are installed, this step is automated**
|
**Note that after the dependencies are installed, this step is automated**
|
||||||
**with `./build.sh`.**
|
**with `./buildscripts/build.sh`.**
|
||||||
|
|
||||||
In order to include a jpackaged(dependency-free) I2P router in the Profile
|
In order to include a jpackaged(dependency-free) I2P router in the Profile
|
||||||
Bundle you will need to build the jpackaged I2P router as an "App Image" on
|
Bundle you will need to build the jpackaged I2P router as an "App Image" on
|
||||||
@ -127,10 +127,10 @@ Ubuntu in WSL.
|
|||||||
ant clean pkg
|
ant clean pkg
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
7. Move into the i2p.firefox directory. Run the `./build.sh` script.
|
7. Move into the i2p.firefox directory. Run the `./buildscripts/build.sh` script.
|
||||||
|
|
||||||
cd i2p.firefox
|
cd i2p.firefox
|
||||||
./build.sh
|
./buildscripts/build.sh
|
||||||
|
|
||||||
8. Compile the NSIS installer using WSL.
|
8. Compile the NSIS installer using WSL.
|
||||||
|
|
||||||
@ -143,18 +143,9 @@ I highly recommend you look into the Chocolatey package manager, which makes it
|
|||||||
easier to configure these tools and keep them up to date.
|
easier to configure these tools and keep them up to date.
|
||||||
|
|
||||||
**Prerequisites:** In addition to the other prerequisites, you will need to to have
|
**Prerequisites:** In addition to the other prerequisites, you will need to to have
|
||||||
`make` installed with `cygwin`. If you are using this method, you cannot use the
|
`make` installed with `cygwin`. For our purposes, as long as everything else is
|
||||||
automated build scripts without a hack. You will need to create a file called `wsl`
|
set up and you're using git bash, that is enough to make the scripts compatible with
|
||||||
in a place that is in the path used by `git-bash.exe` sessions, with the content:
|
`cygwin`. Cygwin builds without git bash are not likely to work.
|
||||||
|
|
||||||
```
|
|
||||||
#! /usr/bin/env bash
|
|
||||||
$@
|
|
||||||
```
|
|
||||||
|
|
||||||
For our purposes, as long as everything else is set up and you're using git bash,
|
|
||||||
that is enough to make the scripts compatible with `cygwin`. Cygwin builds without
|
|
||||||
git bash are not likely to work.
|
|
||||||
|
|
||||||
1. Run the Cygwin `setup-$arch.exe` for your platform to set up new packages. Select the `make` `jq` `dos2unix` and `curl` packages.
|
1. Run the Cygwin `setup-$arch.exe` for your platform to set up new packages. Select the `make` `jq` `dos2unix` and `curl` packages.
|
||||||
2. Open a cygwin terminal.
|
2. Open a cygwin terminal.
|
||||||
@ -170,10 +161,10 @@ git bash are not likely to work.
|
|||||||
ant clean pkg
|
ant clean pkg
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
5. Move into the i2p.firefox directory. Run the `./build.sh` script.
|
5. Move into the i2p.firefox directory. Run the `./buildscripts/unsigned.sh` script.
|
||||||
|
|
||||||
cd i2p.firefox
|
cd i2p.firefox
|
||||||
./build.sh
|
./buildscripts/unsigned.sh
|
||||||
|
|
||||||
6. Run `make` to build the installer.
|
6. Run `make` to build the installer.
|
||||||
|
|
||||||
|
29
UPDATES.md
29
UPDATES.md
@ -1,29 +0,0 @@
|
|||||||
Setting up an Update Server for an I2P Bundle
|
|
||||||
=============================================
|
|
||||||
|
|
||||||
It is important to set up a signed update server so that people are able to
|
|
||||||
safely and anonymously update your I2P bundle.
|
|
||||||
|
|
||||||
The quick way:
|
|
||||||
--------------
|
|
||||||
|
|
||||||
This process depends on my ability to push releases to github. If you are
|
|
||||||
forking, setting up a dev server, or taking over because I got hit by a bus,
|
|
||||||
you'll need to do it the complete way.
|
|
||||||
|
|
||||||
For as long as I am building updates, you will be able to mirror the jpackaged
|
|
||||||
Windows bundle by cloning the repository `https://github.com/eyedeekay/i2p` and
|
|
||||||
running the `make docker run` target in that repository. You can retrieve the
|
|
||||||
base32 address of your update server by viewing the log with
|
|
||||||
`docker logs eephttpd-jpackage | grep b32.i2p | tee eephttpd-address.md`. To
|
|
||||||
update the site, run `./update.site.sh` in that repository.
|
|
||||||
|
|
||||||
Once you have cloned the repository and started the container with
|
|
||||||
`make docker run`, you can simply add `path/to/repo/update-site.sh` to your
|
|
||||||
`crontab` and it will update at an interval of your choosing.
|
|
||||||
|
|
||||||
The complete way:
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
TODO: describe how to do it with less of the awesome fancy stuff I put together
|
|
||||||
to make it easier on myself to keep an update server going.
|
|
@ -1,4 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
curl -s "https://addons.mozilla.org/api/v5/addons/addon/$1/versions/?page_size=1" | jq '.results | .[0] | .file | .url' | tr -d '"'
|
|
||||||
|
|
68
build.sh
68
build.sh
@ -1,68 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
|
||||||
|
|
||||||
if [ -f i2pversion_override ]; then
|
|
||||||
. "$SCRIPT_DIR/i2pversion_override"
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
|
||||||
|
|
||||||
if [ -f config_overide.sh ]; then
|
|
||||||
. "$SCRIPT_DIR/config_override.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z $machine ]; then
|
|
||||||
unameOut="$(uname -s)"
|
|
||||||
case "${unameOut}" in
|
|
||||||
Linux*) machine=Linux;;
|
|
||||||
Darwin*) machine=Mac;;
|
|
||||||
*) machine="UNKNOWN:${unameOut}"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$machine" = "Mac" ]; then
|
|
||||||
rm -rf I2P
|
|
||||||
./getprebuilt.sh
|
|
||||||
exit 0
|
|
||||||
elif [ "$machine" = "Linux" ]; then
|
|
||||||
rm -rf I2P
|
|
||||||
./getprebuilt.sh
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/launcher.sh"
|
|
||||||
|
|
||||||
if [ -z $I2P_VERSION ]; then
|
|
||||||
I2P_VERSION=$("$JAVA_HOME"/bin/java -cp build/router.jar net.i2p.router.RouterVersion | sed "s/.*: //" | head -n 1 | sed 's|-|.|g')
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "preparing to invoke jpackage for I2P version $I2P_VERSION"
|
|
||||||
|
|
||||||
rm -rf I2P
|
|
||||||
|
|
||||||
make src/I2P/config
|
|
||||||
|
|
||||||
"$JAVA_HOME"/bin/jpackage --type app-image --name I2P --app-version "$I2P_VERSION" \
|
|
||||||
--verbose \
|
|
||||||
--java-options "-Xmx512m" \
|
|
||||||
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
|
|
||||||
--java-options "--add-opens java.base/sun.nio.fs=ALL-UNNAMED" \
|
|
||||||
--java-options "--add-opens java.base/java.nio=ALL-UNNAMED" \
|
|
||||||
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
|
|
||||||
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
|
||||||
$JPACKAGE_OPTS \
|
|
||||||
--resource-dir build \
|
|
||||||
--app-content src/I2P/config \
|
|
||||||
--app-content src/unix/torbrowser.sh \
|
|
||||||
--app-content src/icons/windowsUIToopie2.png \
|
|
||||||
--app-content src/icons/ui2pbrowser_icon.ico \
|
|
||||||
--icon src/icons/windowsUIToopie2.png \
|
|
||||||
--input build --main-jar launcher.jar --main-class net.i2p.router.WinLauncher
|
|
||||||
|
|
||||||
cp "$I2P_PKG/licenses/"* license/
|
|
||||||
cp "$HERE/../i2p.i2p.jpackage-build/LICENSE.txt" license/I2P.txt
|
|
83
buildscripts/build.sh
Executable file
83
buildscripts/build.sh
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f config_overide.sh ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$SCRIPT_DIR"/buildscripts/version.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/licenses.sh
|
||||||
|
|
||||||
|
if [ -z $machine ]; then
|
||||||
|
unameOut="$(uname -s)"
|
||||||
|
case "${unameOut}" in
|
||||||
|
Linux*) machine=Linux;;
|
||||||
|
Darwin*) machine=Mac;;
|
||||||
|
*) machine="UNKNOWN:${unameOut}"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
ICON="$SCRIPT_DIR/src/icons/ui2pbrowser_icon.ico"
|
||||||
|
|
||||||
|
if [ "$machine" = "Mac" ]; then
|
||||||
|
rm -rf I2P
|
||||||
|
"$SCRIPT_DIR"/buildscripts/getprebuilt.sh
|
||||||
|
exit 0
|
||||||
|
elif [ "$machine" = "Linux" ]; then
|
||||||
|
rm -rf I2P
|
||||||
|
"$SCRIPT_DIR"/buildscripts/getprebuilt.sh
|
||||||
|
exit 0
|
||||||
|
elif [ "$machine" = "unix" ]; then
|
||||||
|
ICON="$SCRIPT_DIR"/src/icons/windowsUIToopie2.png
|
||||||
|
export EXTRACODE="unix"
|
||||||
|
export EXTRA=" public final static String EXTRA = \"-$EXTRACODE\";"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DI"$SCRIPT_DIR"/buildscripts/launcher.sh"
|
||||||
|
|
||||||
|
if [ -z $I2P_VERSION ]; then
|
||||||
|
I2P_VERSION=$("$JAVA_HOME"/bin/java -cp $SCRIPT_DIR/build/router.jar net.i2p.router.RouterVersion | sed "s/.*: //" | head -n 1 | sed 's|-|.|g')
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "preparing to invoke jpackage for I2P version $I2P_VERSION"
|
||||||
|
|
||||||
|
rm -rf I2P
|
||||||
|
|
||||||
|
if [ ! -d "I2P" ]; then
|
||||||
|
"$JAVA_HOME"/bin/jpackage --type app-image --name I2P --app-version "$I2P_VERSION" \
|
||||||
|
--verbose \
|
||||||
|
--java-options "-Xmx512m" \
|
||||||
|
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
|
||||||
|
--java-options "--add-opens java.base/sun.nio.fs=ALL-UNNAMED" \
|
||||||
|
--java-options "--add-opens java.base/java.nio=ALL-UNNAMED" \
|
||||||
|
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
|
||||||
|
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
||||||
|
$JPACKAGE_OPTS \
|
||||||
|
--resource-dir $SCRIPT_DIR/build \
|
||||||
|
--app-content "$SCRIPT_DIR"/src/I2P/config \
|
||||||
|
--app-content "$SCRIPT_DIR"/src/unix/torbrowser.sh \
|
||||||
|
--app-content "$SCRIPT_DIR"/src/win/torbrowser-windows.sh \
|
||||||
|
--app-content "$SCRIPT_DIR"/src/icons/windowsUIToopie2.png \
|
||||||
|
--app-content "$SCRIPT_DIR"/src/icons/ui2pbrowser_icon.ico \
|
||||||
|
--icon "${ICON}" \
|
||||||
|
--input $SCRIPT_DIR/build --main-jar launcher.jar --main-class net.i2p.router.WinLauncher
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp "$I2P_PKG/licenses/"* license/
|
||||||
|
cp "$SCRIPT_DIR/../i2p.i2p.jpackage-build/LICENSE.txt" license/I2P.txt
|
||||||
|
|
||||||
|
|
||||||
|
mkdir -p "$SCRIPT_DIR"/build/I2P
|
||||||
|
cp -rv "$SCRIPT_DIR"/I2P/* "$SCRIPT_DIR"/build/I2P
|
||||||
|
cp -rv src/I2P/config build/I2P/config
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
. "$SCRIPT_DIR/config.sh"
|
||||||
@ -31,4 +31,5 @@ rm -rf \
|
|||||||
*.jar \
|
*.jar \
|
||||||
*.exe \
|
*.exe \
|
||||||
*.dmg
|
*.dmg
|
||||||
make clean
|
rm -rf build app-profile-*.tgz profile-*.tgz I2P-Easy-Install-Bundle-*.exe *.deb src/I2P/config *.su3 .version *.url make.log
|
||||||
|
git clean -fdx src build onionkeys tlskeys i2pkeys
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
@ -25,7 +25,7 @@ fi
|
|||||||
# GITHUB_USERNAME=your github username
|
# GITHUB_USERNAME=your github username
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git checkout .
|
git checkout .
|
||||||
./targz.sh
|
"$SCRIPT_DIR"/buildscripts/targz.sh
|
||||||
|
|
||||||
. "$HOME/github-release-config.sh"
|
. "$HOME/github-release-config.sh"
|
||||||
|
|
||||||
@ -50,3 +50,4 @@ sleep 2s
|
|||||||
ZIPCHECKSUM=$(sha256sum "I2P.tar.gz")
|
ZIPCHECKSUM=$(sha256sum "I2P.tar.gz")
|
||||||
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.tar.gz" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.tar.gz"
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.tar.gz" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.tar.gz"
|
||||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.tar.gz" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.tar.gz"
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.tar.gz" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.tar.gz"
|
||||||
|
|
52
buildscripts/daily-portable-windows.sh
Executable file
52
buildscripts/daily-portable-windows.sh
Executable file
@ -0,0 +1,52 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f config_overide.sh ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
### How to set up this script:
|
||||||
|
#
|
||||||
|
# This script will not work unless you give it a Github API key.
|
||||||
|
# You need to create a file in your $HOME directory, which on
|
||||||
|
# Windows will by /c/Users/yourusername, called github-release-config.sh,
|
||||||
|
# containing this key as the variable GITHUB_TOKEN.
|
||||||
|
# github-release-config.sh must also contain:
|
||||||
|
# GITHUB_USERNAME=your github username
|
||||||
|
git clean -fd
|
||||||
|
git checkout .
|
||||||
|
|
||||||
|
. "$HOME/github-release-config.sh"
|
||||||
|
|
||||||
|
if [ -f ./i2pversion_override ]; then
|
||||||
|
. ./i2pversion_override
|
||||||
|
fi
|
||||||
|
|
||||||
|
TODAYSDATE=$(date +%Y%m%d)
|
||||||
|
|
||||||
|
if [ -z "$DESCRIPTION" ]; then
|
||||||
|
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE
|
||||||
|
===================================================
|
||||||
|
|
||||||
|
These builds are automatically built on a daily basis and may have serious bugs.
|
||||||
|
They are intended for testing purposes only, use them at your own risk.
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
|
||||||
|
github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
|
||||||
|
|
||||||
|
"$SCRIPT_DIR"/buildscripts/zip.sh
|
||||||
|
WINZIPCHECKSUM=$(sha256sum "I2P-windows-portable.zip")
|
||||||
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-windows-portable.zip" -l "$WINZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P-windows-portable.zip"
|
||||||
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-windows-portable.zip" -l "$WINZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P-windows-portable.zip"
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
|
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
|
||||||
@ -25,7 +25,7 @@ fi
|
|||||||
git clean -fd
|
git clean -fd
|
||||||
git checkout .
|
git checkout .
|
||||||
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
|
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
|
||||||
./unsigned.sh
|
"$SCRIPT_DIR"/buildscripts/unsigned.sh
|
||||||
|
|
||||||
. "$HOME/github-release-config.sh"
|
. "$HOME/github-release-config.sh"
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
@ -22,7 +22,7 @@ mv "$SCRIPT_DIR/config_override.sh" "$SCRIPT_DIR/config_override.sh.bak"
|
|||||||
# GITHUB_USERNAME=your github username
|
# GITHUB_USERNAME=your github username
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git checkout .
|
git checkout .
|
||||||
./unsigned.sh
|
"$SCRIPT_DIR"/buildscripts/unsigned.sh
|
||||||
|
|
||||||
. "$HOME/github-release-config.sh"
|
. "$HOME/github-release-config.sh"
|
||||||
|
|
||||||
@ -51,7 +51,6 @@ powershell Compress-Archive -force I2P I2P.zip
|
|||||||
ZIPCHECKSUM=$(sha256sum "I2P.zip")
|
ZIPCHECKSUM=$(sha256sum "I2P.zip")
|
||||||
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.zip"
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.zip"
|
||||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.zip"
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.zip"
|
||||||
|
|
||||||
TARCHECKSUM=$(sha256sum "../i2p.i2p.jpackage-build.tar.gz")
|
TARCHECKSUM=$(sha256sum "../i2p.i2p.jpackage-build.tar.gz")
|
||||||
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../i2p.i2p.jpackage-build.tar.gz" -l "Upstream I2P Router source code $TARCHECKSUM" -t "$TODAYSDATE" -n "i2p.i2p.jpackage-build.tar.gz"
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../i2p.i2p.jpackage-build.tar.gz" -l "Upstream I2P Router source code $TARCHECKSUM" -t "$TODAYSDATE" -n "i2p.i2p.jpackage-build.tar.gz"
|
||||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../i2p.i2p.jpackage-build.tar.gz" -l "Upstream I2P Router source code $TARCHECKSUM" -t "$TODAYSDATE" -n "i2p.i2p.jpackage-build.tar.gz"
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../i2p.i2p.jpackage-build.tar.gz" -l "Upstream I2P Router source code $TARCHECKSUM" -t "$TODAYSDATE" -n "i2p.i2p.jpackage-build.tar.gz"
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
|
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
. "$SCRIPT_DIR/i2pversion"
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
|
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
|
||||||
|
|
||||||
# Motivation
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. ./config.sh
|
. ./config.sh
|
||||||
. ./i2pversion
|
. ./i2pversion
|
||||||
@ -16,10 +17,10 @@ jpackage --name I2P-EXE --app-version "$I2P_VERSION" \
|
|||||||
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
|
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
|
||||||
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
||||||
$JPACKAGE_OPTS \
|
$JPACKAGE_OPTS \
|
||||||
--app-content src/I2P/config \
|
--app-content "$SCRIPT_DIR"/src/I2P/config \
|
||||||
--app-content src/icons/windowsUIToopie2.png \
|
--app-content "$SCRIPT_DIR"/src/icons/windowsUIToopie2.png \
|
||||||
--icon src/icons/windowsUIToopie2.png \
|
--icon "$SCRIPT_DIR"/src/icons/windowsUIToopie2.png \
|
||||||
--input build \
|
--input "$SCRIPT_DIR/build" \
|
||||||
--verbose \
|
--verbose \
|
||||||
--type exe \
|
--type exe \
|
||||||
--win-dir-chooser \
|
--win-dir-chooser \
|
16
buildscripts/experimental.sh
Executable file
16
buildscripts/experimental.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$SCRIPT_DIR"/buildscripts/clean.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/version.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/licenses.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/build.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/nsis.sh
|
64
buildscripts/getprebuilt.sh
Executable file
64
buildscripts/getprebuilt.sh
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f config_overide.sh ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$SCRIPT_DIR"/buildscripts/version.sh
|
||||||
|
echo "version set"
|
||||||
|
"$SCRIPT_DIR"/buildscripts/licenses.sh
|
||||||
|
echo "licenses generated"
|
||||||
|
. "$HOME/github-release-config.sh"
|
||||||
|
|
||||||
|
if [ -z $TODAYSDATE ]; then
|
||||||
|
TODAYSDATE=$(date -d '-1 day' '+%Y%m%d')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f I2P.zip ]; then
|
||||||
|
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P.zip" -t "$TODAYSDATE"
|
||||||
|
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P.zip" -t "$TODAYSDATE"
|
||||||
|
fi
|
||||||
|
unzip -FF I2P.zip || true
|
||||||
|
echo "unzipped prebuilt router"
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
echo "moved prebuilt router"
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
|
export I2P_PKG="$SCRIPT_DIR/../i2p.i2p.jpackage-build/pkg-temp"
|
||||||
|
export RES_DIR="$SCRIPT_DIR/../i2p.i2p.jpackage-build/installer/resources"
|
||||||
|
export I2P_JARS="$I2P_PKG/lib"
|
||||||
|
export I2P_JBIGI="$SCRIPT_DIR/../i2p.i2p.jpackage-build/installer/lib/jbigi"
|
||||||
|
export I2P_JBIGI_JAR="$SCRIPT_DIR/../i2p.i2p.jpackage-build/build/jbigi.jar"
|
||||||
|
|
||||||
|
mkdir -p "$SCRIPT_DIR/src/I2P/config"
|
||||||
|
rm -rf "$SCRIPT_DIR/src/I2P/config/geoip" "$SCRIPT_DIR/src/I2P/config/webapps" "$SCRIPT_DIR/src/I2P/config/certificates"
|
||||||
|
cp -v "$RES_DIR/clients.config" "$SCRIPT_DIR/src/I2P/config/"
|
||||||
|
cp -v "$RES_DIR/wrapper.config" "$SCRIPT_DIR/src/I2P/config/"
|
||||||
|
#grep -v 'router.updateURL' $(RES_DIR)/router.config > "$SCRIPT_DIR"/src/I2P/config/router.config
|
||||||
|
cat router.config > "$SCRIPT_DIR/src/I2P/config/router.config"
|
||||||
|
cat i2ptunnel.config > "$SCRIPT_DIR/src/I2P/config/i2ptunnel.config"
|
||||||
|
cp -v "$RES_DIR/hosts.txt" "$SCRIPT_DIR/src/I2P/config/hosts.txt"
|
||||||
|
cp -r "$RES_DIR/certificates" "$SCRIPT_DIR/src/I2P/config/certificates"
|
||||||
|
cp -r "$RES_DIR/eepsite" "$SCRIPT_DIR/src/I2P/config/eepsite"
|
||||||
|
mkdir -p "$SCRIPT_DIR/src/I2P/config/geoip"
|
||||||
|
cp -v "$RES_DIR/GeoLite2-Country.mmdb.gz" "$SCRIPT_DIR/src/I2P/config/geoip/GeoLite2-Country.mmdb.gz"
|
||||||
|
#cp -r "$I2P_PKG/webapps" "$SCRIPT_DIR/src/I2P/config/webapps"
|
||||||
|
cd "$SCRIPT_DIR/src/I2P/config/geoip" && gunzip GeoLite2-Country.mmdb.gz; cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
|
mkdir -p "$SCRIPT_DIR"/build/I2P
|
||||||
|
cp -rv "$SCRIPT_DIR"/I2P/* "$SCRIPT_DIR"/build/I2P
|
||||||
|
cp -rv "$SCRIPT_DIR"/src/I2P/config "$SCRIPT_DIR"/build/I2P/config
|
127
buildscripts/launcher.sh
Executable file
127
buildscripts/launcher.sh
Executable file
@ -0,0 +1,127 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
COUNT="Ten Nine Eight Seven Six Five Four Three Two One"
|
||||||
|
|
||||||
|
which java
|
||||||
|
export JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t\- ')
|
||||||
|
|
||||||
|
if [ "$JAVA" -lt "14" ]; then
|
||||||
|
echo "Java 14+ must be used to compile with jpackage, java is $JAVA"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "$JAVA" -lt "17" ]; then
|
||||||
|
echo "It is highly recommended that you use Java 17+ to build release packages"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${JAVA_HOME}" ]; then
|
||||||
|
export JAVA_HOME=$(type -p java|xargs readlink -f|xargs dirname|xargs dirname)
|
||||||
|
fi
|
||||||
|
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||||
|
export JAVA_HOME=$(type -p java|xargs readlink -f|xargs dirname|xargs dirname)
|
||||||
|
fi
|
||||||
|
echo "Building with: $JAVA, $JAVA_HOME"
|
||||||
|
sleep 5s
|
||||||
|
|
||||||
|
"$SCRIPT_DIR"/buildscripts/version.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/licenses.sh
|
||||||
|
|
||||||
|
#SCRIPT_DIR="$PWD"
|
||||||
|
export I2P_PKG="$SCRIPT_DIR/../i2p.i2p.jpackage-build/pkg-temp"
|
||||||
|
export RES_DIR="$SCRIPT_DIR/../i2p.i2p.jpackage-build/installer/resources"
|
||||||
|
export I2P_JARS="$I2P_PKG/lib"
|
||||||
|
export I2P_JBIGI="$SCRIPT_DIR/../i2p.i2p.jpackage-build/installer/lib/jbigi"
|
||||||
|
export I2P_JBIGI_JAR="$SCRIPT_DIR/../i2p.i2p.jpackage-build/build/jbigi.jar"
|
||||||
|
if [ ! -d "$SCRIPT_DIR/../i2p.i2p.jpackage-build/" ]; then
|
||||||
|
git clone --depth=1 -b "$VERSION" https://i2pgit.org/i2p-hackers/i2p.i2p "$SCRIPT_DIR/../i2p.i2p.jpackage-build/"
|
||||||
|
fi
|
||||||
|
cd "$SCRIPT_DIR/../i2p.i2p.jpackage-build/"
|
||||||
|
OLDEXTRA=$(find . -name RouterVersion.java -exec grep 'String EXTRA' {} \;)
|
||||||
|
if [ -z "$EXTRA" ]; then
|
||||||
|
export EXTRACODE="win"
|
||||||
|
export EXTRA=" public final static String EXTRA = \"-$EXTRACODE\";"
|
||||||
|
fi
|
||||||
|
if [ "$VERSION" = master ]; then
|
||||||
|
VERSIONDATE="$(date +%m%d)"
|
||||||
|
fi
|
||||||
|
find . -name RouterVersion.java -exec sed -i "s|$OLDEXTRA|$EXTRA|g" {} \;
|
||||||
|
git switch - || :
|
||||||
|
git pull --tags
|
||||||
|
git checkout -b "i2p-$VERSION$VERSIONDATE-$EXTRACODE" || :
|
||||||
|
git commit -am "i2p-$VERSION$VERSIONDATE-$EXTRACODE" || :
|
||||||
|
git archive --format=tar.gz --output="$SCRIPT_DIR/../i2p.firefox/i2p.i2p.jpackage-build.tar.gz" "i2p-$VERSION$VERSIONDATE-$EXTRACODE"
|
||||||
|
git checkout "i2p-$VERSION$VERSIONDATE-$EXTRACODE" || :
|
||||||
|
|
||||||
|
for i in $COUNT; do
|
||||||
|
echo -n "$i...."; sleep 1s
|
||||||
|
done
|
||||||
|
ant distclean pkg || true
|
||||||
|
ant jbigi
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
|
mkdir -p "$SCRIPT_DIR/src/I2P/config"
|
||||||
|
rm -rf "$SCRIPT_DIR/src/I2P/config/geoip" "$SCRIPT_DIR/src/I2P/config/webapps" "$SCRIPT_DIR/src/I2P/config/certificates"
|
||||||
|
cp -v "$RES_DIR/clients.config" "$SCRIPT_DIR/src/I2P/config/"
|
||||||
|
cp -v "$RES_DIR/wrapper.config" "$SCRIPT_DIR/src/I2P/config/"
|
||||||
|
#grep -v 'router.updateURL' $(RES_DIR)/router.config > "$SCRIPT_DIR"/src/I2P/config/router.config
|
||||||
|
cat router.config > "$SCRIPT_DIR/src/I2P/config/router.config"
|
||||||
|
cat i2ptunnel.config > "$SCRIPT_DIR/src/I2P/config/i2ptunnel.config"
|
||||||
|
cp -v "$RES_DIR/hosts.txt" "$SCRIPT_DIR/src/I2P/config/hosts.txt"
|
||||||
|
cp -R "$RES_DIR/certificates" "$SCRIPT_DIR/src/I2P/config/certificates"
|
||||||
|
cp -R "$RES_DIR/eepsite" "$SCRIPT_DIR/src/I2P/config/eepsite"
|
||||||
|
mkdir -p "$SCRIPT_DIR/src/I2P/config/geoip"
|
||||||
|
cp -v "$RES_DIR/GeoLite2-Country.mmdb.gz" "$SCRIPT_DIR/src/I2P/config/geoip/GeoLite2-Country.mmdb.gz"
|
||||||
|
cp -R "$I2P_PKG/webapps" "$SCRIPT_DIR/src/I2P/config/webapps"
|
||||||
|
cd "$SCRIPT_DIR/src/I2P/config/geoip" && gunzip GeoLite2-Country.mmdb.gz; cd ../../..
|
||||||
|
|
||||||
|
echo "compiling custom launcher"
|
||||||
|
mkdir -p "$SCRIPT_DIR/build"
|
||||||
|
cp "$I2P_JARS"/*.jar "$SCRIPT_DIR/build"
|
||||||
|
cp "$I2P_JBIGI_JAR" "$SCRIPT_DIR/build"
|
||||||
|
if [ ! -f "$SCRIPT_DIR/build/jna.jar" ]; then
|
||||||
|
wget "https://repo1.maven.org/maven2/net/java/dev/jna/jna/$JNA_VERSION/jna-$JNA_VERSION.jar" -O "$SCRIPT_DIR/build/jna.jar"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$SCRIPT_DIR/build/jna-platform.jar" ]; then
|
||||||
|
wget "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/$JNA_VERSION/jna-platform-$JNA_VERSION.jar" -O "$SCRIPT_DIR/build/jna-platform.jar"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$SCRIPT_DIR/build/i2pfirefox.jar" ]; then
|
||||||
|
wget "https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/$I2PFIREFOX_VERSION/i2pfirefox.jar" -O "$SCRIPT_DIR/build/i2pfirefox.jar"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dll in "$I2P_JBIGI/"*windows*.dll; do
|
||||||
|
jar uf "$SCRIPT_DIR/build/jbigi.jar" "$dll"
|
||||||
|
done
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR"/java
|
||||||
|
"$JAVA_HOME"/bin/javac -Xlint:deprecation -d ../build -classpath "$SCRIPT_DIR/build/i2pfirefox.jar:$SCRIPT_DIR/build/jna.jar:$SCRIPT_DIR/build/jna-platform.jar":"$SCRIPT_DIR/build/i2p.jar:$SCRIPT_DIR/build/router.jar:$SCRIPT_DIR/build/routerconsole.jar:$SCRIPT_DIR/build/jbigi.jar" \
|
||||||
|
net/i2p/router/CopyConfigDir.java \
|
||||||
|
net/i2p/router/WindowsServiceUtil.java \
|
||||||
|
net/i2p/router/WindowsUpdatePostProcessor.java \
|
||||||
|
net/i2p/router/WinLauncher.java \
|
||||||
|
net/i2p/router/WinUpdateProcess.java \
|
||||||
|
net/i2p/router/ZipUpdateProcess.java
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
#echo "building launcher.jar"
|
||||||
|
cd "$SCRIPT_DIR/build"
|
||||||
|
"$JAVA_HOME"/bin/jar -cf launcher.jar net
|
||||||
|
cd ..
|
31
buildscripts/licenses.sh
Executable file
31
buildscripts/licenses.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$SCRIPT_DIR"/build/licenses
|
||||||
|
cp "$SCRIPT_DIR"/license/* "$SCRIPT_DIR"/build/licenses
|
||||||
|
cp "$SCRIPT_DIR"/LICENSE.md "$SCRIPT_DIR"/build/licenses/MIT.txt
|
||||||
|
cat "$SCRIPT_DIR"/build/licenses/LICENSE.index \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/EPL.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/GPL+CLASSPATH.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/HTTPS-Everywhere.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/LICENSE.tor \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/MIT.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/MPL2.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/NoScript.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/NSS.txt \
|
||||||
|
"$SCRIPT_DIR"/build/licenses/I2P.txt > "$SCRIPT_DIR"/build/licenses/LICENSE.txt
|
||||||
|
unix2dos "$SCRIPT_DIR"/build/licenses/LICENSE.txt
|
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
|
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
|
||||||
|
|
||||||
# Motivation
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. ./config.sh
|
. ./config.sh
|
||||||
. ./i2pversion
|
. ./i2pversion
|
||||||
|
|
||||||
./build.sh
|
"$SCRIPT_DIR"/buildscripts/build.sh
|
||||||
jpackage --name I2P-MSI --app-version "$I2P_VERSION" \
|
jpackage --name I2P-MSI --app-version "$I2P_VERSION" \
|
||||||
--verbose \
|
--verbose \
|
||||||
--java-options "-Xmx512m" \
|
--java-options "-Xmx512m" \
|
||||||
@ -17,10 +18,10 @@ jpackage --name I2P-MSI --app-version "$I2P_VERSION" \
|
|||||||
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
|
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
|
||||||
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
||||||
$JPACKAGE_OPTS \
|
$JPACKAGE_OPTS \
|
||||||
--app-content src/I2P/config \
|
--app-content "$SCRIPT_DIR"/src/I2P/config \
|
||||||
--app-content src/icons/windowsUIToopie2.png \
|
--app-content "$SCRIPT_DIR"/src/icons/windowsUIToopie2.png \
|
||||||
--icon src/icons/windowsUIToopie2.png \
|
--icon "$SCRIPT_DIR"/src/icons/windowsUIToopie2.png \
|
||||||
--input build \
|
--input "$SCRIPT_DIR/build" \
|
||||||
--verbose \
|
--verbose \
|
||||||
--type msi \
|
--type msi \
|
||||||
--win-dir-chooser \
|
--win-dir-chooser \
|
21
buildscripts/nsis.sh
Executable file
21
buildscripts/nsis.sh
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp "$SCRIPT_DIR"/src/nsis/*.nsi "$SCRIPT_DIR"/build
|
||||||
|
cp "$SCRIPT_DIR"/src/nsis/*.nsh "$SCRIPT_DIR"/build
|
||||||
|
cp "$SCRIPT_DIR"/src/icons/*.ico "$SCRIPT_DIR"/build
|
||||||
|
cd "$SCRIPT_DIR"/build && makensisi i2pbrowser-installer.nsi && cp I2P-Easy-Install-Bundle-*.exe ../ && echo "built windows installer"
|
55
buildscripts/release-upload.sh
Normal file
55
buildscripts/release-upload.sh
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv "$SCRIPT_DIR/config_override.sh" "$SCRIPT_DIR/config_override.sh.bak"
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
### How to set up this script:
|
||||||
|
#
|
||||||
|
# This script will not work unless you give it a Github API key.
|
||||||
|
# You need to create a file in your $HOME directory, which on
|
||||||
|
# Windows will by /c/Users/yourusername, called github-release-config.sh,
|
||||||
|
# containing this key as the variable GITHUB_TOKEN.
|
||||||
|
# github-release-config.sh must also contain:
|
||||||
|
# GITHUB_USERNAME=your github username
|
||||||
|
git clean -fd
|
||||||
|
git checkout .
|
||||||
|
"$SCRIPT_DIR"/buildscripts/unsigned.sh
|
||||||
|
|
||||||
|
. "$HOME/github-release-config.sh"
|
||||||
|
|
||||||
|
if [ -f ./i2pversion_override ]; then
|
||||||
|
. ./i2pversion_override
|
||||||
|
fi
|
||||||
|
|
||||||
|
BLANK=$(awk '! NF { print NR; exit }' changelog.txt)
|
||||||
|
|
||||||
|
DESCRIPTION="Release build of i2p.firefox for $I2P_VERSION
|
||||||
|
==========================================================
|
||||||
|
|
||||||
|
$(head -n $BLANK changelog.txt)"
|
||||||
|
|
||||||
|
echo github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$I2P_VERSION" -d "$DESCRIPTION" -t "$I2P_VERSION"
|
||||||
|
github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$I2P_VERSION" -d "$DESCRIPTION" -t "$I2P_VERSION"
|
||||||
|
sleep 2s;
|
||||||
|
EXECHECKSUM=$(sha256sum "I2P-Easy-Install-Bundle-$I2P_VERSION.exe")
|
||||||
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -l "$EXECHECKSUM" -t "$I2P_VERSION" -n "I2P-Easy-Install-Bundle-$I2P_VERSION.exe"
|
||||||
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -l "$EXECHECKSUM" -t "$I2P_VERSION" -n "I2P-Easy-Install-Bundle-$I2P_VERSION.exe"
|
||||||
|
powershell Compress-Archive -force I2P I2P.zip
|
||||||
|
ZIPCHECKSUM=$(sha256sum "I2P.zip")
|
||||||
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "I2P.zip"
|
||||||
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "I2P.zip"
|
||||||
|
TARCHECKSUM=$(sha256sum "../i2p.i2p.jpackage-build.tar.gz")
|
||||||
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../i2p.i2p.jpackage-build.tar.gz" -l "Upstream I2P Router source code $TARCHECKSUM" -t "$I2P_VERSION" -n "i2p.i2p.jpackage-build.tar.gz"
|
||||||
|
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../i2p.i2p.jpackage-build.tar.gz" -l "Upstream I2P Router source code $TARCHECKSUM" -t "$I2P_VERSION" -n "i2p.i2p.jpackage-build.tar.gz"
|
||||||
|
sh -c "powershell Compress-Archive I2P I2P-jpackage-windows-$I2P_VERSION.zip || zip I2P-jpackage-windows-$I2P_VERSION.zip -r I2P"
|
||||||
|
echo github-release upload -R -u "$GITHUB_USERNAME" -r i2p -t i2p-jpackage-windows-$I2P_VERSION -n "i2p-jpackage-windows-$I2P_VERSION" -f "./I2P-jpackage-windows-$I2P_VERSION.zip"
|
||||||
|
github-release upload -R -u "$GITHUB_USERNAME" -r i2p -t i2p-jpackage-windows-$I2P_VERSION -n "i2p-jpackage-windows-$I2P_VERSION" -f "./I2P-jpackage-windows-$I2P_VERSION.zip"
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
. "$SCRIPT_DIR/config.sh"
|
||||||
@ -9,5 +9,5 @@ if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
|||||||
. "$SCRIPT_DIR/config_override.sh"
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./unsigned.sh
|
"$SCRIPT_DIR"/buildscripts/unsigned.sh
|
||||||
./sign.sh
|
"$SCRIPT_DIR"/buildscripts/sign.sh
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
@ -40,6 +40,8 @@ if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
|||||||
linuxsign I2P-Easy-Install-Bundle-$I2P_VERSION.exe
|
linuxsign I2P-Easy-Install-Bundle-$I2P_VERSION.exe
|
||||||
cp "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" "I2P-Easy-Install-Bundle-$I2P_VERSION-signed.exe"
|
cp "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" "I2P-Easy-Install-Bundle-$I2P_VERSION-signed.exe"
|
||||||
else
|
else
|
||||||
signtool.exe sign -a "I2P-Easy-Install-Bundle-$I2P_VERSION.exe"
|
#signtool.exe sign -a "I2P-Easy-Install-Bundle-$I2P_VERSION.exe"
|
||||||
|
echo "WARNING: Signing is temporarily disabled for the installer."
|
||||||
|
sleep 5s
|
||||||
cp "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" "I2P-Easy-Install-Bundle-$I2P_VERSION-signed.exe"
|
cp "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" "I2P-Easy-Install-Bundle-$I2P_VERSION-signed.exe"
|
||||||
fi
|
fi
|
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
. "$SCRIPT_DIR/config.sh"
|
||||||
@ -9,16 +9,16 @@ if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
|||||||
. "$SCRIPT_DIR/config_override.sh"
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
fi
|
fi
|
||||||
export machine=unix
|
export machine=unix
|
||||||
./clean.sh
|
"$SCRIPT_DIR"/buildscripts/clean.sh
|
||||||
wsl make distclean
|
"$SCRIPT_DIR"/buildscripts/clean.sh
|
||||||
./build.sh
|
"$SCRIPT_DIR"/buildscripts/build.sh
|
||||||
cd "$SCRIPT_DIR/I2P" || exit 1
|
cd "$SCRIPT_DIR/I2P" || exit 1
|
||||||
|
|
||||||
TORSOCKS=$(which torsocks)
|
TORSOCKS=$(which torsocks)
|
||||||
if [ -f "${TORSOCKS}" ]; then
|
if [ -f "${TORSOCKS}" ]; then
|
||||||
. "${TORSOCKS}" on
|
. "${TORSOCKS}" on
|
||||||
fi
|
fi
|
||||||
./lib/torbrowser.sh
|
"$SCRIPT_DIR"/src/unix/torbrowser.sh
|
||||||
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
|
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
|
||||||
. "${TORSOCKS}" off
|
. "${TORSOCKS}" off
|
||||||
locale="en-US" # mention your locale. default = en-US
|
locale="en-US" # mention your locale. default = en-US
|
||||||
@ -29,7 +29,4 @@ fi
|
|||||||
rm -vrf "tor-browser_${locale}"
|
rm -vrf "tor-browser_${locale}"
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tar czvf I2P.tar.gz I2P
|
tar czvf I2P.tar.gz I2P
|
14
buildscripts/unsigned.sh
Executable file
14
buildscripts/unsigned.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$SCRIPT_DIR"/buildscripts/clean.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/build.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/nsis.sh
|
26
buildscripts/version.sh
Executable file
26
buildscripts/version.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/i2pversion"
|
||||||
|
|
||||||
|
if [ -f i2pversion_override ]; then
|
||||||
|
. "$SCRIPT_DIR/i2pversion_override"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "!define VERSIONMAJOR $VERSIONMAJOR" > "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi
|
||||||
|
echo "!define VERSIONMINOR $VERSIONMINOR" >> "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi
|
||||||
|
echo "!define VERSIONBUILD $VERSIONBUILD" >> "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi
|
||||||
|
echo "!define I2P_VERSION $PROFILE_VERSION" > "$SCRIPT_DIR"/src/nsis/i2pbrowser-jpackage.nsi
|
||||||
|
|
||||||
|
mkdir -p "$SCRIPT_DIR"/build
|
||||||
|
echo "$PROFILE_VERSION" > "$SCRIPT_DIR"/build/version.txt
|
||||||
|
echo "$PROFILE_VERSION" > "$SCRIPT_DIR"/build/version.txt
|
||||||
|
sed 's|!define VERSION||g' "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi | sed 's| |=|g' > .version
|
33
buildscripts/zip.sh
Executable file
33
buildscripts/zip.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
. "$SCRIPT_DIR/config.sh"
|
||||||
|
|
||||||
|
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
||||||
|
. "$SCRIPT_DIR/config_override.sh"
|
||||||
|
fi
|
||||||
|
"$SCRIPT_DIR"/buildscripts/clean.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/clean.sh
|
||||||
|
"$SCRIPT_DIR"/buildscripts/build.sh
|
||||||
|
cd "$SCRIPT_DIR/I2P" || exit 1
|
||||||
|
|
||||||
|
TORSOCKS=$(which torsocks)
|
||||||
|
if [ -f "${TORSOCKS}" ]; then
|
||||||
|
. "${TORSOCKS}" on
|
||||||
|
fi
|
||||||
|
"$SCRIPT_DIR"/src/win/torbrowser-windows.sh
|
||||||
|
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
|
||||||
|
. "${TORSOCKS}" off
|
||||||
|
locale="en-US" # mention your locale. default = en-US
|
||||||
|
if [ -d /etc/default/locale ]; then
|
||||||
|
. /etc/default/locale
|
||||||
|
locale=$(echo "${LANG}" | cut -d . -f1)
|
||||||
|
fi
|
||||||
|
rm -vrf "tor-browser_${locale}"
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
rm -rf I2P-portable && cp -r I2P I2P-portable
|
||||||
|
#powershell Compress-Archive -force I2P-portable I2P-windows-portable.zip
|
||||||
|
zip -r I2P-windows-portable.zip I2P-portable
|
@ -1,3 +1,7 @@
|
|||||||
|
2023-01-23 idk
|
||||||
|
* Move build scripts to their own directory and make them use correct paths when moved
|
||||||
|
* Add EXTRA to router when generating embedded router jars.
|
||||||
|
|
||||||
2022-09-20 idk
|
2022-09-20 idk
|
||||||
* improve compatibility with local service installs and with un-bundled installs side-by-side with bundled intalls
|
* improve compatibility with local service installs and with un-bundled installs side-by-side with bundled intalls
|
||||||
* version 1.9.7
|
* version 1.9.7
|
||||||
|
53
config.sh
53
config.sh
@ -5,22 +5,36 @@
|
|||||||
|
|
||||||
uname=$(uname)
|
uname=$(uname)
|
||||||
|
|
||||||
#export PATH="$PATH:/c/Program Files/Java/jdk-17.0.3/bin/"
|
NSIS_PATH="/c/Program Files (x86)/NSIS/Bin"
|
||||||
#export JAVA_HOME="/c/Program Files/Java/jdk-17.0.3"
|
PATH="$NSIS_PATH:$PATH:$NSIS_PATH/"
|
||||||
# to use it for Oracle OpenJDK18
|
export PATH="$NSIS_PATH:$PATH:$NSIS_PATH/"
|
||||||
|
|
||||||
|
wget(){
|
||||||
|
which wget && wget $@ && return
|
||||||
|
which powershell && powershell Invoke-WebRequest $@ && return
|
||||||
|
}
|
||||||
|
|
||||||
|
makensisi(){
|
||||||
|
which makensis && makensis $@ && return
|
||||||
|
which wsl && wsl makensis $@ && return
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
|
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
|
||||||
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | findstr "java.home" | sed 's| java.home = ||g')
|
||||||
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
export JAVA_HOME="$JAVA_HOME"
|
||||||
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
|
||||||
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
export PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
|
||||||
|
HOST=win32
|
||||||
|
export HOST=win32
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${uname}" != "Linux" ]; then
|
if [ "${uname}" != "Linux" ]; then
|
||||||
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | findstr "java.home" | sed 's| java.home = ||g')
|
||||||
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
export JAVA_HOME="$JAVA_HOME"
|
||||||
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
|
||||||
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
export PATH="$JAVA_HOME/bin/:$PATH:$JAVA_HOME/bin/"
|
||||||
|
HOST=win32
|
||||||
|
export HOST=win32
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -28,10 +42,10 @@ fi
|
|||||||
## This isn't a default install location, obviously, it's where I unzipped it.
|
## This isn't a default install location, obviously, it's where I unzipped it.
|
||||||
## It won't work for you unless you kurtly tell Windows that your name is `user`
|
## It won't work for you unless you kurtly tell Windows that your name is `user`
|
||||||
## every time you make an account, like I do.
|
## every time you make an account, like I do.
|
||||||
#PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
|
#PATH="/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/:$PATH:/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/"
|
||||||
#export PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
|
#export PATH="/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/:$PATH:/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20/bin/"
|
||||||
#JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
|
#JAVA_HOME=/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20
|
||||||
#export JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
|
#export JAVA_HOME=/c/Users/user/Downloads/openjdk-20_windows-x64_bin/jdk-20
|
||||||
|
|
||||||
## Other potential values(NOT exhaustive):
|
## Other potential values(NOT exhaustive):
|
||||||
|
|
||||||
@ -68,15 +82,20 @@ fi
|
|||||||
# You can also use this to temporarily add applications into the PATH that are
|
# You can also use this to temporarily add applications into the PATH that are
|
||||||
# required to build this if you do not wish to edit your PATH across the entire
|
# required to build this if you do not wish to edit your PATH across the entire
|
||||||
# Windows session, and for setting ANT_HOME
|
# Windows session, and for setting ANT_HOME
|
||||||
#export ANT_HOME="/c/apache-ant-1.10.9"
|
ANT_HOME=$(ls -d /c/apache-ant-*)
|
||||||
#export PATH="$PATH:$ANT_HOME/bin/"
|
export ANT_HOME="$ANT_HOME"
|
||||||
|
export PATH="$PATH:$ANT_HOME/bin/"
|
||||||
|
|
||||||
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
|
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
|
||||||
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
||||||
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
||||||
|
PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
|
||||||
|
export PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${uname}" != "Linux" ]; then
|
if [ "${uname}" != "Linux" ]; then
|
||||||
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
||||||
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
|
||||||
|
PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
|
||||||
|
export PATH="$PATH:C:\Users\user\Downloads\m4-1.4.14-1-bin\bin"
|
||||||
fi
|
fi
|
@ -50,8 +50,8 @@ Launcher
|
|||||||
- `[X]` Wait for router console to be ready to launch router-console browser
|
- `[X]` Wait for router console to be ready to launch router-console browser
|
||||||
- `[X]` Wait for proxy to be ready to launch I2P Web Browser
|
- `[X]` Wait for proxy to be ready to launch I2P Web Browser
|
||||||
- `[X]` Launch browser instead of router when a repeat-launch is detected
|
- `[X]` Launch browser instead of router when a repeat-launch is detected
|
||||||
- `[ ]` [GUI component for launching each available component](http://git.idk.i2p/idk/i2p.plugins.firefox/-/issues/2)
|
- `[X]` GUI component for launching each available component
|
||||||
- `[ ]` [Introduce `browser.properties` for customization](http://git.idk.i2p/idk/i2p.plugins.firefox/-/issues/7)
|
- `[X]` Introduce `browser.properties` for customization
|
||||||
- `[ ]` Registry-based browser discovery [Firefox](http://git.idk.i2p/idk/i2p.plugins.firefox/-/issues/3) [Chromium](http://git.idk.i2p/idk/i2p.plugins.firefox/-/issues/4)
|
- `[ ]` Registry-based browser discovery [Firefox](http://git.idk.i2p/idk/i2p.plugins.firefox/-/issues/3) [Chromium](http://git.idk.i2p/idk/i2p.plugins.firefox/-/issues/4)
|
||||||
|
|
||||||
Browser Configuration All
|
Browser Configuration All
|
25
docs/UPDATES.md
Normal file
25
docs/UPDATES.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Setting up an Update Server for an I2P Bundle
|
||||||
|
=============================================
|
||||||
|
|
||||||
|
It is important to set up a signed update server so that people are able to
|
||||||
|
safely and anonymously update your I2P bundle. There are two sort of "Levels"
|
||||||
|
to what you might do to provide updates to your users. Each of them requires the
|
||||||
|
generation of a [signed newsfeed](https://eyedeekay.github.io/Hopefully-Holistic-Guide-to-I2P-Dev-Build-Update-Hosting/),
|
||||||
|
which also serves as a way to provide information to your users about updates,
|
||||||
|
features, and security events.
|
||||||
|
|
||||||
|
This project, `i2p.firefox` a.k.a. the "I2P Easy Install Bundle" uses the "Executable"
|
||||||
|
update subtype, meaning that it capable of installing itself by executing code as the
|
||||||
|
user who runs the update, which is usually the main user of a Windows 10 or 11 PC.
|
||||||
|
This update subtype is highly flexible, but requires the creation of a "Scripted" using
|
||||||
|
something like `NSIS`, `wixl`, or custom code. Other update types include ZIP (used by
|
||||||
|
the core I2P product) and DMG(used by Mac OSX).
|
||||||
|
|
||||||
|
Static HTTP Update URL over I2P
|
||||||
|
===============================
|
||||||
|
|
||||||
|
Bittorrent Update URL over I2P
|
||||||
|
==============================
|
||||||
|
|
||||||
|
[If you choose to do this, consider using zzzot to host your open tracker instead of a normal site](https://github.com/i2p/i2p.plugins.zzzot),
|
||||||
|
which you can obtain from [this I2P link](http://stats.i2p/i2p/plugins/zzzot.su3).
|
@ -1,15 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
|
||||||
|
|
||||||
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
|
||||||
. "$SCRIPT_DIR/config_override.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
./clean.sh
|
|
||||||
wsl make distclean
|
|
||||||
./build.sh
|
|
||||||
wsl make
|
|
@ -1,25 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
|
||||||
|
|
||||||
if [ -f i2pversion_override ]; then
|
|
||||||
. "$SCRIPT_DIR/i2pversion_override"
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
|
||||||
|
|
||||||
if [ -f config_overide.sh ]; then
|
|
||||||
. "$SCRIPT_DIR/config_override.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$HOME/github-release-config.sh"
|
|
||||||
|
|
||||||
TODAYSDATE=$(date -d '-1 day' '+%Y%m%d')
|
|
||||||
|
|
||||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P.zip" -t "$TODAYSDATE"
|
|
||||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P.zip" -t "$TODAYSDATE"
|
|
||||||
unzip I2P.zip
|
|
@ -21,7 +21,7 @@ tunnel.0.type=httpclient
|
|||||||
tunnel.0.sharedClient=false
|
tunnel.0.sharedClient=false
|
||||||
tunnel.0.interface=127.0.0.1
|
tunnel.0.interface=127.0.0.1
|
||||||
tunnel.0.listenPort=4444
|
tunnel.0.listenPort=4444
|
||||||
tunnel.0.proxyList=false.i2p
|
tunnel.0.proxyList=exit.stormycloud.i2p
|
||||||
tunnel.0.i2cpHost=127.0.0.1
|
tunnel.0.i2cpHost=127.0.0.1
|
||||||
tunnel.0.i2cpPort=7654
|
tunnel.0.i2cpPort=7654
|
||||||
tunnel.0.option.inbound.nickname=HTTP Proxy
|
tunnel.0.option.inbound.nickname=HTTP Proxy
|
||||||
@ -31,7 +31,7 @@ tunnel.0.option.i2cp.reduceIdleTime=900000
|
|||||||
tunnel.0.option.i2cp.reduceOnIdle=true
|
tunnel.0.option.i2cp.reduceOnIdle=true
|
||||||
tunnel.0.option.i2cp.reduceQuantity=1
|
tunnel.0.option.i2cp.reduceQuantity=1
|
||||||
tunnel.0.option.i2p.streaming.connectDelay=1000
|
tunnel.0.option.i2p.streaming.connectDelay=1000
|
||||||
tunnel.0.option.i2ptunnel.httpclient.SSLOutproxies=false.i2p
|
tunnel.0.option.i2ptunnel.httpclient.SSLOutproxies=exit.stormycloud.i2p
|
||||||
tunnel.0.option.inbound.length=3
|
tunnel.0.option.inbound.length=3
|
||||||
tunnel.0.option.inbound.lengthVariance=0
|
tunnel.0.option.inbound.lengthVariance=0
|
||||||
tunnel.0.option.outbound.length=3
|
tunnel.0.option.outbound.length=3
|
||||||
|
19
i2pversion
19
i2pversion
@ -1,16 +1,15 @@
|
|||||||
#! /usr/bin/env sh
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
JNA_VERSION=5.11.0
|
JNA_VERSION=5.12.1
|
||||||
export JNA_VERSION=5.11.0
|
export JNA_VERSION=5.12.1
|
||||||
I2PFIREFOX_VERSION=1.0.1
|
I2PFIREFOX_VERSION=1.0.9
|
||||||
export I2PFIREFOX_VERSION=1.0.1
|
export I2PFIREFOX_VERSION=1.0.9
|
||||||
# Comment this out to build from an alternate branch or
|
# Comment this out to build from an alternate branch or
|
||||||
# the tip of the master branch.
|
# the tip of the master branch.
|
||||||
VERSIONMAJOR=1
|
VERSIONMAJOR=2
|
||||||
VERSIONMINOR=9
|
VERSIONMINOR=2
|
||||||
VERSIONBUILD=7
|
VERSIONBUILD=1
|
||||||
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||||
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||||
VERSION=i2p-jpackage-1.9.4
|
VERSION=i2p-2.2.1
|
||||||
export VERSION=i2p-jpackage-1.9.4
|
export VERSION=i2p-2.2.1
|
||||||
|
|
@ -13,9 +13,9 @@ import java.util.logging.Logger;
|
|||||||
import java.util.logging.SimpleFormatter;
|
import java.util.logging.SimpleFormatter;
|
||||||
|
|
||||||
public class CopyConfigDir extends WindowsServiceUtil {
|
public class CopyConfigDir extends WindowsServiceUtil {
|
||||||
static final Logger logger = Logger.getLogger("configlog");
|
final Logger logger = Logger.getLogger("configlog");
|
||||||
|
|
||||||
public static void initLogger() {
|
public void initLogger() {
|
||||||
try {
|
try {
|
||||||
// This block configure the logger with handler and formatter
|
// This block configure the logger with handler and formatter
|
||||||
FileHandler fh = new FileHandler(logFile().toString());
|
FileHandler fh = new FileHandler(logFile().toString());
|
||||||
@ -31,13 +31,13 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean copyDirectory(String baseDir, String workDir) {
|
public boolean copyDirectory(String baseDir, String workDir) {
|
||||||
File baseFile = new File(baseDir);
|
File baseFile = new File(baseDir);
|
||||||
File workFile = new File(workDir);
|
File workFile = new File(workDir);
|
||||||
return copyDirectory(baseFile, workFile);
|
return copyDirectory(baseFile, workFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean copyDirectory(File baseDir, File workDir) {
|
public boolean copyDirectory(File baseDir, File workDir) {
|
||||||
for (File file : baseDir.listFiles()) {
|
for (File file : baseDir.listFiles()) {
|
||||||
String fPath = file.getAbsolutePath().replace(
|
String fPath = file.getAbsolutePath().replace(
|
||||||
file.getParentFile().getAbsolutePath(), "");
|
file.getParentFile().getAbsolutePath(), "");
|
||||||
@ -52,7 +52,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean copyConfigDirectory(File baseDir, File workDir) {
|
public boolean copyConfigDirectory(File baseDir, File workDir) {
|
||||||
for (File file : baseDir.listFiles()) {
|
for (File file : baseDir.listFiles()) {
|
||||||
// System.out.println(file.getAbsolutePath());
|
// System.out.println(file.getAbsolutePath());
|
||||||
String fPath = file.getAbsolutePath().replace(
|
String fPath = file.getAbsolutePath().replace(
|
||||||
@ -66,35 +66,38 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
if (0 == cnr)
|
if (0 == cnr)
|
||||||
return false;
|
return false;
|
||||||
if (1 == cnr) {
|
if (1 == cnr) {
|
||||||
logger.info("using jpackaged configs in a jpackaged install, creating jpackaged file");
|
logger.info(
|
||||||
|
"using jpackaged configs in a jpackaged install, creating jpackaged file");
|
||||||
File jpackagedConfigsInUse = new File(appImageHome(), "jpackaged");
|
File jpackagedConfigsInUse = new File(appImageHome(), "jpackaged");
|
||||||
if (!jpackagedConfigsInUse.exists()){
|
if (!jpackagedConfigsInUse.exists()) {
|
||||||
try{
|
try {
|
||||||
jpackagedConfigsInUse.createNewFile();
|
jpackagedConfigsInUse.createNewFile();
|
||||||
}catch(IOException e){
|
} catch (IOException e) {
|
||||||
logger.warning("Error creating jpackaged file, delete config files manually when uninstalling");
|
logger.warning(
|
||||||
|
"Error creating jpackaged file, delete config files manually when uninstalling");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (-1 == cnr) {
|
if (-1 == cnr) {
|
||||||
logger.info("not overwriting existing config file, not creating jpackaged file");
|
logger.info(
|
||||||
|
"not overwriting existing config file, not creating jpackaged file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int copyFileNeverOverwrite(String basePath, String workPath) {
|
public int copyFileNeverOverwrite(String basePath, String workPath) {
|
||||||
File baseFile = new File(basePath);
|
File baseFile = new File(basePath);
|
||||||
File workFile = new File(workPath);
|
File workFile = new File(workPath);
|
||||||
return copyFileNeverOverwrite(baseFile, workFile);
|
return copyFileNeverOverwrite(baseFile, workFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int copyFileNeverOverwrite(File basePath, File workPath) {
|
public int copyFileNeverOverwrite(File basePath, File workPath) {
|
||||||
return copyFile(basePath, workPath, false);
|
return copyFile(basePath, workPath, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int copyFile(File basePath, File workPath, boolean overWrite) {
|
public int copyFile(File basePath, File workPath, boolean overWrite) {
|
||||||
if (!basePath.exists()) {
|
if (!basePath.exists()) {
|
||||||
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
|
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
|
||||||
return 0;
|
return 0;
|
||||||
@ -132,7 +135,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static File selectHome() { // throws Exception {
|
protected File selectHome() { // throws Exception {
|
||||||
String path_override = System.getenv("I2P_CONFIG");
|
String path_override = System.getenv("I2P_CONFIG");
|
||||||
if (path_override != null) {
|
if (path_override != null) {
|
||||||
File path = new File(path_override);
|
File path = new File(path_override);
|
||||||
@ -148,7 +151,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
return i2p;
|
return i2p;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static File selectProgramFile() {
|
protected File selectProgramFile() {
|
||||||
String path_override = System.getenv("I2P");
|
String path_override = System.getenv("I2P");
|
||||||
if (path_override != null) {
|
if (path_override != null) {
|
||||||
File path = new File(path_override);
|
File path = new File(path_override);
|
||||||
@ -179,7 +182,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected static File javaHome() {
|
protected File javaHome() {
|
||||||
File jrehome = new File(System.getProperty("java.home"));
|
File jrehome = new File(System.getProperty("java.home"));
|
||||||
if (jrehome != null) {
|
if (jrehome != null) {
|
||||||
if (jrehome.exists()) {
|
if (jrehome.exists()) {
|
||||||
@ -196,7 +199,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
*
|
*
|
||||||
* @return the app-image root
|
* @return the app-image root
|
||||||
*/
|
*/
|
||||||
protected static File appImageHome() {
|
protected File appImageHome() {
|
||||||
File jreHome = javaHome();
|
File jreHome = javaHome();
|
||||||
if (jreHome != null) {
|
if (jreHome != null) {
|
||||||
switch (osName()) {
|
switch (osName()) {
|
||||||
@ -218,7 +221,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
*
|
*
|
||||||
* @return the app-image root
|
* @return the app-image root
|
||||||
*/
|
*/
|
||||||
protected static String appImageExe() {
|
protected String appImageExe() {
|
||||||
File aih = appImageHome();
|
File aih = appImageHome();
|
||||||
if (aih != null) {
|
if (aih != null) {
|
||||||
switch (osName()) {
|
switch (osName()) {
|
||||||
@ -240,7 +243,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
*
|
*
|
||||||
* @return the app-image root
|
* @return the app-image root
|
||||||
*/
|
*/
|
||||||
protected static File appImageConfig() {
|
protected File appImageConfig() {
|
||||||
File aih = appImageHome();
|
File aih = appImageHome();
|
||||||
if (aih == null) {
|
if (aih == null) {
|
||||||
return null;
|
return null;
|
||||||
@ -266,13 +269,13 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean copyConfigDir() {
|
protected boolean copyConfigDir() {
|
||||||
File appImageConfigDir = appImageConfig();
|
File appImageConfigDir = appImageConfig();
|
||||||
File appImageHomeDir = selectHome();
|
File appImageHomeDir = selectHome();
|
||||||
return copyConfigDirectory(appImageConfigDir, appImageHomeDir);
|
return copyConfigDirectory(appImageConfigDir, appImageHomeDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String routerConfig() {
|
protected String routerConfig() {
|
||||||
File appImageHomeDir = selectHome();
|
File appImageHomeDir = selectHome();
|
||||||
File routerConf = new File(appImageHomeDir, "router.config");
|
File routerConf = new File(appImageHomeDir, "router.config");
|
||||||
if (routerConf != null) {
|
if (routerConf != null) {
|
||||||
@ -288,14 +291,14 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected static File logFile() { return logFile("launcher.log"); }
|
protected File logFile() { return logFile("launcher.log"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set up the path to the log file
|
* set up the path to the log file
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected static File logFile(String p) {
|
protected File logFile(String p) {
|
||||||
File log = new File(selectProgramFile(), "logs");
|
File log = new File(selectProgramFile(), "logs");
|
||||||
if (!log.exists())
|
if (!log.exists())
|
||||||
log.mkdirs();
|
log.mkdirs();
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
package net.i2p.router;
|
|
||||||
|
|
||||||
import com.sun.jna.WString;
|
|
||||||
import com.sun.jna.platform.win32.Kernel32;
|
|
||||||
import com.sun.jna.platform.win32.Kernel32Util;
|
|
||||||
|
|
||||||
public class Elevator {
|
|
||||||
public static void main(String... args) {
|
|
||||||
executeAsAdministrator("c:\\windows\\system32\\notepad.exe", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void executeAsAdministrator(String command, String args) {
|
|
||||||
if (command == "" || command == null) {
|
|
||||||
System.out.println("No command specified");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Shell32X.SHELLEXECUTEINFO execInfo = new Shell32X.SHELLEXECUTEINFO();
|
|
||||||
execInfo.lpFile = new WString(command);
|
|
||||||
if (args != null)
|
|
||||||
execInfo.lpParameters = new WString(args);
|
|
||||||
execInfo.nShow = Shell32X.SW_SHOWDEFAULT;
|
|
||||||
execInfo.fMask = Shell32X.SEE_MASK_NOCLOSEPROCESS;
|
|
||||||
execInfo.lpVerb = new WString("runas");
|
|
||||||
boolean result = Shell32X.INSTANCE.ShellExecuteEx(execInfo);
|
|
||||||
|
|
||||||
if (!result) {
|
|
||||||
int lastError = Kernel32.INSTANCE.GetLastError();
|
|
||||||
String errorMessage =
|
|
||||||
Kernel32Util.formatMessageFromLastErrorCode(lastError);
|
|
||||||
throw new RuntimeException("Error performing elevation: " + lastError +
|
|
||||||
": " + errorMessage +
|
|
||||||
" (apperror=" + execInfo.hInstApp + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
package net.i2p.router;
|
|
||||||
|
|
||||||
import com.sun.jna.Native;
|
|
||||||
import com.sun.jna.Pointer;
|
|
||||||
import com.sun.jna.Structure;
|
|
||||||
import com.sun.jna.WString;
|
|
||||||
import com.sun.jna.platform.win32.Shell32;
|
|
||||||
import com.sun.jna.platform.win32.WinDef.HINSTANCE;
|
|
||||||
import com.sun.jna.platform.win32.WinDef.HWND;
|
|
||||||
import com.sun.jna.platform.win32.WinNT.HANDLE;
|
|
||||||
import com.sun.jna.platform.win32.WinReg.HKEY;
|
|
||||||
import com.sun.jna.win32.W32APIOptions;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public interface Shell32X extends Shell32 {
|
|
||||||
Shell32X INSTANCE = (Shell32X)Native.loadLibrary(
|
|
||||||
"shell32", Shell32X.class, W32APIOptions.UNICODE_OPTIONS);
|
|
||||||
|
|
||||||
int SW_HIDE = 0;
|
|
||||||
int SW_MAXIMIZE = 3;
|
|
||||||
int SW_MINIMIZE = 6;
|
|
||||||
int SW_RESTORE = 9;
|
|
||||||
int SW_SHOW = 5;
|
|
||||||
int SW_SHOWDEFAULT = 10;
|
|
||||||
int SW_SHOWMAXIMIZED = 3;
|
|
||||||
int SW_SHOWMINIMIZED = 2;
|
|
||||||
int SW_SHOWMINNOACTIVE = 7;
|
|
||||||
int SW_SHOWNA = 8;
|
|
||||||
int SW_SHOWNOACTIVATE = 4;
|
|
||||||
int SW_SHOWNORMAL = 1;
|
|
||||||
|
|
||||||
/** File not found. */
|
|
||||||
int SE_ERR_FNF = 2;
|
|
||||||
|
|
||||||
/** Path not found. */
|
|
||||||
int SE_ERR_PNF = 3;
|
|
||||||
|
|
||||||
/** Access denied. */
|
|
||||||
int SE_ERR_ACCESSDENIED = 5;
|
|
||||||
|
|
||||||
/** Out of memory. */
|
|
||||||
int SE_ERR_OOM = 8;
|
|
||||||
|
|
||||||
/** DLL not found. */
|
|
||||||
int SE_ERR_DLLNOTFOUND = 32;
|
|
||||||
|
|
||||||
/** Cannot share an open file. */
|
|
||||||
int SE_ERR_SHARE = 26;
|
|
||||||
|
|
||||||
int SEE_MASK_NOCLOSEPROCESS = 0x00000040;
|
|
||||||
|
|
||||||
int ShellExecute(int i, String lpVerb, String lpFile, String lpParameters,
|
|
||||||
String lpDirectory, int nShow);
|
|
||||||
|
|
||||||
boolean ShellExecuteEx(SHELLEXECUTEINFO lpExecInfo);
|
|
||||||
|
|
||||||
public static class SHELLEXECUTEINFO extends Structure {
|
|
||||||
/*
|
|
||||||
* DWORD cbSize;
|
|
||||||
* ULONG fMask;
|
|
||||||
* HWND hwnd;
|
|
||||||
* LPCTSTR lpVerb;
|
|
||||||
* LPCTSTR lpFile;
|
|
||||||
* LPCTSTR lpParameters;
|
|
||||||
* LPCTSTR lpDirectory;
|
|
||||||
* int nShow;
|
|
||||||
* HINSTANCE hInstApp;
|
|
||||||
* LPVOID lpIDList;
|
|
||||||
* LPCTSTR lpClass;
|
|
||||||
* HKEY hkeyClass;
|
|
||||||
* DWORD dwHotKey;
|
|
||||||
* union {
|
|
||||||
* HANDLE hIcon;
|
|
||||||
* HANDLE hMonitor;
|
|
||||||
* } DUMMYUNIONNAME;
|
|
||||||
* HANDLE hProcess;
|
|
||||||
*/
|
|
||||||
|
|
||||||
public int cbSize = size();
|
|
||||||
public int fMask;
|
|
||||||
public HWND hwnd;
|
|
||||||
public WString lpVerb;
|
|
||||||
public WString lpFile;
|
|
||||||
public WString lpParameters;
|
|
||||||
public WString lpDirectory;
|
|
||||||
public int nShow;
|
|
||||||
public HINSTANCE hInstApp;
|
|
||||||
public Pointer lpIDList;
|
|
||||||
public WString lpClass;
|
|
||||||
public HKEY hKeyClass;
|
|
||||||
public int dwHotKey;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Actually:
|
|
||||||
* union {
|
|
||||||
* HANDLE hIcon;
|
|
||||||
* HANDLE hMonitor;
|
|
||||||
* } DUMMYUNIONNAME;
|
|
||||||
*/
|
|
||||||
public HANDLE hMonitor;
|
|
||||||
public HANDLE hProcess;
|
|
||||||
|
|
||||||
protected List getFieldOrder() {
|
|
||||||
return Arrays.asList(new String[] {
|
|
||||||
"cbSize",
|
|
||||||
"fMask",
|
|
||||||
"hwnd",
|
|
||||||
"lpVerb",
|
|
||||||
"lpFile",
|
|
||||||
"lpParameters",
|
|
||||||
"lpDirectory",
|
|
||||||
"nShow",
|
|
||||||
"hInstApp",
|
|
||||||
"lpIDList",
|
|
||||||
"lpClass",
|
|
||||||
"hKeyClass",
|
|
||||||
"dwHotKey",
|
|
||||||
"hMonitor",
|
|
||||||
"hProcess",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,5 @@
|
|||||||
package net.i2p.router;
|
package net.i2p.router;
|
||||||
|
|
||||||
import static net.i2p.update.UpdateType.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
@ -18,10 +16,11 @@ import net.i2p.router.RouterLaunch;
|
|||||||
import net.i2p.update.*;
|
import net.i2p.update.*;
|
||||||
import net.i2p.update.UpdateManager;
|
import net.i2p.update.UpdateManager;
|
||||||
import net.i2p.update.UpdatePostProcessor;
|
import net.i2p.update.UpdatePostProcessor;
|
||||||
|
import net.i2p.update.UpdateType.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches a router from %PROGRAMFILES%/I2P using configuration data in
|
* Launches a router from %WORKINGDIR%/I2P using configuration data in
|
||||||
* %LOCALAPPDATA%/I2P.. Uses Java 9 APIs.
|
* %WORKINGDIR%/I2P.. Uses Java 9 APIs.
|
||||||
*
|
*
|
||||||
* Sets the following properties:
|
* Sets the following properties:
|
||||||
* i2p.dir.base - this points to the (read-only) resources inside the bundle
|
* i2p.dir.base - this points to the (read-only) resources inside the bundle
|
||||||
@ -30,12 +29,13 @@ import net.i2p.update.UpdatePostProcessor;
|
|||||||
* router.pid - the pid of the java process.
|
* router.pid - the pid of the java process.
|
||||||
*/
|
*/
|
||||||
public class WinLauncher extends CopyConfigDir {
|
public class WinLauncher extends CopyConfigDir {
|
||||||
static WindowsUpdatePostProcessor wupp = null;
|
WindowsUpdatePostProcessor wupp = null;
|
||||||
private static Router i2pRouter;
|
private Router i2pRouter;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
setupLauncher();
|
var launcher = new WinLauncher();
|
||||||
initLogger();
|
launcher.setupLauncher();
|
||||||
|
launcher.initLogger();
|
||||||
int privateBrowsing = 0;
|
int privateBrowsing = 0;
|
||||||
boolean usabilityMode = false;
|
boolean usabilityMode = false;
|
||||||
boolean chromiumFirst = false;
|
boolean chromiumFirst = false;
|
||||||
@ -47,18 +47,18 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
if (arg.equals("-private")) {
|
if (arg.equals("-private")) {
|
||||||
privateBrowsing = 1;
|
privateBrowsing = 1;
|
||||||
logger.info(
|
launcher.logger.info(
|
||||||
"Private browsing is true, profile will be discarded at end of session.");
|
"Private browsing is true, profile will be discarded at end of session.");
|
||||||
} else if (arg.equals("-chromium")) {
|
} else if (arg.equals("-chromium")) {
|
||||||
chromiumFirst = true;
|
chromiumFirst = true;
|
||||||
logger.info("Chromium will be selected before Firefox.");
|
launcher.logger.info("Chromium will be selected before Firefox.");
|
||||||
} else if (arg.equals("-usability")) {
|
} else if (arg.equals("-usability")) {
|
||||||
usabilityMode = true;
|
usabilityMode = true;
|
||||||
logger.info(
|
launcher.logger.info(
|
||||||
"Usability mode is true, using alternate extensions loadout.");
|
"Usability mode is true, using alternate extensions loadout.");
|
||||||
} else if (arg.equals("-noproxycheck")) {
|
} else if (arg.equals("-noproxycheck")) {
|
||||||
proxyTimeoutTime = 0;
|
proxyTimeoutTime = 0;
|
||||||
logger.info("Proxy timeout time set to zero");
|
launcher.logger.info("Proxy timeout time set to zero");
|
||||||
} else {
|
} else {
|
||||||
// make an effort to not let people launch into sites if the proxy
|
// make an effort to not let people launch into sites if the proxy
|
||||||
// isn't quite ready yet, but also disable the proxy timeout if
|
// isn't quite ready yet, but also disable the proxy timeout if
|
||||||
@ -77,7 +77,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
proxyTimeoutTime = 0;
|
proxyTimeoutTime = 0;
|
||||||
} else if (proxyTimeoutTime > 0) {
|
} else if (proxyTimeoutTime > 0) {
|
||||||
newArgsList.add(arg);
|
newArgsList.add(arg);
|
||||||
} else if (!isAvailable(4444)) {
|
} else if (!launcher.isAvailable(4444)) {
|
||||||
newArgsList.add(arg);
|
newArgsList.add(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,10 +85,12 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File programs = programFile();
|
File programs = launcher.programFile();
|
||||||
File home = homeDir();
|
File home = launcher.homeDir();
|
||||||
|
|
||||||
System.setProperty("i2p.dir.base", programs.getAbsolutePath());
|
System.setProperty(
|
||||||
|
"i2p.dir.base",
|
||||||
|
new File(programs.getAbsolutePath(), "config").getAbsolutePath());
|
||||||
System.setProperty("i2p.dir.config", home.getAbsolutePath());
|
System.setProperty("i2p.dir.config", home.getAbsolutePath());
|
||||||
System.setProperty("router.pid",
|
System.setProperty("router.pid",
|
||||||
String.valueOf(ProcessHandle.current().pid()));
|
String.valueOf(ProcessHandle.current().pid()));
|
||||||
@ -99,123 +101,66 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
* to find the JVM and Runtime bundle. This broke Windows 11 installs.
|
* to find the JVM and Runtime bundle. This broke Windows 11 installs.
|
||||||
*/
|
*/
|
||||||
System.setProperty("user.dir", programs.getAbsolutePath());
|
System.setProperty("user.dir", programs.getAbsolutePath());
|
||||||
logger.info("\t" + System.getProperty("user.dir"));
|
launcher.logger.info("\t" + System.getProperty("user.dir"));
|
||||||
logger.info("\t" + System.getProperty("i2p.dir.base"));
|
launcher.logger.info("\t" + System.getProperty("i2p.dir.base"));
|
||||||
logger.info("\t" + System.getProperty("i2p.dir.config"));
|
launcher.logger.info("\t" + System.getProperty("i2p.dir.config"));
|
||||||
logger.info("\t" + System.getProperty("router.pid"));
|
launcher.logger.info("\t" + System.getProperty("router.pid"));
|
||||||
boolean continuerunning = promptServiceStartIfAvailable("i2p");
|
boolean continuerunning = launcher.promptServiceStartIfAvailable("i2p");
|
||||||
if (!continuerunning) {
|
if (!continuerunning) {
|
||||||
logger.severe(
|
launcher.logger.severe(
|
||||||
"Service startup failure, please start I2P service with services.msc");
|
"Service startup failure, please start I2P service with services.msc");
|
||||||
System.exit(2);
|
System.exit(2);
|
||||||
} else {
|
|
||||||
fixServiceConfig();
|
|
||||||
}
|
}
|
||||||
continuerunning = promptUserInstallStartIfAvailable();
|
continuerunning = launcher.promptUserInstallStartIfAvailable();
|
||||||
if (!continuerunning) {
|
if (!continuerunning) {
|
||||||
logger.severe("User-install startup required.");
|
launcher.logger.severe("User-install startup required.");
|
||||||
System.exit(2);
|
System.exit(2);
|
||||||
} else {
|
|
||||||
fixServiceConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This actually does most of what we use NSIS for if NSIS hasn't
|
// This actually does most of what we use NSIS for if NSIS hasn't
|
||||||
// already done it, which essentially makes this whole thing portable.
|
// already done it, which essentially makes this whole thing portable.
|
||||||
if (!copyConfigDir()) {
|
if (!launcher.copyConfigDir()) {
|
||||||
logger.severe("Cannot copy the configuration directory");
|
launcher.logger.severe("Cannot copy the configuration directory");
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (launchBrowser(privateBrowsing, usabilityMode, chromiumFirst,
|
if (launcher.launchBrowser(privateBrowsing, usabilityMode, chromiumFirst,
|
||||||
proxyTimeoutTime, newArgsList)) {
|
proxyTimeoutTime, newArgsList)) {
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
i2pRouter = new Router(routerConfig(), System.getProperties());
|
launcher.i2pRouter =
|
||||||
if (!isInstalled("i2p")) {
|
new Router(launcher.routerConfig(), System.getProperties());
|
||||||
if (i2pRouter.saveConfig("routerconsole.browser", null)) {
|
if (!launcher.isInstalled("i2p")) {
|
||||||
logger.info("removed routerconsole.browser config");
|
if (launcher.i2pRouter.saveConfig("routerconsole.browser", null)) {
|
||||||
|
launcher.logger.info("removed routerconsole.browser config");
|
||||||
}
|
}
|
||||||
if (i2pRouter.saveConfig("routerconsole.browser",
|
if (launcher.i2pRouter.saveConfig("routerconsole.browser",
|
||||||
appImageExe() + " -noproxycheck")) {
|
launcher.appImageExe() +
|
||||||
logger.info("updated routerconsole.browser config " + appImageExe());
|
" -noproxycheck")) {
|
||||||
|
launcher.logger.info("updated routerconsole.browser config " +
|
||||||
|
launcher.appImageExe());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("Router is configured");
|
launcher.logger.info("Router is configured");
|
||||||
|
|
||||||
Thread registrationThread = new Thread(REGISTER_UPP);
|
Thread registrationThread = new Thread(launcher.REGISTER_UPP);
|
||||||
registrationThread.setName("UPP Registration");
|
registrationThread.setName("UPP Registration");
|
||||||
registrationThread.setDaemon(true);
|
registrationThread.setDaemon(true);
|
||||||
registrationThread.start();
|
registrationThread.start();
|
||||||
|
|
||||||
setNotStarting();
|
launcher.setNotStarting();
|
||||||
|
|
||||||
i2pRouter.runRouter();
|
launcher.i2pRouter.runRouter();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void fixServiceConfig() {
|
private void setupLauncher() {
|
||||||
if (osName() != "windows")
|
|
||||||
return;
|
|
||||||
// If the user installed the Easy bundle before installing the
|
|
||||||
// IzPack installer, then they have a config file which contains the
|
|
||||||
// wrong update URL. Check for it, and change it back if necessary.
|
|
||||||
// closes #23
|
|
||||||
String routerconf = routerConfig();
|
|
||||||
if (routerconf != null) {
|
|
||||||
File routerconffile = new File(routerconf);
|
|
||||||
if (!routerconffile.exists()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isInstalled("i2p") || checkProgramFilesInstall()) {
|
|
||||||
i2pRouter = new Router(routerconf, System.getProperties());
|
|
||||||
String newsURL = i2pRouter.getConfigSetting("router.newsURL");
|
|
||||||
if (newsURL != null) {
|
|
||||||
if (newsURL.contains("http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news/win/beta/news.su3")) {
|
|
||||||
logger.info(
|
|
||||||
"checked router.newsURL config, containes win/beta in a service install, invalid update type");
|
|
||||||
if (i2pRouter.saveConfig("router.newsURL", ServiceUpdaterString())) {
|
|
||||||
logger.info("updated routerconsole.browser config " +
|
|
||||||
appImageExe());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String backupNewsURL = i2pRouter.getConfigSetting("router.backupNewsURL");
|
|
||||||
if (backupNewsURL != null) {
|
|
||||||
if (backupNewsURL.contains("http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/win/beta/news.su3")) {
|
|
||||||
logger.info(
|
|
||||||
"checked router.backupNewsURL config, containes win/beta in a service install, invalid update type");
|
|
||||||
if (i2pRouter.saveConfig("router.backupNewsURL",
|
|
||||||
ServiceBackupUpdaterString())) {
|
|
||||||
logger.info("updated routerconsole.browser config " +
|
|
||||||
appImageExe());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String updateURL = i2pRouter.getConfigSetting("router.updateURL");
|
|
||||||
if (updateURL != null) {
|
|
||||||
if (updateURL.contains("http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3")) {
|
|
||||||
logger.info(
|
|
||||||
"checked router.updateURL config, containes easy-intall update in a service install, invalid update type");
|
|
||||||
if (i2pRouter.saveConfig("router.updateURL",
|
|
||||||
ServiceStaticUpdaterString())) {
|
|
||||||
logger.info("updated routerconsole.browser config " +
|
|
||||||
appImageExe());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void setupLauncher() {
|
|
||||||
File jrehome = javaHome();
|
File jrehome = javaHome();
|
||||||
logger.info("jre home is: " + jrehome.getAbsolutePath());
|
logger.info("jre home is: " + jrehome.getAbsolutePath());
|
||||||
File appimagehome = appImageHome();
|
File appimagehome = appImageHome();
|
||||||
logger.info("appimage home is: " + appimagehome.getAbsolutePath());
|
logger.info("appimage home is: " + appimagehome.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File programFile() {
|
private File programFile() {
|
||||||
File programs = selectProgramFile();
|
File programs = selectProgramFile();
|
||||||
if (!programs.exists())
|
if (!programs.exists())
|
||||||
programs.mkdirs();
|
programs.mkdirs();
|
||||||
@ -228,7 +173,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
return programs;
|
return programs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File homeDir() {
|
private File homeDir() {
|
||||||
File home = selectHome();
|
File home = selectHome();
|
||||||
if (!home.exists())
|
if (!home.exists())
|
||||||
home.mkdirs();
|
home.mkdirs();
|
||||||
@ -241,11 +186,9 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
return home;
|
return home;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean launchBrowser(int privateBrowsing,
|
private boolean launchBrowser(int privateBrowsing, boolean usabilityMode,
|
||||||
boolean usabilityMode,
|
boolean chromiumFirst, int proxyTimeoutTime,
|
||||||
boolean chromiumFirst,
|
ArrayList<String> newArgsList) {
|
||||||
int proxyTimeoutTime,
|
|
||||||
ArrayList<String> newArgsList) {
|
|
||||||
if (i2pIsRunning()) {
|
if (i2pIsRunning()) {
|
||||||
logger.info("I2P is already running, launching an I2P browser");
|
logger.info("I2P is already running, launching an I2P browser");
|
||||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||||
@ -268,7 +211,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
|
|
||||||
// see
|
// see
|
||||||
// https://stackoverflow.com/questions/434718/sockets-discover-port-availability-using-java
|
// https://stackoverflow.com/questions/434718/sockets-discover-port-availability-using-java
|
||||||
private static boolean isAvailable(int portNr) {
|
private boolean isAvailable(int portNr) {
|
||||||
boolean portFree;
|
boolean portFree;
|
||||||
try (var ignored = new ServerSocket(portNr)) {
|
try (var ignored = new ServerSocket(portNr)) {
|
||||||
portFree = true;
|
portFree = true;
|
||||||
@ -278,7 +221,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
return portFree;
|
return portFree;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean i2pIsRunningCheck() {
|
private boolean i2pIsRunningCheck() {
|
||||||
// check if there's something listening on port 7657(Router Console)
|
// check if there's something listening on port 7657(Router Console)
|
||||||
if (!isAvailable(7657))
|
if (!isAvailable(7657))
|
||||||
return true;
|
return true;
|
||||||
@ -290,7 +233,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setNotStarting() {
|
private void setNotStarting() {
|
||||||
logger.info("removing startup file, the application has started");
|
logger.info("removing startup file, the application has started");
|
||||||
File home = selectHome();
|
File home = selectHome();
|
||||||
File starting = new File(home, "starting");
|
File starting = new File(home, "starting");
|
||||||
@ -299,7 +242,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setStarting() {
|
private void setStarting() {
|
||||||
logger.info("creating startup file, router is starting up");
|
logger.info("creating startup file, router is starting up");
|
||||||
File home = selectHome();
|
File home = selectHome();
|
||||||
File starting = new File(home, "starting");
|
File starting = new File(home, "starting");
|
||||||
@ -310,9 +253,15 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
logger.info(e.toString());
|
logger.info(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
setNotStarting();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkStarting() {
|
private boolean checkStarting() {
|
||||||
logger.info("checking startup file");
|
logger.info("checking startup file");
|
||||||
File home = selectHome();
|
File home = selectHome();
|
||||||
File starting = new File(home, "starting");
|
File starting = new File(home, "starting");
|
||||||
@ -327,7 +276,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
|
|
||||||
// check for the existence of router.ping file, if it's less then 2
|
// check for the existence of router.ping file, if it's less then 2
|
||||||
// minutes old, exit
|
// minutes old, exit
|
||||||
private static boolean checkPing() {
|
private boolean checkPing() {
|
||||||
File home = selectHome();
|
File home = selectHome();
|
||||||
File ping = new File(home, "router.ping");
|
File ping = new File(home, "router.ping");
|
||||||
if (ping.exists()) {
|
if (ping.exists()) {
|
||||||
@ -344,7 +293,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean i2pIsRunning() {
|
private boolean i2pIsRunning() {
|
||||||
if (checkStarting())
|
if (checkStarting())
|
||||||
return true;
|
return true;
|
||||||
if (checkPing())
|
if (checkPing())
|
||||||
@ -359,7 +308,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Runnable REGISTER_UPP = () -> {
|
private final Runnable REGISTER_UPP = () -> {
|
||||||
RouterContext ctx;
|
RouterContext ctx;
|
||||||
while ((ctx = i2pRouter.getContext()) == null) {
|
while ((ctx = i2pRouter.getContext()) == null) {
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
@ -384,7 +333,7 @@ public class WinLauncher extends CopyConfigDir {
|
|||||||
*
|
*
|
||||||
* @param millis
|
* @param millis
|
||||||
*/
|
*/
|
||||||
private static void sleep(int millis) {
|
private void sleep(int millis) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(millis);
|
Thread.sleep(millis);
|
||||||
} catch (InterruptedException bad) {
|
} catch (InterruptedException bad) {
|
||||||
|
@ -47,34 +47,34 @@ class WinUpdateProcess implements Runnable {
|
|||||||
File workingDir = workDir();
|
File workingDir = workDir();
|
||||||
File logFile = new File(workingDir, "log-" + version + ".txt");
|
File logFile = new File(workingDir, "log-" + version + ".txt");
|
||||||
|
|
||||||
if (logFile.canWrite()) {
|
// check if we can write to the log file. If we can, use the
|
||||||
// check if we can write to the log file. If we can, use the
|
// ProcessBuilder to run the installer.
|
||||||
// ProcessBuilder to run the installer.
|
ProcessBuilder pb = new ProcessBuilder(
|
||||||
ProcessBuilder pb = new ProcessBuilder(
|
file.getAbsolutePath(), "/S", "/D=" + workingDir.getAbsolutePath());
|
||||||
file.getAbsolutePath(), "/S", "/D=" + workingDir.getAbsolutePath());
|
Map<String, String> env = pb.environment();
|
||||||
Map<String, String> env = pb.environment();
|
env.put("OLD_I2P_VERSION", version);
|
||||||
env.put("OLD_I2P_VERSION", version);
|
env.remove("RESTART_I2P");
|
||||||
env.remove("RESTART_I2P");
|
|
||||||
|
|
||||||
int exitCode = ctx.router().scheduledGracefulExitCode();
|
int exitCode = ctx.router().scheduledGracefulExitCode();
|
||||||
if (exitCode == Router.EXIT_HARD_RESTART ||
|
if (exitCode == Router.EXIT_HARD_RESTART ||
|
||||||
exitCode == Router.EXIT_GRACEFUL_RESTART)
|
exitCode == Router.EXIT_GRACEFUL_RESTART)
|
||||||
env.put("RESTART_I2P", "true");
|
env.put("RESTART_I2P", "true");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pb.directory(workingDir)
|
Process p = pb.directory(workingDir)
|
||||||
.redirectErrorStream(true)
|
.redirectErrorStream(true)
|
||||||
.redirectOutput(logFile)
|
.redirectOutput(logFile)
|
||||||
.start();
|
.start();
|
||||||
} catch (IOException ex) {
|
exitCode = p.waitFor();
|
||||||
_log.error(
|
if (exitCode != 0)
|
||||||
"Unable to run update-program in background. Update will fail.");
|
_log.error("Update failed with exit code " + exitCode + " see " +
|
||||||
}
|
logFile.getAbsolutePath() + " for more details");
|
||||||
} else {
|
} catch (IOException ex) {
|
||||||
// If we cant write to the log file and we're on Windows, use the elevator
|
_log.error(
|
||||||
// to execute the installer instead of the ProcessBuilder.
|
"Unable to run update program in background. Update will fail.", ex);
|
||||||
Elevator.executeAsAdministrator(file.getAbsolutePath(),
|
} catch (InterruptedException ex) {
|
||||||
" /S /D=" + workingDir.getAbsolutePath());
|
_log.error(
|
||||||
|
"Unable to run update program in background. Update will fail.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import javax.swing.JOptionPane;
|
|||||||
|
|
||||||
public class WindowsServiceUtil {
|
public class WindowsServiceUtil {
|
||||||
public WindowsServiceUtil() {}
|
public WindowsServiceUtil() {}
|
||||||
public static String queryService(String serviceName) {
|
public String queryService(String serviceName) {
|
||||||
String result = "";
|
String result = "";
|
||||||
String line;
|
String line;
|
||||||
ProcessBuilder pb = new ProcessBuilder("sc", "query", serviceName);
|
ProcessBuilder pb = new ProcessBuilder("sc", "query", serviceName);
|
||||||
@ -54,7 +54,7 @@ public class WindowsServiceUtil {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
public static String getStatePrefix(String qResult) {
|
public String getStatePrefix(String qResult) {
|
||||||
String statePrefix = "STATE : ";
|
String statePrefix = "STATE : ";
|
||||||
// get the first occurrence of "STATE", then find the
|
// get the first occurrence of "STATE", then find the
|
||||||
// next occurrence of of ":" after that. Count the
|
// next occurrence of of ":" after that. Count the
|
||||||
@ -70,7 +70,7 @@ public class WindowsServiceUtil {
|
|||||||
}
|
}
|
||||||
return statePrefix;
|
return statePrefix;
|
||||||
}
|
}
|
||||||
public static int getServiceStateInt(String serviceName) {
|
public int getServiceStateInt(String serviceName) {
|
||||||
// String statePrefix = "STATE : ";
|
// String statePrefix = "STATE : ";
|
||||||
String qResult = queryService(serviceName);
|
String qResult = queryService(serviceName);
|
||||||
String statePrefix = getStatePrefix(qResult);
|
String statePrefix = getStatePrefix(qResult);
|
||||||
@ -86,14 +86,14 @@ public class WindowsServiceUtil {
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isInstalled(String serviceName) {
|
public boolean isInstalled(String serviceName) {
|
||||||
if (getServiceState(serviceName).equals("uninstalled")) {
|
if (getServiceState(serviceName).equals("uninstalled")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isStart(String serviceName) {
|
public boolean isStart(String serviceName) {
|
||||||
if (getServiceState(serviceName).equals("started")) {
|
if (getServiceState(serviceName).equals("started")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ public class WindowsServiceUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean promptServiceStartIfAvailable(String serviceName) {
|
public boolean promptServiceStartIfAvailable(String serviceName) {
|
||||||
if (osName() != "windows") {
|
if (osName() != "windows") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -152,17 +152,17 @@ public class WindowsServiceUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String ServiceUpdaterString() {
|
public String ServiceUpdaterString() {
|
||||||
return "http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/news.su3";
|
return "http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/news.su3";
|
||||||
}
|
}
|
||||||
public static String ServiceBackupUpdaterString() {
|
public String ServiceBackupUpdaterString() {
|
||||||
return "http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news.su3";
|
return "http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news.su3";
|
||||||
}
|
}
|
||||||
public static String ServiceStaticUpdaterString() {
|
public String ServiceStaticUpdaterString() {
|
||||||
return "http://echelon.i2p/i2p/i2pupdate.sud,http://stats.i2p/i2p/i2pupdate.sud";
|
return "http://echelon.i2p/i2p/i2pupdate.sud,http://stats.i2p/i2p/i2pupdate.sud";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getProgramFilesInstall() {
|
public String getProgramFilesInstall() {
|
||||||
String programFiles = System.getenv("PROGRAMFILES");
|
String programFiles = System.getenv("PROGRAMFILES");
|
||||||
if (programFiles != null) {
|
if (programFiles != null) {
|
||||||
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
|
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
|
||||||
@ -178,7 +178,7 @@ public class WindowsServiceUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkProgramFilesInstall() {
|
public boolean checkProgramFilesInstall() {
|
||||||
String programFiles = System.getenv("PROGRAMFILES");
|
String programFiles = System.getenv("PROGRAMFILES");
|
||||||
if (programFiles != null) {
|
if (programFiles != null) {
|
||||||
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
|
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
|
||||||
@ -194,7 +194,7 @@ public class WindowsServiceUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean promptUserInstallStartIfAvailable() {
|
public boolean promptUserInstallStartIfAvailable() {
|
||||||
if (osName() != "windows") {
|
if (osName() != "windows") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ public class WindowsServiceUtil {
|
|||||||
message +=
|
message +=
|
||||||
"However, it is not running yet. Please start it using the shortcut on the desktop.\n";
|
"However, it is not running yet. Please start it using the shortcut on the desktop.\n";
|
||||||
message +=
|
message +=
|
||||||
"If you click \"No\", the jpackage router will be launched instead.\n";
|
"If you click \"No\", the Easy-Install router will be launched instead.\n";
|
||||||
a = JOptionPane.showConfirmDialog(null, message,
|
a = JOptionPane.showConfirmDialog(null, message,
|
||||||
"I2P Service detected not running",
|
"I2P Service detected not running",
|
||||||
JOptionPane.YES_NO_OPTION);
|
JOptionPane.YES_NO_OPTION);
|
||||||
@ -216,7 +216,7 @@ public class WindowsServiceUtil {
|
|||||||
try {
|
try {
|
||||||
String pfi = getProgramFilesInstall();
|
String pfi = getProgramFilesInstall();
|
||||||
if (pfi != null)
|
if (pfi != null)
|
||||||
Runtime.getRuntime().exec(pfi);
|
Runtime.getRuntime().exec(new String[] {pfi});
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ public class WindowsServiceUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getServiceState(String serviceName) {
|
public String getServiceState(String serviceName) {
|
||||||
String stateString = "uninstalled";
|
String stateString = "uninstalled";
|
||||||
int state = getServiceStateInt(serviceName);
|
int state = getServiceStateInt(serviceName);
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@ -269,11 +269,12 @@ public class WindowsServiceUtil {
|
|||||||
return "linux";
|
return "linux";
|
||||||
}
|
}
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
|
WindowsServiceUtil wsu = new WindowsServiceUtil();
|
||||||
// when querying the I2P router service installed by the IzPack installer
|
// when querying the I2P router service installed by the IzPack installer
|
||||||
// this is the correct call.
|
// this is the correct call.
|
||||||
String state = getServiceState("i2p");
|
String state = wsu.getServiceState("i2p");
|
||||||
int stateInt = getServiceStateInt("i2p");
|
int stateInt = wsu.getServiceStateInt("i2p");
|
||||||
System.out.println("i2p state: " + state + " code: " + stateInt);
|
System.out.println("i2p state: " + state + " code: " + stateInt);
|
||||||
promptServiceStartIfAvailable("i2p");
|
wsu.promptServiceStartIfAvailable("i2p");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,14 +39,13 @@ public class WindowsUpdatePostProcessor implements UpdatePostProcessor {
|
|||||||
String version, File file)
|
String version, File file)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
_log.info("Got an update to post-process");
|
_log.info("Got an update to post-process");
|
||||||
|
if (type != UpdateType.ROUTER_SIGNED_SU3 &&
|
||||||
|
type != UpdateType.ROUTER_DEV_SU3) {
|
||||||
|
_log.warn("Unsupported update type " + type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (SystemVersion.isWindows()) {
|
if (SystemVersion.isWindows()) {
|
||||||
|
|
||||||
if (type != UpdateType.ROUTER_SIGNED_SU3 &&
|
|
||||||
type != UpdateType.ROUTER_DEV_SU3) {
|
|
||||||
_log.warn("Unsupported update type " + type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fileType != SU3File.TYPE_EXE) {
|
if (fileType != SU3File.TYPE_EXE) {
|
||||||
_log.warn("Unsupported file type " + fileType);
|
_log.warn("Unsupported file type " + fileType);
|
||||||
return;
|
return;
|
||||||
@ -64,6 +63,21 @@ public class WindowsUpdatePostProcessor implements UpdatePostProcessor {
|
|||||||
|
|
||||||
ctx.addFinalShutdownTask(
|
ctx.addFinalShutdownTask(
|
||||||
new WinUpdateProcess(ctx, this::getVersion, this::getFile));
|
new WinUpdateProcess(ctx, this::getVersion, this::getFile));
|
||||||
|
} else {
|
||||||
|
if (fileType == SU3File.TYPE_ZIP) {
|
||||||
|
this.positionedFile = moveUpdateInstaller(file);
|
||||||
|
this.version = version;
|
||||||
|
|
||||||
|
if (!hook.compareAndSet(false, true)) {
|
||||||
|
_log.info("shutdown hook was already set");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_log.info("adding shutdown hook");
|
||||||
|
|
||||||
|
ctx.addFinalShutdownTask(
|
||||||
|
new ZipUpdateProcess(ctx, this::getVersion, this::getFile));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
112
java/net/i2p/router/ZipUpdateProcess.java
Normal file
112
java/net/i2p/router/ZipUpdateProcess.java
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
package net.i2p.router;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.*;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
import net.i2p.I2PAppContext;
|
||||||
|
import net.i2p.router.*;
|
||||||
|
import net.i2p.util.Log;
|
||||||
|
|
||||||
|
public class ZipUpdateProcess implements Runnable {
|
||||||
|
private final RouterContext ctx;
|
||||||
|
private final Supplier<String> versionSupplier;
|
||||||
|
private final Supplier<File> fileSupplier;
|
||||||
|
private final Log _log;
|
||||||
|
|
||||||
|
ZipUpdateProcess(RouterContext ctx, Supplier<String> versionSupplier,
|
||||||
|
Supplier<File> fileSupplier) {
|
||||||
|
this.ctx = ctx;
|
||||||
|
this.versionSupplier = versionSupplier;
|
||||||
|
this.fileSupplier = fileSupplier;
|
||||||
|
this._log = ctx.logManager().getLog(ZipUpdateProcess.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private File workDir() throws IOException {
|
||||||
|
if (ctx != null) {
|
||||||
|
File workDir =
|
||||||
|
new File(ctx.getConfigDir().getAbsolutePath(), "i2p_update_zip");
|
||||||
|
if (workDir.exists()) {
|
||||||
|
if (workDir.isFile())
|
||||||
|
throw new IOException(workDir +
|
||||||
|
" exists but is a file, get it out of the way");
|
||||||
|
return workDir;
|
||||||
|
} else {
|
||||||
|
workDir.mkdirs();
|
||||||
|
}
|
||||||
|
return workDir;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unzipUpdateInstaller() throws IOException {
|
||||||
|
String version = versionSupplier.get();
|
||||||
|
File file = fileSupplier.get();
|
||||||
|
if (file == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
File workingDir = workDir();
|
||||||
|
File zipFile = new File(workingDir, "i2pupdate_portable.zip");
|
||||||
|
File destDir = ctx.getConfigDir();
|
||||||
|
|
||||||
|
String errors = unzip(zipFile.getAbsolutePath(), destDir.getAbsolutePath());
|
||||||
|
_log.error(errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
unzipUpdateInstaller();
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
_log.error("Error running updater, update may fail." + ioe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// copied wholesale from this example:
|
||||||
|
// https://www.digitalocean.com/community/tutorials/java-unzip-file-example
|
||||||
|
// It doesn't check for zip-slips, but that's fine because if somebody's able
|
||||||
|
// to deliver a malicious update then they can just run code anyway so there's
|
||||||
|
// no point.
|
||||||
|
private static String unzip(String zipFilePath, String destDir) {
|
||||||
|
File dir = new File(destDir);
|
||||||
|
// create output directory if it doesn't exist
|
||||||
|
if (!dir.exists())
|
||||||
|
dir.mkdirs();
|
||||||
|
FileInputStream fis;
|
||||||
|
// buffer for read and write data to file
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
try {
|
||||||
|
fis = new FileInputStream(zipFilePath);
|
||||||
|
ZipInputStream zis = new ZipInputStream(fis);
|
||||||
|
ZipEntry ze = zis.getNextEntry();
|
||||||
|
while (ze != null) {
|
||||||
|
String fileName = ze.getName();
|
||||||
|
File newFile = new File(destDir + File.separator + fileName);
|
||||||
|
System.out.println("Unzipping to " + newFile.getAbsolutePath());
|
||||||
|
// create directories for sub directories in zip
|
||||||
|
new File(newFile.getParent()).mkdirs();
|
||||||
|
FileOutputStream fos = new FileOutputStream(newFile);
|
||||||
|
int len;
|
||||||
|
while ((len = zis.read(buffer)) > 0) {
|
||||||
|
fos.write(buffer, 0, len);
|
||||||
|
}
|
||||||
|
fos.close();
|
||||||
|
// close this ZipEntry
|
||||||
|
zis.closeEntry();
|
||||||
|
ze = zis.getNextEntry();
|
||||||
|
}
|
||||||
|
// close last ZipEntry
|
||||||
|
zis.closeEntry();
|
||||||
|
zis.close();
|
||||||
|
fis.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
return e.toString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
89
launcher.sh
89
launcher.sh
@ -1,89 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/i2pversion"
|
|
||||||
|
|
||||||
if [ -f i2pversion_override ]; then
|
|
||||||
. "$SCRIPT_DIR/i2pversion_override"
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
|
||||||
|
|
||||||
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
|
||||||
. "$SCRIPT_DIR/config_override.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
COUNT="Ten Nine Eight Seven Six Five Four Three Two One"
|
|
||||||
|
|
||||||
which java
|
|
||||||
export JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t\- ')
|
|
||||||
|
|
||||||
if [ "$JAVA" -lt "14" ]; then
|
|
||||||
echo "Java 14+ must be used to compile with jpackage, java is $JAVA"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ "$JAVA" -lt "17" ]; then
|
|
||||||
echo "It is highly recommended that you use Java 17+ to build release packages"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${JAVA_HOME}" ]; then
|
|
||||||
export JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
|
|
||||||
fi
|
|
||||||
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
|
||||||
export JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
|
|
||||||
fi
|
|
||||||
echo "Building with: $JAVA, $JAVA_HOME"
|
|
||||||
sleep 5s
|
|
||||||
|
|
||||||
HERE="$PWD"
|
|
||||||
if [ ! -d "$HERE/../i2p.i2p.jpackage-build/" ]; then
|
|
||||||
git clone --depth=1 -b "$VERSION" https://i2pgit.org/i2p-hackers/i2p.i2p "$HERE/../i2p.i2p.jpackage-build/"
|
|
||||||
tar --exclude="$HERE/../i2p.i2p.jpackage-build/.git" -cvzf i2p.i2p.jpackage-build.tar.gz "$HERE/../i2p.i2p.jpackage-build/"
|
|
||||||
fi
|
|
||||||
cd "$HERE/../i2p.i2p.jpackage-build/"
|
|
||||||
git pull --all
|
|
||||||
for i in $COUNT; do
|
|
||||||
echo -n "$i...."; sleep 1s
|
|
||||||
done
|
|
||||||
ant distclean pkg || true
|
|
||||||
|
|
||||||
cd "$HERE"
|
|
||||||
export I2P_PKG="$HERE/../i2p.i2p.jpackage-build/pkg-temp"
|
|
||||||
export RES_DIR="$HERE/../i2p.i2p.jpackage-build/installer/resources"
|
|
||||||
export I2P_JARS="$I2P_PKG/lib"
|
|
||||||
export I2P_JBIGI="$HERE/../i2p.i2p.jpackage-build/installer/lib/jbigi"
|
|
||||||
|
|
||||||
echo "compiling custom launcher"
|
|
||||||
mkdir -p build
|
|
||||||
cp "$I2P_JARS"/*.jar build
|
|
||||||
if [ ! -f "$HERE/build/jna.jar" ]; then
|
|
||||||
wget -O "$HERE/build/jna.jar" "https://repo1.maven.org/maven2/net/java/dev/jna/jna/$JNA_VERSION/jna-$JNA_VERSION.jar"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "$HERE/build/jna-platform.jar" ]; then
|
|
||||||
wget -O "$HERE/build/jna-platform.jar" "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/$JNA_VERSION/jna-platform-$JNA_VERSION.jar"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "$HERE/build/i2pfirefox.jar" ]; then
|
|
||||||
wget -O "$HERE/build/i2pfirefox.jar" "https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/$I2PFIREFOX_VERSION/i2pfirefox.jar"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd java
|
|
||||||
"$JAVA_HOME"/bin/javac -d ../build -classpath "$HERE/build/i2pfirefox.jar:$HERE/build/jna.jar":"$HERE/build/jna-platform.jar":"$HERE/build/i2p.jar":"$HERE/build/router.jar":"$HERE/build/routerconsole.jar" \
|
|
||||||
net/i2p/router/CopyConfigDir.java \
|
|
||||||
net/i2p/router/Elevator.java \
|
|
||||||
net/i2p/router/Shell32X.java \
|
|
||||||
net/i2p/router/WinLauncher.java \
|
|
||||||
net/i2p/router/WindowsUpdatePostProcessor.java \
|
|
||||||
net/i2p/router/WinUpdateProcess.java \
|
|
||||||
net/i2p/router/WindowsServiceUtil.java
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
#echo "building launcher.jar"
|
|
||||||
cd build
|
|
||||||
"$JAVA_HOME"/bin/jar -cf launcher.jar net
|
|
||||||
cd ..
|
|
@ -1,4 +0,0 @@
|
|||||||
orig:
|
|
||||||
tar --exclude=debian --exclude=.git -cvzf ../i2p-firefox-profile_$(PROFILE_VERSION).orig.tar.gz .
|
|
||||||
|
|
||||||
## HOWTO: Don't bother. See http://i2pgit.org/idk/i2p.plugins.firefox debian jpackages.
|
|
@ -1 +0,0 @@
|
|||||||
# DEPRECATED: see https://i2pgit.org/idk/i2p.plugins.firefox for much better replacement.
|
|
@ -1 +0,0 @@
|
|||||||
#DEPRECATED moved to i2p.plugins.firefox as "Base/Strict Mode"
|
|
@ -1 +0,0 @@
|
|||||||
#DEPRECATED moved to i2p.plugins.firefox as "Usability Mode"
|
|
@ -7,11 +7,11 @@ $(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools:
|
|||||||
go mod vendor && go build
|
go mod vendor && go build
|
||||||
|
|
||||||
prepupdate:
|
prepupdate:
|
||||||
cp -v "I2P-Profile-Installer-$(PROFILE_VERSION)-signed.su3" i2pwinupdate.su3
|
cp -v "I2P-Easy-Install-Bundle-$(PROFILE_VERSION)-signed.su3" i2pwinupdate.su3
|
||||||
|
|
||||||
su3: $(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools
|
su3: $(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools
|
||||||
$(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools -name "I2P-Profile-Installer-$(PROFILE_VERSION)-signed" -signer "$(SIGNER)" -version "$(I2P_VERSION)"
|
$(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools -name "I2P-Easy-Install-Bundle-$(PROFILE_VERSION)-signed" -signer "$(SIGNER)" -version "$(PROFILE_VERSION)"
|
||||||
java -cp "$(HOME)/i2p/lib/*" net.i2p.crypto.SU3File sign -c ROUTER -f EXE I2P-Profile-Installer-$(PROFILE_VERSION)-signed.exe I2P-Profile-Installer-$(PROFILE_VERSION)-signed.su3 "$(HOME)/.i2p-plugin-keys/news-su3-keystore.ks" $(PROFILE_VERSION) $(SIGNER)
|
java -cp "$(HOME)/i2p/lib/*" net.i2p.crypto.SU3File sign -c ROUTER -f EXE I2P-Easy-Install-Bundle-$(PROFILE_VERSION)-signed.exe I2P-Easy-Install-Bundle-$(PROFILE_VERSION)-signed.su3 "$(HOME)/.i2p-plugin-keys/news-su3-keystore.ks" $(PROFILE_VERSION) $(SIGNER)
|
||||||
|
|
||||||
i2pwinupdate.su3.torrent: prepupdate su3
|
i2pwinupdate.su3.torrent: prepupdate su3
|
||||||
mktorrent \
|
mktorrent \
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 67 KiB |
@ -11,13 +11,126 @@
|
|||||||
|
|
||||||
!ifndef FindProcess
|
!ifndef FindProcess
|
||||||
!define FindProcess '!insertmacro FindProcess'
|
!define FindProcess '!insertmacro FindProcess'
|
||||||
|
|
||||||
|
!ifndef un.FindProcess
|
||||||
|
!define un.FindProcess '!insertmacro un.FindProcess'
|
||||||
|
|
||||||
!macro FindProcess ProcessList BoolReturn
|
!macro FindProcess ProcessList BoolReturn
|
||||||
Push '${ProcessList}'
|
Push '${ProcessList}'
|
||||||
Call FindProcess
|
Call FindProcess
|
||||||
Pop ${BoolReturn}
|
Pop ${BoolReturn}
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
!macro un.FindProcess ProcessList BoolReturn
|
||||||
|
Push '${ProcessList}'
|
||||||
|
Call un.FindProcess
|
||||||
|
Pop ${BoolReturn}
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
Function un.FindProcess
|
||||||
|
# return True if any process in ProcessList is active
|
||||||
|
Exch $0 ; get ProcessList, save $0
|
||||||
|
Push $1
|
||||||
|
Push $2
|
||||||
|
Push $R0
|
||||||
|
Push $R1
|
||||||
|
Push $R2
|
||||||
|
|
||||||
|
StrCpy $2 "$0," ; $2 = ProcessList
|
||||||
|
|
||||||
|
Push 0 ; set return value = False
|
||||||
|
|
||||||
|
# method based upon one by Phoenix1701@gmail.com 1/27/07
|
||||||
|
|
||||||
|
System::Alloc 1024
|
||||||
|
Pop $R0 ; process list buffer
|
||||||
|
|
||||||
|
# get an array of all process ids
|
||||||
|
System::Call "Psapi::EnumProcesses(i R0, i 1024, *i .R1)i .r0"
|
||||||
|
${Unless} $0 = 0
|
||||||
|
|
||||||
|
IntOp $R1 $R1 / 4 ; Divide by sizeof(DWORD) to get $R1 process count
|
||||||
|
IntOp $R1 $R1 - 1 ; decr for 0 base loop
|
||||||
|
|
||||||
|
ClearErrors
|
||||||
|
${For} $R2 0 $R1
|
||||||
|
# get a PID from the array
|
||||||
|
IntOp $0 $R2 << 2
|
||||||
|
IntOp $0 $0 + $R0 ; buffer.dword[i]
|
||||||
|
System::Call "*$0(i .r0)" ; Get next PID
|
||||||
|
|
||||||
|
${Unless} $0 = 0
|
||||||
|
Push $0
|
||||||
|
Call un.GetProcessName
|
||||||
|
Pop $1
|
||||||
|
|
||||||
|
# is this process one we are looking for?
|
||||||
|
${WordFind} '$2' ',' 'E/$1' $0
|
||||||
|
${Unless} ${Errors}
|
||||||
|
# yes, change return value
|
||||||
|
Pop $0 ; discard old result
|
||||||
|
Push 1 ; set return True
|
||||||
|
|
||||||
|
# exit the loop
|
||||||
|
${Break}
|
||||||
|
${EndUnless}
|
||||||
|
${EndUnless}
|
||||||
|
${Next}
|
||||||
|
|
||||||
|
${EndUnless}
|
||||||
|
|
||||||
|
System::Free $R0
|
||||||
|
|
||||||
|
Pop $0 ; get return value
|
||||||
|
Pop $R2 ; restore registers
|
||||||
|
Pop $R1
|
||||||
|
Pop $R0
|
||||||
|
Pop $2
|
||||||
|
Pop $1
|
||||||
|
Exch $0
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function un.GetProcessName
|
||||||
|
# ( Pid -- ProcessName )
|
||||||
|
Exch $2 ; get Pid, save $2
|
||||||
|
Push $0
|
||||||
|
Push $1
|
||||||
|
Push $3
|
||||||
|
Push $R0
|
||||||
|
|
||||||
|
System::Call "Kernel32::OpenProcess(i 1040, i 0, i r2)i .r3"
|
||||||
|
|
||||||
|
StrCpy $2 "<unknown>" ; set return value
|
||||||
|
|
||||||
|
${Unless} $3 = 0 ; $3 is hProcess
|
||||||
|
# get hMod array
|
||||||
|
System::Alloc 1024
|
||||||
|
Pop $R0
|
||||||
|
|
||||||
|
# params: Pid, &hMod, sizeof(hMod), &cb
|
||||||
|
System::Call "Psapi::EnumProcessModules(i r3, i R0, i 1024, *i .r1)i .r0"
|
||||||
|
|
||||||
|
${Unless} $0 = 0
|
||||||
|
# get first hMod
|
||||||
|
System::Call "*$R0(i .r0)"
|
||||||
|
|
||||||
|
# get BaseName; params: Pid, hMod, szBuffer, sizeof(szBuffer)
|
||||||
|
System::Call "Psapi::GetModuleBaseName(i r3, i r0, t .r2, i 256)i .r0"
|
||||||
|
${EndUnless}
|
||||||
|
|
||||||
|
System::Free $R0
|
||||||
|
System::Call "kernel32::CloseHandle(i r3)"
|
||||||
|
${EndUnless}
|
||||||
|
|
||||||
|
Pop $R0 ; restore registers
|
||||||
|
Pop $3
|
||||||
|
Pop $1
|
||||||
|
Pop $0
|
||||||
|
Exch $2 ; save process name
|
||||||
|
FunctionEnd
|
||||||
|
!endif
|
||||||
|
|
||||||
|
|
||||||
Function FindProcess
|
Function FindProcess
|
||||||
# return True if any process in ProcessList is active
|
# return True if any process in ProcessList is active
|
||||||
Exch $0 ; get ProcessList, save $0
|
Exch $0 ; get ProcessList, save $0
|
||||||
@ -119,4 +232,4 @@ Function GetProcessName
|
|||||||
Pop $0
|
Pop $0
|
||||||
Exch $2 ; save process name
|
Exch $2 ; save process name
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
!endif
|
!endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# This now requires v3
|
# This now requires v3
|
||||||
UniCode true
|
UniCode true
|
||||||
|
|
||||||
!define APPNAME "I2PBrowser-Launcher"
|
!define APPNAME "i2peasy"
|
||||||
!define COMPANYNAME "I2P"
|
!define COMPANYNAME "I2P"
|
||||||
!define DESCRIPTION "This is a tool which contains an I2P router, a bundled JVM, and a tool for automatically configuring a browser to use with I2P."
|
!define DESCRIPTION "This is a tool which contains an I2P router, a bundled JVM, and a tool for automatically configuring a browser to use with I2P."
|
||||||
!define I2P_MESSAGE "Please choose a directory."
|
!define I2P_MESSAGE "Please choose a directory."
|
||||||
@ -10,7 +10,6 @@ UniCode true
|
|||||||
!define CONSOLE_URL "http://127.0.0.1:7657/home"
|
!define CONSOLE_URL "http://127.0.0.1:7657/home"
|
||||||
|
|
||||||
!include i2pbrowser-version.nsi
|
!include i2pbrowser-version.nsi
|
||||||
!include i2pbrowser-jpackage.nsi
|
|
||||||
!include FindProcess.nsh
|
!include FindProcess.nsh
|
||||||
|
|
||||||
#var INSTDIR
|
#var INSTDIR
|
||||||
@ -18,11 +17,11 @@ UniCode true
|
|||||||
SetOverwrite on
|
SetOverwrite on
|
||||||
|
|
||||||
!define INSTDIR
|
!define INSTDIR
|
||||||
!define I2PINSTEXE_USERMODE "$LOCALAPPDATA\i2peasy"
|
!define I2PINSTEXE_USERMODE "$LOCALAPPDATA\${APPNAME}"
|
||||||
|
|
||||||
!define RAM_NEEDED_FOR_64BIT 0x80000000
|
!define RAM_NEEDED_FOR_64BIT 0x80000000
|
||||||
|
|
||||||
InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}"
|
InstallDir $LOCALAPPDATA\${APPNAME}
|
||||||
|
|
||||||
# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n)
|
# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n)
|
||||||
LicenseData "licenses\LICENSE.txt"
|
LicenseData "licenses\LICENSE.txt"
|
||||||
@ -132,11 +131,6 @@ Function .onInit
|
|||||||
# Admin installs have been migrated to user-mode installs.
|
# Admin installs have been migrated to user-mode installs.
|
||||||
# But I'm leaving it because I might need it again if I support service installs.
|
# But I'm leaving it because I might need it again if I support service installs.
|
||||||
StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
|
StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
|
||||||
UserInfo::GetAccountType
|
|
||||||
pop $0
|
|
||||||
${If} $0 != "admin"
|
|
||||||
StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
|
|
||||||
${EndIf}
|
|
||||||
!insertmacro MUI_LANGDLL_DISPLAY
|
!insertmacro MUI_LANGDLL_DISPLAY
|
||||||
#Call ShouldInstall64Bit
|
#Call ShouldInstall64Bit
|
||||||
# look for user installs
|
# look for user installs
|
||||||
@ -157,8 +151,8 @@ Function routerDetect
|
|||||||
|
|
||||||
createDirectory "$INSTDIR\"
|
createDirectory "$INSTDIR\"
|
||||||
SetOutPath "$INSTDIR\"
|
SetOutPath "$INSTDIR\"
|
||||||
File /a /r "I2P/config/certificates"
|
File /a /r "I2P\config\certificates\"
|
||||||
File /a /r "I2P/config/geoip"
|
File /a /r "I2P\config\geoip\"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function installerFunction
|
Function installerFunction
|
||||||
@ -168,11 +162,6 @@ Function installerFunction
|
|||||||
Sleep 500
|
Sleep 500
|
||||||
${LoopWhile} $0 <> 0
|
${LoopWhile} $0 <> 0
|
||||||
${EndIf}
|
${EndIf}
|
||||||
# delete the jpackaged file for safety. Remove this IMMEDIATELY after the next release.
|
|
||||||
# early-adopters and daily-build users may have to manually delete config files if they
|
|
||||||
# uninstall.
|
|
||||||
# RELATED: line 246
|
|
||||||
Delete "$INSTDIR\jpackaged"
|
|
||||||
|
|
||||||
# set the installation directory as the destination for the following actions
|
# set the installation directory as the destination for the following actions
|
||||||
createDirectory $INSTDIR
|
createDirectory $INSTDIR
|
||||||
@ -188,7 +177,7 @@ Function installerFunction
|
|||||||
# Install the licenses
|
# Install the licenses
|
||||||
createDirectory "$INSTDIR\licenses"
|
createDirectory "$INSTDIR\licenses"
|
||||||
SetOutPath "$INSTDIR\licenses"
|
SetOutPath "$INSTDIR\licenses"
|
||||||
File /a /r "licenses/*"
|
File /a /r "licenses\"
|
||||||
|
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
createDirectory "$SMPROGRAMS\${APPNAME}"
|
createDirectory "$SMPROGRAMS\${APPNAME}"
|
||||||
@ -197,6 +186,7 @@ Function installerFunction
|
|||||||
|
|
||||||
CreateShortCut "$DESKTOP\Browse I2P.lnk" "$INSTDIR\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
CreateShortCut "$DESKTOP\Browse I2P.lnk" "$INSTDIR\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||||
CreateShortCut "$DESKTOP\Browse I2P - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
CreateShortCut "$DESKTOP\Browse I2P - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||||
|
CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall I2P Easy-Install Bundle.lnk" "$INSTDIR\uninstall-i2pbrowser.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
|
|
||||||
SetShellVarContext current
|
SetShellVarContext current
|
||||||
@ -210,9 +200,8 @@ Function installerFunction
|
|||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
# create the uninstaller
|
# create the uninstaller
|
||||||
WriteUninstaller "$INSTDIR\uninstall-i2pbrowser.exe"
|
WriteUninstaller "$INSTDIR\uninstall-i2pbrowser.exe"
|
||||||
|
CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall I2P Easy-Install Bundle.lnk" "$INSTDIR\uninstall-i2pbrowser.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||||
|
|
||||||
# create a shortcut to the uninstaller
|
|
||||||
CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall-${APPNAME}.lnk" "$INSTDIR\uninstall-i2pbrowser.exe"
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
|
||||||
@ -223,6 +212,16 @@ SectionEnd
|
|||||||
|
|
||||||
# uninstaller section start
|
# uninstaller section start
|
||||||
Section "uninstall"
|
Section "uninstall"
|
||||||
|
# Don't try to uninstall until the router is fully shut down.
|
||||||
|
${un.FindProcess} "I2P.exe" $0
|
||||||
|
${If} $0 <> 0
|
||||||
|
MessageBox MB_OK "I2P is still running, uninstaller is paused. Uninstaller will continue after I2P has shut down."
|
||||||
|
${Do}
|
||||||
|
${un.FindProcess} "I2P.exe" $0
|
||||||
|
Sleep 500
|
||||||
|
${LoopWhile} $0 <> 0
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
# Uninstall the launcher scripts
|
# Uninstall the launcher scripts
|
||||||
rmDir /r "$INSTDIR\app"
|
rmDir /r "$INSTDIR\app"
|
||||||
rmDir /r "$INSTDIR\config"
|
rmDir /r "$INSTDIR\config"
|
||||||
@ -275,21 +274,9 @@ Function LaunchLink
|
|||||||
${If} ${Silent}
|
${If} ${Silent}
|
||||||
ReadEnvStr $0 RESTART_I2P
|
ReadEnvStr $0 RESTART_I2P
|
||||||
${If} $0 != ""
|
${If} $0 != ""
|
||||||
UserInfo::GetAccountType
|
|
||||||
pop $0
|
|
||||||
${If} $0 == "admin"
|
|
||||||
ShellExecAsUser::ShellExecAsUser "open" "$DESKTOP\Browse I2P.lnk"
|
|
||||||
${Else}
|
|
||||||
ExecShell "" "$DESKTOP\Browse I2P.lnk"
|
ExecShell "" "$DESKTOP\Browse I2P.lnk"
|
||||||
${EndIf}
|
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${Else}
|
${Else}
|
||||||
UserInfo::GetAccountType
|
|
||||||
pop $0
|
|
||||||
${If} $0 == "admin"
|
|
||||||
ShellExecAsUser::ShellExecAsUser "open" "$DESKTOP\Browse I2P.lnk"
|
|
||||||
${Else}
|
|
||||||
ExecShell "" "$DESKTOP\Browse I2P.lnk"
|
ExecShell "" "$DESKTOP\Browse I2P.lnk"
|
||||||
${EndIf}
|
|
||||||
${EndIf}
|
${EndIf}
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -1 +0,0 @@
|
|||||||
!define I2P_VERSION 1.9.7
|
|
@ -1,3 +1,3 @@
|
|||||||
!define VERSIONMAJOR 1
|
!define VERSIONMAJOR 2
|
||||||
!define VERSIONMINOR 9
|
!define VERSIONMINOR 2
|
||||||
!define VERSIONBUILD 7
|
!define VERSIONBUILD 1
|
||||||
|
38
src/win/torbrowser-windows.sh
Executable file
38
src/win/torbrowser-windows.sh
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TORSOCKS=$(which torsocks)
|
||||||
|
#if [ -f "${TORSOCKS}" ]; then
|
||||||
|
# . "${TORSOCKS}" on
|
||||||
|
#fi
|
||||||
|
|
||||||
|
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
|
||||||
|
locale="en-US" # mention your locale. default = en-US
|
||||||
|
if [ -d /etc/default/locale ]; then
|
||||||
|
. /etc/default/locale
|
||||||
|
locale=$(echo "${LANG}" | cut -d . -f1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ./tor.keyring ]; then
|
||||||
|
gpg --auto-key-locate nodefault,wkd --locate-keys torbrowser@torproject.org
|
||||||
|
gpg --output ./tor.keyring --export torbrowser@torproject.org
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "tor-browser-linux64-${version}_${locale}.exe" ]; then
|
||||||
|
wget -cv "https://www.torproject.org/dist/torbrowser/${version}/torbrowser-install-win64-${version}_${locale}.exe"
|
||||||
|
wget -cv "https://www.torproject.org/dist/torbrowser/${version}/torbrowser-install-win64-${version}_${locale}.exe.asc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
gpgv --keyring ./tor.keyring "torbrowser-install-win64-${version}_${locale}.exe.asc" "torbrowser-install-win64-${version}_${locale}.exe"
|
||||||
|
|
||||||
|
#tar xvJf "torbrowser-install-win64-${version}_${locale}.exe"
|
||||||
|
#for n in `seq 1 2000`; do echo $n; dd ibs=256 if="torbrowser-install-win64-${version}_${locale}.exe" count=2 skip=$n | file - ; done 2>/dev/null |less
|
||||||
|
#zip -FF "torbrowser-install-win64-${version}_${locale}.exe" --out extracted.zip
|
||||||
|
WINE=$(which wine)
|
||||||
|
if [ -z "$WINE" ]; then
|
||||||
|
"./torbrowser-install-win64-${version}_${locale}.exe" /S #/D .
|
||||||
|
cp -vr "$HOME/Desktop/Tor Browser/" "Tor Browser"
|
||||||
|
else
|
||||||
|
export WINEPREFIX=$(pwd)/../tmp
|
||||||
|
$WINE "torbrowser-install-win64-${version}_${locale}.exe" /S #/D .
|
||||||
|
cp -vr "$WINEPREFIX/drive_c/users/idk/Desktop/Tor Browser/" "Tor Browser"
|
||||||
|
fi
|
15
unsigned.sh
15
unsigned.sh
@ -1,15 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
|
||||||
|
|
||||||
. "$SCRIPT_DIR/config.sh"
|
|
||||||
|
|
||||||
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
|
|
||||||
. "$SCRIPT_DIR/config_override.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
./clean.sh
|
|
||||||
wsl make distclean
|
|
||||||
./build.sh
|
|
||||||
wsl make
|
|
Reference in New Issue
Block a user