Make it possible to optionally generate jpackage which can be added to a Linux tar.gzipped firefox profile+script. If a Firefox is added to this .tar.gz in a directory called ./firefox/, and that Firefox is configured to be portable and avoid the disk, the launching script will favor the local Firefox and it *should* never need to touch anything outside the directory it's unpacked in, making it usable from a flash drive without touching the disk on a host, for instance. More generally, forming the basis of a TBB-like package

This commit is contained in:
idk
2021-05-25 13:46:37 -04:00
parent c66d08d9d8
commit 10f02140a3
6 changed files with 38 additions and 13 deletions

View File

@ -56,6 +56,7 @@ profile: build/profile/user.js build/profile/prefs.js build/profile/bookmarks.ht
profile.tgz: profile
$(eval PROFILE_VERSION := $(shell cat src/profile/version.txt))
@echo "building profile tarball $(PROFILE_VERSION)"
bash -c 'ls I2P && cp -rv I2P build/app-profile/I2P'; true
install -m755 src/unix/i2pbrowser.sh build/profile/i2pbrowser.sh
cd build && tar -czf profile-$(PROFILE_VERSION).tgz profile && cp profile-$(PROFILE_VERSION).tgz ../
@ -81,6 +82,7 @@ app-profile: build/app-profile/user.js build/app-profile/prefs.js build/app-prof
app-profile.tgz: app-profile
$(eval PROFILE_VERSION := $(shell cat src/app-profile/version.txt))
@echo "building app-profile tarball $(PROFILE_VERSION)"
bash -c 'ls I2P && cp -rv I2P build/app-profile/I2P'; true
install -m755 src/unix/i2pconfig.sh build/app-profile/i2pconfig.sh
cd build && tar -czf app-profile-$(PROFILE_VERSION).tgz app-profile && cp app-profile-$(PROFILE_VERSION).tgz ../

View File

@ -120,6 +120,9 @@ build process for non-Windows users.
End-to-End Windows build process using WSL
------------------------------------------
**If you've already done this once, you can just use:** `./build.sh && wsl make`
**in `git bash`** to automatically build an installer.
**Prerequisites:** You need to have OpenJDK 14 or greater installed and configured
with your `%JAVA_HOME%` environment variable configured and `%JAVA_HOME%/bin` on
your `%PATH%`. You need to have Apache Ant installed and configured with `%ANT_HOME%`

View File

@ -3,13 +3,13 @@ set -e
. i2pversion
JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t ')
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
sleep 2s
if [ -z "${JAVA_HOME}" ]; then
JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`

View File

@ -3,6 +3,7 @@ package net.i2p.router;
import java.io.*;
import java.util.*;
import net.i2p.router.RouterLaunch;
import net.i2p.util.SystemVersion;
/**
* Launches a router from %PROGRAMFILES%/I2P using configuration data in
@ -48,18 +49,30 @@ public class WinLauncher {
}
private static File selectHome() throws Exception {
File home = new File(System.getProperty("user.home"));
File i2p;
File appData = new File(home, "AppData");
File local = new File(appData, "Local");
i2p = new File(local, "I2P");
return i2p.getAbsoluteFile();
if (SystemVersion.isWindows()) {
File home = new File(System.getProperty("user.home"));
File i2p;
File appData = new File(home, "AppData");
File local = new File(appData, "Local");
i2p = new File(local, "I2P");
return i2p.getAbsoluteFile();
} else {
File jrehome = new File(System.getProperty("java.home"));
File programs = new File(jrehome.getParentFile().getParentFile(), ".i2p");
return programs.getAbsoluteFile();
}
}
private static File selectProgramFile() throws Exception {
File jrehome = new File(System.getProperty("java.home"));
File programs = jrehome.getParentFile();
return programs.getAbsoluteFile();
if (SystemVersion.isWindows()) {
File jrehome = new File(System.getProperty("java.home"));
File programs = jrehome.getParentFile();
return programs.getAbsoluteFile();
} else {
File jrehome = new File(System.getProperty("java.home"));
File programs = new File(jrehome.getParentFile().getParentFile(), "i2p");
return programs.getAbsoluteFile();
}
}
}

View File

@ -6,7 +6,10 @@ fi
if [ ! -z $I2PROUTER ]; then
echo "$I2PROUTER" "$I2PCOMMAND"
"$I2PROUTER" "$I2PCOMMAND"
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || "$I2PROUTER" "$I2PCOMMAND"
else if [ -d "I2P/bin" ]; then
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || ./I2P/bin/I2P; \
echo "running the jpackaged I2P router since we can't find another one to use."
fi
if [ -z $BROWSING_PROFILE ]; then

View File

@ -6,7 +6,11 @@ fi
if [ ! -z $I2PROUTER ]; then
echo "$I2PROUTER" "$I2PCOMMAND"
"$I2PROUTER" "$I2PCOMMAND"
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || "$I2PROUTER" "$I2PCOMMAND"
else if [ -d "I2P/bin" ]; then
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || ./I2P/bin/I2P; \
echo "running the jpackaged I2P router since we can't find another one to use."
fi
if [ -f "$HOME/.i2p/router.config" ]; then