Compare commits

...

200 Commits

Author SHA1 Message Date
idk
67e0b87d97 clone i2p.i2p to depth=1 2022-10-08 13:14:04 -04:00
idk
1424913447 shellcheck torbrowser.sh script 2022-10-01 22:30:11 -04:00
idk
c0cb68f972 pack a recent TBB into the linux portable just in case 2022-10-01 22:05:58 -04:00
idk
52c91e1e65 update i2pfirefox version 2022-10-01 22:00:58 -04:00
idk
9e6ea435af Comment out Potent Portables 2022-10-01 21:28:00 -04:00
idk
308055143f update i2p.plugins.firefox version 2022-10-01 21:06:48 -04:00
idk
53f731f945 mark torbrowser.sh script executable 2022-10-01 21:01:00 -04:00
idk
7ec56455cd remove obsolete/redundant Unix scripts 2022-10-01 20:51:03 -04:00
idk
c11f982088 be even more specific about the WinLauncher.java URL fixes 2022-09-20 23:24:28 -04:00
idk
58e1276072 get rid of the "jpackaged" file from the NSIS installer, that's only created after a config migration inside the jpackage now 2022-09-20 12:35:59 -04:00
idk
20240c9e75 get rid of the "jpackaged" file from the NSIS installer, that's only created after a config migration inside the jpackage now 2022-09-20 12:34:52 -04:00
idk
4079d6a8b1 remove some NSIS lines that are now automated by the jpackage. 2022-09-20 11:39:24 -04:00
idk
8b893d1116 skip service correction if config is absent 2022-09-20 01:12:22 -04:00
idk
0d209bb2a8 skip service correction if config is absent 2022-09-20 01:07:56 -04:00
idk
186493b154 skip service correction on linux 2022-09-20 00:54:56 -04:00
idk
51a7f0f1d7 move config_override.sh out of the way when doing a daily 2022-09-20 00:17:30 -04:00
idk
99e3ddb05a bump version 2022-09-20 00:15:30 -04:00
idk
13a5cab2c1 bump version 2022-09-20 00:15:01 -04:00
idk
125b711de2 remove a junk section from the NSIS file 2022-09-20 00:12:33 -04:00
idk
a267bb7d65 also fix backupNewsURL in the case of conflicting bundled and un-bundled intalls 2022-09-20 00:09:17 -04:00
idk
c5b2f958c2 fix the router.config file for the user if they installed un-bundled after bundled. closes #23 2022-09-20 00:01:15 -04:00
idk
56b8b5470f fix the router.config file for the user if they installed un-bundled after bundled. closes #23 2022-09-19 23:59:59 -04:00
idk
15cbddb5b0 fix the router.config file for the user if they installed un-bundled after bundled. closes #23 2022-09-19 23:53:38 -04:00
idk
c4bd64a559 fix the router.config file for the user if they installed un-bundled after bundled 2022-09-19 23:50:46 -04:00
idk
f4f7935cdc fix the router.config file for the user if they installed un-bundled after bundled 2022-09-19 23:46:34 -04:00
idk
afca98692a launch services.msc with service prompt 2022-09-19 20:41:28 -04:00
idk
11914ff9aa launch user-installs automatically if they're present and the user consents 2022-09-19 20:25:44 -04:00
idk
4aa4763770 prompt for separate user-installs too 2022-09-19 20:03:57 -04:00
idk
6b61213625 don't change value of routerconsole.browser if we're running alongside a service install 2022-09-19 19:50:13 -04:00
idk
51873e9d62 change message 2022-09-19 19:35:42 -04:00
idk
a54feb9550 change message 2022-09-19 19:31:21 -04:00
idk
b485d0630f remove config_override.sh from daily.sh 2022-09-19 19:01:20 -04:00
idk
434546f24c add app-content of ico 2022-09-19 18:46:37 -04:00
idk
3d80c32a31 comment to clarify icon situation 2022-09-19 18:29:01 -04:00
idk
7156974136 use png ico icon for nsis installer 2022-09-19 18:28:23 -04:00
idk
348c876c59 use png icon instead of ico icon 2022-09-19 18:25:47 -04:00
idk
630e58ea0a icons 2022-09-19 17:57:01 -04:00
idk
96806ecc07 expressly include icon in jpackage output 2022-09-19 17:50:28 -04:00
idk
aef946f3c8 expressly include icon in jpackage output 2022-09-19 17:48:33 -04:00
idk
d49ec2330f fix override sourcing 2022-09-19 17:15:51 -04:00
idk
0c304b0d11 add config_override.sh to gitignore 2022-09-19 17:07:50 -04:00
idk
3387c03bf4 don't git clean in distclean anymore 2022-09-19 16:56:07 -04:00
idk
037b1265d5 make sure that the correct config gets copied before building an unsigned during unstable builds 2022-09-19 16:52:23 -04:00
idk
e68ea5f9ef remove erroneously checked-in file 2022-09-19 16:21:41 -04:00
idk
51d2b7291e edit releases in scripts, fix release text 2022-09-19 16:21:15 -04:00
idk
2d25264023 edit releases 2022-09-19 16:12:43 -04:00
idk
664dc7ad22 create a tag 2022-09-19 15:52:25 -04:00
idk
e80d7eb4bc sleep a second 2022-09-19 15:44:24 -04:00
idk
d9d452aca5 remove extension targets from build scripts 2022-09-19 15:43:09 -04:00
idk
0cac49b575 get rid of clean-extensions target 2022-09-19 15:40:07 -04:00
idk
4997485d5b automatically copy config_override.sh in daily_unstable.sh 2022-09-19 15:34:54 -04:00
idk
1442c57577 automatically copy config_override.sh in daily_unstable.sh 2022-09-19 15:28:41 -04:00
idk
9887d69121 Export variables before running build.sh 2022-09-19 15:17:02 -04:00
idk
fb3392ef70 Create a daily build script with Java 19 2022-09-19 15:11:05 -04:00
idk
4d5d48c5ff add override-example for java 19 2022-09-19 14:48:16 -04:00
idk
3ba39c1d6f Add other required lines for Java 19 in config.sh 2022-09-19 12:49:12 -04:00
idk
1b9d230844 fix path style on java 19 line in config.sh 2022-09-19 12:40:50 -04:00
idk
e4a3057898 Add notes on conditional which decides whether we should prompt the user to start the service 2022-09-19 12:34:41 -04:00
idk
b7c0b91d55 fix double-declaration of option message 2022-09-19 11:52:20 -04:00
idk
8ebde03f98 Add a line to configure OpenJDK 19 in config.sh 2022-09-19 11:41:36 -04:00
idk
74f985dc33 test using a swing dialog to prompt the user to start a system-wide I2P service. 2022-09-19 03:10:47 -04:00
idk
c226103bc7 detect all Windows service states 2022-09-19 02:40:52 -04:00
idk
0216bc7254 fix example in main 2022-09-19 02:37:59 -04:00
idk
1984487b7d fix space-finding function 2022-09-19 02:35:17 -04:00
idk
7e5b69b2cc enable building launcher and jpackage in separate steps 2022-09-19 02:28:37 -04:00
idk
58305471f6 enable getting service state as both an int and as a string, test uppercase and lowercase queries, test a service we know is there, test a service with it's name and it's registry entry 2022-09-19 01:45:01 -04:00
idk
9489428e36 enable getting service state as both an int and as a string, test uppercase and lowercase queries, test a service we know is there, test a service with it's name and it's registry entry 2022-09-19 01:44:29 -04:00
idk
2cf656ecfa WindowsServiceUtil should have public static void main 2022-09-19 01:25:23 -04:00
idk
893f889636 remember to add WindowsServiceUtil to compile line 2022-09-19 00:40:18 -04:00
idk
280588dee4 prepare to try and probe a windows service from Java 2022-09-19 00:26:52 -04:00
idk
e09f05ce42 start working on Windows Service querying tool 2022-09-18 17:20:00 -04:00
idk
58ef493666 start working on Windows Service querying tool 2022-09-18 16:44:58 -04:00
idk
93a8b02667 update index.html 2022-09-18 16:43:19 -04:00
idk
afeae19cfd more README clarifications 2022-09-18 16:42:39 -04:00
idk
a4355587a1 make it fatal if a jpackage is not found because the profile launcher is now inside the jpackage 2022-09-18 14:01:36 -04:00
idk
9bda24d196 remove more superfluous targets 2022-09-18 13:57:20 -04:00
idk
68784fe6a2 add nsis-pluginapi to readme for e2e Windows builds 2022-09-18 13:32:12 -04:00
idk
415331e881 remove debian directory and Dockerfile 2022-09-18 00:41:22 -04:00
idk
93b7946803 update index.html 2022-09-18 00:40:30 -04:00
idk
6bdc6a2b39 fix links 2022-09-18 00:40:27 -04:00
idk
cef19a24e0 update index.html 2022-09-17 16:23:20 -04:00
idk
0c15a46cea fix link on home page 2022-09-17 16:22:59 -04:00
idk
190a5741a8 update UPDATES.html 2022-09-16 18:04:09 -04:00
idk
b6fa3fae7a update LICENSE.html 2022-09-16 18:04:05 -04:00
idk
6f5ee3f0f4 update index.html 2022-09-16 18:04:01 -04:00
idk
184b5d9e0f update changelog 2022-09-16 18:03:56 -04:00
idk
8b1820bd81 add note about unix portable to the readme 2022-09-16 18:01:58 -04:00
idk
835966aecb add note about config files to readme 2022-09-16 18:00:09 -04:00
idk
b0aa8a4989 update readme 2022-09-16 17:48:53 -04:00
idk
a366a31dce Remove Docker Makefile 2022-09-16 17:35:03 -04:00
idk
a0f638c2de document removal of Unix features 2022-09-16 17:33:01 -04:00
idk
e216b67105 remove user.js from profile makefiles 2022-09-15 20:07:33 -04:00
idk
379264cfaf no longer pull in extensions as part of the build for this repository, that has been moved to i2p.plugins.firefox 2022-09-15 11:37:05 -04:00
idk
2270c2aadb remove some redundant stuff from the installer 2022-09-14 16:55:37 -04:00
idk
2cf58e2460 change the name from profile install to easy install bundle 2022-09-14 16:50:11 -04:00
idk
6faaab1f44 delete a couple of redundant files 2022-09-14 16:47:00 -04:00
idk
3fc68f928b fix launcher logging to file 2022-09-13 22:53:12 -04:00
idk
3c404cd15e use selectHome instead of appImageHome in case somebody has set I2P or I2P_CONFIG in the environment 2022-09-13 13:49:16 -04:00
idk
2394ddf378 fix description of linux dailies, for regeneration of daily windows zip 2022-09-13 13:18:56 -04:00
idk
6594b1af99 only use powershell to zip for windows dailies, linux daily can always be tar.gz 2022-09-13 13:05:42 -04:00
idk
3d8cddec4f bump version number, update changelog, make logging slightly better 2022-09-13 12:58:52 -04:00
idk
e94d008335 selectHome and selectProgramFile need to be the same 2022-09-13 12:50:11 -04:00
idk
068a8ef1a6 it's still OK to instantiate i2pRouter underneath of the launchBrowser call because if we need to instantiate i2pRouter by definition the router isn't running, we've already checked. 2022-09-13 12:35:19 -04:00
idk
72b3f3910c only need one WUPP 2022-09-13 02:04:05 -04:00
idk
11a8f2cb08 update the configuration file to point back automatically 2022-09-13 02:03:09 -04:00
idk
0183222ac9 sleep for a moment after first github-release call 2022-09-13 00:54:46 -04:00
idk
0fb3193af2 add a script to automatically generate an upload a portable linux tar.gz 2022-09-13 00:49:37 -04:00
idk
15292c0aa4 make a tar.gz file sometimes 2022-09-13 00:45:18 -04:00
idk
fa0cfe6226 don't change exit status apparently 2022-09-12 23:39:48 -04:00
idk
9e176175d3 simpler daily zip generation 2022-09-12 22:41:06 -04:00
idk
bb58a3ce1f fix daily zip generation 2022-09-12 22:33:41 -04:00
idk
8de96b7df8 fix daily zip generation 2022-09-12 22:02:08 -04:00
idk
78148ee37f fix daily zip generation 2022-09-12 21:56:13 -04:00
idk
64a11096b0 exit with status 0 2022-09-12 20:36:46 -04:00
idk
573f16c380 update jpackage-only install instructions 2022-09-12 20:32:31 -04:00
idk
d8887fdfa5 remove and replace TODO comment 2022-09-12 20:29:09 -04:00
idk
5171164167 if NSIS hasn't put files in place already, get them from the config dir. 2022-09-12 18:53:20 -04:00
idk
0ae1609f0f Copy config file from NSIS, keep a reference to the router in the WinLauncher class 2022-09-12 16:45:27 -04:00
idk
09af24a115 set up the router in advance and run it with runRouter instead of RouterLaunch.main 2022-09-11 17:10:04 -04:00
idk
5cbf441715 targz is 2 levels up from build dir 2022-09-11 12:39:08 -04:00
idk
d2e005a583 fix tarball uploader 2022-09-11 12:08:05 -04:00
idk
3ad4216ce4 make my TODO 2022-09-11 02:18:32 -04:00
idk
50d803d191 bump up the profile manager version again 2022-09-11 02:11:00 -04:00
idk
5d23b012ed change selectHome log message 2022-09-11 01:58:16 -04:00
idk
299cf5ef3e change from never call setStarting except in checkStarting 2022-09-11 01:53:08 -04:00
idk
fe68a39d94 change from never call setStarting except in checkStarting 2022-09-11 01:35:01 -04:00
idk
2f0f99f609 add functionality to find base config 2022-09-11 01:31:08 -04:00
idk
cf67f6c476 include config in app content 2022-09-11 00:31:31 -04:00
idk
4a7fb5f55c include config in app content 2022-09-11 00:21:57 -04:00
idk
a34079c8ab setNotStarting before i2pBrowser.launch 2022-09-11 00:06:27 -04:00
idk
bfcdabd794 Factor out functions in WinLauncher 2022-09-11 00:03:30 -04:00
idk
733167ea8d Factor out factors in WinLauncher 2022-09-10 23:56:57 -04:00
idk
36d61b3bf6 Factor out factors in WinLauncher 2022-09-10 23:51:13 -04:00
idk
d403fd4b09 start organizing the functions used to gather information about the environment it's running in differently so they make more sense 2022-09-10 22:14:34 -04:00
idk
736071a992 Start moving config copy logic 2022-09-09 00:52:54 -04:00
idk
81d9d13742 app-content not resource-dir 2022-09-09 00:18:59 -04:00
idk
e66fc3440c app-content not resource-dir 2022-09-09 00:07:36 -04:00
idk
f9e3d1b040 experiment with how jpackage handles packaging on it's own 2022-09-08 23:51:24 -04:00
idk
928ae1a85f Update changelog and clean script 2022-09-08 10:49:20 -04:00
idk
93b197efb9 exclude .git directory from tarball 2022-09-08 10:41:06 -04:00
idk
09ffb8edbe fix date in changelog 2022-09-08 10:37:01 -04:00
idk
cdc3224eaa Generate a tarball of the exact tag or branch it's built from, upload it when we do a daily 2022-09-08 10:34:53 -04:00
idk
2eeb2106fc shorten first-run checks timeout. 2022-09-07 16:19:21 -04:00
idk
26a7944470 add safety checks around Windows config stuff 2022-09-07 12:40:05 -04:00
idk
b97d581fcc add safety checks around Windows config stuff 2022-09-07 12:37:57 -04:00
idk
615818976a add safety checks around Windows config stuff 2022-09-07 12:34:19 -04:00
idk
e6fc5a349d when launching into a router console disable the proxy timeout 2022-09-07 12:29:54 -04:00
idk
3718d2edb9 when launching into a router console disable the proxy timeout 2022-09-07 12:26:11 -04:00
idk
4a55a8d4ab bump i2pfirefox version again 2022-09-07 04:36:50 -04:00
idk
a3a45b01e5 bump i2pfirefox version 2022-09-07 03:25:46 -04:00
idk
e07c43f1eb make sure args are of right type 2022-09-07 02:59:26 -04:00
idk
fd75a7e244 Fix parsing of arguments 2022-09-07 02:28:23 -04:00
idk
0e77d53c15 bump i2pfirefox version 2022-09-07 00:05:07 -04:00
idk
4dd9448752 bump version 2022-09-06 21:57:25 -04:00
idk
b220697af2 update i2pfirefox package, point release 2022-09-06 21:53:53 -04:00
idk
d9cffc9520 update version 2022-09-06 15:45:53 -04:00
idk
c8590e4fe5 fix redundant option 2022-09-06 01:31:55 -04:00
idk
3c8b1b6d28 try an experiment where I build an MSI 2022-09-06 01:29:30 -04:00
idk
460837d7f5 bump again 2022-09-05 14:19:35 -04:00
idk
2bd3abe6bb re-add self-run of I2P.exe to save users a click, this needs testing but since I've got 3 VM's and 3 laptops on my desk right now I'm going to do it right now 2022-09-05 14:12:00 -04:00
idk
5ef6118b91 bump version again 2022-09-05 10:42:24 -04:00
idk
394f58f90e bump launcher lib again 2022-09-05 10:23:17 -04:00
idk
5ee89f98a9 chnge tunnel nickname of HTTP proxy 2022-09-05 03:01:11 -04:00
idk
6736d527a2 setNotRunning must be called on browser launch too 2022-09-05 02:55:35 -04:00
idk
ef203ba935 setNotRunning before launching the router, counter-intuitively but this is for determining whether we should launch the browser only. The other checks will still work for determining if a router is there. It only needs to be there for the first 21 or so seconds. 2022-09-05 02:00:54 -04:00
idk
3749f49641 setNotRunning before launching the router, counter-intuitively but this is for determining whether we should launch the browser only. The other checks will still work for determining if a router is there. It only needs to be there for the first 21 or so seconds. 2022-09-05 01:58:53 -04:00
idk
d63128096c Bump browserlauncher version 2022-09-05 01:51:28 -04:00
idk
51cb4c608a enable faster router startup 2022-09-05 01:47:16 -04:00
idk
f920fa8090 further accelerate startups 2022-09-05 00:41:51 -04:00
idk
252a80eb72 further accelerate startups 2022-09-05 00:41:20 -04:00
idk
ed7814cd74 enable faster startups 2022-09-04 23:56:07 -04:00
idk
073ba01da6 Lessen startup delay/timeout 2022-09-04 23:50:58 -04:00
idk
7caf03d6e4 Bump again 2022-09-04 23:12:52 -04:00
idk
c3934ab4e4 switch i2p.exe to /bin/false 2022-09-04 22:40:25 -04:00
idk
54ffdc2352 bump version and extend timeout again 2022-09-04 21:37:25 -04:00
idk
ab2548ecd4 bump version and extend timeout again 2022-09-04 21:34:14 -04:00
idk
5cf5d56738 check for up to a whole 20 seconds to see if a router is running instead of just 2 2022-09-04 14:45:10 -04:00
idk
262311390e prevent double-launch on the first run 2022-09-04 11:09:52 -04:00
idk
3ac2f2b4a2 switch to tag containing the addressbook fix 2022-09-04 08:35:29 -04:00
idk
00ca509e57 bump version 2022-09-04 02:04:37 -04:00
idk
a1826d40e8 rotate keys in tunnel config 2022-09-04 01:59:27 -04:00
idk
c8f3f0b960 rotate keys in tunnel config 2022-09-04 01:52:58 -04:00
idk
a80512cd5a add a note which indicates that the user.dir must be set for the launcher to relauch itself 2022-09-04 01:39:09 -04:00
idk
7e5579fd65 allow chromium-first mode while I wait for the VM to extract(again) 2022-09-04 00:52:48 -04:00
idk
934ab43b2a Download from sub-directory since my release now has multiple artifacts github puts it at a different place 2022-09-03 22:41:30 -04:00
idk
9214c2116c move version of browser wrapping bundle to version config file 2022-09-03 22:20:42 -04:00
idk
c02e466f80 move version of browser wrapping bundle to version config file 2022-09-03 21:57:07 -04:00
idk
59a1a3d9e6 update browser wrapping bundle 2022-09-03 21:42:39 -04:00
idk
a230a49af7 format everything for readability and so the brackets all line up again. All whitespace changes. 2022-09-03 21:17:44 -04:00
idk
079ef87c8f format everything for readability and so the brackets all line up again. All whitespace changes. 2022-09-03 21:13:27 -04:00
idk
f9a7f8ab2d Set user.dir after getting path 2022-09-03 20:51:33 -04:00
idk
3c8dd9dee9 fix indent 2022-09-03 19:09:47 -04:00
idk
65db834ec9 no directory abort 2022-09-03 19:08:57 -04:00
idk
b955dbe66e fix setoutpaths for runtime and app dir 2022-09-03 18:27:13 -04:00
idk
e367227714 enable the usability profile 2022-09-02 20:05:51 -04:00
idk
4a02ec418a Merge branch 'auto-configure-any-browser' into 'master'
WIP: This enables the jpackage to launch almost any browser as an I2P-enabled...

