Compare commits
15 Commits
20220920.j
...
20221008
Author | SHA1 | Date | |
---|---|---|---|
67e0b87d97 | |||
1424913447 | |||
c0cb68f972 | |||
52c91e1e65 | |||
9e6ea435af | |||
308055143f | |||
53f731f945 | |||
7ec56455cd | |||
c11f982088 | |||
58e1276072 | |||
20240c9e75 | |||
4079d6a8b1 | |||
8b893d1116 | |||
0d209bb2a8 | |||
186493b154 |
1
Makefile
1
Makefile
@ -72,7 +72,6 @@ build/I2P: I2P build
|
||||
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)/wrapper.config src/I2P/config/
|
||||
#grep -v 'router.updateURL' $(RES_DIR)/router.config > src/I2P/config/router.config
|
||||
|
@ -234,7 +234,8 @@ 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.**
|
||||
**generate that. Once generated, `cd I2P && ./lib/torbrowser.sh` to complete**
|
||||
**setup, and `./bin/I2P` to run it.**
|
||||
|
||||
Issues
|
||||
------
|
||||
|
1
build.sh
1
build.sh
@ -38,6 +38,7 @@ make src/I2P/config
|
||||
$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 \
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
JNA_VERSION=5.11.0
|
||||
export JNA_VERSION=5.11.0
|
||||
I2PFIREFOX_VERSION=0.0.36
|
||||
export I2PFIREFOX_VERSION=0.0.36
|
||||
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
|
||||
|
@ -46,7 +46,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
||||
if (copyDirectory(file, new File(newPath)))
|
||||
return false;
|
||||
if (file.isFile())
|
||||
if (!copyFile(file, new File(newPath), true))
|
||||
if (0 == copyFile(file, new File(newPath), true))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -61,37 +61,49 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
||||
if (file.isDirectory())
|
||||
if (!copyConfigDirectory(file, new File(newPath)))
|
||||
return false;
|
||||
if (file.isFile())
|
||||
if (!copyFileNeverOverwrite(
|
||||
file,
|
||||
new File(newPath))) // new File(workDir, file.toString())))
|
||||
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 boolean copyFileNeverOverwrite(String basePath,
|
||||
String workPath) {
|
||||
public static int copyFileNeverOverwrite(String basePath, String workPath) {
|
||||
File baseFile = new File(basePath);
|
||||
File workFile = new File(workPath);
|
||||
return copyFileNeverOverwrite(baseFile, workFile);
|
||||
}
|
||||
|
||||
public static boolean copyFileNeverOverwrite(File basePath, File workPath) {
|
||||
public static int copyFileNeverOverwrite(File basePath, File workPath) {
|
||||
return copyFile(basePath, workPath, false);
|
||||
}
|
||||
|
||||
public static boolean copyFile(File basePath, File workPath,
|
||||
boolean overWrite) {
|
||||
public static int copyFile(File basePath, File workPath, boolean overWrite) {
|
||||
if (!basePath.exists()) {
|
||||
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!overWrite && workPath.exists()) {
|
||||
logger.info(workPath.getAbsolutePath() +
|
||||
" already exists, not overwriting");
|
||||
return true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
File workDir = workPath.getParentFile();
|
||||
@ -111,12 +123,12 @@ public class CopyConfigDir extends WindowsServiceUtil {
|
||||
}
|
||||
in.close();
|
||||
out.close();
|
||||
return true;
|
||||
return 1;
|
||||
} catch (Throwable e) {
|
||||
logger.warning(e.toString());
|
||||
logger.warning("failed to copy " + basePath.getAbsolutePath() + " to " +
|
||||
workPath.getAbsolutePath());
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class WinLauncher extends CopyConfigDir {
|
||||
public static void main(String[] args) {
|
||||
setupLauncher();
|
||||
initLogger();
|
||||
boolean privateBrowsing = false;
|
||||
int privateBrowsing = 0;
|
||||
boolean usabilityMode = false;
|
||||
boolean chromiumFirst = false;
|
||||
int proxyTimeoutTime = 200;
|
||||
@ -46,7 +46,7 @@ public class WinLauncher extends CopyConfigDir {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
if (arg.equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
privateBrowsing = 1;
|
||||
logger.info(
|
||||
"Private browsing is true, profile will be discarded at end of session.");
|
||||
} else if (arg.equals("-chromium")) {
|
||||
@ -153,15 +153,26 @@ public class WinLauncher extends CopyConfigDir {
|
||||
}
|
||||
|
||||
private static void fixServiceConfig() {
|
||||
if (osName() != "windows")
|
||||
return;
|
||||
// If the user installed the Easy bundle before installing the
|
||||
// regulalr bundle, then they have a config file which contains 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
|
||||
i2pRouter = new Router(routerConfig(), System.getProperties());
|
||||
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("win/beta")) {
|
||||
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())) {
|
||||
@ -172,7 +183,7 @@ public class WinLauncher extends CopyConfigDir {
|
||||
}
|
||||
String backupNewsURL = i2pRouter.getConfigSetting("router.backupNewsURL");
|
||||
if (backupNewsURL != null) {
|
||||
if (backupNewsURL.contains("win/beta")) {
|
||||
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",
|
||||
@ -184,9 +195,9 @@ public class WinLauncher extends CopyConfigDir {
|
||||
}
|
||||
String updateURL = i2pRouter.getConfigSetting("router.updateURL");
|
||||
if (updateURL != null) {
|
||||
if (updateURL.contains("i2pwinupdate.su3")) {
|
||||
if (updateURL.contains("http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3")) {
|
||||
logger.info(
|
||||
"checked router.updateURL config, containes win/beta in a service install, invalid update type");
|
||||
"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 " +
|
||||
@ -230,7 +241,7 @@ public class WinLauncher extends CopyConfigDir {
|
||||
return home;
|
||||
}
|
||||
|
||||
private static boolean launchBrowser(boolean privateBrowsing,
|
||||
private static boolean launchBrowser(int privateBrowsing,
|
||||
boolean usabilityMode,
|
||||
boolean chromiumFirst,
|
||||
int proxyTimeoutTime,
|
||||
|
@ -40,10 +40,11 @@ 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/"
|
||||
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
|
||||
|
@ -4,7 +4,7 @@ UniCode true
|
||||
!define APPNAME "I2PBrowser-Launcher"
|
||||
!define COMPANYNAME "I2P"
|
||||
!define DESCRIPTION "This is a tool which contains an I2P router, a bundled JVM, and a tool for automatically configuring a browser to use with I2P."
|
||||
!define I2P_MESSAGE "Could not find I2P. Installing portable Jpackaged 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"
|
||||
@ -13,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
|
||||
|
||||
@ -122,18 +122,20 @@ PageEx license
|
||||
PageExEnd
|
||||
PageEx directory
|
||||
dirtext "${I2P_MESSAGE}"
|
||||
dirvar $I2PINSTEXE
|
||||
dirvar $INSTDIR
|
||||
PageCallbacks routerDetect
|
||||
PageExEnd
|
||||
Page instfiles
|
||||
|
||||
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
|
||||
@ -141,34 +143,22 @@ Function .onInit
|
||||
FunctionEnd
|
||||
|
||||
Function routerDetect
|
||||
createDirectory $I2PINSTEXE
|
||||
SetOutPath $I2PINSTEXE\app
|
||||
createDirectory $INSTDIR
|
||||
SetOutPath $INSTDIR\app
|
||||
File /a /r "I2P\app\"
|
||||
SetOutPath $I2PINSTEXE\runtime
|
||||
SetOutPath $INSTDIR\runtime
|
||||
File /a /r "I2P\runtime\"
|
||||
SetOutPath $I2PINSTEXE
|
||||
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"
|
||||
File "I2P\config\jpackaged"
|
||||
|
||||
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"
|
||||
FunctionEnd
|
||||
|
||||
Function installerFunction
|
||||
@ -178,55 +168,44 @@ Function installerFunction
|
||||
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/*"
|
||||
|
||||
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}\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\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
|
||||
|
||||
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
|
||||
@ -245,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"
|
||||
@ -262,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
|
||||
@ -280,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 != ""
|
||||
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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" $@
|
@ -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"
|
@ -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"
|
@ -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
27
src/unix/torbrowser.sh
Executable 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"
|
22
targz.sh
22
targz.sh
@ -12,4 +12,24 @@ fi
|
||||
./clean.sh
|
||||
wsl make distclean
|
||||
./build.sh
|
||||
tar czvf I2P.tar.gz I2P
|
||||
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
|
||||
|
Reference in New Issue
Block a user