Compare commits
63 Commits
i2p-firefo
...
master
Author | SHA1 | Date | |
---|---|---|---|
d013060249 | |||
1e19c61d8c | |||
48d08076f7 | |||
8c7ad5a905 | |||
7165629f52 | |||
4c28feea8c | |||
8a22bb8277 | |||
56b3317184 | |||
de8420c5b2 | |||
80dfa2498c | |||
a60da07d5a | |||
ccd2edbc20 | |||
5a2143a5b0 | |||
87e4b3d0d6 | |||
e50c862903 | |||
3050624b81 | |||
e1cbbbf284 | |||
1a18d38522 | |||
78ad39e142 | |||
919be083e1 | |||
3d48629a40 | |||
5f9df2cb9a | |||
a1f093f0b0 | |||
55e10a1633 | |||
0f470f08ff | |||
1ea7ccb671 | |||
e3e9d71f62 | |||
d2cb4e7dac | |||
d3bc6ffc89 | |||
0c7e4a9fd6 | |||
0f271a9013 | |||
a01b11ecb0 | |||
0eea4f9fcb | |||
acb936a675 | |||
45f64db3cd | |||
3769d7a74c | |||
45873071fb | |||
a96502d5c1 | |||
83d02cf379 | |||
1463e62c2a | |||
1611312f25 | |||
1e4d327ca2 | |||
045c6dbfbd | |||
e13156005f | |||
1a3d0743ab | |||
a41a4824fe | |||
093ac9fe5d | |||
855887da6b | |||
9ecd701462 | |||
66f77fec8d | |||
8471360a63 | |||
c006fb0ca8 | |||
39a457d314 | |||
216f075f32 | |||
4d3e700ec3 | |||
0fc103b777 | |||
e7ff841eb5 | |||
a4ce1b9a8b | |||
021c1cd1ba | |||
d06a8bb4bf | |||
95c045e97c | |||
3047f70164 | |||
c53baa20e9 |
135
.github/workflows/ant-latest.yml
vendored
Normal file
135
.github/workflows/ant-latest.yml
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
|
||||
name: Java 22 CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Every day at midnight UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
nsis-jdk22:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: Vampire/setup-wsl@v3
|
||||
with:
|
||||
distribution: Ubuntu-20.04
|
||||
- name: Set git to use LF
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
git config --global user.email "github@i2p.net"
|
||||
git config --global user.name "eyedeekay Github CI Build"
|
||||
- uses: actions/checkout@v4
|
||||
- run: wsl apt-get update
|
||||
- run: wsl apt-get install -y nsis nsis-common nsis-pluginapi wget dos2unix curl jq gpg gettext
|
||||
- name: Set up JDK 22
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '22'
|
||||
distribution: 'temurin'
|
||||
- name: build with script
|
||||
run: bash -c "./buildscripts/unsigned.sh; ls *.exe"
|
||||
- name: Upload archived copy of I2P router source embedded in the build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: i2p.i2p.jpackage-build.tar.gz
|
||||
path: i2p.i2p.jpackage-build.tar.gz
|
||||
- name: Upload prebuilt jpackage bundle without any plugins or modded config
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-Prebuilt.zip
|
||||
path: I2P-Prebuilt.zip
|
||||
- name: Upload I2P-Easy-Install-Bundle-unsigned.exe
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-Easy-Install-Bundle-unsigned-jdk22.exe
|
||||
path: I2P-Easy-Install-Bundle-*.exe
|
||||
|
||||
buildjpackagexe-jdk22:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 22
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '22'
|
||||
distribution: 'temurin'
|
||||
- name: build with script
|
||||
run: bash -c "./buildscripts/exe.sh; ls *.exe"
|
||||
- name: Upload I2P-Easy-Install-Bundle-unsigned.exe
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-EXE-unsigned-jdk22.exe
|
||||
path: I2P-EXE-*.exe
|
||||
|
||||
buildjpackagmsi-jdk22:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 22
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '22'
|
||||
distribution: 'temurin'
|
||||
- name: build with script
|
||||
run: bash -c "./buildscripts/msi.sh; ls *.msi"
|
||||
- name: Upload I2P-Easy-Install-Bundle-unsigned.msi
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-MSI-unsigned-jdk22.msi
|
||||
path: I2P-MSI-*.msi
|
||||
|
||||
buildzip-jdk22:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: Vampire/setup-wsl@v3
|
||||
with:
|
||||
distribution: Ubuntu-20.04
|
||||
- name: Set git to use LF
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
git config --global user.email "github@i2p.net"
|
||||
git config --global user.name "eyedeekay Github CI Build"
|
||||
- uses: actions/checkout@v4
|
||||
- run: wsl apt-get update
|
||||
- run: wsl apt-cache search 7zip
|
||||
- run: wsl apt-get install -y nsis nsis-common nsis-pluginapi wget dos2unix curl jq gpg gettext zip p7zip-full ca-certificates
|
||||
- run: choco install wget
|
||||
- name: Set up JDK 22
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '22'
|
||||
distribution: 'temurin'
|
||||
- name: build with script
|
||||
run: bash -c "./buildscripts/zip.sh; ls -d * */* "
|
||||
- name: Upload I2P-windows-portable.zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-windows-portable-jdk22.zip
|
||||
path: I2P-windows-portable.zip
|
||||
|
||||
buildtgz-jdk22:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 22
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '22'
|
||||
distribution: 'temurin'
|
||||
- run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y nsis nsis-common nsis-pluginapi wget dos2unix curl jq gpg gettext
|
||||
- name: build with script
|
||||
run: ./buildscripts/targz.sh; ls *.tar.gz
|
||||
- name: Upload I2P.tar.gz
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-jdk22.tar.gz
|
||||
path: I2P.tar.gz
|
19
.github/workflows/ant.yml
vendored
19
.github/workflows/ant.yml
vendored
@ -1,7 +1,14 @@
|
||||
|
||||
name: Java CI
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Every day at midnight UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
@ -27,6 +34,16 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
- name: build with script
|
||||
run: bash -c "./buildscripts/unsigned.sh; ls *.exe"
|
||||
- name: Upload archived copy of I2P router source embedded in the build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: i2p.i2p.jpackage-build.tar.gz
|
||||
path: i2p.i2p.jpackage-build.tar.gz
|
||||
- name: Upload prebuilt jpackage bundle without any plugins or modded config
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: I2P-Prebuilt.zip
|
||||
path: I2P-Prebuilt.zip
|
||||
- name: Upload I2P-Easy-Install-Bundle-unsigned.exe
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
101
.github/workflows/release-nightly-latest.yml
vendored
Normal file
101
.github/workflows/release-nightly-latest.yml
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
name: Nightly Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Every day at midnight UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
changelog.txt
|
||||
docs/RELEASE.md
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: sleep 22 minutes
|
||||
run: |
|
||||
echo "sleeping 22 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 21 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 20 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 19 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 18 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 17 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 16 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 15 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 14 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 13 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 12 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 11 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 10 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 9 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 8 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 7 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 6 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 5 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 4 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 3 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 2 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 1 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
- name: Download artifacts
|
||||
id: download-artifact
|
||||
uses: dawidd6/action-download-artifact@v3
|
||||
with:
|
||||
skip_unpack: true
|
||||
workflow: ant-latest.yml
|
||||
if_no_artifact_found: fail
|
||||
# remove .zip file extension
|
||||
- run: for f in *.zip; do unzip "$f"; rm "$f"; done
|
||||
- run: cp changelog.txt changelog-java22.txt
|
||||
- run: echo "" | tee -a changelog-java22.txt
|
||||
- run: echo "## Checksums" | tee -a changelog-java22.txt
|
||||
- run: echo "" | tee -a changelog-java22.txt
|
||||
- run: echo '```' | tee -a changelog-java22.txt
|
||||
- run: sha256sum * | tee -a changelog-java22.txt
|
||||
- run: echo '```' | tee -a changelog-java22.txt
|
||||
- run: echo "" | tee -a changelog-java22.txt
|
||||
- run: echo '```' | tee -a changelog-java22.txt
|
||||
- run: file * | tee -a changelog-java22.txt
|
||||
- run: echo '```' | tee -a changelog-java22.txt
|
||||
- run: echo "" | tee -a changelog-java22.txt
|
||||
- run: cat docs/RELEASE.md changelog-java22.txt > RELEASE.md
|
||||
- name: Upload artifacts
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "*"
|
||||
prerelease: true
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
makeLatest: true
|
||||
tag: nightly
|
||||
bodyFile: "RELEASE.md"
|
96
.github/workflows/release-nightly.yml
vendored
Normal file
96
.github/workflows/release-nightly.yml
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
name: Nightly 22 Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Every day at midnight UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
changelog.txt
|
||||
docs/RELEASE.md
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: sleep 15 minutes
|
||||
run: |
|
||||
echo "sleeping 20 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 19 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 18 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 17 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 16 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 15 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 14 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 13 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 12 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 11 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 10 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 9 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 8 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 7 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 6 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 5 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 4 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 3 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 2 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
echo "sleeping 1 minutes to wait for artifacts"
|
||||
sleep 1m
|
||||
- name: Download artifacts
|
||||
id: download-artifact
|
||||
uses: dawidd6/action-download-artifact@v3
|
||||
with:
|
||||
skip_unpack: true
|
||||
workflow: ant.yml
|
||||
if_no_artifact_found: fail
|
||||
# remove .zip file extension
|
||||
- run: for f in *.zip; do unzip "$f"; rm "$f"; done
|
||||
- run: echo "" | tee -a changelog.txt
|
||||
- run: echo "## Checksums" | tee -a changelog.txt
|
||||
- run: echo "" | tee -a changelog.txt
|
||||
- run: echo '```' | tee -a changelog.txt
|
||||
- run: sha256sum * | tee -a changelog.txt
|
||||
- run: echo '```' | tee -a changelog.txt
|
||||
- run: echo "" | tee -a changelog.txt
|
||||
- run: echo '```' | tee -a changelog.txt
|
||||
- run: file * | tee -a changelog.txt
|
||||
- run: echo '```' | tee -a changelog.txt
|
||||
- run: echo "" | tee -a changelog.txt
|
||||
- run: cat docs/RELEASE.md changelog.txt > RELEASE.md
|
||||
- name: Upload artifacts
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "*"
|
||||
prerelease: true
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
makeLatest: true
|
||||
tag: nightly
|
||||
bodyFile: "RELEASE.md"
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -1,7 +1,5 @@
|
||||
name: Release
|
||||
|
||||
#on: [push]
|
||||
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
|
66
.github/workflows/sync.yaml
vendored
Normal file
66
.github/workflows/sync.yaml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
# GitHub Actions workflow file to sync an external repository to this GitHub mirror.
|
||||
# This file was automatically generated by go-github-sync.
|
||||
#
|
||||
# The workflow does the following:
|
||||
# - Runs on a scheduled basis (and can also be triggered manually)
|
||||
# - Clones the GitHub mirror repository
|
||||
# - Fetches changes from the primary external repository
|
||||
# - Applies those changes to the mirror repository
|
||||
# - Pushes the updated content back to the GitHub mirror
|
||||
#
|
||||
# Authentication is handled by the GITHUB_TOKEN secret provided by GitHub Actions.
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Validate Github Actions Environment
|
||||
run: if [ "$GITHUB_ACTIONS" != "true" ]; then echo 'This script must be run in a GitHub Actions environment.'; exit 1; fi
|
||||
- name: Checkout GitHub Mirror
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Configure Git
|
||||
run: |-
|
||||
git config user.name 'GitHub Actions'
|
||||
git config user.email 'actions@github.com'
|
||||
- env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: Sync Primary Repository
|
||||
run: |-
|
||||
# Add the primary repository as a remote
|
||||
git remote add primary https://i2pgit.org/I2P_Developers/i2p.firefox.git
|
||||
|
||||
# Fetch the latest changes from the primary repository
|
||||
git fetch primary
|
||||
|
||||
# Check if the primary branch exists in the primary repository
|
||||
if git ls-remote --heads primary master | grep -q master; then
|
||||
echo "Primary branch master found in primary repository"
|
||||
else
|
||||
echo "Error: Primary branch master not found in primary repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if we're already on the mirror branch
|
||||
if git rev-parse --verify --quiet master; then
|
||||
git checkout master
|
||||
else
|
||||
# Create the mirror branch if it doesn't exist
|
||||
git checkout -b master
|
||||
fi
|
||||
|
||||
|
||||
# Force-apply all changes from primary, overriding any conflicts
|
||||
echo "Performing force sync from primary/master to master"
|
||||
git reset --hard primary/master
|
||||
|
||||
|
||||
# Push changes back to the mirror repository
|
||||
git push origin master
|
||||
name: Sync Primary Repository to GitHub Mirror
|
||||
"on":
|
||||
push: {}
|
||||
schedule:
|
||||
- cron: 0 * * * *
|
||||
workflow_dispatch: {}
|
@ -95,8 +95,8 @@ Windows Build
|
||||
-------------
|
||||
|
||||
After installing the dependencies and completing the preparations,
|
||||
just run `make`. This will produce the install.exe - the windows
|
||||
installer, which sets up the shortcuts to launch Firefox on Windows.
|
||||
just run `buildscripts/unsigned.sh`. This will produce the install.exe - the
|
||||
windows installer, which sets up the shortcuts to launch Firefox on Windows.
|
||||
Building without a jpackage is no longer supported.
|
||||
|
||||
When generating a build it's important to make sure that the
|
||||
@ -137,7 +137,7 @@ Ubuntu in WSL.
|
||||
7. Move into the i2p.firefox directory. Run the `./buildscripts/build.sh` script.
|
||||
|
||||
cd i2p.firefox
|
||||
./buildscripts/build.sh
|
||||
./buildscripts/unsigned.sh
|
||||
|
||||
8. Compile the NSIS installer using WSL.
|
||||
|
||||
@ -178,8 +178,7 @@ Doing a Release
|
||||
|
||||
Once you have the installer `.exe` file produced by NSIS, you're almost ready to
|
||||
do a release. As a final step, someone must sign the `.exe` file using a
|
||||
Certificate which Windows will recognize. The current signer of the Windows
|
||||
bundle is Zlatinb. Standard Windows signing tools are used.
|
||||
Certificate which Windows will recognize. Standard Windows signing tools are used.
|
||||
|
||||
```sh
|
||||
./release.sh
|
||||
|
@ -55,7 +55,12 @@ 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" \
|
||||
if echo "$I2P_VERSION" | grep "master"; then
|
||||
RELEASE_VERSION="9.9.9"
|
||||
else
|
||||
RELEASE_VERSION="$I2P_VERSION"
|
||||
fi
|
||||
"$JAVA_HOME"/bin/jpackage --type app-image --name I2P --app-version "$RELEASE_VERSION" \
|
||||
--verbose \
|
||||
--java-options "-Xmx512m" \
|
||||
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
|
||||
@ -80,4 +85,5 @@ 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
|
||||
cp -rv src/I2P/config build/I2P/config
|
||||
zip -r I2P-Prebuilt.zip build/I2P/
|
@ -8,7 +8,12 @@ cd "$SCRIPT_DIR" || exit 1
|
||||
. ./config.sh
|
||||
. ./i2pversion
|
||||
./buildscripts/build.sh
|
||||
jpackage --name I2P-EXE --app-version "$I2P_VERSION" \
|
||||
if echo "$I2P_VERSION" | grep "master"; then
|
||||
RELEASE_VERSION="9.9.9"
|
||||
else
|
||||
RELEASE_VERSION="$I2P_VERSION"
|
||||
fi
|
||||
jpackage --name I2P-EXE --app-version "$RELEASE_VERSION" \
|
||||
--verbose \
|
||||
--java-options "-Xmx512m" \
|
||||
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
|
||||
|
@ -48,9 +48,16 @@ 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/"
|
||||
if [ -d "$SCRIPT_DIR/../i2p.i2p/" ]; then
|
||||
echo cloning from local i2p.i2p checkout
|
||||
git clone --depth=1 -b "$VERSION" -l "$SCRIPT_DIR/../i2p.i2p/" "$SCRIPT_DIR/../i2p.i2p.jpackage-build/"
|
||||
else
|
||||
echo cloning from remote i2p.i2p repository
|
||||
git clone --depth=1 -b "$VERSION" https://i2pgit.org/I2P_Developers/i2p.i2p "$SCRIPT_DIR/../i2p.i2p.jpackage-build/"
|
||||
fi
|
||||
fi
|
||||
cd "$SCRIPT_DIR/../i2p.i2p.jpackage-build/"
|
||||
echo "setting up git branch for build"
|
||||
OLDEXTRA=$(find . -name RouterVersion.java -exec grep 'String EXTRA' {} \;)
|
||||
if [ -z "$EXTRA" ]; then
|
||||
export EXTRACODE="win"
|
||||
@ -58,12 +65,10 @@ if [ -z "$EXTRA" ]; then
|
||||
fi
|
||||
if [ "$VERSION" = master ]; then
|
||||
VERSIONDATE="$(date +%m%d)"
|
||||
export TAG_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
else
|
||||
export TAG_VERSION="$VERSION"
|
||||
fi
|
||||
|
||||
|
||||
echo "build is: i2p-$TAG_VERSION-$VERSIONDATE-$EXTRACODE"
|
||||
|
||||
find . -name RouterVersion.java -exec sed -i "s|$OLDEXTRA|$EXTRA|g" {} \;
|
||||
git switch - || :
|
||||
@ -82,7 +87,7 @@ 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"
|
||||
rm -rf "$SCRIPT_DIR/src/I2P/config/geoip" "$SCRIPT_DIR/src/I2P/config/webapps" "$SCRIPT_DIR/src/I2P/config/certificates" "$SCRIPT_DIR/src/I2P/config/eepsite"
|
||||
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
|
||||
@ -115,11 +120,11 @@ if [ ! -f "$SCRIPT_DIR/build/i2pfirefox.zip" ]; then
|
||||
wget_download "https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/$I2PFIREFOX_VERSION/plugin.zip" -O "$SCRIPT_DIR/build/i2pfirefox.zip"
|
||||
fi
|
||||
|
||||
if [ ! -d "$SCRIPT_DIR/build/I2P/config/plugins/i2pfirefox" ]; then
|
||||
mkdir -p "$SCRIPT_DIR/build/I2P/config/plugins/"
|
||||
unzip "$SCRIPT_DIR/build/i2pfirefox.zip" -d "$SCRIPT_DIR/build/I2P/config/plugins/"
|
||||
rm -rf "$SCRIPT_DIR/build/I2P/config/plugins/i2pfirefox"
|
||||
mv "$SCRIPT_DIR/build/I2P/config/plugins/plugin" "$SCRIPT_DIR/build/I2P/config/plugins/i2pfirefox"
|
||||
if [ ! -d "$SCRIPT_DIR/src/I2P/config/plugins/i2pfirefox" ]; then
|
||||
mkdir -p "$SCRIPT_DIR/src/I2P/config/plugins/"
|
||||
unzip "$SCRIPT_DIR/build/i2pfirefox.zip" -d "$SCRIPT_DIR/src/I2P/config/plugins/"
|
||||
rm -rf "$SCRIPT_DIR/src/I2P/config/plugins/i2pfirefox"
|
||||
mv "$SCRIPT_DIR/src/I2P/config/plugins/plugin" "$SCRIPT_DIR/src/I2P/config/plugins/i2pfirefox"
|
||||
fi
|
||||
|
||||
for dll in "$I2P_JBIGI/"*windows*.dll; do
|
||||
@ -128,12 +133,11 @@ 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/WindowsAppUtil.java \
|
||||
net/i2p/router/I2PAppUtil.java \
|
||||
net/i2p/router/WinUpdatePostProcessor.java \
|
||||
net/i2p/router/WindowsAppUtil.java \
|
||||
net/i2p/router/WindowsServiceUtil.java \
|
||||
net/i2p/router/WinLauncher.java \
|
||||
net/i2p/router/WinUpdatePostProcessor.java \
|
||||
net/i2p/router/WinUpdateProcess.java \
|
||||
net/i2p/router/ZipUpdateProcess.java
|
||||
|
||||
|
@ -9,7 +9,12 @@ cd "$SCRIPT_DIR" || exit 1
|
||||
. ./i2pversion
|
||||
|
||||
"$SCRIPT_DIR"/buildscripts/build.sh
|
||||
jpackage --name I2P-MSI --app-version "$I2P_VERSION" \
|
||||
if echo "$I2P_VERSION" | grep "master"; then
|
||||
RELEASE_VERSION="9.9.9"
|
||||
else
|
||||
RELEASE_VERSION="$I2P_VERSION"
|
||||
fi
|
||||
jpackage --name I2P-MSI --app-version "$RELEASE_VERSION" \
|
||||
--verbose \
|
||||
--java-options "-Xmx512m" \
|
||||
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
|
||||
|
@ -29,14 +29,14 @@ fi
|
||||
|
||||
|
||||
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -t "$I2P_VERSION"
|
||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -t "$I2P_VERSION"
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -t "i2p-firefox-$I2P_VERSION"
|
||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -t "i2p-firefox-$I2P_VERSION"
|
||||
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P.zip" -t "$I2P_VERSION"
|
||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P.zip" -t "$I2P_VERSION"
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P-windows-portable.zip" -t "$I2P_VERSION"
|
||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "I2P-windows-portable.zip" -t "i2p-firefox-$I2P_VERSION"
|
||||
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "i2p.i2p.jpackage-build.tar.gz" -t "$I2P_VERSION"
|
||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "i2p.i2p.jpackage-build.tar.gz" -t "$I2P_VERSION"
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "i2p.i2p.jpackage-build.tar.gz" -t "i2p-firefox-$I2P_VERSION"
|
||||
github-release download -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "i2p.i2p.jpackage-build.tar.gz" -t "i2p-firefox-$I2P_VERSION"
|
||||
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r i2p -t "$I2P_VERSION" -n "./I2P-jpackage-windows-$I2P_VERSION.zip"
|
||||
github-release download -u "$GITHUB_USERNAME" -r i2p -t "$I2P_VERSION" -n "./I2P-jpackage-windows-$I2P_VERSION.zip"
|
||||
echo github-release download -u "$GITHUB_USERNAME" -r i2p.firefox -t "i2p-firefox-$I2P_VERSION" -n "./I2P-jpackage-windows-$I2P_VERSION.zip"
|
||||
github-release download -u "$GITHUB_USERNAME" -r i2p.firefox -t "i2p-firefox-$I2P_VERSION" -n "./I2P-jpackage-windows-$I2P_VERSION.zip"
|
||||
|
@ -36,13 +36,13 @@ java -cp "$I2P_LIBS/*" net.i2p.crypto.SU3File sign -c ROUTER -f EXE I2P-Easy-Ins
|
||||
rm -f i2pwinupdate.su3.torrent
|
||||
cp -v I2P-Easy-Install-Bundle-$I2P_VERSION-signed.su3 i2pwinupdate.su3
|
||||
|
||||
java -cp "$I2P_LIBS/*" "org.klomp.snark.Storage" -a http://tracker2.postman.i2p/announce.php -a http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/a -a http://mb5ir7klpc2tj6ha3xhmrs3mseqvanauciuoiamx2mmzujvg67uq.b32.i2p/a -c "$SIGNER" -m "Official torrent for Windows Easy-Install version $I2P_VERSION" i2pwinupdate.su3
|
||||
java -cp "$I2P_LIBS/*" "org.klomp.snark.Storage" -a http://tracker2.postman.i2p/announce.php -c "$SIGNER" -m "Official torrent for Windows Easy-Install version $I2P_VERSION" i2pwinupdate.su3
|
||||
echo "~~~~~~~~~~"
|
||||
MAGNET=$(transmission-show -m "i2pwinupdate.su3.torrent" 2>&1 3>&1 | tail -n 1)
|
||||
echo "$MAGNET"
|
||||
ZIPCHECKSUM=$(sha256sum "i2pwinupdate.su3")
|
||||
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3"
|
||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3"
|
||||
echo github-release upload -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3"
|
||||
github-release upload -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3"
|
||||
ZIPCHECKSUM=$(sha256sum "i2pwinupdate.su3.torrent")
|
||||
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3.torrent"
|
||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3.torrent"
|
||||
echo github-release upload -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3.torrent"
|
||||
github-release upload -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "i2p-firefox-$I2P_VERSION" -n "i2pwinupdate.su3.torrent"
|
5
buildscripts/wine-jpackage.sh
Normal file
5
buildscripts/wine-jpackage.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
|
||||
cd "$SCRIPT_DIR" || exit 1
|
||||
|
@ -1,3 +1,7 @@
|
||||
2025-06-05 idk
|
||||
* Remove Chromium support completely. Much smaller binary now.
|
||||
* Version 2.9.0
|
||||
|
||||
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.
|
||||
|
@ -1,15 +1,3 @@
|
||||
# I2P Easy-Install Bundle for Windows 2.5.0
|
||||
# I2P Easy-Install 2.8.0
|
||||
|
||||
This is a pre-release of the I2P Easy-Install Bundle for Windows.
|
||||
|
||||
## 2.5.0 Release Notes.
|
||||
|
||||
This release, I2P 2.5.0, provides more user-facing improvements than the 2.4.0 release, which was focused on implementing the NetDB isolation strategy.
|
||||
|
||||
New features have been added to I2PSnark like the ability to search through torrents. Bugs have been fixed to improve compatibility with other I2P torrent clients like BiglyBT and qBittorrent. We would like to thank all of the developers who have worked with libtorrent and qBittorrent to enable and improve their I2P support. New features have also been added to SusiMail including support for Markdown formatting in emails and the ability to drag-and-drop attachments into emails. Tunnels created with the Hidden Services manager now support "Keepalive" which improves performance and compatibility with web technologies, enabling more sophisticated I2P sites.
|
||||
|
||||
During this release we also made several tweaks to the NetDB to improve its resilience to spam and to improve the router's ability to reject suspicious messages. This was part of an effort to "audit" the implementation of "Sub-DB isolation" defenses from the 2.4.0 release. This investigation uncovered one minor isolation-piercing event which we repaired. This issue was discovered and fixed internally by the I2P team.
|
||||
|
||||
During this release several improvements were made to the process of releasing our downstream distributions for Android and Windows. This should result in improved delivery and availability for these downstream products.
|
||||
|
||||
As usual, we recommend that you update to this release. The best way to maintain security and help the network is to run the latest release.
|
||||
This release updates the embedded I2P router to I2P 2.8.0.
|
||||
|
36
i2pversion
36
i2pversion
@ -4,26 +4,36 @@ JNA_VERSION=5.12.1
|
||||
export JNA_VERSION=5.12.1
|
||||
|
||||
export GITHUB_TAG=$(git describe --tags --abbrev=0 | sed 's|i2p||g' | tr -d [a-z-])
|
||||
VERSIONMAJOR=$(echo "$GITHUB_TAG" | cut -d . -f 1)
|
||||
VERSIONMINOR=$(echo "$GITHUB_TAG" | cut -d . -f 2)
|
||||
VERSIONBUILD=$(echo "$GITHUB_TAG" | cut -d . -f 3)
|
||||
if [ -z "$VERSIONBUILD" ]; then
|
||||
VERSIONBUILD=2
|
||||
if [ -z "$VERSIONMAJOR" ]; then
|
||||
VERSIONMAJOR=$(echo "$GITHUB_TAG" | cut -d . -f 1)
|
||||
fi
|
||||
if [ -z "$VERSIONMINOR" ]; then
|
||||
VERSIONMINOR=4
|
||||
VERSIONMINOR=$(echo "$GITHUB_TAG" | cut -d . -f 2)
|
||||
fi
|
||||
if [ -z "$VERSIONBUILD" ]; then
|
||||
VERSIONBUILD=$(echo "$GITHUB_TAG" | cut -d . -f 3)
|
||||
fi
|
||||
if [ -z "$VERSIONMAJOR" ]; then
|
||||
VERSIONMAJOR=0
|
||||
I2P_VERSION="master"
|
||||
export I2P_VERSION="master"
|
||||
VERSION="master"
|
||||
export VERSION="master"
|
||||
I2PFIREFOX_VERSION="2.9.0"
|
||||
export I2PFIREFOX_VERSION="2.9.0"
|
||||
else
|
||||
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
VERSION="i2p-$I2P_VERSION"
|
||||
export VERSION="i2p-$I2P_VERSION"
|
||||
I2PFIREFOX_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
export I2PFIREFOX_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
fi
|
||||
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
|
||||
# Comment this out to build from an alternate branch or
|
||||
# the tip of the master branch.
|
||||
#VERSION=i2p-2.4.0
|
||||
#export VERSION=i2p-2.4.0
|
||||
VERSION=master
|
||||
export VERSION=master
|
||||
|
||||
I2PFIREFOX_VERSION=$I2P_VERSION
|
||||
export I2PFIREFOX_VERSION=$I2P_VERSION
|
||||
echo "I2P version $I2P_VERSION"
|
||||
echo "Tag $VERSION"
|
||||
echo "I2P Firefox Profile version $I2PFIREFOX_VERSION"
|
||||
|
@ -1,150 +0,0 @@
|
||||
package net.i2p.router;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class CopyConfigDir extends I2PAppUtil {
|
||||
final Log logger;
|
||||
|
||||
public CopyConfigDir(RouterContext ctx) {
|
||||
logger = ctx.logManager().getLog(CopyConfigDir.class);
|
||||
}
|
||||
|
||||
public boolean copyDirectory(String baseDir, String workDir) {
|
||||
File baseFile = new File(baseDir);
|
||||
File workFile = new File(workDir);
|
||||
return copyDirectory(baseFile, workFile);
|
||||
}
|
||||
|
||||
public boolean copyDirectory(File baseDir, File workDir) {
|
||||
for (File file : baseDir.listFiles()) {
|
||||
String fPath = file.getAbsolutePath().replace(
|
||||
file.getParentFile().getAbsolutePath(), "");
|
||||
String newPath = workDir.toString() + fPath;
|
||||
if (file.isDirectory())
|
||||
if (copyDirectory(file, new File(newPath)))
|
||||
return false;
|
||||
if (file.isFile())
|
||||
if (0 == copyFile(file, new File(newPath), true))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean copyConfigDirectory(File baseDir, File workDir) {
|
||||
for (File file : baseDir.listFiles()) {
|
||||
// System.out.println(file.getAbsolutePath());
|
||||
String fPath = file.getAbsolutePath().replace(
|
||||
file.getParentFile().getAbsolutePath(), "");
|
||||
String newPath = workDir.toString() + fPath;
|
||||
if (file.isDirectory())
|
||||
if (!copyConfigDirectory(file, new File(newPath)))
|
||||
return false;
|
||||
if (file.isFile()) {
|
||||
int cnr = copyFileNeverOverwrite(file, new File(newPath));
|
||||
if (0 == cnr)
|
||||
return false;
|
||||
if (1 == cnr) {
|
||||
logger.info(
|
||||
"using jpackaged configs in a jpackaged install, creating jpackaged file");
|
||||
File jpackagedConfigsInUse = new File(appImageHome(), "jpackaged");
|
||||
if (!jpackagedConfigsInUse.exists()) {
|
||||
try {
|
||||
jpackagedConfigsInUse.createNewFile();
|
||||
} catch (IOException e) {
|
||||
logger.warn(
|
||||
"Error creating jpackaged file, delete config files manually when uninstalling");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-1 == cnr) {
|
||||
logger.info(
|
||||
"not overwriting existing config file, not creating jpackaged file");
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public int copyFileNeverOverwrite(String basePath, String workPath) {
|
||||
File baseFile = new File(basePath);
|
||||
File workFile = new File(workPath);
|
||||
return copyFileNeverOverwrite(baseFile, workFile);
|
||||
}
|
||||
|
||||
public int copyFileNeverOverwrite(File basePath, File workPath) {
|
||||
return copyFile(basePath, workPath, false);
|
||||
}
|
||||
|
||||
public int copyFile(File basePath, File workPath, boolean overWrite) {
|
||||
if (!basePath.exists()) {
|
||||
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!overWrite && workPath.exists()) {
|
||||
logger.info(workPath.getAbsolutePath() +
|
||||
" already exists, not overwriting");
|
||||
return -1;
|
||||
}
|
||||
|
||||
File workDir = workPath.getParentFile();
|
||||
if (!workDir.exists()) {
|
||||
workDir.mkdirs();
|
||||
}
|
||||
try (InputStream in =
|
||||
new BufferedInputStream(new FileInputStream(basePath));
|
||||
OutputStream out =
|
||||
new BufferedOutputStream(new FileOutputStream(workPath))) {
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
int lengthRead;
|
||||
while ((lengthRead = in.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, lengthRead);
|
||||
out.flush();
|
||||
}
|
||||
in.close();
|
||||
out.close();
|
||||
return 1;
|
||||
} catch (Throwable e) {
|
||||
logger.warn(e.toString());
|
||||
logger.warn("failed to copy " + basePath.getAbsolutePath() + " to " +
|
||||
workPath.getAbsolutePath());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean copyConfigDir() {
|
||||
File appImageConfigDir = appImageConfig();
|
||||
File appImageHomeDir = selectHome();
|
||||
return copyConfigDirectory(appImageConfigDir, appImageHomeDir);
|
||||
}
|
||||
|
||||
/**
|
||||
* set up the path to the log file
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected File logFile() { return logFile("launcher.log"); }
|
||||
|
||||
/**
|
||||
* set up the path to the log file
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected File logFile(String p) {
|
||||
File log = new File(selectHome(), "logs");
|
||||
if (!log.exists())
|
||||
log.mkdirs();
|
||||
return new File(log, p);
|
||||
}
|
||||
}
|
@ -3,8 +3,10 @@ package net.i2p.router;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import javax.swing.JOptionPane;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
public class I2PAppUtil extends WindowsAppUtil {
|
||||
|
||||
public String ServiceUpdaterString() {
|
||||
return "http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/news.su3";
|
||||
}
|
||||
@ -78,29 +80,4 @@ public class I2PAppUtil extends WindowsAppUtil {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the path to the binary of the app-image root by getting the path to
|
||||
* java.home and the OS, and traversing up to the app-image root based on that
|
||||
* information, then getting the binary path on a per-platform basis. The path
|
||||
* returned will be relative to the root.
|
||||
*
|
||||
* @return the app-image root
|
||||
*/
|
||||
protected String appImageExe() {
|
||||
File aih = appImageHome();
|
||||
if (aih != null) {
|
||||
// get the name of the aih directory itself, which will be the default
|
||||
// name of the executable as well
|
||||
String baseName = "I2P";
|
||||
switch (osName()) {
|
||||
case "windows":
|
||||
return baseName + ".exe";
|
||||
case "mac":
|
||||
case "linux":
|
||||
return "./bin/" + baseName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -25,20 +25,20 @@ import net.i2p.util.Log;
|
||||
* router.pid - the pid of the java process.
|
||||
*/
|
||||
public class WinLauncher extends I2PAppUtil {
|
||||
private final CopyConfigDir copyConfigDir;
|
||||
// private final CopyConfigDir copyConfigDir;
|
||||
WinUpdatePostProcessor wupp = null;
|
||||
private Router i2pRouter;
|
||||
private final Log logger;
|
||||
|
||||
public WinLauncher() {
|
||||
File programs = programFile();
|
||||
File home = homeDir();
|
||||
|
||||
System.setProperty(
|
||||
"i2p.dir.base",
|
||||
new File(programs.getAbsolutePath(), "config").getAbsolutePath());
|
||||
System.setProperty("i2p.dir.config", home.getAbsolutePath());
|
||||
appImageConfig().getAbsolutePath());
|
||||
System.setProperty("i2p.dir.config", appImageConfig().getAbsolutePath());
|
||||
System.setProperty("router.pid",
|
||||
String.valueOf(ProcessHandle.current().pid()));
|
||||
String.valueOf(ProcessHandle.current().pid()));
|
||||
/**
|
||||
* IMPORTANT: You must set user.dir to the same directory where the
|
||||
* jpackage is intstalled, or when the launcher tries to re-run itself
|
||||
@ -48,7 +48,8 @@ public class WinLauncher extends I2PAppUtil {
|
||||
System.setProperty("user.dir", programs.getAbsolutePath());
|
||||
|
||||
i2pRouter = new Router(routerConfig(), System.getProperties());
|
||||
copyConfigDir = new CopyConfigDir(i2pRouter.getContext());
|
||||
this.setLog(i2pRouter.getContext().logManager().getLog(WindowsAppUtil.class));
|
||||
// copyConfigDir = new CopyConfigDir(i2pRouter.getContext());
|
||||
logger = i2pRouter.getContext().logManager().getLog(WinLauncher.class);
|
||||
}
|
||||
|
||||
@ -75,15 +76,17 @@ public class WinLauncher extends I2PAppUtil {
|
||||
|
||||
// This actually does most of what we use NSIS for if NSIS hasn't
|
||||
// already done it, which essentially makes this whole thing portable.
|
||||
if (!launcher.copyConfigDir.copyConfigDir()) {
|
||||
launcher.logger.error("Cannot copy the configuration directory");
|
||||
System.exit(1);
|
||||
}
|
||||
/*
|
||||
* if (!launcher.copyConfigDir.copyConfigDir()) {
|
||||
* launcher.logger.error("Cannot copy the configuration directory");
|
||||
* System.exit(1);
|
||||
* }
|
||||
*/
|
||||
|
||||
if (!launcher.isInstalled("i2p")) {
|
||||
if (launcher.i2pRouter.saveConfig("routerconsole.browser", "NUL")) {
|
||||
launcher.logger.info("updated routerconsole.browser config " +
|
||||
launcher.appImageExe());
|
||||
launcher.appImageExe());
|
||||
}
|
||||
}
|
||||
launcher.logger.info("Router is configured");
|
||||
@ -110,25 +113,12 @@ public class WinLauncher extends I2PAppUtil {
|
||||
else if (!programs.isDirectory()) {
|
||||
logger.warn(
|
||||
programs +
|
||||
" exists but is not a directory. Please get it out of the way");
|
||||
" exists but is not a directory. Please get it out of the way");
|
||||
System.exit(1);
|
||||
}
|
||||
return programs;
|
||||
}
|
||||
|
||||
private File homeDir() {
|
||||
File home = selectHome();
|
||||
if (!home.exists())
|
||||
home.mkdirs();
|
||||
else if (!home.isDirectory()) {
|
||||
logger.warn(
|
||||
home +
|
||||
" exists but is not a directory. Please get it out of the way");
|
||||
System.exit(1);
|
||||
}
|
||||
return home;
|
||||
}
|
||||
|
||||
// see
|
||||
// https://stackoverflow.com/questions/434718/sockets-discover-port-availability-using-java
|
||||
private boolean isAvailable(int portNr) {
|
||||
@ -152,8 +142,7 @@ public class WinLauncher extends I2PAppUtil {
|
||||
sleep(1000);
|
||||
}
|
||||
UpdateManager um;
|
||||
while ((um = (UpdateManager)cam.getRegisteredApp(UpdateManager.APP_NAME)) ==
|
||||
null) {
|
||||
while ((um = (UpdateManager) cam.getRegisteredApp(UpdateManager.APP_NAME)) == null) {
|
||||
sleep(1000);
|
||||
}
|
||||
WinUpdatePostProcessor wupp = new WinUpdatePostProcessor(ctx);
|
||||
|
@ -31,12 +31,16 @@ public class WinUpdatePostProcessor implements UpdatePostProcessor {
|
||||
this._log = ctx.logManager().getLog(WinUpdatePostProcessor.class);
|
||||
}
|
||||
|
||||
public String getVersion() { return version; }
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public File getFile() { return positionedFile; }
|
||||
public File getFile() {
|
||||
return positionedFile;
|
||||
}
|
||||
|
||||
public void updateDownloadedandVerified(UpdateType type, int fileType,
|
||||
String version, File file)
|
||||
String version, File file)
|
||||
throws IOException {
|
||||
_log.info("Got an update to post-process");
|
||||
if (type != UpdateType.ROUTER_SIGNED_SU3 &&
|
||||
@ -97,12 +101,11 @@ public class WinUpdatePostProcessor implements UpdatePostProcessor {
|
||||
|
||||
private File workDir() throws IOException {
|
||||
if (this.ctx != null) {
|
||||
File workDir =
|
||||
new File(this.ctx.getConfigDir().getAbsolutePath(), "i2p_update_win");
|
||||
File workDir = new File(this.ctx.getConfigDir().getAbsolutePath(), "i2p_update_win");
|
||||
if (workDir.exists()) {
|
||||
if (workDir.isFile())
|
||||
throw new IOException(workDir +
|
||||
" exists but is a file, get it out of the way");
|
||||
" exists but is a file, get it out of the way");
|
||||
return null;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
|
@ -14,7 +14,7 @@ class WinUpdateProcess implements Runnable {
|
||||
private final Log _log;
|
||||
|
||||
WinUpdateProcess(RouterContext ctx, Supplier<String> versionSupplier,
|
||||
Supplier<File> fileSupplier) {
|
||||
Supplier<File> fileSupplier) {
|
||||
this.ctx = ctx;
|
||||
this.versionSupplier = versionSupplier;
|
||||
this.fileSupplier = fileSupplier;
|
||||
@ -23,12 +23,11 @@ class WinUpdateProcess implements Runnable {
|
||||
|
||||
private File workDir() throws IOException {
|
||||
if (ctx != null) {
|
||||
File workDir =
|
||||
new File(ctx.getConfigDir().getAbsolutePath(), "i2p_update_win");
|
||||
File workDir = new File(ctx.getConfigDir().getAbsolutePath(), "i2p_update_win");
|
||||
if (workDir.exists()) {
|
||||
if (workDir.isFile())
|
||||
throw new IOException(workDir +
|
||||
" exists but is a file, get it out of the way");
|
||||
" exists but is a file, get it out of the way");
|
||||
return workDir;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
@ -62,13 +61,13 @@ class WinUpdateProcess implements Runnable {
|
||||
|
||||
try {
|
||||
Process p = pb.directory(workingDir)
|
||||
.redirectErrorStream(true)
|
||||
.redirectOutput(logFile)
|
||||
.start();
|
||||
.redirectErrorStream(true)
|
||||
.redirectOutput(logFile)
|
||||
.start();
|
||||
exitCode = p.waitFor();
|
||||
if (exitCode != 0)
|
||||
_log.error("Update failed with exit code " + exitCode + " see " +
|
||||
logFile.getAbsolutePath() + " for more details");
|
||||
logFile.getAbsolutePath() + " for more details");
|
||||
} catch (IOException ex) {
|
||||
_log.error(
|
||||
"Unable to run update program in background. Update will fail.", ex);
|
||||
|
@ -2,8 +2,15 @@ package net.i2p.router;
|
||||
|
||||
import java.io.File;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
private Log _log;
|
||||
|
||||
public void setLog(Log log) {
|
||||
this._log = log;
|
||||
}
|
||||
|
||||
private File checkPathEnvironmentVariable(String name) {
|
||||
String path_override = System.getenv(name);
|
||||
if (path_override != null) {
|
||||
@ -31,10 +38,10 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
* relative to the root of the app-image on each platform:
|
||||
*
|
||||
* Windows - Root of appimage is 1 directory above directory named runtime
|
||||
* ./runtime
|
||||
* ./runtime
|
||||
*
|
||||
* Linux - Root of appimage is 2 directories above directory named runtime
|
||||
* ./lib/runtime
|
||||
* ./lib/runtime
|
||||
*
|
||||
* Mac OSX - Unknown for now
|
||||
*
|
||||
@ -61,11 +68,11 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
File jreHome = javaHome();
|
||||
if (jreHome != null) {
|
||||
switch (osName()) {
|
||||
case "windows":
|
||||
return jreHome.getAbsoluteFile().getParentFile();
|
||||
case "mac":
|
||||
case "linux":
|
||||
return jreHome.getAbsoluteFile().getParentFile().getParentFile();
|
||||
case "windows":
|
||||
return jreHome.getAbsoluteFile().getParentFile();
|
||||
case "mac":
|
||||
case "linux":
|
||||
return jreHome.getAbsoluteFile().getParentFile().getParentFile();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -77,7 +84,7 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
* information, then getting the binary path on a per-platform basis. The path
|
||||
* returned will be relative to the root.
|
||||
*
|
||||
* @return the app-image root
|
||||
* @return the app-image root + the path to the executable
|
||||
*/
|
||||
protected String appImageExe() {
|
||||
File aih = appImageHome();
|
||||
@ -86,11 +93,11 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
// name of the executable as well
|
||||
String baseName = aih.getName();
|
||||
switch (osName()) {
|
||||
case "windows":
|
||||
return baseName + ".exe";
|
||||
case "mac":
|
||||
case "linux":
|
||||
return "./bin/" + baseName;
|
||||
case "windows":
|
||||
return baseName + ".exe";
|
||||
case "mac":
|
||||
case "linux":
|
||||
return "./bin/" + baseName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -111,21 +118,29 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
}
|
||||
String osName = osName();
|
||||
switch (osName) {
|
||||
case "windows":
|
||||
File winConfigDir = new File(aih, "config");
|
||||
if (winConfigDir != null) {
|
||||
if (winConfigDir.exists()) {
|
||||
return winConfigDir;
|
||||
case "windows":
|
||||
File winConfigDir = new File(aih, "config");
|
||||
if (winConfigDir != null) {
|
||||
if (winConfigDir.exists()) {
|
||||
return winConfigDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
case "mac":
|
||||
case "linux":
|
||||
File linConfigDir = new File(aih, "lib/config");
|
||||
if (linConfigDir != null) {
|
||||
if (linConfigDir.exists()) {
|
||||
return linConfigDir;
|
||||
case "mac":
|
||||
case "linux":
|
||||
File linConfigDir = new File(aih, "lib/config");
|
||||
if (linConfigDir != null) {
|
||||
if (linConfigDir.exists()) {
|
||||
File cfg = new File(linConfigDir, "router.config");
|
||||
if (cfg.canWrite())
|
||||
return linConfigDir;
|
||||
else {
|
||||
String home = System.getenv("HOME");
|
||||
if (home != null)
|
||||
linConfigDir = new File(home,"i2p-config");
|
||||
}
|
||||
return linConfigDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -30,7 +30,9 @@ import javax.swing.JOptionPane;
|
||||
*/
|
||||
|
||||
public class WindowsServiceUtil {
|
||||
public WindowsServiceUtil() {}
|
||||
public WindowsServiceUtil() {
|
||||
}
|
||||
|
||||
public String queryService(String serviceName) {
|
||||
String result = "";
|
||||
String line;
|
||||
@ -39,8 +41,7 @@ public class WindowsServiceUtil {
|
||||
Process p = pb.start();
|
||||
try {
|
||||
p.waitFor(); // wait for process to finish then continue.
|
||||
BufferedReader bri =
|
||||
new BufferedReader(new InputStreamReader(p.getInputStream()));
|
||||
BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
|
||||
while ((line = bri.readLine()) != null) {
|
||||
result += line;
|
||||
}
|
||||
@ -54,6 +55,7 @@ public class WindowsServiceUtil {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getStatePrefix(String qResult) {
|
||||
String statePrefix = "STATE : ";
|
||||
// get the first occurrence of "STATE", then find the
|
||||
@ -70,8 +72,9 @@ public class WindowsServiceUtil {
|
||||
}
|
||||
return statePrefix;
|
||||
}
|
||||
|
||||
public int getServiceStateInt(String serviceName) {
|
||||
// String statePrefix = "STATE : ";
|
||||
// String statePrefix = "STATE : ";
|
||||
String qResult = queryService(serviceName);
|
||||
String statePrefix = getStatePrefix(qResult);
|
||||
// check that the temp string contains the status prefix
|
||||
@ -79,7 +82,7 @@ public class WindowsServiceUtil {
|
||||
if (ix >= 0) {
|
||||
// compare status number to one of the states
|
||||
String stateStr = qResult.substring(ix + statePrefix.length(),
|
||||
ix + statePrefix.length() + 1);
|
||||
ix + statePrefix.length() + 1);
|
||||
int state = Integer.parseInt(stateStr);
|
||||
return state;
|
||||
}
|
||||
@ -113,15 +116,12 @@ public class WindowsServiceUtil {
|
||||
if (isInstalled(serviceName)) {
|
||||
if (!isStart(serviceName)) {
|
||||
int a;
|
||||
String message =
|
||||
"It appears you have an existing I2P service installed.\n";
|
||||
message +=
|
||||
"However, it is not running yet. Please start it through `services.msc`.\n";
|
||||
message +=
|
||||
"If you click \"No\", the jpackage router will be launched instead.\n";
|
||||
String message = "It appears you have an existing I2P service installed.\n";
|
||||
message += "However, it is not running yet. Please start it through `services.msc`.\n";
|
||||
message += "If you click \"No\", the jpackage router will be launched instead.\n";
|
||||
a = JOptionPane.showConfirmDialog(null, message,
|
||||
"I2P Service detected not running",
|
||||
JOptionPane.YES_NO_OPTION);
|
||||
"I2P Service detected not running",
|
||||
JOptionPane.YES_NO_OPTION);
|
||||
if (a == JOptionPane.NO_OPTION) {
|
||||
// Do nothing here, this will continue on to launch a jpackaged router
|
||||
return true;
|
||||
@ -131,8 +131,7 @@ public class WindowsServiceUtil {
|
||||
// user can start the service themselves. OR maybe we ask for
|
||||
// elevation here? May need to refactor Elevator and Shell32X to
|
||||
// achieve it though
|
||||
ProcessBuilder pb =
|
||||
new ProcessBuilder("C:\\Windows\\System32\\services.msc");
|
||||
ProcessBuilder pb = new ProcessBuilder("C:\\Windows\\System32\\services.msc");
|
||||
try {
|
||||
Process p = pb.start();
|
||||
int exitCode = p.waitFor();
|
||||
@ -156,27 +155,27 @@ public class WindowsServiceUtil {
|
||||
String stateString = "uninstalled";
|
||||
int state = getServiceStateInt(serviceName);
|
||||
switch (state) {
|
||||
case (1): // service stopped
|
||||
stateString = "stopped";
|
||||
break;
|
||||
case (2): // service starting
|
||||
stateString = "starting";
|
||||
break;
|
||||
case (3): // service stopping
|
||||
stateString = "stopping";
|
||||
break;
|
||||
case (4): // service started
|
||||
stateString = "started";
|
||||
break;
|
||||
case (5): // service resuming from pause
|
||||
stateString = "resuming";
|
||||
break;
|
||||
case (6): // service pausing
|
||||
stateString = "pausing";
|
||||
break;
|
||||
case (7): // service paused
|
||||
stateString = "paused";
|
||||
break;
|
||||
case (1): // service stopped
|
||||
stateString = "stopped";
|
||||
break;
|
||||
case (2): // service starting
|
||||
stateString = "starting";
|
||||
break;
|
||||
case (3): // service stopping
|
||||
stateString = "stopping";
|
||||
break;
|
||||
case (4): // service started
|
||||
stateString = "started";
|
||||
break;
|
||||
case (5): // service resuming from pause
|
||||
stateString = "resuming";
|
||||
break;
|
||||
case (6): // service pausing
|
||||
stateString = "pausing";
|
||||
break;
|
||||
case (7): // service paused
|
||||
stateString = "paused";
|
||||
break;
|
||||
}
|
||||
return stateString;
|
||||
}
|
||||
@ -184,7 +183,7 @@ public class WindowsServiceUtil {
|
||||
/**
|
||||
* get the OS name(windows, mac, linux only)
|
||||
*
|
||||
* @return os name in lower-case, "windows" "mac" or "linux"
|
||||
* @return os name in lower-case, "windows" "mac" or "linux"
|
||||
*/
|
||||
protected String osName() {
|
||||
String osName = System.getProperty("os.name").toLowerCase();
|
||||
@ -194,6 +193,7 @@ public class WindowsServiceUtil {
|
||||
return "mac";
|
||||
return "linux";
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
WindowsServiceUtil wsu = new WindowsServiceUtil();
|
||||
// when querying the I2P router service installed by the IzPack installer
|
||||
|
@ -20,7 +20,7 @@ public class ZipUpdateProcess implements Runnable {
|
||||
private final Log _log;
|
||||
|
||||
ZipUpdateProcess(RouterContext ctx, Supplier<String> versionSupplier,
|
||||
Supplier<File> fileSupplier) {
|
||||
Supplier<File> fileSupplier) {
|
||||
this.ctx = ctx;
|
||||
this.versionSupplier = versionSupplier;
|
||||
this.fileSupplier = fileSupplier;
|
||||
@ -29,12 +29,11 @@ public class ZipUpdateProcess implements Runnable {
|
||||
|
||||
private File workDir() throws IOException {
|
||||
if (ctx != null) {
|
||||
File workDir =
|
||||
new File(ctx.getConfigDir().getAbsolutePath(), "i2p_update_zip");
|
||||
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");
|
||||
" exists but is a file, get it out of the way");
|
||||
return workDir;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
|
@ -1,3 +1,3 @@
|
||||
!define VERSIONMAJOR 2
|
||||
!define VERSIONMINOR 4
|
||||
!define VERSIONMINOR 6
|
||||
!define VERSIONBUILD 0
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
TORSOCKS=$(which torsocks)
|
||||
if [ -f "${TORSOCKS}" ]; then
|
||||
. "${TORSOCKS}" on
|
||||
if [ -z "$NO_TORSOCKS" ]; then
|
||||
TORSOCKS=$(which torsocks)
|
||||
if [ -f "${TORSOCKS}" ]; then
|
||||
. "${TORSOCKS}" on
|
||||
fi
|
||||
fi
|
||||
|
||||
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
|
||||
|
Reference in New Issue
Block a user