See merge request i2p-hackers/i2p.firefox!7
2022-09-02 02:51:05 +00:00
idk
4368b80c79 Merge branch 'master' into 'auto-configure-any-browser'
# Conflicts:
#   src/nsis/i2pbrowser-installer.nsi
2022-09-02 02:49:56 +00:00
idk
7dff65d67d Merge branch 'experimental-extension-loadout' into 'master'
WIP: add 2 extension loadouts, one "Usability" loadout, one "Strict" loadout

See merge request i2p-hackers/i2p.firefox!8
2022-09-02 02:48:58 +00:00
idk
0ad9406387 copy app, runtime individually instead of the parent dir 2022-09-01 21:33:32 -04:00
idk
21b396e343 add buildscript for experimental extension loadout 2022-08-29 19:56:13 -04:00
72 changed files with 2661 additions and 2593 deletions

5
.gitignore vendored
View File

@ -18,4 +18,7 @@ i2pversion_override
*.log
cmd
*.so
*.jar
*.jar
*.zip
*.tar.gz
config_override.sh

View File

@ -1,10 +0,0 @@
FROM alpine:latest
RUN apk update && apk add firefox make curl musl-locales dbus-x11 font-ubuntu-nerd jq --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing
ADD . /src
WORKDIR /src
RUN make profile.tgz # && \
RUN chown -R 1000:1000 /src/build/profile # && \
RUN chmod -R +w /src/build/profile
RUN ls -lah /src/build/profile
#USER 1000
CMD sh -c 'cd build/profile && ./i2pbrowser.sh'

View File

@ -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 &ldquo;Software&rdquo;), 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 &ldquo;AS IS&rdquo;, 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

View File

@ -32,23 +32,15 @@ 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)"
@echo "$(preset)"
prep: #launchers build/licenses profile.tgz app-profile.tgz profile build/I2P build/I2P/config #
make launchers
echo "launchers" >make.log
make build/licenses
echo "licenses" >make.log
make profile.tgz
echo "profilezip" >make.log
make app-profile.tgz
echo "appprofile" >make.log
make profile
echo "profile" >make.log
make build/I2P
echo "buildi2p" >make.log
make build/I2P/config
@ -60,15 +52,14 @@ 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"
export I2P_JBIGI="../i2p.i2p.jpackage-build/installer/lib/jbigi"
distclean: clean clean-extensions
distclean: clean
rm -rf I2P
git clean -fd
I2P:
./build.sh
@ -78,15 +69,14 @@ 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,31 +112,17 @@ 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:
@echo "creating build directory"
mkdir -p build
include makefiles/profile.mk
include makefiles/app-profile.mk
-include makefiles/new-extensions.mk
include makefiles/extensions.mk
include makefiles/build.mk
include makefiles/install.mk
include makefiles/su.mk
include makefiles/su-unsigned.mk
include makefiles/docker.mk
include makefiles/debian.mk
I2P_DATE=`date +%Y-%m-%d`
@ -159,7 +135,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

249
README.md
View File

