Compare commits
120 Commits
auto-confi
...
20220917
Author | SHA1 | Date | |
---|---|---|---|
cef19a24e0 | |||
0c15a46cea | |||
190a5741a8 | |||
b6fa3fae7a | |||
6f5ee3f0f4 | |||
184b5d9e0f | |||
8b1820bd81 | |||
835966aecb | |||
b0aa8a4989 | |||
a366a31dce | |||
a0f638c2de | |||
e216b67105 | |||
379264cfaf | |||
2270c2aadb | |||
2cf58e2460 | |||
6faaab1f44 | |||
3fc68f928b | |||
3c404cd15e | |||
2394ddf378 | |||
6594b1af99 | |||
3d8cddec4f | |||
e94d008335 | |||
068a8ef1a6 | |||
72b3f3910c | |||
11a8f2cb08 | |||
0183222ac9 | |||
0fb3193af2 | |||
15292c0aa4 | |||
fa0cfe6226 | |||
9e176175d3 | |||
bb58a3ce1f | |||
8de96b7df8 | |||
78148ee37f | |||
64a11096b0 | |||
573f16c380 | |||
d8887fdfa5 | |||
5171164167 | |||
0ae1609f0f | |||
09af24a115 | |||
5cbf441715 | |||
d2e005a583 | |||
3ad4216ce4 | |||
50d803d191 | |||
5d23b012ed | |||
299cf5ef3e | |||
fe68a39d94 | |||
2f0f99f609 | |||
cf67f6c476 | |||
4a7fb5f55c | |||
a34079c8ab | |||
bfcdabd794 | |||
733167ea8d | |||
36d61b3bf6 | |||
d403fd4b09 | |||
736071a992 | |||
81d9d13742 | |||
e66fc3440c | |||
f9e3d1b040 | |||
928ae1a85f | |||
93b197efb9 | |||
09ffb8edbe | |||
cdc3224eaa | |||
2eeb2106fc | |||
26a7944470 | |||
b97d581fcc | |||
615818976a | |||
e6fc5a349d | |||
3718d2edb9 | |||
4a55a8d4ab | |||
a3a45b01e5 | |||
e07c43f1eb | |||
fd75a7e244 | |||
0e77d53c15 | |||
4dd9448752 | |||
b220697af2 | |||
d9cffc9520 | |||
c8590e4fe5 | |||
3c8b1b6d28 | |||
460837d7f5 | |||
2bd3abe6bb | |||
5ef6118b91 | |||
394f58f90e | |||
5ee89f98a9 | |||
6736d527a2 | |||
ef203ba935 | |||
3749f49641 | |||
d63128096c | |||
51cb4c608a | |||
f920fa8090 | |||
252a80eb72 | |||
ed7814cd74 | |||
073ba01da6 | |||
7caf03d6e4 | |||
c3934ab4e4 | |||
54ffdc2352 | |||
ab2548ecd4 | |||
5cf5d56738 | |||
262311390e | |||
3ac2f2b4a2 | |||
00ca509e57 | |||
a1826d40e8 | |||
c8f3f0b960 | |||
a80512cd5a | |||
7e5579fd65 | |||
934ab43b2a | |||
9214c2116c | |||
c02e466f80 | |||
59a1a3d9e6 | |||
a230a49af7 | |||
079ef87c8f | |||
f9a7f8ab2d | |||
3c8dd9dee9 | |||
65db834ec9 | |||
b955dbe66e | |||
e367227714 | |||
4a02ec418a | |||
4368b80c79 | |||
7dff65d67d | |||
0ad9406387 | |||
21b396e343 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -18,4 +18,6 @@ i2pversion_override
|
||||
*.log
|
||||
cmd
|
||||
*.so
|
||||
*.jar
|
||||
*.jar
|
||||
*.zip
|
||||
*.tar.gz
|
26
LICENSE.html
26
LICENSE.html
@ -17,6 +17,11 @@
|
||||
<div id="shownav">
|
||||
<div id="hidenav">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="..">
|
||||
Up one level ^
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="index.html">
|
||||
index
|
||||
@ -40,12 +45,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="returnhome" href="/">
|
||||
/
|
||||
</a>
|
||||
<p>
|
||||
Copyright 2018
|
||||
</p>
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the “Software”), to deal in
|
||||
this software and associated documentation files (the “Software”), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
@ -56,13 +64,27 @@
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
</p>
|
||||
<div id="sourcecode">
|
||||
<span id="sourcehead">
|
||||
<strong>
|
||||
Get the source code:
|
||||
</strong>
|
||||
</span>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/eyedeekay/i2p.firefox">
|
||||
Source Repository: (https://github.com/eyedeekay/i2p.firefox)
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<a href="#show">
|
||||
Show license
|
||||
|
12
Makefile
12
Makefile
@ -32,7 +32,7 @@ i2pbrowser-jpackage.nsi:
|
||||
jpackage: version I2P build/I2P/config all
|
||||
|
||||
help: version
|
||||
@echo "I2P-Profile-Installer-$(PROFILE_VERSION)"
|
||||
@echo "I2P-Easy-Install-Bundle-$(PROFILE_VERSION)"
|
||||
@echo "$(SIGNER)"
|
||||
@echo "$(I2P_VERSION)"
|
||||
@echo "$(MAJOR).$(MINOR).$(BUILD)"
|
||||
@ -60,7 +60,7 @@ prep: #launchers build/licenses profile.tgz app-profile.tgz profile build/I2P bu
|
||||
cp src/icons/*.ico build
|
||||
|
||||
install.exe: #build/licenses
|
||||
cd build && makensis i2pbrowser-installer.nsi && cp I2P-Profile-Installer-*.exe ../ && echo "built windows installer"
|
||||
cd build && makensis i2pbrowser-installer.nsi && cp I2P-Easy-Install-Bundle-*.exe ../ && echo "built windows installer"
|
||||
|
||||
export RES_DIR="../i2p.i2p.jpackage-build/installer/resources"
|
||||
export PKG_DIR="../i2p.i2p.jpackage-build/pkg-temp"
|
||||
@ -78,15 +78,15 @@ build/I2P: I2P build
|
||||
cp -rv I2P build/I2P ; true
|
||||
cp "$(I2P_JBIGI)"/*windows*.dll build/I2P/runtime/lib; true
|
||||
|
||||
src/I2P/config: build/I2P
|
||||
src/I2P/config:
|
||||
mkdir -p src/I2P/config
|
||||
rm -rf src/I2P/config/geoip src/I2P/config/webapps src/I2P/config/certificates
|
||||
echo true | tee src/I2P/config/jpackaged
|
||||
cp -v $(RES_DIR)/clients.config src/I2P/config/
|
||||
cp -v $(RES_DIR)/i2ptunnel.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
|
||||
@ -122,7 +122,7 @@ build/licenses: build
|
||||
unix2dos build/licenses/LICENSE.txt
|
||||
|
||||
clean:
|
||||
rm -rf build app-profile-*.tgz profile-*.tgz I2P-Profile-Installer-*.exe *.deb src/I2P/config *.su3 .version *.url make.log
|
||||
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
|
||||
|
||||
build:
|
||||
@ -159,7 +159,7 @@ BLANK=`awk '! NF { print NR; exit }' changelog.txt`
|
||||
I2P.zip: I2P-jpackage-windows-$(I2P_VERSION).zip
|
||||
|
||||
I2P-jpackage-windows-$(I2P_VERSION).zip:
|
||||
zip I2P-jpackage-windows-$(I2P_VERSION).zip -r build/I2P
|
||||
sh -c 'powershell Compress-Archive I2P I2P-jpackage-windows-$(I2P_VERSION).zip || zip I2P-jpackage-windows-$(I2P_VERSION).zip -r I2P'
|
||||
|
||||
changelog:
|
||||
head -n "$(BLANK)" changelog.txt
|
||||
|
229
README.md
229
README.md
@ -13,7 +13,7 @@ Features:
|
||||
Build Dependencies:
|
||||
-------------------
|
||||
|
||||
To build this, you will need the following software packages (all available in Debian) :
|
||||
To build this, you will need the following software packages (all available in Debian and Ubuntu, see WSL section below) :
|
||||
|
||||
- make
|
||||
- nsis
|
||||
@ -30,89 +30,26 @@ and copy the content of `Plugins` to `/usr/share/nsis/Plugins`.
|
||||
cp -rv Plugins/* /usr/share/nsis/Plugins/
|
||||
```
|
||||
|
||||
To build a Debian package, you'll also need
|
||||
|
||||
- checkinstall
|
||||
|
||||
Preparation
|
||||
-----------
|
||||
|
||||
Before you build, run the targets
|
||||
|
||||
make clean-extensions
|
||||
make extensions
|
||||
|
||||
to update the extensions to point to their latest versions.
|
||||
|
||||
Windows Build
|
||||
-------------
|
||||
|
||||
After installing the dependencies and completing the preparations,
|
||||
just run `make`. This will produce three files:
|
||||
|
||||
profile.tgz - the firefox profile, plus a shell script which will
|
||||
launch it if Firefox is found in the $PATH on Unix-Like operating
|
||||
systems.
|
||||
app-profile.tgz - the Firefox profile plus a launcher shell script,
|
||||
which will launch a *modified* Firefox without a URL bar as a router
|
||||
console wrapper.
|
||||
install.exe - the windows installer, which sets up shortcuts to
|
||||
launch Firefox on Windows.
|
||||
|
||||
When generating a Windows build it's important to make sure that the
|
||||
licenses for all the bundled softare are included. This should happen
|
||||
automatically. When bundling software, describe the terms and where
|
||||
they are applied in the `LICENSE.index`, then add the full license
|
||||
to the `licenses` directory. Then, add the full license to the `cat`
|
||||
command in the `build/licenses` make target. The build/licenses
|
||||
target is run automatically during the build process.
|
||||
|
||||
Unix Support
|
||||
------------
|
||||
|
||||
It is possible to use these profiles on Linux and possibly other
|
||||
Unixes, if Firefox is already installed on the system. It can be
|
||||
installed system-wide using the `make install` target. Running
|
||||
`make install` requires root, and requires `make` to have been run
|
||||
first. To install on Unix, system-wide, run:
|
||||
|
||||
make
|
||||
sudo make install
|
||||
|
||||
To run without installing them system wide, unpack the `profile*.tgz`
|
||||
to a location of your choice and run the `i2pbrowser.sh` script. This
|
||||
will start a Firefox profile configured to use I2P.
|
||||
|
||||
tar xvf profile-0.3.tgz
|
||||
cd profile
|
||||
./i2pbrowser.sh
|
||||
|
||||
If you want to run the app-like i2pconfig browser, then follow the
|
||||
same steps with app-profile*.tgz.
|
||||
|
||||
tar xvf app-profile-0.3.tgz
|
||||
cd app-profile
|
||||
./i2pconfig.sh
|
||||
|
||||
To generate a `deb` package, install the package `checkinstall` and run
|
||||
the `make checkinstall` target after building with `make`.
|
||||
|
||||
make
|
||||
make checkinstall
|
||||
sudo apt install ./i2p-firefox*.deb
|
||||
|
||||
If you want to set up i2pconfig to run when you start the service
|
||||
with `sudo service i2p start` then you can run the script:
|
||||
|
||||
/usr/local/bin/i2p-config-service-setup
|
||||
|
||||
Including a jpackaged I2P Router
|
||||
--------------------------------
|
||||
|
||||
**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%`
|
||||
environment variable configured and `%ANT_HOME%/bin` on your `%PATH%`. You must have
|
||||
Cygwin installed. You must have `NSIS.exe` installed and `makensis` available on your
|
||||
`%PATH%`. You must have Git for Windows installed. When installing git for Windows,
|
||||
you should select "Checkout as is, commit as is" and leave line-endings alone.
|
||||
|
||||
TODO: Add links to the respective instructions for each of these.
|
||||
|
||||
**Note that after the dependencies are installed, this step is automated**
|
||||
**with `./build.sh`.**
|
||||
|
||||
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
|
||||
a Windows system and place it into a directory called `I2P` in your `i2p.firefox`
|
||||
checkout.
|
||||
checkout. Building without a jpackage is no longer supported.
|
||||
|
||||
Assuming a working java and jpackage environment on your Windows system, the
|
||||
following command should generate a suitable "App Image" in a directory
|
||||
@ -130,22 +67,36 @@ necessary, then complete the regular build instructions. If a jpackaged I2P rout
|
||||
isn't present to use at build time, the inclusion will be skipped automatically
|
||||
with a non-fatal warning.
|
||||
|
||||
In the near future, I'll start providing a pre-built app image to ease the
|
||||
build process for non-Windows users.
|
||||
Pre-built app-images are available from my daily releases at:
|
||||
|
||||
End-to-End Windows build process using WSL
|
||||
------------------------------------------
|
||||
https://github.com/eyedeekay/i2p.plugins.firefox/releases/
|
||||
|
||||
**If you've already done this once, you can just use:** `./build.sh && wsl make`
|
||||
**in `git bash`** to automatically build an installer.
|
||||
Windows Build
|
||||
-------------
|
||||
|
||||
**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%`
|
||||
environment variable configured and `%ANT_HOME%/bin` on your `%PATH%`. You must have
|
||||
Cygwin installed. You must have `NSIS.exe` installed and `makensis` available on your
|
||||
`%PATH%`. You must have Git for Windows installed. When installing git for Windows,
|
||||
you should select "Checkout as is, commit as is" and leave line-endings alone.
|
||||
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.
|
||||
Building without a jpackage is no longer supported.
|
||||
|
||||
When generating a build it's important to make sure that the
|
||||
licenses for all the bundled softare are included. This should happen
|
||||
automatically. When bundling software, describe the terms and where
|
||||
they are applied in the `LICENSE.index`, then add the full license
|
||||
to the `licenses` directory. Then, add the full license to the `cat`
|
||||
command in the `build/licenses` make target. The build/licenses
|
||||
target is run automatically during the build process.
|
||||
|
||||
End-to-End Windows build process using WSL(**Recommended**)
|
||||
-----------------------------------------------------------
|
||||
|
||||
**See `config.sh` and `i2pversion` for instructions on how to tweak**
|
||||
**the build process. File an issue if you need help.**
|
||||
|
||||
**If you've already done this once, you can just use:** `./unsigned.sh`
|
||||
**in `git bash`** to automatically build an installer. If you
|
||||
are using this method, you may use the `makensis` and `make` from
|
||||
Ubuntu in WSL.
|
||||
|
||||
1. [Set up Windows Subsystem for Linux per Microsoft's instructions](https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps)
|
||||
2. [Install Ubuntu Focal per Microsoft's instructions](https://www.microsoft.com/store/apps/9n6svws3rx71)
|
||||
@ -172,21 +123,25 @@ you should select "Checkout as is, commit as is" and leave line-endings alone.
|
||||
|
||||
wsl make
|
||||
|
||||
End-to-End Windows build process using Cygwin
|
||||
---------------------------------------------
|
||||
End-to-End Windows build process using Cygwin(More difficult than WSL for now)
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
I highly recommend you look into the Chocolatey package manager, which makes it much
|
||||
easier to configure these tools and keep them up to date.
|
||||
|
||||
**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%`
|
||||
environment variable configured and `%ANT_HOME%/bin` on your `%PATH%`. You must have
|
||||
WSL and git bash installed. You must have `NSIS.exe` installed and `makensis` available on your
|
||||
`%PATH%`. You must have Git for Windows installed. When installing git for Windows, you should
|
||||
select "Checkout as is, commit as is" and leave line-endings alone.
|
||||
**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
|
||||
automated build scripts without a hack. You will need to create a file called `wsl`
|
||||
in a place that is in the path used by `git-bash.exe` sessions, with the content:
|
||||
|
||||
TODO: Add links to the respective instructions for each of these.
|
||||
```
|
||||
#! /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.
|
||||
2. Open a cygwin terminal.
|
||||
@ -218,16 +173,11 @@ Certificate which Windows will recognize. The current signer of the Windows
|
||||
bundle is Zlatinb. Standard Windows signing tools are used.
|
||||
|
||||
```sh
|
||||
# Release Copypasta
|
||||
./clean.sh
|
||||
wsl make distclean
|
||||
wsl make clean-extensions
|
||||
wsl make extensions
|
||||
./build.sh
|
||||
wsl make
|
||||
./sign.sh
|
||||
./release.sh
|
||||
```
|
||||
|
||||
produces the binary.
|
||||
|
||||
Building a signed update file
|
||||
-----------------------------
|
||||
|
||||
@ -243,21 +193,35 @@ signed update file.
|
||||
Docker Support
|
||||
--------------
|
||||
|
||||
You can use a Docker container to install this browser profile as well. In order
|
||||
to do this, you can run the commands:
|
||||
**MOVED, DEPRECATION NOTICE:** Most of this functionality has been moved
|
||||
to http://git.idk.i2p/idk/i2p.plugins.native which is more stable,
|
||||
easier to build and use, and easier to incorporate into other
|
||||
projects.
|
||||
|
||||
xhost + local:docker
|
||||
docker run -it --rm \
|
||||
--net=host \
|
||||
-e DISPLAY=unix$(DISPLAY) \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
geti2p/i2p.firefox firefox --profile /src/build/profile
|
||||
- https://git.idk.i2p/idk/i2p.plugins.firefox/-/blob/main/docker.sh
|
||||
|
||||
To build and run the container locally, clone this repository and run the
|
||||
Unix Support
|
||||
------------
|
||||
|
||||
make run
|
||||
**MOVED. DEPRECATION NOTICE:** Most of this functionality has been moved
|
||||
to http://git.idk.i2p/idk/i2p.plugins.native which is more stable,
|
||||
easier to build and use, and easier to incorporate into other
|
||||
projects. It is the better option for nearly every non-Windows case
|
||||
right now. You can get binary packages from:
|
||||
|
||||
target.
|
||||
- https://github.com/eyedeekay/i2p.plugins.firefox/releases
|
||||
|
||||
or look at
|
||||
|
||||
- https://i2pgit.org/idk/i2p.plugins.firefox/-/blob/master/PACKAGES.md
|
||||
|
||||
for instructions on how to build your own packages. These packages are
|
||||
unofficial! Although I do dogfood most of them and the `.jar` gets thorough
|
||||
testing.
|
||||
|
||||
**The only remotely interesting Unix functionality that remains in this**
|
||||
**repository is the construction of a portable. You can use `targz.sh` to**
|
||||
**generate that.**
|
||||
|
||||
Issues
|
||||
------
|
||||
@ -269,11 +233,28 @@ pertaining to the plugins may be reported to their upstream
|
||||
maintainers if it's determined that our configuration is not at
|
||||
fault.
|
||||
|
||||
NoScript is developed on Github by `hackademix` and the community:
|
||||
- https://github.com/hackademix/noscript
|
||||
## Credits
|
||||
|
||||
HTTPS Everywhere is developed on Github by the EFF:
|
||||
- https://github.com/EFForg/https-everywhere
|
||||
This profile manager makes use of a set of browser extensions which are largely the work of others.
|
||||
It makes use of dependencies that are the work of others. In many ways, it's merely an elaborate
|
||||
configuration tool. A smart one, but a configuration tool nonetheless. Many thanks to the following
|
||||
projects, developers, and communities:
|
||||
|
||||
### Firefox and Chrome Extensions
|
||||
|
||||
- [NoScript - Giorgio Maone and others](https://noscript.net)
|
||||
- [HTTPS Everywhere - Electronic Frontier Foundation](https://www.eff.org/https-everywhere)
|
||||
- [uBlock Origin - Raymond Gorhill and others](https://ublockorigin.com/)
|
||||
- [LocalCDN - nobody and others](https://www.localcdn.org/)
|
||||
- [jShelter - Libor Polčák and others](https://jshelter.org/)
|
||||
|
||||
### Firefox Configuration Modifiations
|
||||
|
||||
- [Arkenfox - Thorin Oakenpants and Others](https://github.com/arkenfox/user.js/)
|
||||
|
||||
You can find the license files for each of the these projects in the `src/i2p.firefox.*.profile/extensions/*`
|
||||
directory for Firefox, and the `src/i2p.chromium.*.profile/extensions/*.js/*` directories for Chromium within
|
||||
the [`i2p.plugins.firefox`](https://i2pgit.org/idk/i2p.plugins.firefox) project.
|
||||
|
||||
I2P in Private Browsing is developed on Gitlab and Github by idk and the community:
|
||||
- https://i2pgit.org/idk/I2P-in-Private-Browsing-Mode-Firefox
|
||||
|
24
UPDATES.html
24
UPDATES.html
@ -17,6 +17,11 @@
|
||||
<div id="shownav">
|
||||
<div id="hidenav">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="..">
|
||||
Up one level ^
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="index.html">
|
||||
index
|
||||
@ -40,6 +45,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="returnhome" href="/">
|
||||
/
|
||||
</a>
|
||||
<h1>
|
||||
Setting up an Update Server for an I2P Bundle
|
||||
</h1>
|
||||
@ -53,7 +61,7 @@
|
||||
<p>
|
||||
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.
|
||||
you’ll need to do it the complete way.
|
||||
</p>
|
||||
<p>
|
||||
For as long as I am building updates, you will be able to mirror the jpackaged
|
||||
@ -100,6 +108,20 @@
|
||||
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.
|
||||
</p>
|
||||
<div id="sourcecode">
|
||||
<span id="sourcehead">
|
||||
<strong>
|
||||
Get the source code:
|
||||
</strong>
|
||||
</span>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/eyedeekay/i2p.firefox">
|
||||
Source Repository: (https://github.com/eyedeekay/i2p.firefox)
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<a href="#show">
|
||||
Show license
|
||||
|
8
build.sh
8
build.sh
@ -41,6 +41,7 @@ sleep 5s
|
||||
HERE="$PWD"
|
||||
if [ ! -d "$HERE/../i2p.i2p.jpackage-build/" ]; then
|
||||
git clone -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/"
|
||||
for i in $COUNT; do
|
||||
@ -66,11 +67,12 @@ if [ ! -f "$HERE/build/jna-platform.jar" ]; then
|
||||
fi
|
||||
|
||||
if [ ! -f "$HERE/build/i2pfirefox.jar" ]; then
|
||||
wget -O "$HERE/build/i2pfirefox.jar" https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.16/i2pfirefox.jar
|
||||
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 \
|
||||
@ -90,6 +92,9 @@ 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" \
|
||||
@ -100,6 +105,7 @@ rm -rf I2P
|
||||
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
|
||||
$JPACKAGE_OPTS \
|
||||
--resource-dir build \
|
||||
--app-content src/I2P/config \
|
||||
--input build --main-jar launcher.jar --main-class net.i2p.router.WinLauncher
|
||||
|
||||
cp "$I2P_PKG/licenses/"* license/
|
||||
|
@ -1,3 +1,20 @@
|
||||
2022-09-16 idk
|
||||
* remove unstable/deprecated functionality. Better solutions have been developed and instructions
|
||||
on how to use them are provided.
|
||||
* update build documentation.
|
||||
|
||||
2022-09-13 idk
|
||||
* make it a "portable" application in that the entire app and config can be carried on a portable
|
||||
storage device. Requires minor tweaks to work well still.
|
||||
|
||||
2022-09-08 idk
|
||||
* Generate a source tarball when we checkout a branch of i2p.i2p
|
||||
* Upload a source tarball when we do a daily build
|
||||
* Clean up a source tarball when running the clean script. Regenerate tarball after cleaning.
|
||||
|
||||
2022-09-06 idk
|
||||
* Point release 1.9.5, fixes a bug which occurs more often on Windows 11, fixes a SusiDNS issue
|
||||
|
||||
2022-08-28 idk
|
||||
* Migrate away from batch scripts and simply launch a browser if I2P is already running.
|
||||
This is more flexible, stable, and simplet to install
|
||||
|
4
clean.sh
4
clean.sh
@ -4,6 +4,7 @@ SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$SCRIPT_DIR" || exit 1
|
||||
|
||||
. "$SCRIPT_DIR/config.sh"
|
||||
. "$SCRIPT_DIR/i2pversion"
|
||||
|
||||
if [ -f config_overide.sh ]; then
|
||||
. "$SCRIPT_DIR/config_override.sh"
|
||||
@ -11,8 +12,9 @@ fi
|
||||
|
||||
cd ../i2p.i2p.jpackage-build/
|
||||
ant distclean
|
||||
git clean -fd
|
||||
git checkout .
|
||||
git checkout master
|
||||
tar --exclude="$SCRIPT_DIR/../i2p.i2p.jpackage-build/.git" -cvzf "$SCRIPT_DIR/../i2p.i2p.jpackage-build.tar.gz" "$SCRIPT_DIR/../i2p.i2p.jpackage-build/"
|
||||
cd "$SCRIPT_DIR" || exit 1
|
||||
rm -rf \
|
||||
build \
|
||||
|
32
config.sh
32
config.sh
@ -3,16 +3,28 @@
|
||||
## If you need to use a different JVM, JDK, or other utility from
|
||||
# build.sh, set it in this file, for example:
|
||||
|
||||
uname=$(uname)
|
||||
|
||||
#export PATH="$PATH:/c/Program Files/Java/jdk-17.0.3/bin/"
|
||||
#export JAVA_HOME="/c/Program Files/Java/jdk-17.0.3"
|
||||
# to use it for Oracle OpenJDK17
|
||||
|
||||
## Other potential values(NOT exhaustive):
|
||||
|
||||
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
||||
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
||||
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
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/"
|
||||
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
||||
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
fi
|
||||
|
||||
if [ "${uname}" != "Linux" ]; then
|
||||
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
||||
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
|
||||
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
fi
|
||||
|
||||
#export PATH="$PATH:/c/Program Files/Eclipse Adoptium/jdk-17.0.3/bin/"
|
||||
#export JAVA_HOME="/c/Program Files/Eclipse Adoptium/jdk-17.0.3"
|
||||
#export PATH="$PATH:/c/Program Files/OpenJDK/jdk-17.0.3/bin/"
|
||||
@ -49,6 +61,12 @@ export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
|
||||
#export ANT_HOME="/c/apache-ant-1.10.9"
|
||||
#export PATH="$PATH:$ANT_HOME/bin/"
|
||||
|
||||
# Uncomment this to add signtool to the path so you don't have to fight with Visual Studio.
|
||||
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/"
|
||||
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
|
||||
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/"
|
||||
fi
|
||||
|
||||
if [ "${uname}" != "Linux" ]; then
|
||||
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/"
|
||||
fi
|
52
daily-linux.sh
Executable file
52
daily-linux.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 .
|
||||
./targz.sh
|
||||
|
||||
. "$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"
|
||||
DESCRIPTION+="==================================================="
|
||||
DESCRIPTION+=""
|
||||
DESCRIPTION+="These builds are automatically built on a daily basis and may have serious bugs."
|
||||
DESCRIPTION+="They are intended for testing purposes only, use them at your own risk."
|
||||
DESCRIPTION+=""
|
||||
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"
|
||||
sleep 2s
|
||||
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"
|
||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.tar.gz" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.tar.gz"
|
24
daily.sh
24
daily.sh
@ -37,15 +37,23 @@ TODAYSDATE=$(date +%Y%m%d)
|
||||
|
||||
if [ -z "$DESCRIPTION" ]; then
|
||||
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE"
|
||||
DESCRIPTION+="==================================================="
|
||||
DESCRIPTION+=""
|
||||
DESCRIPTION+="These builds are automatically built on a daily basis and may have serious bugs."
|
||||
DESCRIPTION+="They are intended for testing purposes only, use them at your own risk."
|
||||
DESCRIPTION+=""
|
||||
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"
|
||||
EXECHECKSUM=$(sha256sum "I2P-Profile-Installer-$I2P_VERSION.exe")
|
||||
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-Profile-Installer-$I2P_VERSION.exe" -l "$EXECHECKSUM" -t "$TODAYSDATE" -n "I2P-Profile-Installer-$I2P_VERSION.exe"
|
||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-Profile-Installer-$I2P_VERSION.exe" -l "$EXECHECKSUM" -t "$TODAYSDATE" -n "I2P-Profile-Installer-$I2P_VERSION.exe"
|
||||
cd build || exit
|
||||
tar -a -cf ../I2P.zip I2P
|
||||
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"
|
||||
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "../I2P.zip" -l "$ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.zip"
|
||||
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 "$TODAYSDATE" -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 "$TODAYSDATE" -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 "$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")
|
||||
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"
|
||||
|
32
exe.sh
Executable file
32
exe.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
|
||||
|
||||
# Motivation
|
||||
|
||||
. ./config.sh
|
||||
. ./i2pversion
|
||||
./build.sh
|
||||
jpackage --name I2P-EXE --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 \
|
||||
--app-content src/I2P/config \
|
||||
--input build \
|
||||
--verbose \
|
||||
--type exe \
|
||||
--win-dir-chooser \
|
||||
--win-help-url "https://geti2p.net" \
|
||||
--win-menu \
|
||||
--win-menu-group "I2P Easy-Install Bundle" \
|
||||
--win-shortcut \
|
||||
--win-shortcut-prompt \
|
||||
--win-per-user-install \
|
||||
--license-file LICENSE.md \
|
||||
--main-jar launcher.jar \
|
||||
--main-class net.i2p.router.WinLauncher
|
17
experimental.sh
Executable file
17
experimental.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$SCRIPT_DIR" || exit 1
|
||||
|
||||
. "$SCRIPT_DIR/config.sh"
|
||||
|
||||
if [ -f config_overide.sh ]; then
|
||||
. "$SCRIPT_DIR/config_override.sh"
|
||||
fi
|
||||
|
||||
./clean.sh
|
||||
wsl make distclean
|
||||
wsl make clean-extensions
|
||||
wsl make new-extensions
|
||||
./build.sh
|
||||
wsl make
|
192
i2ptunnel.config
Normal file
192
i2ptunnel.config
Normal file
@ -0,0 +1,192 @@
|
||||
# NOTE: This I2P config file must use UTF-8 encoding
|
||||
#
|
||||
# If you have a 'split' directory installation, with configuration
|
||||
# files in ~/.i2p (Linux), %LOCALAPPDATA%\I2P (Windows),
|
||||
# or /Users/(user)/Library/Application Support/i2p (Mac), be sure to
|
||||
# edit the file in the configuration directory, NOT the install directory.
|
||||
# When running as a Linux daemon, the configuration directory is /var/lib/i2p
|
||||
# and the install directory is /usr/share/i2p .
|
||||
# When running as a Windows service, the configuration directory is \ProgramData\i2p
|
||||
# and the install directory is \Program Files\i2p .
|
||||
#
|
||||
# On first run, this file will be split into individual config files
|
||||
# in i2ptunnel.config.d/ in the configuration directory.
|
||||
# Look in that directory for the file to edit.
|
||||
#
|
||||
|
||||
# eepproxy
|
||||
tunnel.0.name=I2P HTTP Proxy
|
||||
tunnel.0.description=HTTP proxy for browsing eepsites and the web
|
||||
tunnel.0.type=httpclient
|
||||
tunnel.0.sharedClient=false
|
||||
tunnel.0.interface=127.0.0.1
|
||||
tunnel.0.listenPort=4444
|
||||
tunnel.0.proxyList=false.i2p
|
||||
tunnel.0.i2cpHost=127.0.0.1
|
||||
tunnel.0.i2cpPort=7654
|
||||
tunnel.0.option.inbound.nickname=HTTP Proxy
|
||||
tunnel.0.option.outbound.nickname=HTTP Proxy
|
||||
tunnel.0.option.i2cp.leaseSetEncType=4,0
|
||||
tunnel.0.option.i2cp.reduceIdleTime=900000
|
||||
tunnel.0.option.i2cp.reduceOnIdle=true
|
||||
tunnel.0.option.i2cp.reduceQuantity=1
|
||||
tunnel.0.option.i2p.streaming.connectDelay=1000
|
||||
tunnel.0.option.i2ptunnel.httpclient.SSLOutproxies=false.i2p
|
||||
tunnel.0.option.inbound.length=3
|
||||
tunnel.0.option.inbound.lengthVariance=0
|
||||
tunnel.0.option.outbound.length=3
|
||||
tunnel.0.option.outbound.lengthVariance=0
|
||||
tunnel.0.option.outbound.priority=10
|
||||
tunnel.0.startOnLoad=true
|
||||
tunnel.0.option.persistentClientKey=false
|
||||
tunnel.0.option.i2cp.closeIdleTime=1800000
|
||||
tunnel.0.option.i2cp.closeOnIdle=true
|
||||
tunnel.0.option.i2cp.newDestOnResume=true
|
||||
|
||||
# irc
|
||||
tunnel.1.name=Irc2P
|
||||
tunnel.1.description=IRC tunnel to access the Irc2P network
|
||||
tunnel.1.type=ircclient
|
||||
tunnel.1.sharedClient=false
|
||||
tunnel.1.interface=127.0.0.1
|
||||
tunnel.1.listenPort=6668
|
||||
tunnel.1.targetDestination=irc.postman.i2p:6667,irc.echelon.i2p:6667
|
||||
tunnel.1.i2cpHost=127.0.0.1
|
||||
tunnel.1.i2cpPort=7654
|
||||
tunnel.1.option.inbound.nickname=Irc2P
|
||||
tunnel.1.option.outbound.nickname=Irc2P
|
||||
tunnel.1.option.i2cp.closeIdleTime=1200000
|
||||
tunnel.1.option.i2cp.closeOnIdle=true
|
||||
tunnel.1.option.i2cp.delayOpen=true
|
||||
tunnel.1.option.i2cp.destination.sigType=7
|
||||
tunnel.1.option.i2cp.leaseSetEncType=4,0
|
||||
tunnel.1.option.i2cp.newDestOnResume=false
|
||||
tunnel.1.option.i2cp.reduceIdleTime=600000
|
||||
tunnel.1.option.i2cp.reduceOnIdle=true
|
||||
tunnel.1.option.i2cp.reduceQuantity=1
|
||||
tunnel.1.option.i2p.streaming.connectDelay=1000
|
||||
tunnel.1.option.i2p.streaming.maxWindowSize=16
|
||||
tunnel.1.option.inbound.length=3
|
||||
tunnel.1.option.inbound.lengthVariance=0
|
||||
tunnel.1.option.outbound.length=3
|
||||
tunnel.1.option.outbound.lengthVariance=0
|
||||
tunnel.1.option.outbound.priority=15
|
||||
tunnel.1.startOnLoad=true
|
||||
|
||||
# local eepserver
|
||||
tunnel.3.name=I2P webserver
|
||||
tunnel.3.description=My eepsite
|
||||
tunnel.3.type=httpserver
|
||||
tunnel.3.targetHost=127.0.0.1
|
||||
tunnel.3.targetPort=7658
|
||||
tunnel.3.spoofedHost=mysite.i2p
|
||||
tunnel.3.privKeyFile=eepsite/eepPriv.dat
|
||||
tunnel.3.i2cpHost=127.0.0.1
|
||||
tunnel.3.i2cpPort=7654
|
||||
tunnel.3.option.inbound.nickname=eepsite
|
||||
tunnel.3.option.outbound.nickname=eepsite
|
||||
tunnel.3.option.i2cp.destination.sigType=7
|
||||
tunnel.3.option.i2cp.leaseSetEncType=4,0
|
||||
tunnel.3.option.inbound.length=3
|
||||
tunnel.3.option.inbound.lengthVariance=0
|
||||
tunnel.3.option.outbound.length=3
|
||||
tunnel.3.option.outbound.lengthVariance=0
|
||||
# uncomment for HTTPS to port 7668
|
||||
#tunnel.3.option.targetForPort.443=127.0.0.1:7668
|
||||
tunnel.3.startOnLoad=false
|
||||
|
||||
# postman's SMTP server - see hq.postman.i2p
|
||||
tunnel.4.description=smtp server
|
||||
tunnel.4.i2cpHost=127.0.0.1
|
||||
tunnel.4.i2cpPort=7654
|
||||
tunnel.4.interface=127.0.0.1
|
||||
tunnel.4.listenPort=7659
|
||||
tunnel.4.name=smtp.postman.i2p
|
||||
tunnel.4.option.inbound.nickname=shared clients
|
||||
tunnel.4.option.outbound.nickname=shared clients
|
||||
tunnel.4.option.i2cp.leaseSetEncType=4,0
|
||||
tunnel.4.option.i2cp.reduceIdleTime=900000
|
||||
tunnel.4.option.i2cp.reduceOnIdle=true
|
||||
tunnel.4.option.i2cp.reduceQuantity=1
|
||||
tunnel.4.option.inbound.length=3
|
||||
tunnel.4.option.inbound.lengthVariance=0
|
||||
tunnel.4.option.outbound.length=3
|
||||
tunnel.4.option.outbound.lengthVariance=0
|
||||
tunnel.4.startOnLoad=true
|
||||
tunnel.4.targetDestination=smtp.postman.i2p:25
|
||||
tunnel.4.type=client
|
||||
tunnel.4.sharedClient=true
|
||||
|
||||
# postman's POP3 server - see hq.postman.i2p
|
||||
tunnel.2.name=pop3.postman.i2p
|
||||
tunnel.2.description=pop3 server
|
||||
tunnel.2.i2cpHost=127.0.0.1
|
||||
tunnel.2.i2cpPort=7654
|
||||
tunnel.2.interface=127.0.0.1
|
||||
tunnel.2.listenPort=7660
|
||||
tunnel.2.option.inbound.nickname=shared clients
|
||||
tunnel.2.option.outbound.nickname=shared clients
|
||||
tunnel.2.option.i2cp.leaseSetEncType=4,0
|
||||
tunnel.2.option.i2cp.reduceIdleTime=900000
|
||||
tunnel.2.option.i2cp.reduceOnIdle=true
|
||||
tunnel.2.option.i2cp.reduceQuantity=1
|
||||
tunnel.2.option.i2p.streaming.connectDelay=1000
|
||||
tunnel.2.option.inbound.length=3
|
||||
tunnel.2.option.inbound.lengthVariance=0
|
||||
tunnel.2.option.outbound.length=3
|
||||
tunnel.2.option.outbound.lengthVariance=0
|
||||
tunnel.2.startOnLoad=true
|
||||
tunnel.2.targetDestination=pop.postman.i2p:110
|
||||
tunnel.2.type=client
|
||||
tunnel.2.sharedClient=true
|
||||
|
||||
# HTTPS (CONNECT) outproxy
|
||||
tunnel.5.name=I2P HTTPS Proxy
|
||||
tunnel.5.description=HTTPS proxy for browsing eepsites and the web
|
||||
tunnel.5.type=connectclient
|
||||
tunnel.5.sharedClient=true
|
||||
tunnel.5.interface=127.0.0.1
|
||||
tunnel.5.listenPort=4445
|
||||
tunnel.5.proxyList=outproxy-tor.meeh.i2p
|
||||
tunnel.5.i2cpHost=127.0.0.1
|
||||
tunnel.5.i2cpPort=7654
|
||||
tunnel.5.option.inbound.nickname=shared clients
|
||||
tunnel.5.option.outbound.nickname=shared clients
|
||||
tunnel.5.option.i2cp.leaseSetEncType=4,0
|
||||
tunnel.5.option.i2cp.reduceIdleTime=900000
|
||||
tunnel.5.option.i2cp.reduceOnIdle=true
|
||||
tunnel.5.option.i2cp.reduceQuantity=1
|
||||
tunnel.5.option.i2p.streaming.connectDelay=1000
|
||||
tunnel.5.option.inbound.length=3
|
||||
tunnel.5.option.inbound.lengthVariance=0
|
||||
tunnel.5.option.outbound.length=3
|
||||
tunnel.5.option.outbound.lengthVariance=0
|
||||
tunnel.5.startOnLoad=true
|
||||
|
||||
# I2P Git Repositories SSH Access
|
||||
tunnel.6.description=I2P Git Repositories SSH Access
|
||||
tunnel.6.interface=127.0.0.1
|
||||
tunnel.6.listenPort=7670
|
||||
tunnel.6.name=gitssh.idk.i2p
|
||||
tunnel.6.option.i2cp.closeIdleTime=1800000
|
||||
tunnel.6.option.i2cp.closeOnIdle=false
|
||||
tunnel.6.option.i2cp.delayOpen=true
|
||||
tunnel.6.option.i2cp.destination.sigType=7
|
||||
tunnel.6.option.i2cp.leaseSetEncType=4
|
||||
tunnel.6.option.i2cp.newDestOnResume=false
|
||||
tunnel.6.option.i2cp.reduceIdleTime=1200000
|
||||
tunnel.6.option.i2cp.reduceOnIdle=true
|
||||
tunnel.6.option.i2cp.reduceQuantity=1
|
||||
tunnel.6.option.inbound.backupQuantity=1
|
||||
tunnel.6.option.inbound.length=3
|
||||
tunnel.6.option.inbound.nickname=gitssh.idk.i2p
|
||||
tunnel.6.option.inbound.quantity=3
|
||||
tunnel.6.option.outbound.backupQuantity=1
|
||||
tunnel.6.option.outbound.length=3
|
||||
tunnel.6.option.outbound.nickname=gitssh.idk.i2p
|
||||
tunnel.6.option.outbound.quantity=3
|
||||
tunnel.6.sharedClient=false
|
||||
tunnel.6.startOnLoad=false
|
||||
tunnel.6.targetDestination=gitssh.idk.i2p
|
||||
tunnel.6.type=client
|
||||
|
16
i2pversion
16
i2pversion
@ -2,19 +2,15 @@
|
||||
|
||||
JNA_VERSION=5.11.0
|
||||
export JNA_VERSION=5.11.0
|
||||
|
||||
#Comment this out to build from an alternate branch or
|
||||
I2PFIREFOX_VERSION=0.0.34
|
||||
export I2PFIREFOX_VERSION=0.0.36
|
||||
# Comment this out to build from an alternate branch or
|
||||
# the tip of the master branch.
|
||||
VERSIONMAJOR=1
|
||||
VERSIONMINOR=9
|
||||
VERSIONBUILD=0
|
||||
VERSIONBUILD=6
|
||||
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
|
||||
VERSION=i2p-1.9.0
|
||||
export VERSION=i2p-1.9.0
|
||||
VERSION=i2p-jpackage-1.9.4
|
||||
export VERSION=i2p-jpackage-1.9.4
|
||||
|
||||
#Uncomment this to build from the tip of the master.
|
||||
#I2P_VERSION=1.8.0
|
||||
#export I2P_VERSION=1.8.0
|
||||
#VERSION=master
|
||||
#export VERSION="$VERSION"
|
||||
|
622
index.html
622
index.html
@ -17,6 +17,11 @@
|
||||
<div id="shownav">
|
||||
<div id="hidenav">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="..">
|
||||
Up one level ^
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="index.html">
|
||||
index
|
||||
@ -40,6 +45,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="returnhome" href="/">
|
||||
/
|
||||
</a>
|
||||
<h1>
|
||||
I2P Easy-Install Bundle for Windows(Also/formerly)I2P Browsing Profile for Firefox
|
||||
</h1>
|
||||
@ -67,7 +75,7 @@
|
||||
Build Dependencies:
|
||||
</h2>
|
||||
<p>
|
||||
To build this, you will need the following software packages (all available in Debian) :
|
||||
To build this, you will need the following software packages (all available in Debian and Ubuntu, see WSL section below) :
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
@ -87,8 +95,8 @@
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
In addition, you will need the NSIS plugin “ShellExecAsUser” which you can get from the
|
||||
<a href="https://nsis.sourceforge.io/ShellExecAsUser_plug-in" rel="nofollow">
|
||||
In addition, you will need the NSIS plugin “ShellExecAsUser” which you can get from the
|
||||
<a href="https://nsis.sourceforge.io/ShellExecAsUser_plug-in">
|
||||
NSIS Wiki Page
|
||||
</a>
|
||||
. In order to install
|
||||
@ -97,7 +105,7 @@
|
||||
WSL
|
||||
</code>
|
||||
, you can download the:
|
||||
<a href="https://nsis.sourceforge.io/mediawiki/images/6/68/ShellExecAsUser_amd64-Unicode.7z" rel="nofollow">
|
||||
<a href="https://nsis.sourceforge.io/mediawiki/images/6/68/ShellExecAsUser_amd64-Unicode.7z">
|
||||
7zip release
|
||||
</a>
|
||||
and copy the content of
|
||||
@ -110,215 +118,11 @@
|
||||
</code>
|
||||
.
|
||||
</p>
|
||||
<pre><code>cp -rv Plugins/* /usr/share/nsis/Plugins/
|
||||
</code></pre>
|
||||
<p>
|
||||
To build a Debian package, you’ll also need
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
checkinstall
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
Preparation
|
||||
</h2>
|
||||
<p>
|
||||
Before you build, run the targets
|
||||
</p>
|
||||
<pre><code> make clean-extensions
|
||||
make extensions
|
||||
</code></pre>
|
||||
<p>
|
||||
to update the extensions to point to their latest versions.
|
||||
</p>
|
||||
<h2>
|
||||
Windows Build
|
||||
</h2>
|
||||
<p>
|
||||
After installing the dependencies and completing the preparations,
|
||||
just run
|
||||
<code>
|
||||
make
|
||||
</code>
|
||||
. This will produce three files:
|
||||
</p>
|
||||
<p>
|
||||
profile.tgz - the firefox profile, plus a shell script which will
|
||||
launch it if Firefox is found in the $PATH on Unix-Like operating
|
||||
systems.
|
||||
app-profile.tgz - the Firefox profile plus a launcher shell script,
|
||||
which will launch a
|
||||
<em>
|
||||
modified
|
||||
</em>
|
||||
Firefox without a URL bar as a router
|
||||
console wrapper.
|
||||
install.exe - the windows installer, which sets up shortcuts to
|
||||
launch Firefox on Windows.
|
||||
</p>
|
||||
<p>
|
||||
When generating a Windows build it’s important to make sure that the
|
||||
licenses for all the bundled softare are included. This should happen
|
||||
automatically. When bundling software, describe the terms and where
|
||||
they are applied in the
|
||||
<code>
|
||||
LICENSE.index
|
||||
</code>
|
||||
, then add the full license
|
||||
to the
|
||||
<code>
|
||||
licenses
|
||||
</code>
|
||||
directory. Then, add the full license to the
|
||||
<code>
|
||||
cat
|
||||
</code>
|
||||
command in the
|
||||
<code>
|
||||
build/licenses
|
||||
</code>
|
||||
make target. The build/licenses
|
||||
target is run automatically during the build process.
|
||||
</p>
|
||||
<h2>
|
||||
Unix Support
|
||||
</h2>
|
||||
<p>
|
||||
It is possible to use these profiles on Linux and possibly other
|
||||
Unixes, if Firefox is already installed on the system. It can be
|
||||
installed system-wide using the
|
||||
<code>
|
||||
make install
|
||||
</code>
|
||||
target. Running
|
||||
<code>
|
||||
make install
|
||||
</code>
|
||||
requires root, and requires
|
||||
<code>
|
||||
make
|
||||
</code>
|
||||
to have been run
|
||||
first. To install on Unix, system-wide, run:
|
||||
</p>
|
||||
<pre><code> make
|
||||
sudo make install
|
||||
</code></pre>
|
||||
<p>
|
||||
To run without installing them system wide, unpack the
|
||||
<code>
|
||||
profile*.tgz
|
||||
</code>
|
||||
to a location of your choice and run the
|
||||
<code>
|
||||
i2pbrowser.sh
|
||||
</code>
|
||||
script. This
|
||||
will start a Firefox profile configured to use I2P.
|
||||
</p>
|
||||
<pre><code> tar xvf profile-0.3.tgz
|
||||
cd profile
|
||||
./i2pbrowser.sh
|
||||
</code></pre>
|
||||
<p>
|
||||
If you want to run the app-like i2pconfig browser, then follow the
|
||||
same steps with app-profile*.tgz.
|
||||
</p>
|
||||
<pre><code> tar xvf app-profile-0.3.tgz
|
||||
cd app-profile
|
||||
./i2pconfig.sh
|
||||
</code></pre>
|
||||
<p>
|
||||
To generate a
|
||||
<code>
|
||||
deb
|
||||
</code>
|
||||
package, install the package
|
||||
<code>
|
||||
checkinstall
|
||||
</code>
|
||||
and run
|
||||
the
|
||||
<code>
|
||||
make checkinstall
|
||||
</code>
|
||||
target after building with
|
||||
<code>
|
||||
make
|
||||
</code>
|
||||
.
|
||||
</p>
|
||||
<pre><code> make
|
||||
make checkinstall
|
||||
sudo apt install ./i2p-firefox*.deb
|
||||
</code></pre>
|
||||
<p>
|
||||
If you want to set up i2pconfig to run when you start the service
|
||||
with
|
||||
<code>
|
||||
sudo service i2p start
|
||||
</code>
|
||||
then you can run the script:
|
||||
</p>
|
||||
<pre><code> /usr/local/bin/i2p-config-service-setup
|
||||
<pre><code class="language-sh">cp -rv Plugins/* /usr/share/nsis/Plugins/
|
||||
</code></pre>
|
||||
<h2>
|
||||
Including a jpackaged I2P Router
|
||||
</h2>
|
||||
<p>
|
||||
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
|
||||
a Windows system and place it into a directory called
|
||||
<code>
|
||||
I2P
|
||||
</code>
|
||||
in your
|
||||
<code>
|
||||
i2p.firefox
|
||||
</code>
|
||||
checkout.
|
||||
</p>
|
||||
<p>
|
||||
Assuming a working java and jpackage environment on your Windows system, the
|
||||
following command should generate a suitable “App Image” in a directory
|
||||
called “I2P.”
|
||||
</p>
|
||||
<pre><code> export I2P_VERSION=0.9.49
|
||||
cp -R ../i2p.i2p/pkg-temp/lib build/lib
|
||||
jpackage --type app-image --name I2P --app-version "$I2P_VERSION" \
|
||||
--verbose \
|
||||
--resource-dir build/lib \
|
||||
--input build/lib --main-jar router.jar --main-class net.i2p.router.RouterLaunch
|
||||
</code></pre>
|
||||
<p>
|
||||
Transfer the I2P directory to the machine where you build i2p.firefox if
|
||||
necessary, then complete the regular build instructions. If a jpackaged I2P router
|
||||
isn’t present to use at build time, the inclusion will be skipped automatically
|
||||
with a non-fatal warning.
|
||||
</p>
|
||||
<p>
|
||||
In the near future, I’ll start providing a pre-built app image to ease the
|
||||
build process for non-Windows users.
|
||||
</p>
|
||||
<h2>
|
||||
End-to-End Windows build process using WSL
|
||||
</h2>
|
||||
<p>
|
||||
<strong>
|
||||
If you’ve already done this once, you can just use:
|
||||
</strong>
|
||||
<code>
|
||||
./build.sh && wsl make
|
||||
</code>
|
||||
<strong>
|
||||
in
|
||||
<code>
|
||||
git bash
|
||||
</code>
|
||||
</strong>
|
||||
to automatically build an installer.
|
||||
</p>
|
||||
<p>
|
||||
<strong>
|
||||
Prerequisites:
|
||||
@ -363,20 +167,156 @@
|
||||
%PATH%
|
||||
</code>
|
||||
. You must have Git for Windows installed. When installing git for Windows,
|
||||
you should select “Checkout as is, commit as is” and leave line-endings alone.
|
||||
you should select “Checkout as is, commit as is” and leave line-endings alone.
|
||||
</p>
|
||||
<p>
|
||||
TODO: Add links to the respective instructions for each of these.
|
||||
</p>
|
||||
<p>
|
||||
<strong>
|
||||
Note that after the dependencies are installed, this step is automated
|
||||
</strong>
|
||||
<strong>
|
||||
with
|
||||
<code>
|
||||
./build.sh
|
||||
</code>
|
||||
.
|
||||
</strong>
|
||||
</p>
|
||||
<p>
|
||||
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
|
||||
a Windows system and place it into a directory called
|
||||
<code>
|
||||
I2P
|
||||
</code>
|
||||
in your
|
||||
<code>
|
||||
i2p.firefox
|
||||
</code>
|
||||
checkout. Building without a jpackage is no longer supported.
|
||||
</p>
|
||||
<p>
|
||||
Assuming a working java and jpackage environment on your Windows system, the
|
||||
following command should generate a suitable “App Image” in a directory
|
||||
called “I2P.”
|
||||
</p>
|
||||
<pre><code> export I2P_VERSION=0.9.49
|
||||
cp -R ../i2p.i2p/pkg-temp/lib build/lib
|
||||
jpackage --type app-image --name I2P --app-version "$I2P_VERSION" \
|
||||
--verbose \
|
||||
--resource-dir build/lib \
|
||||
--input build/lib --main-jar router.jar --main-class net.i2p.router.RouterLaunch
|
||||
</code></pre>
|
||||
<p>
|
||||
Transfer the I2P directory to the machine where you build i2p.firefox if
|
||||
necessary, then complete the regular build instructions. If a jpackaged I2P router
|
||||
isn’t present to use at build time, the inclusion will be skipped automatically
|
||||
with a non-fatal warning.
|
||||
</p>
|
||||
<p>
|
||||
Pre-built app-images are available from my daily releases at:
|
||||
</p>
|
||||
<pre><code> https://github.com/eyedeekay/i2p.plugins.firefox/releases/
|
||||
</code></pre>
|
||||
<h2>
|
||||
Windows Build
|
||||
</h2>
|
||||
<p>
|
||||
After installing the dependencies and completing the preparations,
|
||||
just run
|
||||
<code>
|
||||
make
|
||||
</code>
|
||||
. 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.
|
||||
</p>
|
||||
<p>
|
||||
When generating a build it’s important to make sure that the
|
||||
licenses for all the bundled softare are included. This should happen
|
||||
automatically. When bundling software, describe the terms and where
|
||||
they are applied in the
|
||||
<code>
|
||||
LICENSE.index
|
||||
</code>
|
||||
, then add the full license
|
||||
to the
|
||||
<code>
|
||||
licenses
|
||||
</code>
|
||||
directory. Then, add the full license to the
|
||||
<code>
|
||||
cat
|
||||
</code>
|
||||
command in the
|
||||
<code>
|
||||
build/licenses
|
||||
</code>
|
||||
make target. The build/licenses
|
||||
target is run automatically during the build process.
|
||||
</p>
|
||||
<h2>
|
||||
End-to-End Windows build process using WSL(
|
||||
<strong>
|
||||
Recommended
|
||||
</strong>
|
||||
)
|
||||
</h2>
|
||||
<p>
|
||||
<strong>
|
||||
See
|
||||
<code>
|
||||
config.sh
|
||||
</code>
|
||||
and
|
||||
<code>
|
||||
i2pversion
|
||||
</code>
|
||||
for instructions on how to tweak
|
||||
</strong>
|
||||
<strong>
|
||||
the build process. File an issue if you need help.
|
||||
</strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong>
|
||||
If you’ve already done this once, you can just use:
|
||||
</strong>
|
||||
<code>
|
||||
./unsigned.sh
|
||||
</code>
|
||||
<strong>
|
||||
in
|
||||
<code>
|
||||
git bash
|
||||
</code>
|
||||
</strong>
|
||||
to automatically build an installer. If you
|
||||
are using this method, you may use the
|
||||
<code>
|
||||
makensis
|
||||
</code>
|
||||
and
|
||||
<code>
|
||||
make
|
||||
</code>
|
||||
from
|
||||
Ubuntu in WSL.
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p>
|
||||
<a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps" rel="nofollow">
|
||||
Set up Windows Subsystem for Linux per Microsoft’s instructions
|
||||
<a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps">
|
||||
Set up Windows Subsystem for Linux per Microsoft’s instructions
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="https://www.microsoft.com/store/apps/9n6svws3rx71" rel="nofollow">
|
||||
Install Ubuntu Focal per Microsoft’s instructions
|
||||
<a href="https://www.microsoft.com/store/apps/9n6svws3rx71">
|
||||
Install Ubuntu Focal per Microsoft’s instructions
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
@ -439,7 +379,7 @@ cd ..
|
||||
</li>
|
||||
</ol>
|
||||
<h2>
|
||||
End-to-End Windows build process using Cygwin
|
||||
End-to-End Windows build process using Cygwin(More difficult than WSL for now)
|
||||
</h2>
|
||||
<p>
|
||||
I highly recommend you look into the Chocolatey package manager, which makes it much
|
||||
@ -449,50 +389,36 @@ cd ..
|
||||
<strong>
|
||||
Prerequisites:
|
||||
</strong>
|
||||
You need to have OpenJDK 14 or greater installed and configured
|
||||
with your
|
||||
In addition to the other prerequisites, you will need to to have
|
||||
<code>
|
||||
%JAVA_HOME%
|
||||
make
|
||||
</code>
|
||||
environment variable configured and
|
||||
installed with
|
||||
<code>
|
||||
%JAVA_HOME%/bin
|
||||
cygwin
|
||||
</code>
|
||||
on
|
||||
your
|
||||
. If you are using this method, you cannot use the
|
||||
automated build scripts without a hack. You will need to create a file called
|
||||
<code>
|
||||
%PATH%
|
||||
wsl
|
||||
</code>
|
||||
. You need to have Apache Ant installed and configured with
|
||||
in a place that is in the path used by
|
||||
<code>
|
||||
%ANT_HOME%
|
||||
git-bash.exe
|
||||
</code>
|
||||
environment variable configured and
|
||||
<code>
|
||||
%ANT_HOME%/bin
|
||||
</code>
|
||||
on your
|
||||
<code>
|
||||
%PATH%
|
||||
</code>
|
||||
. You must have
|
||||
WSL and git bash installed. You must have
|
||||
<code>
|
||||
NSIS.exe
|
||||
</code>
|
||||
installed and
|
||||
<code>
|
||||
makensis
|
||||
</code>
|
||||
available on your
|
||||
<code>
|
||||
%PATH%
|
||||
</code>
|
||||
. You must have Git for Windows installed. When installing git for Windows, you should
|
||||
select “Checkout as is, commit as is” and leave line-endings alone.
|
||||
sessions, with the content:
|
||||
</p>
|
||||
<pre><code>#! /usr/bin/env bash
|
||||
$@
|
||||
</code></pre>
|
||||
<p>
|
||||
TODO: Add links to the respective instructions for each of these.
|
||||
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
|
||||
<code>
|
||||
cygwin
|
||||
</code>
|
||||
. Cygwin builds without
|
||||
git bash are not likely to work.
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
@ -578,7 +504,7 @@ cd ..
|
||||
<code>
|
||||
.exe
|
||||
</code>
|
||||
file produced by NSIS, you’re almost ready to
|
||||
file produced by NSIS, you’re almost ready to
|
||||
do a release. As a final step, someone must sign the
|
||||
<code>
|
||||
.exe
|
||||
@ -587,15 +513,11 @@ cd ..
|
||||
Certificate which Windows will recognize. The current signer of the Windows
|
||||
bundle is Zlatinb. Standard Windows signing tools are used.
|
||||
</p>
|
||||
<pre><code># Release Copypasta
|
||||
./clean.sh
|
||||
wsl make distclean
|
||||
wsl make clean-extensions
|
||||
wsl make extensions
|
||||
./build.sh
|
||||
wsl make
|
||||
./sign.sh
|
||||
<pre><code class="language-sh">./release.sh
|
||||
</code></pre>
|
||||
<p>
|
||||
produces the binary.
|
||||
</p>
|
||||
<h2>
|
||||
Building a signed update file
|
||||
</h2>
|
||||
@ -614,23 +536,82 @@ wsl make
|
||||
Docker Support
|
||||
</h2>
|
||||
<p>
|
||||
You can use a Docker container to install this browser profile as well. In order
|
||||
to do this, you can run the commands:
|
||||
<strong>
|
||||
MOVED, DEPRECATION NOTICE:
|
||||
</strong>
|
||||
Most of this functionality has been moved
|
||||
to
|
||||
<a href="http://git.idk.i2p/idk/i2p.plugins.native">
|
||||
http://git.idk.i2p/idk/i2p.plugins.native
|
||||
</a>
|
||||
which is more stable,
|
||||
easier to build and use, and easier to incorporate into other
|
||||
projects.
|
||||
</p>
|
||||
<pre><code> xhost + local:docker
|
||||
docker run -it --rm \
|
||||
--net=host \
|
||||
-e DISPLAY=unix$(DISPLAY) \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
geti2p/i2p.firefox firefox --profile /src/build/profile
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://git.idk.i2p/idk/i2p.plugins.firefox/-/blob/main/docker.sh">
|
||||
https://git.idk.i2p/idk/i2p.plugins.firefox/-/blob/main/docker.sh
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
Unix Support
|
||||
</h2>
|
||||
<p>
|
||||
To build and run the container locally, clone this repository and run the
|
||||
<strong>
|
||||
MOVED. DEPRECATION NOTICE:
|
||||
</strong>
|
||||
Most of this functionality has been moved
|
||||
to
|
||||
<a href="http://git.idk.i2p/idk/i2p.plugins.native">
|
||||
http://git.idk.i2p/idk/i2p.plugins.native
|
||||
</a>
|
||||
which is more stable,
|
||||
easier to build and use, and easier to incorporate into other
|
||||
projects. It is the better option for nearly every non-Windows case
|
||||
right now. You can get binary packages from:
|
||||
</p>
|
||||
<pre><code> make run
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/eyedeekay/i2p.plugins.firefox/releases">
|
||||
https://github.com/eyedeekay/i2p.plugins.firefox/releases
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
target.
|
||||
or look at
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://i2pgit.org/idk/i2p.plugins.firefox/-/blob/master/PACKAGES.md">
|
||||
https://i2pgit.org/idk/i2p.plugins.firefox/-/blob/master/PACKAGES.md
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
for instructions on how to build your own packages. These packages are
|
||||
unofficial! Although I do dogfood most of them and the
|
||||
<code>
|
||||
.jar
|
||||
</code>
|
||||
gets thorough
|
||||
testing.
|
||||
</p>
|
||||
<p>
|
||||
<strong>
|
||||
The only remotely interesting Unix functionality that remains in this
|
||||
</strong>
|
||||
<strong>
|
||||
repository is the construction of a portable. You can use
|
||||
<code>
|
||||
targz.sh
|
||||
</code>
|
||||
to
|
||||
</strong>
|
||||
<strong>
|
||||
generate that.
|
||||
</strong>
|
||||
</p>
|
||||
<h2>
|
||||
Issues
|
||||
@ -638,47 +619,110 @@ wsl make
|
||||
<p>
|
||||
To report issues against this browser profile, please file issues
|
||||
at
|
||||
<a href="https://i2pgit.org/i2p-hackers/i2p.firefox" rel="nofollow">
|
||||
<a href="https://i2pgit.org/i2p-hackers/i2p.firefox">
|
||||
the official Gitlab
|
||||
</a>
|
||||
or the
|
||||
<a href="https://github.com/i2p/i2p.firefox" rel="nofollow">
|
||||
<a href="https://github.com/i2p/i2p.firefox">
|
||||
Github Mirror
|
||||
</a>
|
||||
. Issues
|
||||
pertaining to the plugins may be reported to their upstream
|
||||
maintainers if it’s determined that our configuration is not at
|
||||
maintainers if it’s determined that our configuration is not at
|
||||
fault.
|
||||
</p>
|
||||
<h2>
|
||||
Credits
|
||||
</h2>
|
||||
<p>
|
||||
NoScript is developed on Github by
|
||||
<code>
|
||||
hackademix
|
||||
</code>
|
||||
and the community:
|
||||
-
|
||||
<a href="https://github.com/hackademix/noscript" rel="nofollow">
|
||||
https://github.com/hackademix/noscript
|
||||
</a>
|
||||
This profile manager makes use of a set of browser extensions which are largely the work of others.
|
||||
It makes use of dependencies that are the work of others. In many ways, it’s merely an elaborate
|
||||
configuration tool. A smart one, but a configuration tool nonetheless. Many thanks to the following
|
||||
projects, developers, and communities:
|
||||
</p>
|
||||
<h3>
|
||||
Firefox and Chrome Extensions
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://noscript.net">
|
||||
NoScript - Giorgio Maone and others
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.eff.org/https-everywhere">
|
||||
HTTPS Everywhere - Electronic Frontier Foundation
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://ublockorigin.com/">
|
||||
uBlock Origin - Raymond Gorhill and others
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.localcdn.org/">
|
||||
LocalCDN - nobody and others
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://jshelter.org/">
|
||||
jShelter - Libor Polčák and others
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Firefox Configuration Modifiations
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/arkenfox/user.js/">
|
||||
Arkenfox - Thorin Oakenpants and Others
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
HTTPS Everywhere is developed on Github by the EFF:
|
||||
-
|
||||
<a href="https://github.com/EFForg/https-everywhere" rel="nofollow">
|
||||
https://github.com/EFForg/https-everywhere
|
||||
You can find the license files for each of the these projects in the
|
||||
<code>
|
||||
src/i2p.firefox.*.profile/extensions/*
|
||||
</code>
|
||||
directory for Firefox, and the
|
||||
<code>
|
||||
src/i2p.chromium.*.profile/extensions/*.js/*
|
||||
</code>
|
||||
directories for Chromium within
|
||||
the
|
||||
<a href="https://i2pgit.org/idk/i2p.plugins.firefox">
|
||||
<code>
|
||||
i2p.plugins.firefox
|
||||
</code>
|
||||
</a>
|
||||
project.
|
||||
</p>
|
||||
<p>
|
||||
I2P in Private Browsing is developed on Gitlab and Github by idk and the community:
|
||||
-
|
||||
<a href="https://i2pgit.org/idk/I2P-in-Private-Browsing-Mode-Firefox" rel="nofollow">
|
||||
<a href="https://i2pgit.org/idk/I2P-in-Private-Browsing-Mode-Firefox">
|
||||
https://i2pgit.org/idk/I2P-in-Private-Browsing-Mode-Firefox
|
||||
</a>
|
||||
-
|
||||
<a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox" rel="nofollow">
|
||||
<a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox">
|
||||
https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox
|
||||
</a>
|
||||
</p>
|
||||
<div id="sourcecode">
|
||||
<span id="sourcehead">
|
||||
<strong>
|
||||
Get the source code:
|
||||
</strong>
|
||||
</span>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/eyedeekay/i2p.firefox">
|
||||
Source Repository: (https://github.com/eyedeekay/i2p.firefox)
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<a href="#show">
|
||||
Show license
|
||||
|
306
java/net/i2p/router/CopyConfigDir.java
Normal file
306
java/net/i2p/router/CopyConfigDir.java
Normal file
@ -0,0 +1,306 @@
|
||||
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.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
|
||||
public class CopyConfigDir {
|
||||
static final Logger logger = Logger.getLogger("configlog");
|
||||
|
||||
public static void initLogger() {
|
||||
try {
|
||||
// This block configure the logger with handler and formatter
|
||||
FileHandler fh = new FileHandler(logFile().toString());
|
||||
logger.addHandler(fh);
|
||||
SimpleFormatter formatter = new SimpleFormatter();
|
||||
fh.setFormatter(formatter);
|
||||
// the following statement is used to log any messages
|
||||
logger.info("My first log");
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean copyDirectory(String baseDir, String workDir) {
|
||||
File baseFile = new File(baseDir);
|
||||
File workFile = new File(workDir);
|
||||
return copyDirectory(baseFile, workFile);
|
||||
}
|
||||
|
||||
public static 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 (!copyFile(file, new File(newPath), true))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static 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())
|
||||
if (!copyFileNeverOverwrite(
|
||||
file,
|
||||
new File(newPath))) // new File(workDir, file.toString())))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean copyFileNeverOverwrite(String basePath,
|
||||
String workPath) {
|
||||
File baseFile = new File(basePath);
|
||||
File workFile = new File(workPath);
|
||||
return copyFileNeverOverwrite(baseFile, workFile);
|
||||
}
|
||||
|
||||
public static boolean copyFileNeverOverwrite(File basePath, File workPath) {
|
||||
return copyFile(basePath, workPath, false);
|
||||
}
|
||||
|
||||
public static boolean copyFile(File basePath, File workPath,
|
||||
boolean overWrite) {
|
||||
if (!basePath.exists()) {
|
||||
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!overWrite && workPath.exists()) {
|
||||
logger.info(workPath.getAbsolutePath() +
|
||||
" already exists, not overwriting");
|
||||
return true;
|
||||
}
|
||||
|
||||
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 true;
|
||||
} catch (Throwable e) {
|
||||
logger.warning(e.toString());
|
||||
logger.warning("failed to copy " + basePath.getAbsolutePath() + " to " +
|
||||
workPath.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected static File selectHome() { // throws Exception {
|
||||
String path_override = System.getenv("I2P_CONFIG");
|
||||
if (path_override != null) {
|
||||
File path = new File(path_override);
|
||||
if (path != null && path.exists()) {
|
||||
if (path.isDirectory())
|
||||
return path.getAbsoluteFile();
|
||||
else
|
||||
throw new RuntimeException("I2P_CONFIG is not a directory: " + path);
|
||||
}
|
||||
}
|
||||
File i2p = appImageHome();
|
||||
logger.info("Checking for signs of life in I2P_CONFIG directory: " + i2p);
|
||||
return i2p;
|
||||
}
|
||||
|
||||
protected static File selectProgramFile() {
|
||||
String path_override = System.getenv("I2P");
|
||||
if (path_override != null) {
|
||||
File path = new File(path_override);
|
||||
if (path.exists()) {
|
||||
if (path.isDirectory())
|
||||
return path.getAbsoluteFile();
|
||||
else
|
||||
throw new RuntimeException("I2P is not a directory: " + path);
|
||||
}
|
||||
}
|
||||
File i2p = appImageHome();
|
||||
logger.info("Checking for signs of life in I2P directory: " + i2p);
|
||||
return i2p;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the OS name(windows, mac, linux only)
|
||||
*
|
||||
* @return os name in lower-case, "windows" "mac" or "linux"
|
||||
*/
|
||||
protected static String osName() {
|
||||
String osName = System.getProperty("os.name").toLowerCase();
|
||||
if (osName.contains("windows"))
|
||||
return "windows";
|
||||
if (osName.contains("mac"))
|
||||
return "mac";
|
||||
return "linux";
|
||||
}
|
||||
|
||||
/**
|
||||
* get the path to the java home, for jpackage this is related to the
|
||||
* executable itself, which is handy to know. It's a directory called runtime,
|
||||
* relative to the root of the app-image on each platform:
|
||||
*
|
||||
* Windows - Root of appimage is 1 directory above directory named runtime
|
||||
* ./runtime
|
||||
*
|
||||
* Linux - Root of appimage is 2 directories above directory named runtime
|
||||
* ./lib/runtime
|
||||
*
|
||||
* Mac OSX - Unknown for now
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected static File javaHome() {
|
||||
File jrehome = new File(System.getProperty("java.home"));
|
||||
if (jrehome != null) {
|
||||
if (jrehome.exists()) {
|
||||
return jrehome;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the path to the root 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.
|
||||
*
|
||||
* @return the app-image root
|
||||
*/
|
||||
protected static File appImageHome() {
|
||||
File jreHome = javaHome();
|
||||
if (jreHome != null) {
|
||||
switch (osName()) {
|
||||
case "windows":
|
||||
return jreHome.getAbsoluteFile().getParentFile();
|
||||
case "mac":
|
||||
case "linux":
|
||||
return jreHome.getAbsoluteFile().getParentFile().getParentFile();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 static String appImageExe() {
|
||||
File aih = appImageHome();
|
||||
if (aih != null) {
|
||||
switch (osName()) {
|
||||
case "windows":
|
||||
return "I2P.exe";
|
||||
case "mac":
|
||||
case "linux":
|
||||
return "./bin/I2P";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the path to the default config of the app-image by getting the path to
|
||||
* java.home and the OS, and traversing up to the app-image root based on that
|
||||
* information, then appending the config directory to the end onn a
|
||||
* per-platform basis
|
||||
*
|
||||
* @return the app-image root
|
||||
*/
|
||||
protected static File appImageConfig() {
|
||||
File aih = appImageHome();
|
||||
if (aih == null) {
|
||||
return null;
|
||||
}
|
||||
String osName = osName();
|
||||
switch (osName) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected static boolean copyConfigDir() {
|
||||
File appImageConfigDir = appImageConfig();
|
||||
File appImageHomeDir = selectHome();
|
||||
return copyConfigDirectory(appImageConfigDir, appImageHomeDir);
|
||||
}
|
||||
|
||||
protected static String routerConfig() {
|
||||
File appImageHomeDir = selectHome();
|
||||
File routerConf = new File(appImageHomeDir, "router.config");
|
||||
if (routerConf != null) {
|
||||
if (routerConf.exists()) {
|
||||
return routerConf.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* set up the path to the log file
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected static File logFile() { return logFile("launcher.log"); }
|
||||
|
||||
/**
|
||||
* set up the path to the log file
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected static File logFile(String p) {
|
||||
File log = new File(selectProgramFile(), "logs");
|
||||
if (!log.exists())
|
||||
log.mkdirs();
|
||||
return new File(log, p);
|
||||
}
|
||||
}
|
@ -5,29 +5,31 @@ 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 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 + ")");
|
||||
}
|
||||
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,7 +1,5 @@
|
||||
package net.i2p.router;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
@ -12,100 +10,114 @@ 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);
|
||||
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;
|
||||
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;
|
||||
/** File not found. */
|
||||
int SE_ERR_FNF = 2;
|
||||
|
||||
/** Path not found. */
|
||||
int SE_ERR_PNF = 3;
|
||||
/** Path not found. */
|
||||
int SE_ERR_PNF = 3;
|
||||
|
||||
/** Access denied. */
|
||||
int SE_ERR_ACCESSDENIED = 5;
|
||||
/** Access denied. */
|
||||
int SE_ERR_ACCESSDENIED = 5;
|
||||
|
||||
/** Out of memory. */
|
||||
int SE_ERR_OOM = 8;
|
||||
/** Out of memory. */
|
||||
int SE_ERR_OOM = 8;
|
||||
|
||||
/** DLL not found. */
|
||||
int SE_ERR_DLLNOTFOUND = 32;
|
||||
/** DLL not found. */
|
||||
int SE_ERR_DLLNOTFOUND = 32;
|
||||
|
||||
/** Cannot share an open file. */
|
||||
int SE_ERR_SHARE = 26;
|
||||
/** Cannot share an open file. */
|
||||
int SE_ERR_SHARE = 26;
|
||||
|
||||
int SEE_MASK_NOCLOSEPROCESS = 0x00000040;
|
||||
int SEE_MASK_NOCLOSEPROCESS = 0x00000040;
|
||||
|
||||
int ShellExecute(int i, String lpVerb, String lpFile, String lpParameters, String lpDirectory, int nShow);
|
||||
int ShellExecute(int i, String lpVerb, String lpFile, String lpParameters,
|
||||
String lpDirectory, int nShow);
|
||||
|
||||
boolean ShellExecuteEx(SHELLEXECUTEINFO lpExecInfo);
|
||||
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 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;
|
||||
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;
|
||||
/*
|
||||
* 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",
|
||||
});
|
||||
}
|
||||
protected List getFieldOrder() {
|
||||
return Arrays.asList(new String[] {
|
||||
"cbSize",
|
||||
"fMask",
|
||||
"hwnd",
|
||||
"lpVerb",
|
||||
"lpFile",
|
||||
"lpParameters",
|
||||
"lpDirectory",
|
||||
"nShow",
|
||||
"hInstApp",
|
||||
"lpIDList",
|
||||
"lpClass",
|
||||
"hKeyClass",
|
||||
"dwHotKey",
|
||||
"hMonitor",
|
||||
"hProcess",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package net.i2p.router;
|
||||
|
||||
import static net.i2p.update.UpdateType.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.InetAddress;
|
||||
import java.net.ServerSocket;
|
||||
@ -8,224 +10,312 @@ import java.util.*;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
|
||||
import net.i2p.crypto.*;
|
||||
|
||||
import net.i2p.app.ClientAppManager;
|
||||
import net.i2p.router.RouterLaunch;
|
||||
import net.i2p.crypto.*;
|
||||
import net.i2p.i2pfirefox.*;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.RouterLaunch;
|
||||
import net.i2p.update.*;
|
||||
import net.i2p.update.UpdateManager;
|
||||
import net.i2p.update.UpdatePostProcessor;
|
||||
import net.i2p.util.SystemVersion;
|
||||
import net.i2p.update.*;
|
||||
import net.i2p.i2pfirefox.*;
|
||||
|
||||
import static net.i2p.update.UpdateType.*;
|
||||
|
||||
/**
|
||||
* Launches a router from %PROGRAMFILES%/I2P using configuration data in
|
||||
* %LOCALAPPDATA%/I2P.. Uses Java 9 APIs.
|
||||
*
|
||||
*
|
||||
* Sets the following properties:
|
||||
* i2p.dir.base - this points to the (read-only) resources inside the bundle
|
||||
* i2p.dir.config this points to the (read-write) config directory in local
|
||||
* appdata
|
||||
* router.pid - the pid of the java process.
|
||||
*/
|
||||
public class WinLauncher {
|
||||
static Logger logger = Logger.getLogger("launcherlog");
|
||||
static FileHandler fh;
|
||||
public class WinLauncher extends CopyConfigDir {
|
||||
static WindowsUpdatePostProcessor wupp = null;
|
||||
private static Router i2pRouter;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
// This block configure the logger with handler and formatter
|
||||
fh = new FileHandler(logFile().toString());
|
||||
logger.addHandler(fh);
|
||||
SimpleFormatter formatter = new SimpleFormatter();
|
||||
fh.setFormatter(formatter);
|
||||
// the following statement is used to log any messages
|
||||
logger.info("My first log");
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
boolean privateBrowsing = false;
|
||||
if (args != null && args.length > 0) {
|
||||
logger.info("checking for private browsing");
|
||||
if (args[0].equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
logger.info("private browsing is true, profile will be discarded at end of session");
|
||||
public static void main(String[] args) throws Exception {
|
||||
setupLauncher();
|
||||
initLogger();
|
||||
boolean privateBrowsing = false;
|
||||
boolean usabilityMode = false;
|
||||
boolean chromiumFirst = false;
|
||||
int proxyTimeoutTime = 200;
|
||||
ArrayList<String> newArgsList = new ArrayList<String>();
|
||||
|
||||
if (args != null) {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
if (arg.equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
logger.info(
|
||||
"Private browsing is true, profile will be discarded at end of session.");
|
||||
} else if (arg.equals("-chromium")) {
|
||||
chromiumFirst = true;
|
||||
logger.info("Chromium will be selected before Firefox.");
|
||||
} else if (arg.equals("-usability")) {
|
||||
usabilityMode = true;
|
||||
logger.info(
|
||||
"Usability mode is true, using alternate extensions loadout.");
|
||||
} else if (arg.equals("-noproxycheck")) {
|
||||
proxyTimeoutTime = 0;
|
||||
logger.info("Proxy timeout time set to zero");
|
||||
} else {
|
||||
// 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
|
||||
// they're reaching a router console
|
||||
if (arg.startsWith("http://localhost:76")) {
|
||||
newArgsList.add(arg);
|
||||
proxyTimeoutTime = 0;
|
||||
} else if (arg.startsWith("http://127.0.0.1:76")) {
|
||||
newArgsList.add(arg);
|
||||
proxyTimeoutTime = 0;
|
||||
} else if (arg.startsWith("https://localhost:76")) {
|
||||
newArgsList.add(arg);
|
||||
proxyTimeoutTime = 0;
|
||||
} else if (arg.startsWith("https://127.0.0.1:76")) {
|
||||
newArgsList.add(arg);
|
||||
proxyTimeoutTime = 0;
|
||||
} else if (proxyTimeoutTime > 0) {
|
||||
newArgsList.add(arg);
|
||||
} else if (!isAvailable(4444)) {
|
||||
newArgsList.add(arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File programs = selectProgramFile();
|
||||
if (!programs.exists())
|
||||
programs.mkdirs();
|
||||
else if (!programs.isDirectory()) {
|
||||
logger.warning(programs + " exists but is not a directory. Please get it out of the way");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
File home = selectHome();
|
||||
if (!home.exists())
|
||||
home.mkdirs();
|
||||
else if (!home.isDirectory()) {
|
||||
logger.warning(home + " exists but is not a directory. Please get it out of the way");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
if (i2pIsRunning()) {
|
||||
logger.warning("I2P is already running");
|
||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||
System.out.println("i2pBrowser");
|
||||
i2pBrowser.launch(privateBrowsing);
|
||||
return;
|
||||
}
|
||||
|
||||
System.setProperty("i2p.dir.base", programs.getAbsolutePath());
|
||||
System.setProperty("i2p.dir.config", home.getAbsolutePath());
|
||||
System.setProperty("router.pid", String.valueOf(ProcessHandle.current().pid()));
|
||||
logger.info("\t" + System.getProperty("i2p.dir.base") + "\n\t" + System.getProperty("i2p.dir.config")
|
||||
+ "\n\t" + System.getProperty("router.pid"));
|
||||
|
||||
// wupp.i2pRouter = new Router(System.getProperties());
|
||||
logger.info("Router is configured");
|
||||
|
||||
Thread registrationThread = new Thread(REGISTER_UPP);
|
||||
registrationThread.setName("UPP Registration");
|
||||
registrationThread.setDaemon(true);
|
||||
registrationThread.start();
|
||||
|
||||
// wupp.i2pRouter.runRouter();
|
||||
RouterLaunch.main(args);
|
||||
}
|
||||
|
||||
// see https://stackoverflow.com/questions/434718/sockets-discover-port-availability-using-java
|
||||
public static boolean isAvailable(int portNr) {
|
||||
boolean portFree;
|
||||
try (var ignored = new ServerSocket(portNr)) {
|
||||
portFree = true;
|
||||
} catch (IOException e) {
|
||||
portFree = false;
|
||||
}
|
||||
return portFree;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean i2pIsRunning() {
|
||||
sleep(2000);
|
||||
// check if there's something listening on port 7657(Router Console)
|
||||
if (!isAvailable(7657)) {
|
||||
return true;
|
||||
}
|
||||
// check if there's something listening on port 7654(I2CP)
|
||||
if (!isAvailable(7654)) {
|
||||
return true;
|
||||
}
|
||||
// check for the existence of router.ping file, if it's less then 2 minutes old,
|
||||
// exit
|
||||
File home = selectHome();
|
||||
File ping = new File(home, "router.ping");
|
||||
if (ping.exists()) {
|
||||
long diff = System.currentTimeMillis() - ping.lastModified();
|
||||
if (diff < 60 * 1000) {
|
||||
logger.info("router.ping exists and is less than 1 minute old, I2P appears to be running already.");
|
||||
logger.info("If I2P is not running, wait 60 seconds and try again.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
File programs = programFile();
|
||||
File home = homeDir();
|
||||
|
||||
// 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 (!copyConfigDir()) {
|
||||
logger.severe("Cannot copy the configuration directory");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
System.setProperty("i2p.dir.base", programs.getAbsolutePath());
|
||||
System.setProperty("i2p.dir.config", home.getAbsolutePath());
|
||||
System.setProperty("router.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
|
||||
* to start the browser, it will start in the wrong directory and fail
|
||||
* to find the JVM and Runtime bundle. This broke Windows 11 installs.
|
||||
*/
|
||||
System.setProperty("user.dir", programs.getAbsolutePath());
|
||||
logger.info("\t" + System.getProperty("user.dir"));
|
||||
logger.info("\t" + System.getProperty("i2p.dir.base"));
|
||||
logger.info("\t" + System.getProperty("i2p.dir.config"));
|
||||
logger.info("\t" + System.getProperty("router.pid"));
|
||||
if (launchBrowser(privateBrowsing, usabilityMode, chromiumFirst,
|
||||
proxyTimeoutTime, newArgsList)) {
|
||||
System.exit(0);
|
||||
}
|
||||
i2pRouter = new Router(routerConfig(), System.getProperties());
|
||||
if (i2pRouter.saveConfig("routerconsole.browser", null)) {
|
||||
logger.info("removed routerconsole.browser config");
|
||||
}
|
||||
if (i2pRouter.saveConfig("routerconsole.browser",
|
||||
appImageExe() + " -noproxycheck")) {
|
||||
logger.info("updated routerconsole.browser config " + appImageExe());
|
||||
}
|
||||
logger.info("Router is configured");
|
||||
|
||||
Thread registrationThread = new Thread(REGISTER_UPP);
|
||||
registrationThread.setName("UPP Registration");
|
||||
registrationThread.setDaemon(true);
|
||||
registrationThread.start();
|
||||
|
||||
setNotStarting();
|
||||
|
||||
i2pRouter.runRouter();
|
||||
}
|
||||
|
||||
private static void setupLauncher() {
|
||||
File jrehome = javaHome();
|
||||
logger.info("jre home is: " + jrehome.getAbsolutePath());
|
||||
File appimagehome = appImageHome();
|
||||
logger.info("appimage home is: " + appimagehome.getAbsolutePath());
|
||||
}
|
||||
|
||||
private static File programFile() {
|
||||
File programs = selectProgramFile();
|
||||
if (!programs.exists())
|
||||
programs.mkdirs();
|
||||
else if (!programs.isDirectory()) {
|
||||
logger.warning(
|
||||
programs +
|
||||
" exists but is not a directory. Please get it out of the way");
|
||||
System.exit(1);
|
||||
}
|
||||
return programs;
|
||||
}
|
||||
|
||||
private static File homeDir() {
|
||||
File home = selectHome();
|
||||
if (!home.exists())
|
||||
home.mkdirs();
|
||||
else if (!home.isDirectory()) {
|
||||
logger.warning(
|
||||
home +
|
||||
" exists but is not a directory. Please get it out of the way");
|
||||
System.exit(1);
|
||||
}
|
||||
return home;
|
||||
}
|
||||
|
||||
private static boolean launchBrowser(boolean privateBrowsing,
|
||||
boolean usabilityMode,
|
||||
boolean chromiumFirst,
|
||||
int proxyTimeoutTime,
|
||||
ArrayList<String> newArgsList) {
|
||||
if (i2pIsRunning()) {
|
||||
logger.info("I2P is already running, launching an I2P browser");
|
||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||
i2pBrowser.usability = usabilityMode;
|
||||
i2pBrowser.chromiumFirst = chromiumFirst;
|
||||
i2pBrowser.firefox = !chromiumFirst;
|
||||
i2pBrowser.chromium = chromiumFirst;
|
||||
if (chromiumFirst) {
|
||||
logger.warning("favoring Chromium instead of Firefox");
|
||||
}
|
||||
i2pBrowser.setProxyTimeoutTime(proxyTimeoutTime);
|
||||
System.out.println("I2PBrowser");
|
||||
String[] newArgs = newArgsList.toArray(new String[newArgsList.size()]);
|
||||
setNotStarting();
|
||||
i2pBrowser.launch(privateBrowsing, newArgs);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// see
|
||||
// https://stackoverflow.com/questions/434718/sockets-discover-port-availability-using-java
|
||||
private static boolean isAvailable(int portNr) {
|
||||
boolean portFree;
|
||||
try (var ignored = new ServerSocket(portNr)) {
|
||||
portFree = true;
|
||||
} catch (IOException e) {
|
||||
portFree = false;
|
||||
}
|
||||
return portFree;
|
||||
}
|
||||
|
||||
private static boolean i2pIsRunningCheck() {
|
||||
// check if there's something listening on port 7657(Router Console)
|
||||
if (!isAvailable(7657))
|
||||
return true;
|
||||
// check if there's something listening on port 7654(I2CP)
|
||||
if (!isAvailable(7654))
|
||||
return true;
|
||||
if (checkPing())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void setNotStarting() {
|
||||
logger.info("removing startup file, the application has started");
|
||||
File home = selectHome();
|
||||
File starting = new File(home, "starting");
|
||||
if (starting.exists()) {
|
||||
starting.delete();
|
||||
}
|
||||
}
|
||||
|
||||
private static void setStarting() {
|
||||
logger.info("creating startup file, router is starting up");
|
||||
File home = selectHome();
|
||||
File starting = new File(home, "starting");
|
||||
if (!starting.exists()) {
|
||||
try {
|
||||
starting.createNewFile();
|
||||
} catch (IOException e) {
|
||||
logger.info(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkStarting() {
|
||||
logger.info("checking startup file");
|
||||
File home = selectHome();
|
||||
File starting = new File(home, "starting");
|
||||
if (starting.exists()) {
|
||||
logger.info("startup file exists, I2P is already starting up");
|
||||
return true;
|
||||
}
|
||||
logger.info("startup file does not exist but we're running now");
|
||||
setStarting();
|
||||
return false;
|
||||
}
|
||||
|
||||
// check for the existence of router.ping file, if it's less then 2
|
||||
// minutes old, exit
|
||||
private static boolean checkPing() {
|
||||
File home = selectHome();
|
||||
File ping = new File(home, "router.ping");
|
||||
if (ping.exists()) {
|
||||
long diff = System.currentTimeMillis() - ping.lastModified();
|
||||
if (diff > 60 * 1000) {
|
||||
logger.info(
|
||||
"router.ping exists and is more than 1 minute old, I2P does not appear to be running.");
|
||||
logger.info("If I2P is running, report this as a bug.");
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static final Runnable REGISTER_UPP = () -> {
|
||||
|
||||
// first wait for the RouterContext to appear
|
||||
RouterContext ctx;
|
||||
while ((ctx = (RouterContext) RouterContext.getCurrentContext()) == null) {
|
||||
sleep(1000);
|
||||
}
|
||||
|
||||
// then wait for the update manager
|
||||
|
||||
ClientAppManager cam;
|
||||
while ((cam = ctx.clientAppManager()) == null) {
|
||||
sleep(1000);
|
||||
}
|
||||
|
||||
UpdateManager um;
|
||||
while ((um = (UpdateManager) cam.getRegisteredApp(UpdateManager.APP_NAME)) == null) {
|
||||
sleep(1000);
|
||||
}
|
||||
|
||||
WindowsUpdatePostProcessor wupp = new WindowsUpdatePostProcessor(ctx);
|
||||
um.register(wupp, UpdateType.ROUTER_SIGNED_SU3, SU3File.TYPE_EXE);
|
||||
um.register(wupp, UpdateType.ROUTER_DEV_SU3, SU3File.TYPE_EXE);
|
||||
};
|
||||
|
||||
private static void sleep(int millis) {
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
} catch (InterruptedException bad) {
|
||||
bad.printStackTrace();
|
||||
throw new RuntimeException(bad);
|
||||
}
|
||||
private static boolean i2pIsRunning() {
|
||||
if (checkStarting())
|
||||
return true;
|
||||
if (checkPing())
|
||||
return true;
|
||||
if (i2pIsRunningCheck())
|
||||
return true;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (i2pIsRunningCheck())
|
||||
return true;
|
||||
sleep(1000);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static File selectHome() { // throws Exception {
|
||||
String path_override = System.getenv("I2P_CONFIG");
|
||||
if (path_override != null) {
|
||||
File path = new File(path_override);
|
||||
if (path != null && path.exists()) {
|
||||
if (path.isDirectory())
|
||||
return path.getAbsoluteFile();
|
||||
else
|
||||
throw new RuntimeException("I2P_CONFIG is not a directory: " + path);
|
||||
}
|
||||
}
|
||||
if (SystemVersion.isWindows()) {
|
||||
File home = new File(System.getProperty("user.home"));
|
||||
File appData = new File(home, "AppData");
|
||||
File local = new File(appData, "Local");
|
||||
File i2p;
|
||||
i2p = new File(local, "I2P");
|
||||
logger.info("Windows jpackage wrapper started, using: " + i2p + " as base config");
|
||||
return i2p.getAbsoluteFile();
|
||||
} else {
|
||||
File jrehome = new File(System.getProperty("java.home"));
|
||||
File programs = new File(jrehome.getParentFile().getParentFile(), ".i2p");
|
||||
logger.info("Linux portable jpackage wrapper started, using: " + programs + " as base config");
|
||||
return programs.getAbsoluteFile();
|
||||
}
|
||||
private static final Runnable REGISTER_UPP = () -> {
|
||||
RouterContext ctx;
|
||||
while ((ctx = i2pRouter.getContext()) == null) {
|
||||
sleep(1000);
|
||||
}
|
||||
// then wait for the update manager
|
||||
ClientAppManager cam;
|
||||
while ((cam = ctx.clientAppManager()) == null) {
|
||||
sleep(1000);
|
||||
}
|
||||
UpdateManager um;
|
||||
while ((um = (UpdateManager)cam.getRegisteredApp(UpdateManager.APP_NAME)) ==
|
||||
null) {
|
||||
sleep(1000);
|
||||
}
|
||||
WindowsUpdatePostProcessor wupp = new WindowsUpdatePostProcessor(ctx);
|
||||
um.register(wupp, UpdateType.ROUTER_SIGNED_SU3, SU3File.TYPE_EXE);
|
||||
um.register(wupp, UpdateType.ROUTER_DEV_SU3, SU3File.TYPE_EXE);
|
||||
};
|
||||
|
||||
private static File selectProgramFile() {
|
||||
String path_override = System.getenv("I2P");
|
||||
if (path_override != null) {
|
||||
File path = new File(path_override);
|
||||
if (path.exists()) {
|
||||
if (path.isDirectory())
|
||||
return path.getAbsoluteFile();
|
||||
else
|
||||
throw new RuntimeException("I2P is not a directory: " + path);
|
||||
}
|
||||
}
|
||||
if (SystemVersion.isWindows()) {
|
||||
File jrehome = new File(System.getProperty("java.home"));
|
||||
File programs = jrehome.getParentFile();
|
||||
logger.info("Windows portable jpackage wrapper found, using: " + programs + " as working config");
|
||||
return programs.getAbsoluteFile();
|
||||
} else {
|
||||
File jrehome = new File(System.getProperty("java.home"));
|
||||
File programs = new File(jrehome.getParentFile().getParentFile(), "i2p");
|
||||
logger.info("Linux portable jpackage wrapper found, using: " + programs + " as working config");
|
||||
return programs.getAbsoluteFile();
|
||||
}
|
||||
}
|
||||
|
||||
private static File logFile() {
|
||||
File log = new File(selectProgramFile(), "log");
|
||||
if (!log.exists())
|
||||
log.mkdirs();
|
||||
return new File(log, "launcher.log");
|
||||
/**
|
||||
* sleep for 1 second
|
||||
*
|
||||
* @param millis
|
||||
*/
|
||||
private static void sleep(int millis) {
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
} catch (InterruptedException bad) {
|
||||
bad.printStackTrace();
|
||||
throw new RuntimeException(bad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,80 +1,88 @@
|
||||
package net.i2p.router;
|
||||
|
||||
import net.i2p.router.*;
|
||||
import net.i2p.I2PAppContext;
|
||||
|
||||
import java.util.function.*;
|
||||
import java.io.*;
|
||||
import java.util.function.*;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.router.*;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
class WinUpdateProcess implements Runnable {
|
||||
private final RouterContext ctx;
|
||||
private final Supplier<String> versionSupplier;
|
||||
private final Supplier<File> fileSupplier;
|
||||
private final Log _log;
|
||||
private final RouterContext ctx;
|
||||
private final Supplier<String> versionSupplier;
|
||||
private final Supplier<File> fileSupplier;
|
||||
private final Log _log;
|
||||
|
||||
WinUpdateProcess(RouterContext ctx, Supplier<String> versionSupplier, Supplier<File> fileSupplier) {
|
||||
this.ctx = ctx;
|
||||
this.versionSupplier = versionSupplier;
|
||||
this.fileSupplier = fileSupplier;
|
||||
this._log = ctx.logManager().getLog(WinUpdateProcess.class);
|
||||
WinUpdateProcess(RouterContext ctx, Supplier<String> versionSupplier,
|
||||
Supplier<File> fileSupplier) {
|
||||
this.ctx = ctx;
|
||||
this.versionSupplier = versionSupplier;
|
||||
this.fileSupplier = fileSupplier;
|
||||
this._log = ctx.logManager().getLog(WinUpdateProcess.class);
|
||||
}
|
||||
|
||||
private File workDir() throws IOException {
|
||||
if (ctx != null) {
|
||||
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");
|
||||
return workDir;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
}
|
||||
return workDir;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private File workDir() throws IOException {
|
||||
if (ctx != null) {
|
||||
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");
|
||||
return workDir;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
}
|
||||
return workDir;
|
||||
}
|
||||
return null;
|
||||
private void runUpdateInstaller() throws IOException {
|
||||
String version = versionSupplier.get();
|
||||
File file = fileSupplier.get();
|
||||
if (file == null)
|
||||
return;
|
||||
|
||||
var workingDir = workDir();
|
||||
var logFile = new File(workingDir, "log-" + version + ".txt");
|
||||
|
||||
if (logFile.canWrite()) {
|
||||
// check if we can write to the log file. If we can, use the
|
||||
// ProcessBuilder to run the installer.
|
||||
ProcessBuilder pb = new ProcessBuilder(
|
||||
file.getAbsolutePath(), "/S", "/D=" + workingDir.getAbsolutePath());
|
||||
var env = pb.environment();
|
||||
env.put("OLD_I2P_VERSION", version);
|
||||
env.remove("RESTART_I2P");
|
||||
|
||||
int exitCode = ctx.router().scheduledGracefulExitCode();
|
||||
if (exitCode == Router.EXIT_HARD_RESTART ||
|
||||
exitCode == Router.EXIT_GRACEFUL_RESTART)
|
||||
env.put("RESTART_I2P", "true");
|
||||
|
||||
try {
|
||||
pb.directory(workingDir)
|
||||
.redirectErrorStream(true)
|
||||
.redirectOutput(logFile)
|
||||
.start();
|
||||
} catch (IOException ex) {
|
||||
_log.error(
|
||||
"Unable to run update-program in background. Update will fail.");
|
||||
}
|
||||
} else {
|
||||
// If we cant write to the log file and we're on Windows, use the elevator
|
||||
// to execute the installer instead of the ProcessBuilder.
|
||||
Elevator.executeAsAdministrator(file.getAbsolutePath(),
|
||||
" /S /D=" + workingDir.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
private void runUpdateInstaller() throws IOException {
|
||||
String version = versionSupplier.get();
|
||||
File file = fileSupplier.get();
|
||||
if (file == null)
|
||||
return;
|
||||
|
||||
var workingDir = workDir();
|
||||
var logFile = new File(workingDir, "log-" + version + ".txt");
|
||||
|
||||
if (logFile.canWrite()) {
|
||||
// check if we can write to the log file. If we can, use the ProcessBuilder to
|
||||
// run the installer.
|
||||
ProcessBuilder pb = new ProcessBuilder(file.getAbsolutePath(), "/S", "/D=" + workingDir.getAbsolutePath());
|
||||
var env = pb.environment();
|
||||
env.put("OLD_I2P_VERSION", version);
|
||||
env.remove("RESTART_I2P");
|
||||
|
||||
int exitCode = ctx.router().scheduledGracefulExitCode();
|
||||
if (exitCode == Router.EXIT_HARD_RESTART || exitCode == Router.EXIT_GRACEFUL_RESTART)
|
||||
env.put("RESTART_I2P", "true");
|
||||
|
||||
try {
|
||||
pb.directory(workingDir).redirectErrorStream(true).redirectOutput(logFile).start();
|
||||
} catch (IOException ex) {
|
||||
_log.error("Unable to run update-program in background. Update will fail.");
|
||||
}
|
||||
} else {
|
||||
// If we cant write to the log file and we're on Windows, use the elevator to
|
||||
// execute the installer instead of the ProcessBuilder.
|
||||
Elevator.executeAsAdministrator(file.getAbsolutePath(), " /S /D=" + workingDir.getAbsolutePath());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
runUpdateInstaller();
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Error running updater, update may fail." + ioe);
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
runUpdateInstaller();
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Error running updater, update may fail." + ioe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,101 +1,100 @@
|
||||
package net.i2p.router;
|
||||
|
||||
import static net.i2p.update.UpdateType.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.InterruptedException;
|
||||
import java.lang.Process;
|
||||
import java.lang.ProcessBuilder;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.*;
|
||||
|
||||
import net.i2p.crypto.*;
|
||||
import static net.i2p.update.UpdateType.*;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.update.UpdateType;
|
||||
import net.i2p.crypto.*;
|
||||
import net.i2p.update.UpdatePostProcessor;
|
||||
import net.i2p.update.UpdateType;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SystemVersion;
|
||||
|
||||
import java.lang.ProcessBuilder;
|
||||
import java.lang.Process;
|
||||
import java.lang.InterruptedException;
|
||||
|
||||
public class WindowsUpdatePostProcessor implements UpdatePostProcessor {
|
||||
private final Log _log;
|
||||
private final RouterContext ctx;
|
||||
private final AtomicBoolean hook = new AtomicBoolean();
|
||||
private final String fileName = "i2p-jpackage-update.exe";
|
||||
private final Log _log;
|
||||
private final RouterContext ctx;
|
||||
private final AtomicBoolean hook = new AtomicBoolean();
|
||||
private final String fileName = "i2p-jpackage-update.exe";
|
||||
|
||||
private volatile String version;
|
||||
private volatile String version;
|
||||
|
||||
private volatile File positionedFile = null;
|
||||
private volatile File positionedFile = null;
|
||||
|
||||
WindowsUpdatePostProcessor(RouterContext ctx) {
|
||||
this.ctx = ctx;
|
||||
this._log = ctx.logManager().getLog(WindowsUpdatePostProcessor.class);
|
||||
WindowsUpdatePostProcessor(RouterContext ctx) {
|
||||
this.ctx = ctx;
|
||||
this._log = ctx.logManager().getLog(WindowsUpdatePostProcessor.class);
|
||||
}
|
||||
|
||||
public String getVersion() { return version; }
|
||||
|
||||
public File getFile() { return positionedFile; }
|
||||
|
||||
public void updateDownloadedandVerified(UpdateType type, int fileType,
|
||||
String version, File file)
|
||||
throws IOException {
|
||||
_log.info("Got an update to post-process");
|
||||
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) {
|
||||
_log.warn("Unsupported file type " + fileType);
|
||||
return;
|
||||
}
|
||||
|
||||
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 WinUpdateProcess(ctx, this::getVersion, this::getFile));
|
||||
}
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return positionedFile;
|
||||
}
|
||||
|
||||
public void updateDownloadedandVerified(UpdateType type, int fileType, String version, File file)
|
||||
throws IOException {
|
||||
_log.info("Got an update to post-process");
|
||||
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) {
|
||||
_log.warn("Unsupported file type " + fileType);
|
||||
return;
|
||||
}
|
||||
|
||||
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 WinUpdateProcess(ctx, this::getVersion, this::getFile));
|
||||
}
|
||||
}
|
||||
|
||||
private File moveUpdateInstaller(File file) throws IOException {
|
||||
if (this.ctx != null) {
|
||||
File newFile = new File(workDir(), fileName);
|
||||
boolean renamedStatus = file.renameTo(newFile);
|
||||
if (renamedStatus)
|
||||
return newFile;
|
||||
else
|
||||
throw new IOException(
|
||||
"WindowsUpdatePostProcesssor unable to move file to working directory, update will fail");
|
||||
}
|
||||
private File moveUpdateInstaller(File file) throws IOException {
|
||||
if (this.ctx != null) {
|
||||
File newFile = new File(workDir(), fileName);
|
||||
boolean renamedStatus = file.renameTo(newFile);
|
||||
if (renamedStatus)
|
||||
return newFile;
|
||||
else
|
||||
throw new IOException(
|
||||
"Router context not available to WindowsUpdatePostProcesssor, unable to find working directory, update will fail");
|
||||
"WindowsUpdatePostProcesssor unable to move file to working directory, update will fail");
|
||||
}
|
||||
throw new IOException(
|
||||
"Router context not available to WindowsUpdatePostProcesssor, unable to find working directory, update will fail");
|
||||
}
|
||||
|
||||
private File workDir() throws IOException {
|
||||
if (this.ctx != null) {
|
||||
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");
|
||||
return null;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
}
|
||||
return workDir;
|
||||
}
|
||||
private File workDir() throws IOException {
|
||||
if (this.ctx != null) {
|
||||
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");
|
||||
return null;
|
||||
} else {
|
||||
workDir.mkdirs();
|
||||
}
|
||||
return workDir;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
app-profile: .version build/app-profile/user.js build/app-profile/prefs.js build/app-profile/chrome/userChrome.css build/app-profile/bookmarks.html build/app-profile/storage-sync.sqlite copy-app-xpi
|
||||
app-profile: .version build/app-profile/chrome/userChrome.css build/app-profile/storage-sync.sqlite
|
||||
|
||||
app-profile.tgz: app-profile
|
||||
# $(eval PROFILE_VERSION := $(shell cat src/app-profile/version.txt))
|
||||
@ -7,30 +7,8 @@ app-profile.tgz: app-profile
|
||||
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 ../
|
||||
|
||||
src/app-profile/user.js:
|
||||
wget -O src/app-profile/user.js "https://github.com/arkenfox/user.js/raw/master/user.js"
|
||||
sed -i 's|user_pref("extensions.autoDisableScopes", 15);|user_pref("extensions.autoDisableScopes", 0);|g src/app-profile/user.js
|
||||
sed -i 's|user_pref("extensions.enabledScopes", 5);|user_pref("extensions.enabledScopes", 1);|g' src/app-profile/user.js
|
||||
sed -i 's|user_pref("dom.security.https_only_mode", true);|user_pref("dom.security.https_only_mode", false);|g' src/app-profile/user.js
|
||||
|
||||
|
||||
build/app-profile/user.js: build/app-profile src/app-profile/user.js
|
||||
cp src/app-profile/user.js build/app-profile/user.js
|
||||
cp src/app-profile/user-overrides.js build/app-profile/user-overrides.js
|
||||
|
||||
build/app-profile/prefs.js: build/app-profile src/app-profile/prefs.js
|
||||
cp src/app-profile/prefs.js build/app-profile/prefs.js
|
||||
|
||||
build/app-profile/chrome/userChrome.css: build/app-profile/chrome src/app-profile/chrome/userChrome.css
|
||||
cp src/app-profile/chrome/userChrome.css build/app-profile/chrome/userChrome.css
|
||||
|
||||
build/app-profile/bookmarks.html: build/app-profile src/app-profile/bookmarks.html
|
||||
cp src/app-profile/bookmarks.html build/app-profile/bookmarks.html
|
||||
|
||||
build/app-profile/storage-sync.sqlite: build/app-profile src/app-profile/storage-sync.sqlite
|
||||
cp src/app-profile/storage-sync.sqlite build/app-profile/storage-sync.sqlite
|
||||
|
||||
copy-app-xpi: build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi build/https-everywhere-eff@eff.org.xpi build/i2ppb@eyedeekay.github.io.xpi build/app-profile/extensions
|
||||
cp build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi "build/app-profile/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
|
||||
cp build/https-everywhere-eff@eff.org.xpi "build/app-profile/extensions/https-everywhere-eff@eff.org.xpi"
|
||||
cp build/i2ppb@eyedeekay.github.io.xpi build/app-profile/extensions/i2ppb@eyedeekay.github.io.xpi
|
@ -1,55 +1,4 @@
|
||||
orig:
|
||||
tar --exclude=debian --exclude=.git -cvzf ../i2p-firefox-profile_$(PROFILE_VERSION).orig.tar.gz .
|
||||
|
||||
## HOWTO: If you need to release a package to launchpad, build for the oldest
|
||||
## release launchpad supports(bionic AFIACT). Then, after the build is
|
||||
## published, copy it to the other distributions. When bionic is out of date,
|
||||
## update it to the new LTS.
|
||||
|
||||
bionic:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) bionic; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
focal:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) focal; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
groovy:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) groovy; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
buster:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) buster; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
bullseye:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) bullseye; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
trixie:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) trixie; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
sid:
|
||||
@sed -i "s|`head -n 1 debian/changelog`|i2p-firefox-profile ($(PROFILE_VERSION)-1) sid; urgency=medium|g" debian/changelog
|
||||
make orig
|
||||
debuild -S
|
||||
make dput
|
||||
|
||||
dput:
|
||||
dput --simulate --force ppa:i2p-community/ppa ../i2p-firefox-profile_$(PROFILE_VERSION)-1_source.changes || exit
|
||||
dput --force ppa:i2p-community/ppa ../i2p-firefox-profile_$(PROFILE_VERSION)-1_source.changes
|
||||
|
||||
launchpad: bionic
|
||||
## HOWTO: Don't bother. See http://i2pgit.org/idk/i2p.plugins.firefox debian jpackages.
|
||||
|
@ -1,12 +1 @@
|
||||
docker:
|
||||
docker build -t geti2p/i2p.firefox .
|
||||
|
||||
xhost:
|
||||
xhost + local:docker
|
||||
|
||||
run: docker xhost
|
||||
docker run -it --rm \
|
||||
--net=host \
|
||||
-e DISPLAY=unix$(DISPLAY) \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
geti2p/i2p.firefox firefox --profile /src/build/profile
|
||||
# DEPRECATED: see https://i2pgit.org/idk/i2p.plugins.firefox for much better replacement.
|
@ -1,25 +1 @@
|
||||
|
||||
build-extensions: extensions build/i2ppb@eyedeekay.github.io.xpi build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi build/https-everywhere-eff@eff.org.xpi
|
||||
|
||||
build/i2ppb@eyedeekay.github.io.xpi: i2psetproxy.url
|
||||
curl -L `cat i2psetproxy.url` > build/i2ppb@eyedeekay.github.io.xpi
|
||||
|
||||
build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi: NoScript.url
|
||||
curl -L `cat NoScript.url` > "build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
|
||||
|
||||
build/https-everywhere-eff@eff.org.xpi: HTTPSEverywhere.url
|
||||
curl -L `cat HTTPSEverywhere.url` > build/https-everywhere-eff@eff.org.xpi
|
||||
|
||||
clean-extensions:
|
||||
rm -fv i2psetproxy.url NoScript.url HTTPSEverywhere.url build/i2ppb@eyedeekay.github.io.xpi build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi build/https-everywhere-eff@eff.org.xpi
|
||||
|
||||
extensions: HTTPSEverywhere.url NoScript.url i2psetproxy.url
|
||||
|
||||
HTTPSEverywhere.url:
|
||||
@echo `./amo-version.sh https-everywhere` > HTTPSEverywhere.url
|
||||
|
||||
NoScript.url:
|
||||
@echo `./amo-version.sh noscript` > NoScript.url
|
||||
|
||||
i2psetproxy.url:
|
||||
@echo `./amo-version.sh i2p-in-private-browsing` > i2psetproxy.url
|
||||
#DEPRECATED moved to i2p.plugins.firefox as "Base/Strict Mode"
|
@ -1,31 +1 @@
|
||||
|
||||
build-new-extensions: build/i2ppb@eyedeekay.github.io.xpi build/uBlock0@raymondhill.net.xpi build/jsr@javascriptrestrictor.xpi build/onioncbt@eyedeekay.github.io.xpi build/{b86e4813-687a-43e6-ab65-0bde4ab75758}.xpi
|
||||
|
||||
build/uBlock0@raymondhill.net.xpi:
|
||||
curl -L `cat UblockOrigin.url` > build/uBlock0@raymondhill.net.xpi
|
||||
|
||||
build/jsr@javascriptrestrictor.xpi:
|
||||
curl -L `cat JShelter.url` > build/jsr@javascriptrestrictor.xpi
|
||||
|
||||
build/onioncbt@eyedeekay.github.io.xpi:
|
||||
curl -L `cat onioncontainer.url` > build/onioncbt@eyedeekay.github.io.xpi
|
||||
|
||||
build/{b86e4813-687a-43e6-ab65-0bde4ab75758}.xpi:
|
||||
curl -L `cat LocalCDN.url` > build//{b86e4813-687a-43e6-ab65-0bde4ab75758}.xpi
|
||||
|
||||
UBlockOrigin.url:
|
||||
@echo `./amo-version.sh ublock-origin` > UBlockOrigin.url
|
||||
|
||||
JShelter.url:
|
||||
@echo "`./amo-version.sh javascript-restrictor`" > JShelter.url
|
||||
|
||||
onioncontainer.url:
|
||||
@echo `./amo-version.sh onion-in-container-browsing` > onioncontainer.url
|
||||
|
||||
LocalCDN.url:
|
||||
@echo `./amo-version.sh localcdn-fork-of-decentraleyes` > LocalCDN.url
|
||||
|
||||
clean-new-extensions:
|
||||
rm -f UBlockOrigin.url JShelter.url onioncontainer.url LocalCDN.url build/i2ppb@eyedeekay.github.io.xpi build/onioncbt@eyedeekay.github.io.xpi
|
||||
|
||||
new-extensions: UBlockOrigin.url JShelter.url onioncontainer.url LocalCDN.url
|
||||
#DEPRECATED moved to i2p.plugins.firefox as "Usability Mode"
|
@ -1,5 +1,5 @@
|
||||
|
||||
profile: build/profile/user.js build/profile/prefs.js build/profile/bookmarks.html build/profile/storage-sync.sqlite copy-xpi
|
||||
profile: .version build/profile/storage-sync.sqlite
|
||||
|
||||
profile.tgz: .version profile
|
||||
# $(eval PROFILE_VERSION := $(shell cat src/profile/version.txt))
|
||||
@ -8,26 +8,5 @@ profile.tgz: .version profile
|
||||
install -m755 src/unix/i2pbrowser.sh build/profile/i2pbrowser.sh
|
||||
cd build && tar -czf profile-$(PROFILE_VERSION).tgz profile && cp profile-$(PROFILE_VERSION).tgz ../
|
||||
|
||||
src/profile/user.js:
|
||||
wget -O src/profile/user.js "https://github.com/arkenfox/user.js/raw/master/user.js"
|
||||
sed -i 's|user_pref("extensions.autoDisableScopes", 15);|user_pref("extensions.autoDisableScopes", 0);|g src/profile/user.js
|
||||
sed -i 's|user_pref("extensions.enabledScopes", 5);|user_pref("extensions.enabledScopes", 1);|g' src/profile/user.js
|
||||
sed -i 's|user_pref("dom.security.https_only_mode", true);|user_pref("dom.security.https_only_mode", false);|g' src/profile/user.js
|
||||
|
||||
build/profile/user.js: build/profile src/profile/user.js
|
||||
cp src/profile/user.js build/profile/user.js
|
||||
cp src/profile/user-overrides.js build/profile/user-overrides.js
|
||||
|
||||
build/profile/prefs.js: build/profile src/profile/prefs.js
|
||||
cp src/profile/prefs.js build/profile/prefs.js
|
||||
|
||||
build/profile/bookmarks.html: build/profile src/profile/bookmarks.html
|
||||
cp src/profile/bookmarks.html build/profile/bookmarks.html
|
||||
|
||||
build/profile/storage-sync.sqlite: build/profile src/profile/storage-sync.sqlite
|
||||
cp src/profile/storage-sync.sqlite build/profile/storage-sync.sqlite
|
||||
|
||||
copy-xpi: build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi build/https-everywhere-eff@eff.org.xpi build/i2ppb@eyedeekay.github.io.xpi build/profile/extensions
|
||||
cp build/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi "build/profile/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
|
||||
cp build/https-everywhere-eff@eff.org.xpi "build/profile/extensions/https-everywhere-eff@eff.org.xpi"
|
||||
cp build/i2ppb@eyedeekay.github.io.xpi build/profile/extensions/i2ppb@eyedeekay.github.io.xpi
|
||||
|
33
msi.sh
Executable file
33
msi.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
|
||||
|
||||
# Motivation
|
||||
|
||||
. ./config.sh
|
||||
. ./i2pversion
|
||||
|
||||
./build.sh
|
||||
jpackage --name I2P-MSI --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 \
|
||||
--app-content src/I2P/config \
|
||||
--input build \
|
||||
--verbose \
|
||||
--type msi \
|
||||
--win-dir-chooser \
|
||||
--win-help-url "https://geti2p.net" \
|
||||
--win-menu \
|
||||
--win-menu-group "I2P Easy-Install Bundle" \
|
||||
--win-shortcut \
|
||||
--win-shortcut-prompt \
|
||||
--win-per-user-install \
|
||||
--license-file LICENSE.md \
|
||||
--main-jar launcher.jar \
|
||||
--main-class net.i2p.router.WinLauncher
|
@ -1,5 +1,5 @@
|
||||
router.updateURL=http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3
|
||||
router.newsURL=http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news/win/beta/news.su3
|
||||
router.backupNewsURL=http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/win/beta/news.su3
|
||||
routerconsole.browser=I2P.exe
|
||||
routerconsole.browser=I2P.exe -noproxycheck
|
||||
router.disableTunnelTesting=false
|
@ -8,3 +8,8 @@
|
||||
#hidenav {display:block; }
|
||||
#shownav:target {display: block; }
|
||||
#hidenav:target {display: none; }
|
||||
|
||||
#donate {display:none; }
|
||||
#hidedonate {display:block; }
|
||||
#donate:target {display: block; }
|
||||
#hidedonate:target {display: none; }
|
||||
|
8
sign.sh
8
sign.sh
@ -37,9 +37,9 @@ linuxsign() {
|
||||
|
||||
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||
JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
|
||||
linuxsign I2P-Profile-Installer-$I2P_VERSION.exe
|
||||
cp "I2P-Profile-Installer-$I2P_VERSION.exe" "I2P-Profile-Installer-$I2P_VERSION-signed.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"
|
||||
else
|
||||
signtool.exe sign /a "I2P-Profile-Installer-$I2P_VERSION.exe"
|
||||
cp "I2P-Profile-Installer-$I2P_VERSION.exe" "I2P-Profile-Installer-$I2P_VERSION-signed.exe"
|
||||
signtool.exe sign -a "I2P-Easy-Install-Bundle-$I2P_VERSION.exe"
|
||||
cp "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" "I2P-Easy-Install-Bundle-$I2P_VERSION-signed.exe"
|
||||
fi
|
||||
|
@ -1,26 +1,45 @@
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
/* only needed once */
|
||||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
|
||||
@namespace html url("http://www.w3.org/1999/xhtml");
|
||||
|
||||
#PersonalToolbar, #PanelUI-Button, #PanelUI-menu-button, #star-button, #forward-button, #home-button, #bookmarks-toolbar-button, #library-button, #sidebar-button, #pocket-button, #fxa-toolbar-menu-button, #reader-mode-button, #identity-icon {
|
||||
visibility: collapse;
|
||||
#PersonalToolbar,
|
||||
#PanelUI-Button,
|
||||
#PanelUI-menu-button,
|
||||
#star-button,
|
||||
#forward-button,
|
||||
#home-button,
|
||||
#bookmarks-toolbar-button,
|
||||
#library-button,
|
||||
#sidebar-button,
|
||||
#pocket-button,
|
||||
#fxa-toolbar-menu-button,
|
||||
#reader-mode-button,
|
||||
#identity-icon {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
#urlbar-background {
|
||||
background-color: black !important;
|
||||
}
|
||||
|
||||
#urlbar-background {background-color: black !important;}
|
||||
|
||||
/* Remove back button circle */
|
||||
|
||||
#back-button:not(:hover),
|
||||
#back-button:not(:hover) > .toolbarbutton-icon {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
#back-button:not(:hover)>.toolbarbutton-icon {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
#back-button:hover,
|
||||
#back-button:hover > .toolbarbutton-icon {
|
||||
border: none !important;
|
||||
border-radius: 2px !important;
|
||||
#back-button:hover>.toolbarbutton-icon {
|
||||
border: none !important;
|
||||
border-radius: 2px !important;
|
||||
}
|
||||
|
||||
#urlbar-container, #nav-bar { visibility: collapse !important }
|
||||
}
|
||||
#urlbar-container,
|
||||
#nav-bar {
|
||||
visibility: collapse !important
|
||||
}
|
@ -1 +1 @@
|
||||
1.9.0
|
||||
1.9.6
|
||||
|
@ -3,9 +3,8 @@ UniCode true
|
||||
|
||||
!define APPNAME "I2PBrowser-Launcher"
|
||||
!define COMPANYNAME "I2P"
|
||||
!define DESCRIPTION "This launches Firefox with a browser profile pre-configured to use i2p"
|
||||
!define FIREFOX_MESSAGE "Could not find Firefox. Please point to where you have installed Firefox. If you have not installed Firefox yet, exit this installer and install Firefox, then start this installer again."
|
||||
!define I2P_MESSAGE "Could not find I2P. Please point to where you have installed I2P. If you have not installed I2P yet, exit this installer and install I2P, then start this installer again."
|
||||
!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 "Could not find I2P. Installing portable Jpackaged I2P."
|
||||
!define LAUNCH_TEXT "Start I2P?"
|
||||
!define LICENSE_TITLE "Many Licenses"
|
||||
!define CONSOLE_URL "http://127.0.0.1:7657/home"
|
||||
@ -30,7 +29,7 @@ LicenseData "licenses\LICENSE.txt"
|
||||
# This will be in the installer/uninstaller's title bar
|
||||
Name "${COMPANYNAME} - ${APPNAME}"
|
||||
Icon ui2pbrowser_icon.ico
|
||||
OutFile "I2P-Profile-Installer-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.exe"
|
||||
OutFile "I2P-Easy-Install-Bundle-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.exe"
|
||||
|
||||
RequestExecutionLevel user
|
||||
|
||||
@ -128,8 +127,6 @@ PageEx directory
|
||||
PageExEnd
|
||||
Page instfiles
|
||||
|
||||
#!include i2pbrowser-mozcompat.nsi
|
||||
|
||||
Function .onInit
|
||||
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}"
|
||||
UserInfo::GetAccountType
|
||||
@ -145,10 +142,14 @@ FunctionEnd
|
||||
|
||||
Function routerDetect
|
||||
createDirectory $I2PINSTEXE
|
||||
SetOutPath $I2PINSTEXE\app
|
||||
File /nonfatal /a /r "I2P\app\"
|
||||
SetOutPath $I2PINSTEXE\runtime
|
||||
File /nonfatal /a /r "I2P\runtime\"
|
||||
SetOutPath $I2PINSTEXE
|
||||
File /a /r "I2P\"
|
||||
File /nonfatal /a /r "I2P\I2P.exe"
|
||||
File "I2P\config\jpackaged"
|
||||
File /nonfatal /a /r "I2P\I2P.exe"
|
||||
File /nonfatal /a /r "I2P\I2P.ico"
|
||||
File /nonfatal "I2P\config\jpackaged"
|
||||
|
||||
createDirectory "$I2PINSTEXE\"
|
||||
SetOutPath "$I2PINSTEXE\"
|
||||
@ -167,12 +168,10 @@ Function routerDetect
|
||||
File /a /r "I2P/config/certificates"
|
||||
File /a /r "I2P/config/geoip"
|
||||
File /a /r "I2P/config/i2ptunnel.config"
|
||||
|
||||
Abort directory
|
||||
FunctionEnd
|
||||
|
||||
Function installerFunction
|
||||
${If} ${Silent}
|
||||
${If} ${Silent}
|
||||
${Do}
|
||||
${FindProcess} "I2P.exe" $0
|
||||
Sleep 500
|
||||
@ -211,25 +210,13 @@ ${If} ${Silent}
|
||||
SetOutPath "$INSTDIR\licenses"
|
||||
File /a /r "licenses/*"
|
||||
|
||||
# Install the profile
|
||||
createDirectory "$INSTDIR\firefox.profile.i2p"
|
||||
SetOutPath "$INSTDIR\firefox.profile.i2p"
|
||||
File /a /r "profile/*"
|
||||
|
||||
# Install the config profile
|
||||
createDirectory "$INSTDIR\firefox.profile.config.i2p"
|
||||
SetOutPath "$INSTDIR\firefox.profile.config.i2p"
|
||||
File /a /r "app-profile/*"
|
||||
|
||||
SetOutPath "$I2PINSTEXE"
|
||||
createDirectory "$SMPROGRAMS\${APPNAME}"
|
||||
CreateShortCut "$SMPROGRAMS\${APPNAME}\Browse I2P.lnk" "$I2PINSTEXE\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||
CreateShortCut "$SMPROGRAMS\${APPNAME}\Browse I2P - Temporary Identity.lnk" "$I2PINSTEXE\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||
; CreateShortCut "$SMPROGRAMS\${APPNAME}\I2P Applications.lnk" "C:\Windows\system32\cmd.exe" "/c $\"$INSTDIR\i2pconfig.bat$\"" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||
|
||||
CreateShortCut "$DESKTOP\Browse I2P.lnk" "$I2PINSTEXE\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||
CreateShortCut "$DESKTOP\Browse I2P - Temporary Identity.lnk" "$I2PINSTEXE\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||
; CreateShortCut "$DESKTOP\I2P Applications.lnk" "C:\Windows\system32\cmd.exe" "/c $\"$INSTDIR\i2pconfig.bat$\"" "$INSTDIR\ui2pbrowser_icon.ico"
|
||||
SetOutPath "$INSTDIR"
|
||||
|
||||
SetShellVarContext current
|
||||
|
@ -1 +1 @@
|
||||
!define I2P_VERSION 1.9.0
|
||||
!define I2P_VERSION 1.9.6
|
||||
|
@ -1,37 +0,0 @@
|
||||
; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
; Returns 1 in $0 if we should install the 64-bit build, or 0 if not.
|
||||
; The requirements for selecting the 64-bit build to install are:
|
||||
; 1) Running a 64-bit OS (we've already checked the OS version).
|
||||
; 2) An amount of RAM strictly greater than RAM_NEEDED_FOR_64BIT
|
||||
; 3) No third-party products installed that cause issues with the 64-bit build.
|
||||
; Currently this includes Lenovo OneKey Theater and Lenovo Energy Management.
|
||||
Function ShouldInstall64Bit
|
||||
StrCpy $0 0
|
||||
|
||||
${IfNot} ${RunningX64}
|
||||
Return
|
||||
${EndIf}
|
||||
|
||||
System::Call "*(i 64, i, l 0, l, l, l, l, l, l)p.r1"
|
||||
System::Call "Kernel32::GlobalMemoryStatusEx(p r1)"
|
||||
System::Call "*$1(i, i, l.r2, l, l, l, l, l, l)"
|
||||
System::Free $1
|
||||
${If} $2 L<= ${RAM_NEEDED_FOR_64BIT}
|
||||
Return
|
||||
${EndIf}
|
||||
|
||||
; Lenovo OneKey Theater can theoretically be in a directory other than this
|
||||
; one, because some installer versions let you change it, but it's unlikely.
|
||||
${If} ${FileExists} "$PROGRAMFILES32\Lenovo\Onekey Theater\windowsapihookdll64.dll"
|
||||
Return
|
||||
${EndIf}
|
||||
|
||||
${If} ${FileExists} "$PROGRAMFILES32\Lenovo\Energy Management\Energy Management.exe"
|
||||
Return
|
||||
${EndIf}
|
||||
|
||||
StrCpy $0 1
|
||||
FunctionEnd
|
@ -1,71 +0,0 @@
|
||||
|
||||
;;
|
||||
;; TODO: Examine licensing for this function.
|
||||
;;https://nsis.sourceforge.io/StrRep
|
||||
|
||||
!define StrRep "!insertmacro StrRep"
|
||||
!macro StrRep output string old new
|
||||
Push `${string}`
|
||||
Push `${old}`
|
||||
Push `${new}`
|
||||
!ifdef __UNINSTALL__
|
||||
Call un.StrRep
|
||||
!else
|
||||
Call StrRep
|
||||
!endif
|
||||
Pop ${output}
|
||||
!macroend
|
||||
|
||||
!macro Func_StrRep un
|
||||
Function ${un}StrRep
|
||||
Exch $R2 ;new
|
||||
Exch 1
|
||||
Exch $R1 ;old
|
||||
Exch 2
|
||||
Exch $R0 ;string
|
||||
Push $R3
|
||||
Push $R4
|
||||
Push $R5
|
||||
Push $R6
|
||||
Push $R7
|
||||
Push $R8
|
||||
Push $R9
|
||||
|
||||
StrCpy $R3 0
|
||||
StrLen $R4 $R1
|
||||
StrLen $R6 $R0
|
||||
StrLen $R9 $R2
|
||||
loop:
|
||||
StrCpy $R5 $R0 $R4 $R3
|
||||
StrCmp $R5 $R1 found
|
||||
StrCmp $R3 $R6 done
|
||||
IntOp $R3 $R3 + 1 ;move offset by 1 to check the next character
|
||||
Goto loop
|
||||
found:
|
||||
StrCpy $R5 $R0 $R3
|
||||
IntOp $R8 $R3 + $R4
|
||||
StrCpy $R7 $R0 "" $R8
|
||||
StrCpy $R0 $R5$R2$R7
|
||||
StrLen $R6 $R0
|
||||
IntOp $R3 $R3 + $R9 ;move offset by length of the replacement string
|
||||
Goto loop
|
||||
done:
|
||||
|
||||
Pop $R9
|
||||
Pop $R8
|
||||
Pop $R7
|
||||
Pop $R6
|
||||
Pop $R5
|
||||
Pop $R4
|
||||
Pop $R3
|
||||
Push $R0
|
||||
Push $R1
|
||||
Pop $R0
|
||||
Pop $R1
|
||||
Pop $R0
|
||||
Pop $R2
|
||||
Exch $R1
|
||||
FunctionEnd
|
||||
!macroend
|
||||
!insertmacro Func_StrRep ""
|
||||
!insertmacro Func_StrRep "un."
|
@ -1,3 +1,3 @@
|
||||
!define VERSIONMAJOR 1
|
||||
!define VERSIONMINOR 9
|
||||
!define VERSIONBUILD 0
|
||||
!define VERSIONBUILD 6
|
||||
|
@ -1 +1 @@
|
||||
1.9.0
|
||||
1.9.6
|
||||
|
@ -153,5 +153,12 @@ input {
|
||||
|
||||
#navbar {
|
||||
float: right;
|
||||
width: 10%;
|
||||
width: 15%;
|
||||
}
|
||||
#returnhome {
|
||||
font-size: xxx-large;
|
||||
display: inline;
|
||||
}
|
||||
h1 {
|
||||
display: inline;
|
||||
}
|
||||
|
17
targz.sh
Executable file
17
targz.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$SCRIPT_DIR" || exit 1
|
||||
|
||||
. "$SCRIPT_DIR/config.sh"
|
||||
|
||||
if [ -f config_overide.sh ]; then
|
||||
. "$SCRIPT_DIR/config_override.sh"
|
||||
fi
|
||||
|
||||
./clean.sh
|
||||
wsl make distclean
|
||||
wsl make clean-extensions
|
||||
wsl make extensions
|
||||
./build.sh
|
||||
tar czvf I2P.tar.gz I2P
|
Reference in New Issue
Block a user