@ -4,16 +4,17 @@ I2P Easy-Install Bundle for Windows(Also/formerly)I2P Browsing Profile for Firef
Features:
---------
- Automatically select an up-to-date, secure Firefox or Tor Browser(On Windows) variant
- Automatically select an up-to-date, secure browser from the host platform, with Tor Browser and Firefox preferred.
- Automatically configure a profile for I2P
- Automatically block-list all non-I2P local destinations
- Enable first-party isolation, anti-fingerprinting, letterboxing
- Enable first-party isolation, anti-fingerprinting, letterboxing, fusion, other privacy and security options
- Automatically sandbox I2P, Non-I2P, and I2P-Application cookiestores
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
@ -21,6 +22,16 @@ To build this, you will need the following software packages (all available in D
- curl
- jq
These need to be installed in the environment where the NSIS
Package is build, NOT the environment where the java package
is built. These may be different, because you will need to
use a system which provides a Unix-like environment on top of
a Windows system. You can use WSL or Cygwin, and more detailed
instructions are provided below.
Building for Windows target from Linux is not possible unless
you obtain a Windows package from my github.
In addition, you will need the NSIS plugin "ShellExecAsUser" which you can get from the
[NSIS Wiki Page](https://nsis.sourceforge.io/ShellExecAsUser_plug-in). In order to install
the plugin on Debian, Ubuntu, or using `WSL`, you can download the: [7zip release](https://nsis.sourceforge.io/mediawiki/images/6/68/ShellExecAsUser_amd64-Unicode.7z)
@ -30,89 +41,28 @@ 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.
The Windows build tools listed above must be installed on the Windows host machine.
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,27 +80,41 @@ 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)
3. Open Git Bash.
4. Install prerequisites `wsl sudo apt-get update && sudo apt-get install make nsis dos2unix curl jq`
4. Install prerequisites `wsl sudo apt-get update && sudo apt-get install make nsis nsis-pluginapi dos2unix curl jq`
5. Clone `i2p.i2p` and `i2p.firefox`
git clone https://github.com/i2p/i2p.i2p
@ -172,21 +136,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 +186,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 +206,36 @@ 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.firefox 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.firefox 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. Once generated, `cd I2P && ./lib/torbrowser.sh` to complete**
**setup, and `./bin/I2P` to run it.**
Issues
------
@ -269,11 +247,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

View File

@ -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,
youll need to do it the complete way.
you&rsquo;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

View File

@ -16,73 +16,7 @@ if [ -f config_overide.sh ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
COUNT="Ten Nine Eight Seven Six Five Four Three Two One"
which java
JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t\- ')
if [ "$JAVA" -lt "14" ]; then
echo "Java 14+ must be used to compile with jpackage, java is $JAVA"
exit 1
fi
if [ "$JAVA" -lt "17" ]; then
echo "It is highly recommended that you use Java 17+ to build release packages"
fi
if [ -z "${JAVA_HOME}" ]; then
JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
fi
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
fi
echo "Building with: $JAVA, $JAVA_HOME"
sleep 5s
HERE="$PWD"
if [ ! -d "$HERE/../i2p.i2p.jpackage-build/" ]; then
git clone -b "$VERSION" https://i2pgit.org/i2p-hackers/i2p.i2p "$HERE/../i2p.i2p.jpackage-build/"
fi
cd "$HERE/../i2p.i2p.jpackage-build/"
for i in $COUNT; do
echo -n "$i...."; sleep 1s
done
ant distclean pkg || true
cd "$HERE"
I2P_PKG="$HERE/../i2p.i2p.jpackage-build/pkg-temp"
RES_DIR="$HERE/../i2p.i2p.jpackage-build/installer/resources"
I2P_JARS="$I2P_PKG/lib"
I2P_JBIGI="$HERE/../i2p.i2p.jpackage-build/installer/lib/jbigi"
echo "compiling custom launcher"
mkdir -p build
cp "$I2P_JARS"/*.jar build
if [ ! -f "$HERE/build/jna.jar" ]; then
wget -O "$HERE/build/jna.jar" "https://repo1.maven.org/maven2/net/java/dev/jna/jna/$JNA_VERSION/jna-$JNA_VERSION.jar"
fi
if [ ! -f "$HERE/build/jna-platform.jar" ]; then
wget -O "$HERE/build/jna-platform.jar" "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/$JNA_VERSION/jna-platform-$JNA_VERSION.jar"
fi
if [ ! -f "$HERE/build/i2pfirefox.jar" ]; then
wget -O "$HERE/build/i2pfirefox.jar" https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.16/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/Elevator.java \
net/i2p/router/Shell32X.java \
net/i2p/router/WinLauncher.java \
net/i2p/router/WindowsUpdatePostProcessor.java \
net/i2p/router/WinUpdateProcess.java
cd ..
#echo "building launcher.jar"
cd build
"$JAVA_HOME"/bin/jar -cf launcher.jar net
cd ..
. "$SCRIPT_DIR/launcher.sh"
if [ -z $I2P_VERSION ]; then
I2P_VERSION=$("$JAVA_HOME"/bin/java -cp build/router.jar net.i2p.router.RouterVersion | sed "s/.*: //" | head -n 1 | sed 's|-|.|g')
@ -90,6 +24,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 +37,11 @@ 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 \
--app-content src/unix/torbrowser.sh \
--app-content src/icons/windowsUIToopie2.png \
--app-content src/icons/ui2pbrowser_icon.ico \
--icon src/icons/windowsUIToopie2.png \
--input build --main-jar launcher.jar --main-class net.i2p.router.WinLauncher
cp "$I2P_PKG/licenses/"* license/

View File

@ -1,3 +1,28 @@
2022-09-20 idk
* improve compatibility with local service installs and with un-bundled installs side-by-side with bundled intalls
* version 1.9.7
2022-09-18 idk
* remove unstable/deprecated targets from Makefile.
* make it fatal if a jpackaged I2P is not found, the profile launcher is now part of the jpackage
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

View File

@ -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 \

View File

@ -3,16 +3,38 @@
## 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
# to use it for Oracle OpenJDK18
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
### TESTING:
## This isn't a default install location, obviously, it's where I unzipped it.
## It won't work for you unless you kurtly tell Windows that your name is `user`
## every time you make an account, like I do.
#PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
#export PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
#JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
#export JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
## 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"
#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 +71,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

82
config_override.example.sh Executable file
View File

@ -0,0 +1,82 @@
#! /usr/bin/env bash
## 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 OpenJDK18
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
export PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
export JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
fi
if [ "${uname}" != "Linux" ]; then
PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
export PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
export JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
fi
### TESTING:
## This isn't a default install location, obviously, it's where I unzipped it.
## It won't work for you unless you kurtly tell Windows that your name is `user`
## every time you make an account, like I do.
#PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
#export PATH="/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/:$PATH:/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19/bin/"
#JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
#export JAVA_HOME=/c/Users/user/Downloads/openjdk-19_windows-x64_bin/jdk-19
## Other potential values(NOT exhaustive):
#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/"
#export JAVA_HOME="/c/Program Files/OpenJDK/jdk-17.0.3"
#BREAKS!
#export PATH=/c/Program Files/GraalVM/graalvm-ce-java17-22.0.0.2/bin
#export JAVA_HOME=/c/Program Files/GraalVM/graalvm-ce-java17-22.0.0.2
#BREAKS!
# might be fun to learn why this is broken
#WORKS WELL! GETS UPDATES AS SOON AS ORACLE! VIABLE ALTERNATIVE!
#export PATH="$PATH:/c/Program Files/Amazon Corretto/jdk17.0.3_6/bin/"
#export JAVA_HOME="/c/Program Files/Amazon Corretto/jdk17.0.3_6"
#WORKS WELL! GETS UPDATES AS SOON AS ORACLE! VIABLE ALTERNATIVE!
# These are all things I built the package with today(April 20, 2022, idk)
# Which will determine, of course, which java compilers you use and where
# your JAVA_HOME(and thus your bootclasspath jars and stuff) come from.
# So for you reddit nerds who are all into graalVM or whatever, this might
# be where you go to mess with that.
## Until 1.7.4, releases were built using Eclipse Adoptium OpenJDK
# but it lags behind a day or two in security updates which did become
# a major issue in April 2022. At this point it was migrated to Oracle's
# JDK distribution which was more up to date. Should you prefer, or simply
# wish to experiment with a different JVM, copy this file to `config_overrides.sh`
# and add your JAVA_HOME and $PATH changes.
# You can also use this to temporarily add applications into the PATH that are
# required to build this if you do not wish to edit your PATH across the entire
# Windows session, and for setting ANT_HOME
#export ANT_HOME="/c/apache-ant-1.10.9"
#export PATH="$PATH:$ANT_HOME/bin/"
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
View 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
===================================================
These builds are automatically built on a daily basis and may have serious bugs.
They are intended for testing purposes only, use them at your own risk.
"
fi
echo github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
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"

60
daily-unstable.sh Executable file
View File

@ -0,0 +1,60 @@
#! /usr/bin/env bash
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
cd "$SCRIPT_DIR" || exit 1
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
. "$SCRIPT_DIR/i2pversion"
if [ -f i2pversion_override ]; then
. "$SCRIPT_DIR/i2pversion_override"
fi
. "$SCRIPT_DIR/config_override.sh"
### How to set up this script:
#
# This script will not work unless you give it a Github API key.
# You need to create a file in your $HOME directory, which on
# Windows will by /c/Users/yourusername, called github-release-config.sh,
# containing this key as the variable GITHUB_TOKEN.
# github-release-config.sh must also contain:
# GITHUB_USERNAME=your github username
git clean -fd
git checkout .
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
./unsigned.sh
. "$HOME/github-release-config.sh"
if [ -f ./i2pversion_override ]; then
. ./i2pversion_override
fi
TODAYSDATE="$(date +%Y%m%d).java.19.dev.build"
if [ -z "$DESCRIPTION" ]; then
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE
===================================================
These builds are automatically built on a daily basis and may have serious bugs.
They are intended for testing purposes only, use them at your own risk.
"
fi
echo github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
sleep 2s;
EXECHECKSUM=$(sha256sum "I2P-Easy-Install-Bundle-$I2P_VERSION.exe")
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -l "Java 19 Development Build - $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 "Java 19 Development Build - $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 "Java 19 Development Build - $ZIPCHECKSUM" -t "$TODAYSDATE" -n "I2P.zip"
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P.zip" -l "Java 19 Development Build - $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 "Java 19 Development Build - 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 "Java 19 Development Build - Upstream I2P Router source code $TARCHECKSUM" -t "$TODAYSDATE" -n "i2p.i2p.jpackage-build.tar.gz"

View File

@ -9,12 +9,9 @@ if [ -f i2pversion_override ]; then
. "$SCRIPT_DIR/i2pversion_override"
fi
mv "$SCRIPT_DIR/config_override.sh" "$SCRIPT_DIR/config_override.sh.bak"
. "$SCRIPT_DIR/config.sh"
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.
@ -36,16 +33,25 @@ fi
TODAYSDATE=$(date +%Y%m%d)
if [ -z "$DESCRIPTION" ]; then
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE"
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE
===================================================
These builds are automatically built on a daily basis and may have serious bugs.
They are intended for testing purposes only, use them at your own risk.
"
fi
echo github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
github-release release -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
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"
sleep 2s;
EXECHECKSUM=$(sha256sum "I2P-Easy-Install-Bundle-$I2P_VERSION.exe")
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" -l "$EXECHECKSUM" -t "$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"

View File

@ -1,9 +0,0 @@
i2p-firefox-profile for Debian
-----------------------------
This is a Firefox Profile and a bundle of Open-Source extensions which are
packaged for convenience as a Debian-style package. The extensions themselves
may not be packaged in Debian. They are side-loaded on the first run of the
browser profile.
-- idk <hankhill19580@gmail.com> Sat, 03 Jul 2021 23:32:29 -0400

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
i2p-firefox-profile (1.05.0-1) sid; urgency=medium
* Initial release. Closes i2pgit.org/i2p-hackers/i2p.firefox #5
-- eyedeekay <hankhill19580@gmail.com> Sun, 22 Aug 2021 22:27:37 -0400

20
debian/control vendored
View File

@ -1,20 +0,0 @@
Source: i2p-firefox-profile
Section: net
Priority: optional
Maintainer: idk <hankhill19580@gmail.com>
Build-Depends: debhelper-compat (= 11)
Standards-Version: 4.5.1
Homepage: https://i2pgit.org/i2p-hackers/i2p.firefox
Vcs-Browser: https://i2pgit.org/i2p-hackers/i2p.firefox
Vcs-Git: https://i2pgit.org/i2p-hackers/i2p.firefox.git
Rules-Requires-Root: no
Package: i2p-firefox-profile
Architecture: all
Depends: firefox,wget,i2p | i2pd,${misc:Depends}
Suggests: i2p,i2p-router,syndie,tor,tsocks
Description: Browser profile for Firefox+I2P and script to launch it
Debian/Ubuntu port of the I2P Browser Profile for Firefox/Windows
systems. It is built from the same source and has identical
functionality to the Windows version, and in most ways should appear
nearly identical to it's Windows equivalent.

865
debian/copyright vendored
View File

@ -1,865 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: i2p-firefox-profile
Upstream-Contact: idk hankhill19580@gmail.com
Source: https://i2pgit.org/i2p-hackers/i2p.firefox
Files: *
Copyright: 2018 The Invisible Internet Project
License: MIT
Files: debian/*
Copyright: 2021 idk <hankhill19580@gmail.com>
License: MIT
License: MIT
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 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, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
.
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.
# HTTPS Everwyhere:
# Copyright © 2010-2012 Mike Perry <mikeperry@fscked.org>
# Peter Eckersley <pde@eff.org>
# and many others
# (Licensed GPL v2+)
#
# Incorporating code from NoScript,
# Copyright © 2004-2007 Giorgio Maone <g.maone@informaction.com>
# Licensed GPL v2+
#
# Incorporating code from Convergence
# Copyright © Moxie Marlinspike
# Licensed GPL v3+
#
# Incorporating code from URI.js
# Copyright © Rodney Rehm
# Licensed MIT, GPL V3
#
# Incorporating code from js-lru
# Copyright © 2010 Rasmus Andersson
# Licensed MIT
#
# The build system incorporates code from Python 2.6,
# Copyright © 2001-2006 Python Software Foundation
# Python Software Foundation License Version 2
#
# Net License: GPL v3+ (complete tree)
# GPL v2+ (if Moxie's NSS.js is absent)
#
#
# Text of MIT License:
# ====================
# 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 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, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# 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.
# MIT License
#
# Copyright (c) 2019 idk
#
# 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 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, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# 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.
# Mozilla Public License Version 2.0
# ==================================
#
# 1. Definitions
# --------------
#
# 1.1. "Contributor"
# means each individual or legal entity that creates, contributes to
# the creation of, or owns Covered Software.
#
# 1.2. "Contributor Version"
# means the combination of the Contributions of others (if any) used
# by a Contributor and that particular Contributor's Contribution.
#
# 1.3. "Contribution"
# means Covered Software of a particular Contributor.
#
# 1.4. "Covered Software"
# means Source Code Form to which the initial Contributor has attached
# the notice in Exhibit A, the Executable Form of such Source Code
# Form, and Modifications of such Source Code Form, in each case
# including portions thereof.
#
# 1.5. "Incompatible With Secondary Licenses"
# means
#
# (a) that the initial Contributor has attached the notice described
# in Exhibit B to the Covered Software; or
#
# (b) that the Covered Software was made available under the terms of
# version 1.1 or earlier of the License, but not also under the
# terms of a Secondary License.
#
# 1.6. "Executable Form"
# means any form of the work other than Source Code Form.
#
# 1.7. "Larger Work"
# means a work that combines Covered Software with other material, in
# a separate file or files, that is not Covered Software.
#
# 1.8. "License"
# means this document.
#
# 1.9. "Licensable"
# means having the right to grant, to the maximum extent possible,
# whether at the time of the initial grant or subsequently, any and
# all of the rights conveyed by this License.
#
# 1.10. "Modifications"
# means any of the following:
#
# (a) any file in Source Code Form that results from an addition to,
# deletion from, or modification of the contents of Covered
# Software; or
#
# (b) any new file in Source Code Form that contains any Covered
# Software.
#
# 1.11. "Patent Claims" of a Contributor
# means any patent claim(s), including without limitation, method,
# process, and apparatus claims, in any patent Licensable by such
# Contributor that would be infringed, but for the grant of the
# License, by the making, using, selling, offering for sale, having
# made, import, or transfer of either its Contributions or its
# Contributor Version.
#
# 1.12. "Secondary License"
# means either the GNU General Public License, Version 2.0, the GNU
# Lesser General Public License, Version 2.1, the GNU Affero General
# Public License, Version 3.0, or any later versions of those
# licenses.
#
# 1.13. "Source Code Form"
# means the form of the work preferred for making modifications.
#
# 1.14. "You" (or "Your")
# means an individual or a legal entity exercising rights under this
# License. For legal entities, "You" includes any entity that
# controls, is controlled by, or is under common control with You. For
# purposes of this definition, "control" means (a) the power, direct
# or indirect, to cause the direction or management of such entity,
# whether by contract or otherwise, or (b) ownership of more than
# fifty percent (50%) of the outstanding shares or beneficial
# ownership of such entity.
#
# 2. License Grants and Conditions
# --------------------------------
#
# 2.1. Grants
#
# Each Contributor hereby grants You a world-wide, royalty-free,
# non-exclusive license:
#
# (a) under intellectual property rights (other than patent or trademark)
# Licensable by such Contributor to use, reproduce, make available,
# modify, display, perform, distribute, and otherwise exploit its
# Contributions, either on an unmodified basis, with Modifications, or
# as part of a Larger Work; and
#
# (b) under Patent Claims of such Contributor to make, use, sell, offer
# for sale, have made, import, and otherwise transfer either its
# Contributions or its Contributor Version.
#
# 2.2. Effective Date
#
# The licenses granted in Section 2.1 with respect to any Contribution
# become effective for each Contribution on the date the Contributor first
# distributes such Contribution.
#
# 2.3. Limitations on Grant Scope
#
# The licenses granted in this Section 2 are the only rights granted under
# this License. No additional rights or licenses will be implied from the
# distribution or licensing of Covered Software under this License.
# Notwithstanding Section 2.1(b) above, no patent license is granted by a
# Contributor:
#
# (a) for any code that a Contributor has removed from Covered Software;
# or
#
# (b) for infringements caused by: (i) Your and any other third party's
# modifications of Covered Software, or (ii) the combination of its
# Contributions with other software (except as part of its Contributor
# Version); or
#
# (c) under Patent Claims infringed by Covered Software in the absence of
# its Contributions.
#
# This License does not grant any rights in the trademarks, service marks,
# or logos of any Contributor (except as may be necessary to comply with
# the notice requirements in Section 3.4).
#
# 2.4. Subsequent Licenses
#
# No Contributor makes additional grants as a result of Your choice to
# distribute the Covered Software under a subsequent version of this
# License (see Section 10.2) or under the terms of a Secondary License (if
# permitted under the terms of Section 3.3).
#
# 2.5. Representation
#
# Each Contributor represents that the Contributor believes its
# Contributions are its original creation(s) or it has sufficient rights
# to grant the rights to its Contributions conveyed by this License.
#
# 2.6. Fair Use
#
# This License is not intended to limit any rights You have under
# applicable copyright doctrines of fair use, fair dealing, or other
# equivalents.
#
# 2.7. Conditions
#
# Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
# in Section 2.1.
#
# 3. Responsibilities
# -------------------
#
# 3.1. Distribution of Source Form
#
# All distribution of Covered Software in Source Code Form, including any
# Modifications that You create or to which You contribute, must be under
# the terms of this License. You must inform recipients that the Source
# Code Form of the Covered Software is governed by the terms of this
# License, and how they can obtain a copy of this License. You may not
# attempt to alter or restrict the recipients' rights in the Source Code
# Form.
#
# 3.2. Distribution of Executable Form
#
# If You distribute Covered Software in Executable Form then:
#
# (a) such Covered Software must also be made available in Source Code
# Form, as described in Section 3.1, and You must inform recipients of
# the Executable Form how they can obtain a copy of such Source Code
# Form by reasonable means in a timely manner, at a charge no more
# than the cost of distribution to the recipient; and
#
# (b) You may distribute such Executable Form under the terms of this
# License, or sublicense it under different terms, provided that the
# license for the Executable Form does not attempt to limit or alter
# the recipients' rights in the Source Code Form under this License.
#
# 3.3. Distribution of a Larger Work
#
# You may create and distribute a Larger Work under terms of Your choice,
# provided that You also comply with the requirements of this License for
# the Covered Software. If the Larger Work is a combination of Covered
# Software with a work governed by one or more Secondary Licenses, and the
# Covered Software is not Incompatible With Secondary Licenses, this
# License permits You to additionally distribute such Covered Software
# under the terms of such Secondary License(s), so that the recipient of
# the Larger Work may, at their option, further distribute the Covered
# Software under the terms of either this License or such Secondary
# License(s).
#
# 3.4. Notices
#
# You may not remove or alter the substance of any license notices
# (including copyright notices, patent notices, disclaimers of warranty,
# or limitations of liability) contained within the Source Code Form of
# the Covered Software, except that You may alter any license notices to
# the extent required to remedy known factual inaccuracies.
#
# 3.5. Application of Additional Terms
#
# You may choose to offer, and to charge a fee for, warranty, support,
# indemnity or liability obligations to one or more recipients of Covered
# Software. However, You may do so only on Your own behalf, and not on
# behalf of any Contributor. You must make it absolutely clear that any
# such warranty, support, indemnity, or liability obligation is offered by
# You alone, and You hereby agree to indemnify every Contributor for any
# liability incurred by such Contributor as a result of warranty, support,
# indemnity or liability terms You offer. You may include additional
# disclaimers of warranty and limitations of liability specific to any
# jurisdiction.
#
# 4. Inability to Comply Due to Statute or Regulation
# ---------------------------------------------------
#
# If it is impossible for You to comply with any of the terms of this
# License with respect to some or all of the Covered Software due to
# statute, judicial order, or regulation then You must: (a) comply with
# the terms of this License to the maximum extent possible; and (b)
# describe the limitations and the code they affect. Such description must
# be placed in a text file included with all distributions of the Covered
# Software under this License. Except to the extent prohibited by statute
# or regulation, such description must be sufficiently detailed for a
# recipient of ordinary skill to be able to understand it.
#
# 5. Termination
# --------------
#
# 5.1. The rights granted under this License will terminate automatically
# if You fail to comply with any of its terms. However, if You become
# compliant, then the rights granted under this License from a particular
# Contributor are reinstated (a) provisionally, unless and until such
# Contributor explicitly and finally terminates Your grants, and (b) on an
# ongoing basis, if such Contributor fails to notify You of the
# non-compliance by some reasonable means prior to 60 days after You have
# come back into compliance. Moreover, Your grants from a particular
# Contributor are reinstated on an ongoing basis if such Contributor
# notifies You of the non-compliance by some reasonable means, this is the
# first time You have received notice of non-compliance with this License
# from such Contributor, and You become compliant prior to 30 days after
# Your receipt of the notice.
#
# 5.2. If You initiate litigation against any entity by asserting a patent
# infringement claim (excluding declaratory judgment actions,
# counter-claims, and cross-claims) alleging that a Contributor Version
# directly or indirectly infringes any patent, then the rights granted to
# You by any and all Contributors for the Covered Software under Section
# 2.1 of this License shall terminate.
#
# 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
# end user license agreements (excluding distributors and resellers) which
# have been validly granted by You or Your distributors under this License
# prior to termination shall survive termination.
#
# ************************************************************************
# * *
# * 6. Disclaimer of Warranty *
# * ------------------------- *
# * *
# * Covered Software is provided under this License on an "as is" *
# * basis, without warranty of any kind, either expressed, implied, or *
# * statutory, including, without limitation, warranties that the *
# * Covered Software is free of defects, merchantable, fit for a *
# * particular purpose or non-infringing. The entire risk as to the *
# * quality and performance of the Covered Software is with You. *
# * Should any Covered Software prove defective in any respect, You *
# * (not any Contributor) assume the cost of any necessary servicing, *
# * repair, or correction. This disclaimer of warranty constitutes an *
# * essential part of this License. No use of any Covered Software is *
# * authorized under this License except under this disclaimer. *
# * *
# ************************************************************************
#
# ************************************************************************
# * *
# * 7. Limitation of Liability *
# * -------------------------- *
# * *
# * Under no circumstances and under no legal theory, whether tort *
# * (including negligence), contract, or otherwise, shall any *
# * Contributor, or anyone who distributes Covered Software as *
# * permitted above, be liable to You for any direct, indirect, *
# * special, incidental, or consequential damages of any character *
# * including, without limitation, damages for lost profits, loss of *
# * goodwill, work stoppage, computer failure or malfunction, or any *
# * and all other commercial damages or losses, even if such party *
# * shall have been informed of the possibility of such damages. This *
# * limitation of liability shall not apply to liability for death or *
# * personal injury resulting from such party's negligence to the *
# * extent applicable law prohibits such limitation. Some *
# * jurisdictions do not allow the exclusion or limitation of *
# * incidental or consequential damages, so this exclusion and *
# * limitation may not apply to You. *
# * *
# ************************************************************************
#
# 8. Litigation
# -------------
#
# Any litigation relating to this License may be brought only in the
# courts of a jurisdiction where the defendant maintains its principal
# place of business and such litigation shall be governed by laws of that
# jurisdiction, without reference to its conflict-of-law provisions.
# Nothing in this Section shall prevent a party's ability to bring
# cross-claims or counter-claims.
#
# 9. Miscellaneous
# ----------------
#
# This License represents the complete agreement concerning the subject
# matter hereof. If any provision of this License is held to be
# unenforceable, such provision shall be reformed only to the extent
# necessary to make it enforceable. Any law or regulation which provides
# that the language of a contract shall be construed against the drafter
# shall not be used to construe this License against a Contributor.
#
# 10. Versions of the License
# ---------------------------
#
# 10.1. New Versions
#
# Mozilla Foundation is the license steward. Except as provided in Section
# 10.3, no one other than the license steward has the right to modify or
# publish new versions of this License. Each version will be given a
# distinguishing version number.
#
# 10.2. Effect of New Versions
#
# You may distribute the Covered Software under the terms of the version
# of the License under which You originally received the Covered Software,
# or under the terms of any subsequent version published by the license
# steward.
#
# 10.3. Modified Versions
#
# If you create software not governed by this License, and you want to
# create a new license for such software, you may create and use a
# modified version of this License if you rename the license and remove
# any references to the name of the license steward (except to note that
# such modified license differs from this License).
#
# 10.4. Distributing Source Code Form that is Incompatible With Secondary
# Licenses
#
# If You choose to distribute Source Code Form that is Incompatible With
# Secondary Licenses under the terms of this version of the License, the
# notice described in Exhibit B of this License must be attached.
#
# Exhibit A - Source Code Form License Notice
# -------------------------------------------
#
# 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/.
#
# If it is not possible or desirable to put the notice in a particular
# file, then You may include the notice in a location (such as a LICENSE
# file in a relevant directory) where a recipient would be likely to look
# for such a notice.
#
# You may add additional accurate notices of copyright ownership.
#
# Exhibit B - "Incompatible With Secondary Licenses" Notice
# ---------------------------------------------------------
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
#
# Note on GPL Compatibility
# -------------------------
#
# The MPL 2, section 3.3, permits you to combine NSS with code under the GNU
# General Public License (GPL) version 2, or any later version of that
# license, to make a Larger Work, and distribute the result under the GPL.
# The only condition is that you must also make NSS, and any changes you
# have made to it, available to recipients under the terms of the MPL 2 also.
#
# Anyone who receives the combined code from you does not have to continue
# to dual licence in this way, and may, if they wish, distribute under the
# terms of either of the two licences - either the MPL alone or the GPL
# alone. However, we discourage people from distributing copies of NSS under
# the GPL alone, because it means that any improvements they make cannot be
# reincorporated into the main version of NSS. There is never a need to do
# this for license compatibility reasons.
#
# Note on LGPL Compatibility
# --------------------------
#
# The above also applies to combining MPLed code in a single library with
# code under the GNU Lesser General Public License (LGPL) version 2.1, or
# any later version of that license. If the LGPLed code and the MPLed code
# are not in the same library, then the copyleft coverage of the two
# licences does not overlap, so no issues arise.
#
#
# Mozilla Public License Version 2.0
# ==================================
#
# 1. Definitions
# --------------
#
# 1.1. "Contributor"
# means each individual or legal entity that creates, contributes to
# the creation of, or owns Covered Software.
#
# 1.2. "Contributor Version"
# means the combination of the Contributions of others (if any) used
# by a Contributor and that particular Contributor's Contribution.
#
# 1.3. "Contribution"
# means Covered Software of a particular Contributor.
#
# 1.4. "Covered Software"
# means Source Code Form to which the initial Contributor has attached
# the notice in Exhibit A, the Executable Form of such Source Code
# Form, and Modifications of such Source Code Form, in each case
# including portions thereof.
#
# 1.5. "Incompatible With Secondary Licenses"
# means
#
# (a) that the initial Contributor has attached the notice described
# in Exhibit B to the Covered Software; or
#
# (b) that the Covered Software was made available under the terms of
# version 1.1 or earlier of the License, but not also under the
# terms of a Secondary License.
#
# 1.6. "Executable Form"
# means any form of the work other than Source Code Form.
#
# 1.7. "Larger Work"
# means a work that combines Covered Software with other material, in
# a separate file or files, that is not Covered Software.
#
# 1.8. "License"
# means this document.
#
# 1.9. "Licensable"
# means having the right to grant, to the maximum extent possible,
# whether at the time of the initial grant or subsequently, any and
# all of the rights conveyed by this License.
#
# 1.10. "Modifications"
# means any of the following:
#
# (a) any file in Source Code Form that results from an addition to,
# deletion from, or modification of the contents of Covered
# Software; or
#
# (b) any new file in Source Code Form that contains any Covered
# Software.
#
# 1.11. "Patent Claims" of a Contributor
# means any patent claim(s), including without limitation, method,
# process, and apparatus claims, in any patent Licensable by such
# Contributor that would be infringed, but for the grant of the
# License, by the making, using, selling, offering for sale, having
# made, import, or transfer of either its Contributions or its
# Contributor Version.
#
# 1.12. "Secondary License"
# means either the GNU General Public License, Version 2.0, the GNU
# Lesser General Public License, Version 2.1, the GNU Affero General
# Public License, Version 3.0, or any later versions of those
# licenses.
#
# 1.13. "Source Code Form"
# means the form of the work preferred for making modifications.
#
# 1.14. "You" (or "Your")
# means an individual or a legal entity exercising rights under this
# License. For legal entities, "You" includes any entity that
# controls, is controlled by, or is under common control with You. For
# purposes of this definition, "control" means (a) the power, direct
# or indirect, to cause the direction or management of such entity,
# whether by contract or otherwise, or (b) ownership of more than
# fifty percent (50%) of the outstanding shares or beneficial
# ownership of such entity.
#
# 2. License Grants and Conditions
# --------------------------------
#
# 2.1. Grants
#
# Each Contributor hereby grants You a world-wide, royalty-free,
# non-exclusive license:
#
# (a) under intellectual property rights (other than patent or trademark)
# Licensable by such Contributor to use, reproduce, make available,
# modify, display, perform, distribute, and otherwise exploit its
# Contributions, either on an unmodified basis, with Modifications, or
# as part of a Larger Work; and
#
# (b) under Patent Claims of such Contributor to make, use, sell, offer
# for sale, have made, import, and otherwise transfer either its
# Contributions or its Contributor Version.
#
# 2.2. Effective Date
#
# The licenses granted in Section 2.1 with respect to any Contribution
# become effective for each Contribution on the date the Contributor first
# distributes such Contribution.
#
# 2.3. Limitations on Grant Scope
#
# The licenses granted in this Section 2 are the only rights granted under
# this License. No additional rights or licenses will be implied from the
# distribution or licensing of Covered Software under this License.
# Notwithstanding Section 2.1(b) above, no patent license is granted by a
# Contributor:
#
# (a) for any code that a Contributor has removed from Covered Software;
# or
#
# (b) for infringements caused by: (i) Your and any other third party's
# modifications of Covered Software, or (ii) the combination of its
# Contributions with other software (except as part of its Contributor
# Version); or
#
# (c) under Patent Claims infringed by Covered Software in the absence of
# its Contributions.
#
# This License does not grant any rights in the trademarks, service marks,
# or logos of any Contributor (except as may be necessary to comply with
# the notice requirements in Section 3.4).
#
# 2.4. Subsequent Licenses
#
# No Contributor makes additional grants as a result of Your choice to
# distribute the Covered Software under a subsequent version of this
# License (see Section 10.2) or under the terms of a Secondary License (if
# permitted under the terms of Section 3.3).
#
# 2.5. Representation
#
# Each Contributor represents that the Contributor believes its
# Contributions are its original creation(s) or it has sufficient rights
# to grant the rights to its Contributions conveyed by this License.
#
# 2.6. Fair Use
#
# This License is not intended to limit any rights You have under
# applicable copyright doctrines of fair use, fair dealing, or other
# equivalents.
#
# 2.7. Conditions
#
# Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
# in Section 2.1.
#
# 3. Responsibilities
# -------------------
#
# 3.1. Distribution of Source Form
#
# All distribution of Covered Software in Source Code Form, including any
# Modifications that You create or to which You contribute, must be under
# the terms of this License. You must inform recipients that the Source
# Code Form of the Covered Software is governed by the terms of this
# License, and how they can obtain a copy of this License. You may not
# attempt to alter or restrict the recipients' rights in the Source Code
# Form.
#
# 3.2. Distribution of Executable Form
#
# If You distribute Covered Software in Executable Form then:
#
# (a) such Covered Software must also be made available in Source Code
# Form, as described in Section 3.1, and You must inform recipients of
# the Executable Form how they can obtain a copy of such Source Code
# Form by reasonable means in a timely manner, at a charge no more
# than the cost of distribution to the recipient; and
#
# (b) You may distribute such Executable Form under the terms of this
# License, or sublicense it under different terms, provided that the
# license for the Executable Form does not attempt to limit or alter
# the recipients' rights in the Source Code Form under this License.
#
# 3.3. Distribution of a Larger Work
#
# You may create and distribute a Larger Work under terms of Your choice,
# provided that You also comply with the requirements of this License for
# the Covered Software. If the Larger Work is a combination of Covered
# Software with a work governed by one or more Secondary Licenses, and the
# Covered Software is not Incompatible With Secondary Licenses, this
# License permits You to additionally distribute such Covered Software
# under the terms of such Secondary License(s), so that the recipient of
# the Larger Work may, at their option, further distribute the Covered
# Software under the terms of either this License or such Secondary
# License(s).
#
# 3.4. Notices
#
# You may not remove or alter the substance of any license notices
# (including copyright notices, patent notices, disclaimers of warranty,
# or limitations of liability) contained within the Source Code Form of
# the Covered Software, except that You may alter any license notices to
# the extent required to remedy known factual inaccuracies.
#
# 3.5. Application of Additional Terms
#
# You may choose to offer, and to charge a fee for, warranty, support,
# indemnity or liability obligations to one or more recipients of Covered
# Software. However, You may do so only on Your own behalf, and not on
# behalf of any Contributor. You must make it absolutely clear that any
# such warranty, support, indemnity, or liability obligation is offered by
# You alone, and You hereby agree to indemnify every Contributor for any
# liability incurred by such Contributor as a result of warranty, support,
# indemnity or liability terms You offer. You may include additional
# disclaimers of warranty and limitations of liability specific to any
# jurisdiction.
#
# 4. Inability to Comply Due to Statute or Regulation
# ---------------------------------------------------
#
# If it is impossible for You to comply with any of the terms of this
# License with respect to some or all of the Covered Software due to
# statute, judicial order, or regulation then You must: (a) comply with
# the terms of this License to the maximum extent possible; and (b)
# describe the limitations and the code they affect. Such description must
# be placed in a text file included with all distributions of the Covered
# Software under this License. Except to the extent prohibited by statute
# or regulation, such description must be sufficiently detailed for a
# recipient of ordinary skill to be able to understand it.
#
# 5. Termination
# --------------
#
# 5.1. The rights granted under this License will terminate automatically
# if You fail to comply with any of its terms. However, if You become
# compliant, then the rights granted under this License from a particular
# Contributor are reinstated (a) provisionally, unless and until such
# Contributor explicitly and finally terminates Your grants, and (b) on an
# ongoing basis, if such Contributor fails to notify You of the
# non-compliance by some reasonable means prior to 60 days after You have
# come back into compliance. Moreover, Your grants from a particular
# Contributor are reinstated on an ongoing basis if such Contributor
# notifies You of the non-compliance by some reasonable means, this is the
# first time You have received notice of non-compliance with this License
# from such Contributor, and You become compliant prior to 30 days after
# Your receipt of the notice.
#
# 5.2. If You initiate litigation against any entity by asserting a patent
# infringement claim (excluding declaratory judgment actions,
# counter-claims, and cross-claims) alleging that a Contributor Version
# directly or indirectly infringes any patent, then the rights granted to
# You by any and all Contributors for the Covered Software under Section
# 2.1 of this License shall terminate.
#
# 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
# end user license agreements (excluding distributors and resellers) which
# have been validly granted by You or Your distributors under this License
# prior to termination shall survive termination.
#
# ************************************************************************
# * *
# * 6. Disclaimer of Warranty *
# * ------------------------- *
# * *
# * Covered Software is provided under this License on an "as is" *
# * basis, without warranty of any kind, either expressed, implied, or *
# * statutory, including, without limitation, warranties that the *
# * Covered Software is free of defects, merchantable, fit for a *
# * particular purpose or non-infringing. The entire risk as to the *
# * quality and performance of the Covered Software is with You. *
# * Should any Covered Software prove defective in any respect, You *
# * (not any Contributor) assume the cost of any necessary servicing, *
# * repair, or correction. This disclaimer of warranty constitutes an *
# * essential part of this License. No use of any Covered Software is *
# * authorized under this License except under this disclaimer. *
# * *
# ************************************************************************
#
# ************************************************************************
# * *
# * 7. Limitation of Liability *
# * -------------------------- *
# * *
# * Under no circumstances and under no legal theory, whether tort *
# * (including negligence), contract, or otherwise, shall any *
# * Contributor, or anyone who distributes Covered Software as *
# * permitted above, be liable to You for any direct, indirect, *
# * special, incidental, or consequential damages of any character *
# * including, without limitation, damages for lost profits, loss of *
# * goodwill, work stoppage, computer failure or malfunction, or any *
# * and all other commercial damages or losses, even if such party *
# * shall have been informed of the possibility of such damages. This *
# * limitation of liability shall not apply to liability for death or *
# * personal injury resulting from such party's negligence to the *
# * extent applicable law prohibits such limitation. Some *
# * jurisdictions do not allow the exclusion or limitation of *
# * incidental or consequential damages, so this exclusion and *
# * limitation may not apply to You. *
# * *
# ************************************************************************
#
# 8. Litigation
# -------------
#
# Any litigation relating to this License may be brought only in the
# courts of a jurisdiction where the defendant maintains its principal
# place of business and such litigation shall be governed by laws of that
# jurisdiction, without reference to its conflict-of-law provisions.
# Nothing in this Section shall prevent a party's ability to bring
# cross-claims or counter-claims.
#
# 9. Miscellaneous
# ----------------
#
# This License represents the complete agreement concerning the subject
# matter hereof. If any provision of this License is held to be
# unenforceable, such provision shall be reformed only to the extent
# necessary to make it enforceable. Any law or regulation which provides
# that the language of a contract shall be construed against the drafter
# shall not be used to construe this License against a Contributor.
#
# 10. Versions of the License
# ---------------------------
#
# 10.1. New Versions
#
# Mozilla Foundation is the license steward. Except as provided in Section
# 10.3, no one other than the license steward has the right to modify or
# publish new versions of this License. Each version will be given a
# distinguishing version number.
#
# 10.2. Effect of New Versions
#
# You may distribute the Covered Software under the terms of the version
# of the License under which You originally received the Covered Software,
# or under the terms of any subsequent version published by the license
# steward.
#
# 10.3. Modified Versions
#
# If you create software not governed by this License, and you want to
# create a new license for such software, you may create and use a
# modified version of this License if you rename the license and remove
# any references to the name of the license steward (except to note that
# such modified license differs from this License).
#
# 10.4. Distributing Source Code Form that is Incompatible With Secondary
# Licenses
#
# If You choose to distribute Source Code Form that is Incompatible With
# Secondary Licenses under the terms of this version of the License, the
# notice described in Exhibit B of this License must be attached.
#
# Exhibit A - Source Code Form License Notice
# -------------------------------------------
#
# 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/.
#
# If it is not possible or desirable to put the notice in a particular
# file, then You may include the notice in a location (such as a LICENSE
# file in a relevant directory) where a recipient would be likely to look
# for such a notice.
#
# You may add additional accurate notices of copyright ownership.
#
# Exhibit B - "Incompatible With Secondary Licenses" Notice
# ---------------------------------------------------------
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
#

2
debian/files vendored
View File

@ -1,2 +0,0 @@
i2p-firefox-profile_1.05.0-1_all.deb net optional
i2p-firefox-profile_1.05.0-1_amd64.buildinfo net optional

View File

@ -1,2 +0,0 @@
README.source
README.Debian

10
debian/install vendored
View File

@ -1,10 +0,0 @@
src/unix/i2pbrowserrc /etc/i2pbrowser/i2pbrowserrc
src/unix/i2pbrowserdebianrc /etc/i2pbrowser/i2pbrowserdebianrc
src/unix/i2pbrowser.sh /usr/bin/
src/unix/i2pconfig.sh /usr/bin/
src/unix/i2p-config-service-setup.sh /usr/bin/
src/profile /var/lib/i2pbrowser/profile
src/app-profile /var/lib/i2pbrowser/app-profile
src/icons /var/lib/i2pbrowser/icons
src/unix/desktop/i2pbrowser-debian.desktop /usr/share/applications/
src/unix/desktop/i2pconfig-debian.desktop /usr/share/applications/

24
debian/rules vendored
View File

@ -1,24 +0,0 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
override_dh_auto_build:
@echo "no need to do the windows build"
override_dh_auto_install: debian/install
@echo "use debian/install"

View File

@ -1 +0,0 @@
3.0 (quilt)

38
edit-release-unstable.sh Executable file
View File

@ -0,0 +1,38 @@
#! /usr/bin/env bash
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
cd "$SCRIPT_DIR" || exit 1
cp -v "$SCRIPT_DIR/config_override.example.sh" config_override.sh
. "$SCRIPT_DIR/i2pversion"
if [ -f i2pversion_override ]; then
. "$SCRIPT_DIR/i2pversion_override"
fi
. "$SCRIPT_DIR/config.sh"
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
. "$HOME/github-release-config.sh"
if [ -f ./i2pversion_override ]; then
. ./i2pversion_override
fi
TODAYSDATE="$(date +%Y%m%d).java.19.dev.build"
if [ -z "$DESCRIPTION" ]; then
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE
===================================================
These builds are automatically built on a daily basis and may have serious bugs.
They are intended for testing purposes only, use them at your own risk.
"
fi
echo github-release edit -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
github-release edit -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"

36
edit-release.sh Executable file
View File

@ -0,0 +1,36 @@
#! /usr/bin/env bash
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/i2pversion"
if [ -f i2pversion_override ]; then
. "$SCRIPT_DIR/i2pversion_override"
fi
. "$SCRIPT_DIR/config.sh"
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
. "$HOME/github-release-config.sh"
if [ -f ./i2pversion_override ]; then
. ./i2pversion_override
fi
TODAYSDATE=$(date +%Y%m%d)
if [ -z "$DESCRIPTION" ]; then
DESCRIPTION="Daily unsigned build of i2p.firefox for $TODAYSDATE
===================================================
These builds are automatically built on a daily basis and may have serious bugs.
They are intended for testing purposes only, use them at your own risk.
"
fi
echo github-release edit -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"
github-release edit -p -u "$GITHUB_USERNAME" -r "i2p.firefox" -n "$TODAYSDATE" -d "$DESCRIPTION" -t "$TODAYSDATE"

34
exe.sh Executable file
View File

@ -0,0 +1,34 @@
#! /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 \
--app-content src/icons/windowsUIToopie2.png \
--icon src/icons/windowsUIToopie2.png \
--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

15
experimental.sh Executable file
View File

@ -0,0 +1,15 @@
#! /usr/bin/env bash
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/config.sh"
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
./clean.sh
wsl make distclean
./build.sh
wsl make

192
i2ptunnel.config Normal file
View 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

View File

@ -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=1.0.1
export I2PFIREFOX_VERSION=1.0.1
# Comment this out to build from an alternate branch or
# the tip of the master branch.
VERSIONMAJOR=1
VERSIONMINOR=9
VERSIONBUILD=0
VERSIONBUILD=7
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"

View File

@ -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>
@ -48,7 +56,7 @@
</h2>
<ul>
<li>
Automatically select an up-to-date, secure Firefox or Tor Browser(On Windows) variant
Automatically select an up-to-date, secure browser from the host platform, with Tor Browser and Firefox preferred.
</li>
<li>
Automatically configure a profile for I2P
@ -57,7 +65,7 @@
Automatically block-list all non-I2P local destinations
</li>
<li>
Enable first-party isolation, anti-fingerprinting, letterboxing
Enable first-party isolation, anti-fingerprinting, letterboxing, fusion, other privacy and security options
</li>
<li>
Automatically sandbox I2P, Non-I2P, and I2P-Application cookiestores
@ -67,7 +75,8 @@
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 +96,20 @@
</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">
These need to be installed in the environment where the NSIS
Package is build, NOT the environment where the java package
is built. These may be different, because you will need to
use a system which provides a Unix-like environment on top of
a Windows system. You can use WSL or Cygwin, and more detailed
instructions are provided below.
</p>
<p>
Building for Windows target from Linux is not possible unless
you obtain a Windows package from my github.
</p>
<p>
In addition, you will need the NSIS plugin &ldquo;ShellExecAsUser&rdquo; 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 +118,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 +131,11 @@
</code>
.
</p>
<pre><code>cp -rv Plugins/* /usr/share/nsis/Plugins/
</code></pre>
<p>
To build a Debian package, youll 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 its 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 &#34;$I2P_VERSION&#34; \
--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
isnt present to use at build time, the inclusion will be skipped automatically
with a non-fatal warning.
</p>
<p>
In the near future, Ill 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 youve already done this once, you can just use:
</strong>
<code>
./build.sh &amp;&amp; wsl make
</code>
<strong>
in
<code>
git bash
</code>
</strong>
to automatically build an installer.
</p>
<p>
<strong>
Prerequisites:
@ -363,20 +180,159 @@
%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 &ldquo;Checkout as is, commit as is&rdquo; and leave line-endings alone.
</p>
<p>
The Windows build tools listed above must be installed on the Windows host machine.
</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 &ldquo;App Image&rdquo; 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 &ldquo;App Image&rdquo; in a directory
called &ldquo;I2P.&rdquo;
</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 &quot;$I2P_VERSION&quot; \
--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&rsquo;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&rsquo;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&rsquo;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 Microsofts instructions
<a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps">
Set up Windows Subsystem for Linux per Microsoft&rsquo;s instructions
</a>
</p>
</li>
<li>
<p>
<a href="https://www.microsoft.com/store/apps/9n6svws3rx71" rel="nofollow">
Install Ubuntu Focal per Microsofts instructions
<a href="https://www.microsoft.com/store/apps/9n6svws3rx71">
Install Ubuntu Focal per Microsoft&rsquo;s instructions
</a>
</p>
</li>
@ -389,7 +345,7 @@
<p>
Install prerequisites
<code>
wsl sudo apt-get update &amp;&amp; sudo apt-get install make nsis dos2unix curl jq
wsl sudo apt-get update &amp;&amp; sudo apt-get install make nsis nsis-pluginapi dos2unix curl jq
</code>
</p>
</li>
@ -439,7 +395,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 +405,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&rsquo;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 +520,7 @@ cd ..
<code>
.exe
</code>
file produced by NSIS, youre almost ready to
file produced by NSIS, you&rsquo;re almost ready to
do a release. As a final step, someone must sign the
<code>
.exe
@ -587,15 +529,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 +552,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.firefox">
http://git.idk.i2p/idk/i2p.plugins.firefox
</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.firefox">
http://git.idk.i2p/idk/i2p.plugins.firefox
</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 +635,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 its determined that our configuration is not at
maintainers if it&rsquo;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&rsquo;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

View File

@ -0,0 +1,304 @@
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 extends WindowsServiceUtil {
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 (0 == 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()) {
int cnr = copyFileNeverOverwrite(file, new File(newPath));
if (0 == cnr)
return false;
if (1 == cnr) {
logger.info("using jpackaged configs in a jpackaged install, creating jpackaged file");
File jpackagedConfigsInUse = new File(appImageHome(), "jpackaged");
if (!jpackagedConfigsInUse.exists()){
try{
jpackagedConfigsInUse.createNewFile();
}catch(IOException e){
logger.warning("Error creating jpackaged file, delete config files manually when uninstalling");
}
}
}
if (-1 == cnr) {
logger.info("not overwriting existing config file, not creating jpackaged file");
}
}
}
return true;
}
public static int copyFileNeverOverwrite(String basePath, String workPath) {
File baseFile = new File(basePath);
File workFile = new File(workPath);
return copyFileNeverOverwrite(baseFile, workFile);
}
public static int copyFileNeverOverwrite(File basePath, File workPath) {
return copyFile(basePath, workPath, false);
}
public static int copyFile(File basePath, File workPath, boolean overWrite) {
if (!basePath.exists()) {
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
return 0;
}
if (!overWrite && workPath.exists()) {
logger.info(workPath.getAbsolutePath() +
" already exists, not overwriting");
return -1;
}
File workDir = workPath.getParentFile();
if (!workDir.exists()) {
workDir.mkdirs();
}
try (InputStream in =
new BufferedInputStream(new FileInputStream(basePath));
OutputStream out =
new BufferedOutputStream(new FileOutputStream(workPath))) {
byte[] buffer = new byte[1024];
int lengthRead;
while ((lengthRead = in.read(buffer)) > 0) {
out.write(buffer, 0, lengthRead);
out.flush();
}
in.close();
out.close();
return 1;
} catch (Throwable e) {
logger.warning(e.toString());
logger.warning("failed to copy " + basePath.getAbsolutePath() + " to " +
workPath.getAbsolutePath());
return 0;
}
}
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 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);
}
}

View File

@ -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 + ")");
}
}
}

View File

@ -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",
});
}
}
}

View File

@ -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,386 @@ 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) {
setupLauncher();
initLogger();
int privateBrowsing = 0;
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 = 1;
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;
File programs = programFile();
File home = homeDir();
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"));
boolean continuerunning = promptServiceStartIfAvailable("i2p");
if (!continuerunning) {
logger.severe(
"Service startup failure, please start I2P service with services.msc");
System.exit(2);
} else {
fixServiceConfig();
}
continuerunning = promptUserInstallStartIfAvailable();
if (!continuerunning) {
logger.severe("User-install startup required.");
System.exit(2);
} else {
fixServiceConfig();
}
// 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);
}
if (launchBrowser(privateBrowsing, usabilityMode, chromiumFirst,
proxyTimeoutTime, newArgsList)) {
System.exit(0);
}
i2pRouter = new Router(routerConfig(), System.getProperties());
if (!isInstalled("i2p")) {
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 fixServiceConfig() {
if (osName() != "windows")
return;
// If the user installed the Easy bundle before installing the
// IzPack installer, then they have a config file which contains the
// wrong update URL. Check for it, and change it back if necessary.
// closes #23
String routerconf = routerConfig();
if (routerconf != null) {
File routerconffile = new File(routerconf);
if (!routerconffile.exists()) {
return;
}
} else {
return;
}
if (isInstalled("i2p") || checkProgramFilesInstall()) {
i2pRouter = new Router(routerconf, System.getProperties());
String newsURL = i2pRouter.getConfigSetting("router.newsURL");
if (newsURL != null) {
if (newsURL.contains("http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news/win/beta/news.su3")) {
logger.info(
"checked router.newsURL config, containes win/beta in a service install, invalid update type");
if (i2pRouter.saveConfig("router.newsURL", ServiceUpdaterString())) {
logger.info("updated routerconsole.browser config " +
appImageExe());
}
}
// check if there's something listening on port 7654(I2CP)
if (!isAvailable(7654)) {
return true;
}
String backupNewsURL = i2pRouter.getConfigSetting("router.backupNewsURL");
if (backupNewsURL != null) {
if (backupNewsURL.contains("http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/win/beta/news.su3")) {
logger.info(
"checked router.backupNewsURL config, containes win/beta in a service install, invalid update type");
if (i2pRouter.saveConfig("router.backupNewsURL",
ServiceBackupUpdaterString())) {
logger.info("updated routerconsole.browser config " +
appImageExe());
}
}
// 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;
}
}
String updateURL = i2pRouter.getConfigSetting("router.updateURL");
if (updateURL != null) {
if (updateURL.contains("http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3")) {
logger.info(
"checked router.updateURL config, containes easy-intall update in a service install, invalid update type");
if (i2pRouter.saveConfig("router.updateURL",
ServiceStaticUpdaterString())) {
logger.info("updated routerconsole.browser config " +
appImageExe());
}
}
}
}
}
private static void setupLauncher() {
File jrehome = javaHome();
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(int 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);
}
}
}

View File

@ -1,80 +1,89 @@
package net.i2p.router;
import net.i2p.router.*;
import net.i2p.I2PAppContext;
import java.util.function.*;
import java.io.*;
import java.util.Map;
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;
File workingDir = workDir();
File logFile = new File(workingDir, "log-" + version + ".txt");
if (logFile.canWrite()) {
// check if we can write to the log file. If we can, use the
// ProcessBuilder to run the installer.
ProcessBuilder pb = new ProcessBuilder(
file.getAbsolutePath(), "/S", "/D=" + workingDir.getAbsolutePath());
Map<String, String> 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);
}
}
}

View File

@ -0,0 +1,279 @@
package net.i2p.router;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JOptionPane;
/*
* Provides querying of Windows services in order to discover I2P Routers
* running as a service and avoid launching jpackaged routers redundantly.
* It will prompt a user to start their I2P service if one is discovered.
*
* see also:
* https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-query
* https://learn.microsoft.com/en-us/dotnet/api/system.serviceprocess.servicecontrollerstatus?view=dotnet-plat-ext-6.0
* https://stackoverflow.com/questions/10604844/how-to-verify-whether-service-exists-in-services-msc
* C#, API ideas only
* https://stackoverflow.com/questions/334471/need-a-way-to-check-status-of-windows-service-programmatically
* https://stackoverflow.com/questions/5388888/find-status-of-windows-service-from-java-application
* https://stackoverflow.com/questions/21566847/how-to-check-particular-windows-service-is-running-using
* https://stackoverflow.com/questions/9792051/start-windows-service-with-java
*
* There's a chance we can't tell ServiceController to do anything so if
* that is the case then we'll just launch services.msc and tell the user to
* take it from there.
*
* @author idk
* @since 1.9.7
*/
public class WindowsServiceUtil {
public WindowsServiceUtil() {}
public static String queryService(String serviceName) {
String result = "";
String line;
ProcessBuilder pb = new ProcessBuilder("sc", "query", serviceName);
try {
Process p = pb.start();
try {
p.waitFor(); // wait for process to finish then continue.
BufferedReader bri =
new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = bri.readLine()) != null) {
result += line;
}
} catch (InterruptedException e) {
System.err.println(e.toString());
} catch (IOException e) {
System.err.println(e.toString());
}
} catch (IOException e) {
System.err.println(e.toString());
}
return result;
}
public static String getStatePrefix(String qResult) {
String statePrefix = "STATE : ";
// get the first occurrence of "STATE", then find the
// next occurrence of of ":" after that. Count the
// spaces between.
int indexOfState = qResult.indexOf("STATE");
if (indexOfState >= 0) {
int indexOfColon = qResult.indexOf(":", indexOfState);
statePrefix = "STATE";
for (int f = indexOfState + 5; f < indexOfColon; f++) {
statePrefix += " ";
}
statePrefix += ": ";
}
return statePrefix;
}
public static int getServiceStateInt(String serviceName) {
// String statePrefix = "STATE : ";
String qResult = queryService(serviceName);
String statePrefix = getStatePrefix(qResult);
// check that the temp string contains the status prefix
int ix = qResult.indexOf(statePrefix);
if (ix >= 0) {
// compare status number to one of the states
String stateStr = qResult.substring(ix + statePrefix.length(),
ix + statePrefix.length() + 1);
int state = Integer.parseInt(stateStr);
return state;
}
return -2;
}
public static boolean isInstalled(String serviceName) {
if (getServiceState(serviceName).equals("uninstalled")) {
return false;
}
return true;
}
public static boolean isStart(String serviceName) {
if (getServiceState(serviceName).equals("started")) {
return true;
}
if (getServiceState(serviceName).equals("starting")) {
return true;
}
if (getServiceState(serviceName).equals("resuming")) {
return true;
}
return false;
}
public static boolean promptServiceStartIfAvailable(String serviceName) {
if (osName() != "windows") {
return true;
}
if (isInstalled(serviceName)) {
if (!isStart(serviceName)) {
int a;
String message =
"It appears you have an existing I2P service installed.\n";
message +=
"However, it is not running yet. Please start it through `services.msc`.\n";
message +=
"If you click \"No\", the jpackage router will be launched instead.\n";
a = JOptionPane.showConfirmDialog(null, message,
"I2P Service detected not running",
JOptionPane.YES_NO_OPTION);
if (a == JOptionPane.NO_OPTION) {
// Do nothing here, this will continue on to launch a jpackaged router
return true;
} else {
// We can't just call `net start` or `sc start` directly, that throws
// a permission error. We can start services.msc though, where the
// user can start the service themselves. OR maybe we ask for
// elevation here? May need to refactor Elevator and Shell32X to
// achieve it though
ProcessBuilder pb =
new ProcessBuilder("C:\\Windows\\System32\\services.msc");
try {
Process p = pb.start();
int exitCode = p.waitFor();
if (exitCode != 0) {
return false;
}
} catch (IOException e) {
return false;
} catch (InterruptedException e) {
return false;
}
}
return isStart("i2p");
}
return true;
}
return true;
}
public static String ServiceUpdaterString() {
return "http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/news.su3";
}
public static String ServiceBackupUpdaterString() {
return "http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news.su3";
}
public static String ServiceStaticUpdaterString() {
return "http://echelon.i2p/i2p/i2pupdate.sud,http://stats.i2p/i2p/i2pupdate.sud";
}
public static String getProgramFilesInstall() {
String programFiles = System.getenv("PROGRAMFILES");
if (programFiles != null) {
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
if (programFilesI2P.exists())
return programFilesI2P.getAbsolutePath();
}
String programFiles86 = System.getenv("PROGRAMFILES86");
if (programFiles86 != null) {
File programFiles86I2P = new File(programFiles86, "i2p/i2p.exe");
if (programFiles86I2P.exists())
return programFiles86I2P.getAbsolutePath();
}
return null;
}
public static boolean checkProgramFilesInstall() {
String programFiles = System.getenv("PROGRAMFILES");
if (programFiles != null) {
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
if (programFilesI2P.exists())
return true;
}
String programFiles86 = System.getenv("PROGRAMFILES86");
if (programFiles86 != null) {
File programFiles86I2P = new File(programFiles86, "i2p/i2p.exe");
if (programFiles86I2P.exists())
return true;
}
return false;
}
public static boolean promptUserInstallStartIfAvailable() {
if (osName() != "windows") {
return true;
}
if (checkProgramFilesInstall()) {
int a;
String message =
"It appears you have an existing, unbundled I2P rotuer installed.\n";
message +=
"However, it is not running yet. Please start it using the shortcut on the desktop.\n";
message +=
"If you click \"No\", the jpackage router will be launched instead.\n";
a = JOptionPane.showConfirmDialog(null, message,
"I2P Service detected not running",
JOptionPane.YES_NO_OPTION);
if (a == JOptionPane.NO_OPTION) {
// Do nothing here, this will continue on to launch a jpackaged router
return true;
} else {
try {
String pfi = getProgramFilesInstall();
if (pfi != null)
Runtime.getRuntime().exec(pfi);
} catch (IOException e) {
return false;
}
return true;
}
}
return true;
}
public static String getServiceState(String serviceName) {
String stateString = "uninstalled";
int state = getServiceStateInt(serviceName);
switch (state) {
case (1): // service stopped
stateString = "stopped";
break;
case (2): // service starting
stateString = "starting";
break;
case (3): // service stopping
stateString = "stopping";
break;
case (4): // service started
stateString = "started";
break;
case (5): // service resuming from pause
stateString = "resuming";
break;
case (6): // service pausing
stateString = "pausing";
break;
case (7): // service paused
stateString = "paused";
break;
}
return stateString;
}
/**
* 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";
}
public static void main(String args[]) {
// when querying the I2P router service installed by the IzPack installer
// this is the correct call.
String state = getServiceState("i2p");
int stateInt = getServiceStateInt("i2p");
System.out.println("i2p state: " + state + " code: " + stateInt);
promptServiceStartIfAvailable("i2p");
}
}

View File

@ -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;
}
}

89
launcher.sh Executable file
View File

@ -0,0 +1,89 @@
#! /usr/bin/env bash
set -e
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/i2pversion"
if [ -f i2pversion_override ]; then
. "$SCRIPT_DIR/i2pversion_override"
fi
. "$SCRIPT_DIR/config.sh"
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
COUNT="Ten Nine Eight Seven Six Five Four Three Two One"
which java
export JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t\- ')
if [ "$JAVA" -lt "14" ]; then
echo "Java 14+ must be used to compile with jpackage, java is $JAVA"
exit 1
fi
if [ "$JAVA" -lt "17" ]; then
echo "It is highly recommended that you use Java 17+ to build release packages"
fi
if [ -z "${JAVA_HOME}" ]; then
export JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
fi
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
export JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
fi
echo "Building with: $JAVA, $JAVA_HOME"
sleep 5s
HERE="$PWD"
if [ ! -d "$HERE/../i2p.i2p.jpackage-build/" ]; then
git clone --depth=1 -b "$VERSION" https://i2pgit.org/i2p-hackers/i2p.i2p "$HERE/../i2p.i2p.jpackage-build/"
tar --exclude="$HERE/../i2p.i2p.jpackage-build/.git" -cvzf i2p.i2p.jpackage-build.tar.gz "$HERE/../i2p.i2p.jpackage-build/"
fi
cd "$HERE/../i2p.i2p.jpackage-build/"
git pull --all
for i in $COUNT; do
echo -n "$i...."; sleep 1s
done
ant distclean pkg || true
cd "$HERE"
export I2P_PKG="$HERE/../i2p.i2p.jpackage-build/pkg-temp"
export RES_DIR="$HERE/../i2p.i2p.jpackage-build/installer/resources"
export I2P_JARS="$I2P_PKG/lib"
export I2P_JBIGI="$HERE/../i2p.i2p.jpackage-build/installer/lib/jbigi"
echo "compiling custom launcher"
mkdir -p build
cp "$I2P_JARS"/*.jar build
if [ ! -f "$HERE/build/jna.jar" ]; then
wget -O "$HERE/build/jna.jar" "https://repo1.maven.org/maven2/net/java/dev/jna/jna/$JNA_VERSION/jna-$JNA_VERSION.jar"
fi
if [ ! -f "$HERE/build/jna-platform.jar" ]; then
wget -O "$HERE/build/jna-platform.jar" "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/$JNA_VERSION/jna-platform-$JNA_VERSION.jar"
fi
if [ ! -f "$HERE/build/i2pfirefox.jar" ]; then
wget -O "$HERE/build/i2pfirefox.jar" "https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/$I2PFIREFOX_VERSION/i2pfirefox.jar"
fi
cd java
"$JAVA_HOME"/bin/javac -d ../build -classpath "$HERE/build/i2pfirefox.jar:$HERE/build/jna.jar":"$HERE/build/jna-platform.jar":"$HERE/build/i2p.jar":"$HERE/build/router.jar":"$HERE/build/routerconsole.jar" \
net/i2p/router/CopyConfigDir.java \
net/i2p/router/Elevator.java \
net/i2p/router/Shell32X.java \
net/i2p/router/WinLauncher.java \
net/i2p/router/WindowsUpdatePostProcessor.java \
net/i2p/router/WinUpdateProcess.java \
net/i2p/router/WindowsServiceUtil.java
cd ..
#echo "building launcher.jar"
cd build
"$JAVA_HOME"/bin/jar -cf launcher.jar net
cd ..

View File

@ -1,36 +0,0 @@
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.tgz: app-profile
# $(eval PROFILE_VERSION := $(shell cat src/app-profile/version.txt))
@echo "building app-profile tarball $(PROFILE_VERSION)"
sh -c 'ls build/I2P && cp -rv build/I2P build/app-profile/I2P'; true
install -m755 src/unix/i2pconfig.sh build/app-profile/i2pconfig.sh
cd build && tar -czf app-profile-$(PROFILE_VERSION).tgz app-profile && cp app-profile-$(PROFILE_VERSION).tgz ../
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

View File

@ -1,40 +0,0 @@
build/profile/extensions: build/profile
mkdir -p build/profile/extensions
build/profile: build
mkdir -p build/profile
build/win:
mkdir -p build/win/
build/win/common.bat:
#cp src/win/common.bat build/win/common.bat
build/win/copy-config-profile.bat:
#cp src/win/copy-config-profile.bat build/win/copy-config-profile.bat
build/win/copy-profile.bat:
#cp src/win/launchi2p.bat build/win/copy-profile.bat
build/win/launchi2p.bat:
#cp src/win/launchi2p.bat build/win/launchi2p.bat
build/win/i2pbrowser.bat: build/win/common.bat build/win/copy-config-profile.bat build/win/copy-profile.bat build/win/launchi2p.bat
#cp src/win/i2pbrowser.bat build/win/i2pbrowser.bat
build/win/i2pconfig.bat: build/win/common.bat build/win/copy-config-profile.bat build/win/copy-profile.bat build/win/launchi2p.bat
#cp src/win/i2pconfig.bat build/win/i2pconfig.bat
build/win/i2pbrowser-private.bat: build/win/common.bat build/win/copy-config-profile.bat build/win/copy-profile.bat build/win/launchi2p.bat
#cp src/win/i2pbrowser-private.bat build/win/i2pbrowser-private.bat
launchers: build/win build/win/i2pbrowser.bat build/win/i2pbrowser-private.bat build/win/i2pconfig.bat
build/app-profile/chrome: build/app-profile
mkdir -p build/app-profile/chrome
build/app-profile/extensions: build/app-profile
mkdir -p build/app-profile/extensions
build/app-profile: build
mkdir -p build/app-profile

View File

@ -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.

View File

@ -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.

View File

@ -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"

View File

@ -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"

View File

@ -1,33 +0,0 @@
profile: build/profile/user.js build/profile/prefs.js build/profile/bookmarks.html build/profile/storage-sync.sqlite copy-xpi
profile.tgz: .version profile
# $(eval PROFILE_VERSION := $(shell cat src/profile/version.txt))
@echo "building profile tarball $(PROFILE_VERSION)"
sh -c 'ls build/I2P && cp -rv build/I2P build/profile/I2P'; true
install -m755 src/unix/i2pbrowser.sh build/profile/i2pbrowser.sh
cd build && tar -czf profile-$(PROFILE_VERSION).tgz profile && cp profile-$(PROFILE_VERSION).tgz ../
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

35
msi.sh Executable file
View File

@ -0,0 +1,35 @@
#! /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 \
--app-content src/icons/windowsUIToopie2.png \
--icon src/icons/windowsUIToopie2.png \
--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

View File

@ -5,7 +5,7 @@ cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/config.sh"
if [ -f config_overide.sh ]; then
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi

View File

@ -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

View File

@ -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; }

10
sign.sh
View File

@ -11,7 +11,7 @@ fi
. "$SCRIPT_DIR/config.sh"
if [ -f config_overide.sh ]; then
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
@ -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

View File

@ -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
}

View File

@ -1 +1 @@
1.9.0
1.9.7

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@ -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 "Please choose a directory."
!define LAUNCH_TEXT "Start I2P?"
!define LICENSE_TITLE "Many Licenses"
!define CONSOLE_URL "http://127.0.0.1:7657/home"
@ -14,12 +13,12 @@ UniCode true
!include i2pbrowser-jpackage.nsi
!include FindProcess.nsh
var I2PINSTEXE
var INSTDIR
SetOverwrite on
!define I2PINSTEXE
!define I2PINSTEXE_USERMODE "$LOCALAPPDATA\i2p"
!define INSTDIR
!define I2PINSTEXE_USERMODE "$LOCALAPPDATA\i2peasy"
!define RAM_NEEDED_FOR_64BIT 0x80000000
@ -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
@ -123,20 +122,20 @@ PageEx license
PageExEnd
PageEx directory
dirtext "${I2P_MESSAGE}"
dirvar $I2PINSTEXE
dirvar $INSTDIR
PageCallbacks routerDetect
PageExEnd
Page instfiles
#!include i2pbrowser-mozcompat.nsi
Function .onInit
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}"
# Note: This is all redundant and I know it.
# Admin installs have been migrated to user-mode installs.
# But I'm leaving it because I might need it again if I support service installs.
StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
UserInfo::GetAccountType
pop $0
${If} $0 != "admin"
StrCpy $INSTDIR "$LOCALAPPDATA\${COMPANYNAME}\${APPNAME}"
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}"
StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY
#Call ShouldInstall64Bit
@ -144,114 +143,69 @@ Function .onInit
FunctionEnd
Function routerDetect
createDirectory $I2PINSTEXE
SetOutPath $I2PINSTEXE
File /a /r "I2P\"
File /nonfatal /a /r "I2P\I2P.exe"
File "I2P\config\jpackaged"
createDirectory $INSTDIR
SetOutPath $INSTDIR\app
File /a /r "I2P\app\"
SetOutPath $INSTDIR\runtime
File /a /r "I2P\runtime\"
SetOutPath $INSTDIR\config
File /a /r "I2P\config\"
SetOutPath $INSTDIR
File /a /r "I2P\I2P.exe"
# The NSIS Installer uses an ico icon, the jpackage-only ones use png
File /a /r "I2P\ui2pbrowser_icon.ico"
createDirectory "$I2PINSTEXE\"
SetOutPath "$I2PINSTEXE\"
IfFileExists $I2PINSTEXE\router.config +2 0
File /a /r "I2P/config/router.config"
IfFileExists $I2PINSTEXE\clients.config +2 0
File /a /r "I2P/config/clients.config"
IfFileExists $I2PINSTEXE\wrapper.config +2 0
File /a /r "I2P/config/wrapper.config"
IfFileExists $I2PINSTEXE\hosts.txt +2 0
File /a /r "I2P/config/hosts.txt"
IfFileExists $I2PINSTEXE\eepsite +2 0
File /a /r "I2P/config/eepsite"
IfFileExists $I2PINSTEXE\webapps +2 0
File /a /r "I2P/config/webapps"
createDirectory "$INSTDIR\"
SetOutPath "$INSTDIR\"
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
${LoopWhile} $0 <> 0
${EndIf}
# delete the jpackaged file for safety. Remove this IMMEDIATELY after the next release.
# early-adopters and daily-build users may have to manually delete config files if they
# uninstall.
# RELATED: line 246
Delete "$INSTDIR\jpackaged"
# set the installation directory as the destination for the following actions
createDirectory $INSTDIR
SetOutPath $INSTDIR
File ui2pbrowser_icon.ico
# Update jpackaged I2P router, if it exists
${If} ${FileExists} "$I2PINSTEXE\jpackaged"
createDirectory $I2PINSTEXE
SetOutPath $I2PINSTEXE
${If} ${Silent}
ReadEnvStr $0 OLD_I2P_VERSION
${If} $0 < ${I2P_VERSION}
call routerDetect
${EndIf}
${Else}
call routerDetect
${EndIf}
${EndIf}
# Update jpackaged I2P router
call routerDetect
# Install the launcher scripts
createDirectory "$INSTDIR"
#SetOutPath "$INSTDIR"
#File "win/*"
# Install the licenses
createDirectory "$INSTDIR\licenses"
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"
SetOutPath "$INSTDIR"
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 "$SMPROGRAMS\${APPNAME}\Browse I2P.lnk" "$INSTDIR\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Browse I2P - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$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"
CreateShortCut "$DESKTOP\Browse I2P.lnk" "$INSTDIR\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
CreateShortCut "$DESKTOP\Browse I2P - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
SetOutPath "$INSTDIR"
SetShellVarContext current
Var /Global I2PAPPDATA
IfFileExists "$I2PINSTEXE\clients.config" 0 +2
StrCpy $I2PAPPDATA "$I2PINSTEXE"
IfFileExists "$APPDATA\I2P\clients.config.d" 0 +2
StrCpy $I2PAPPDATA "$APPDATA\I2P\"
IfFileExists "$LOCALAPPDATA\I2P\clients.config.d" 0 +2
StrCpy $I2PAPPDATA "$LOCALAPPDATA\I2P\"
IfFileExists "$LOCALAPPDATA\I2P\clients.config" 0 +2
StrCpy $I2PAPPDATA "$LOCALAPPDATA\I2P\"
createDirectory "$I2PAPPDATA"
SetOutPath "$I2PAPPDATA"
IfFileExists "$LOCALAPPDATA\I2P\eepsite\docroot" +2 0
IfFileExists "$INSTDIR\eepsite\docroot" +2 0
File /a /r "I2P\eepsite"
createDirectory "$I2PINSTEXE"
SetOutPath "$I2PINSTEXE"
createDirectory "$INSTDIR"
SetOutPath "$INSTDIR"
SetOutPath "$INSTDIR"
# create the uninstaller
@ -270,12 +224,12 @@ SectionEnd
# uninstaller section start
Section "uninstall"
# Uninstall the launcher scripts
Delete $INSTDIR\*
rmDir /r "$INSTDIR\"
${If} ${FileExists} "$I2PINSTEXE\jpackaged"
Delete $I2PINSTEXE\*
rmDir /r "$I2PINSTEXE"
${EndIf}
rmDir /r "$INSTDIR\app"
rmDir /r "$INSTDIR\config"
rmDir /r "$INSTDIR\runtime"
Delete "$INSTDIR\ui2pbrowser_icon.ico"
Delete "$INSTDIR\windowsUItoopie2.png"
Delete "$INSTDIR\I2P.exe"
# Remove shortcuts and folders
Delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"
@ -287,16 +241,27 @@ Section "uninstall"
Delete "$DESKTOP\${APPNAME}.lnk"
Delete "$DESKTOP\Private Browsing-${APPNAME}.lnk"
rmDir /r "$SMPROGRAMS\${APPNAME}"
rmDir /r "$INSTDIR\firefox.profile.i2p\extensions"
rmDir /r "$INSTDIR\firefox.profile.i2p"
rmDir /r "$LOCALAPPDATA\${APPNAME}"
rmDir /r "$INSTDIR"
#### SUPER SUPER EXTRA IMPORTANT!
### RELATED: line 169
## IF YOU DO THIS WRONG YOU WILL BREAK CONFIGS:
## The purpose of the `jpackaged` file has changed, as has the point
## where it is created.
# 1. The jpackaged file is now created only **after** the jpackage itself
# has migrated default configs into the $INSTDIR. IF THEY ALREADY EXIST,
# it WILL NOT BE CREATED, even if there is a jpackage present. This is
# intentional behavior.
# 2. The jpackaged file now indicates that the configurations were created
# by running the jpackage, and not by an un-bundled router. If it is not
# present, then we have already deleted everything we are responsible for
# and don't need to do the section below.
${If} ${FileExists} "$INSTDIR\jpackaged"
Delete $INSTDIR\*
rmDir /r "$INSTDIR"
${EndIf}
# delete the uninstaller
Delete "$INSTDIR\uninstall-i2pbrowser.exe"
# uninstaller section end
SectionEnd
!define MUI_FINISHPAGE_RUN
@ -305,8 +270,8 @@ SectionEnd
!insertmacro MUI_PAGE_FINISH
Function LaunchLink
SetOutPath "$I2PINSTEXE"
StrCpy $OUTDIR $I2PINSTEXE
SetOutPath "$INSTDIR"
StrCpy $OUTDIR $INSTDIR
${If} ${Silent}
ReadEnvStr $0 RESTART_I2P
${If} $0 != ""

View File

@ -1 +1 @@
!define I2P_VERSION 1.9.0
!define I2P_VERSION 1.9.7

View File

@ -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

View File

@ -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."

View File

@ -1,3 +1,3 @@
!define VERSIONMAJOR 1
!define VERSIONMINOR 9
!define VERSIONBUILD 0
!define VERSIONBUILD 7

View File

@ -1 +1 @@
1.9.0
1.9.7

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/i2pbrowser.sh
Name=I2P Browser
Categories=Network;WebBrowser;
Icon=/var/lib/i2pbrowser/icons/ui2pbrowser_icon.ico

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/usr/local/bin/i2pbrowser
Name=I2P Browser
Categories=Network;WebBrowser;
Icon=/var/lib/i2pbrowser/icons/ui2pbrowser_icon.ico

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/i2pconfig.sh
Name=I2P Configuration
Categories=Network;WebBrowser;
Icon=/var/lib/i2pbrowser/icons/ui2pbrowser_icon.ico

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/usr/local/bin/i2pconfig
Name=I2P Configuration
Categories=Network;WebBrowser;
Icon=/var/lib/i2pbrowser/icons/ui2pbrowser_icon.ico

View File

@ -1,21 +0,0 @@
#! /usr/bin/env sh
# Works for Debian service installs. Sets up minified, custom profile for configuring I2P console.
if grep '^i2psvc:' /etc/passwd; then
I2P_HOME=$(grep '^i2psvc:' /etc/passwd | sed 's|i2psvc:x:||g' | sed 's|:/usr/sbin/nologin||g' | tr -d ':1234567890' | sed 's|ip|i2p|g')
ROUTER_CONFIG=$(sudo -u i2psvc ls $I2P_HOME/i2p-config/router.config)
fi
installer(){
if [ $(sudo -u i2psvc ls $I2P_HOME/i2p-config/router.config) ]; then
echo $I2P_HOME $ROUTER_CONFIG $0
if ! sudo -u i2psvc grep -R 'routerconsole.browser' "$I2P_HOME/i2p-config/router.config" ; then
echo "routerconsole.browser=/usr/local/bin/i2pconfig" | sudo tee -a "$I2P_HOME/i2p-config/router.config"
fi
fi
}
installer

View File

@ -1,44 +0,0 @@
#! /usr/bin/env sh
if [ -f "/etc/i2pbrowser/i2pbrowserrc" ]; then
. /etc/i2pbrowser/i2pbrowserrc
fi
if [ ! -z $I2PROUTER ]; then
"$I2PROUTER" start
fi
if [ -z $BROWSING_PROFILE ]; then
BROWSING_PROFILE="."
fi
if [ ! -d "$BROWSING_PROFILE" ]; then
mkdir -p "$BROWSING_PROFILE"
cp -vr /var/lib/i2pbrowser/profile/* "$BROWSING_PROFILE"
fi
if [ ! -f "$BROWSING_PROFILE/user.js" ]; then
echo "user.js not present in $BROWSING_PROFILE, this is not a Firefox profile"
exit 1
fi
if [ -z $FIREFOX ]; then
if [ -f "firefox/firefox" ]; then
FIREFOX="./firefox/firefox"
fi
FIREFOX=$(which firefox-esr)
if [ -z $FIREFOX ]; then
FIREFOX=$(which firefox)
fi
fi
if [ -z $FIREFOX ]; then
echo "Firefox does not appear to be in your \$PATH."
echo "Please install Firefox via a package manager, or"
echo "or set the FIREFOX variable in your shell to the"
echo "location of a Firefox executable."
exit 1
fi
echo $FIREFOX --profile "$BROWSING_PROFILE" $@
$FIREFOX --profile "$BROWSING_PROFILE" $@

View File

@ -1,17 +0,0 @@
I2PROUTER=$(which i2prouter)
if [ -z $I2PROUTER ]; then
I2PROUTER=/usr/sbin/i2prouter
fi
if [ ! -f $I2PROUTER ]; then
I2PROUTER="$HOME/i2p/i2prouter"
fi
if [ ! -f $I2PROUTER ]; then
I2PROUTER=""
fi
wget -q -O - "http://localhost:7657" >/dev/null && I2PROUTER=""
echo "$I2PROUTER"

View File

@ -1,8 +0,0 @@
if [ -f /etc/i2pbrowser/i2pbrowserdebianrc ]; then
. /etc/i2pbrowser/i2pbrowserdebianrc
fi
CONFIGURING_PROFILE=$HOME/i2p/firefox/webapps
BROWSING_PROFILE=$HOME/i2p/firefox/browsing
ROUTER_CONSOLE="127.0.0.1:7657"

View File

@ -1,60 +0,0 @@
#! /usr/bin/env sh
if [ -f "/etc/i2pbrowser/i2pbrowserrc" ]; then
. /etc/i2pbrowser/i2pbrowserrc
fi
if [ ! -z $I2PROUTER ]; then
"$I2PROUTER" start
fi
if [ -f "$HOME/.i2p/router.config" ]; then
if [ "$0" = "/usr/local/bin/i2pconfig" ]; then
if ! grep -R 'routerconsole.browser' "$HOME/.i2p/router.config" ; then
echo "routerconsole.browser=$0" | tee -a "$HOME/.i2p/router.config"
fi
fi
fi
if [ -z $CONFIGURING_PROFILE ]; then
CONFIGURING_PROFILE="."
fi
if [ -z $ROUTER_CONSOLE ]; then
ROUTER_CONSOLE="$1"
if [ -z $1 ]; then
ROUTER_CONSOLE="http://127.0.0.1:7657"
fi
fi
if [ ! -d "$CONFIGURING_PROFILE" ]; then
mkdir -p "$CONFIGURING_PROFILE"
cp -vr /var/lib/i2pbrowser/app-profile/* "$CONFIGURING_PROFILE"
fi
if [ ! -f "$CONFIGURING_PROFILE/user.js" ]; then
echo "user.js not present in $CONFIGURING_PROFILE, this is not a Firefox profile"
exit 1
fi
if [ -z $FIREFOX ]; then
if [ -f "firefox/firefox" ]; then
FIREFOX="./firefox/firefox"
fi
FIREFOX=$(which firefox-esr)
if [ -z $FIREFOX ]; then
FIREFOX=$(which firefox)
fi
fi
if [ -z $FIREFOX ]; then
echo "Firefox does not appear to be in your \$PATH."
echo "Please install Firefox via a package manager, or"
echo "or set the FIREFOX variable in your shell to the"
echo "location of a Firefox executable."
exit 1
fi
echo $FIREFOX --profile "$CONFIGURING_PROFILE" "$ROUTER_CONSOLE" $@
$FIREFOX --profile "$CONFIGURING_PROFILE" "$ROUTER_CONSOLE" $@

27
src/unix/torbrowser.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
TORSOCKS=$(which torsocks)
if [ -f "${TORSOCKS}" ]; then
. "${TORSOCKS}" on
fi
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
locale="en-US" # mention your locale. default = en-US
if [ -d /etc/default/locale ]; then
. /etc/default/locale
locale=$(echo "${LANG}" | cut -d . -f1)
fi
if [ ! -f ./tor.keyring ]; then
gpg --auto-key-locate nodefault,wkd --locate-keys torbrowser@torproject.org
gpg --output ./tor.keyring --export torbrowser@torproject.org
fi
if [ ! -f "tor-browser-linux64-${version}_${locale}.tar.xz" ]; then
wget -cv "https://www.torproject.org/dist/torbrowser/${version}/tor-browser-linux64-${version}_${locale}.tar.xz"
wget -cv "https://www.torproject.org/dist/torbrowser/${version}/tor-browser-linux64-${version}_${locale}.tar.xz.asc"
fi
gpgv --keyring ./tor.keyring "tor-browser-linux64-${version}_${locale}.tar.xz.asc" "tor-browser-linux64-${version}_${locale}.tar.xz"
tar xvJf "tor-browser-linux64-${version}_${locale}.tar.xz"

View File

@ -153,5 +153,12 @@ input {
#navbar {
float: right;
width: 10%;
width: 15%;
}
#returnhome {
font-size: xxx-large;
display: inline;
}
h1 {
display: inline;
}

35
targz.sh Executable file
View File

@ -0,0 +1,35 @@
#! /usr/bin/env bash
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/config.sh"
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
./clean.sh
wsl make distclean
./build.sh
cd "$SCRIPT_DIR/I2P" || exit 1
TORSOCKS=$(which torsocks)
if [ -f "${TORSOCKS}" ]; then
. "${TORSOCKS}" on
fi
./lib/torbrowser.sh
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
. "${TORSOCKS}" off
locale="en-US" # mention your locale. default = en-US
if [ -d /etc/default/locale ]; then
. /etc/default/locale
locale=$(echo "${LANG}" | cut -d . -f1)
fi
rm -vrf "tor-browser_${locale}"
cd "$SCRIPT_DIR" || exit 1
tar czvf I2P.tar.gz I2P

View File

@ -5,13 +5,11 @@ cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/config.sh"
if [ -f config_overide.sh ]; then
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
./clean.sh
wsl make distclean
wsl make clean-extensions
wsl make extensions
./build.sh
wsl make