Compare commits

...

12 Commits

17 changed files with 129 additions and 274 deletions

View File

@ -72,7 +72,6 @@ build/I2P: I2P build
src/I2P/config: src/I2P/config:
mkdir -p src/I2P/config mkdir -p src/I2P/config
rm -rf src/I2P/config/geoip src/I2P/config/webapps src/I2P/config/certificates 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)/clients.config src/I2P/config/
cp -v $(RES_DIR)/wrapper.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 #grep -v 'router.updateURL' $(RES_DIR)/router.config > src/I2P/config/router.config

View File

@ -38,6 +38,7 @@ make src/I2P/config
$JPACKAGE_OPTS \ $JPACKAGE_OPTS \
--resource-dir build \ --resource-dir build \
--app-content src/I2P/config \ --app-content src/I2P/config \
--app-content src/unix/torbrowser.sh \
--app-content src/icons/windowsUIToopie2.png \ --app-content src/icons/windowsUIToopie2.png \
--app-content src/icons/ui2pbrowser_icon.ico \ --app-content src/icons/ui2pbrowser_icon.ico \
--icon src/icons/windowsUIToopie2.png \ --icon src/icons/windowsUIToopie2.png \

View File

@ -2,8 +2,8 @@
JNA_VERSION=5.11.0 JNA_VERSION=5.11.0
export JNA_VERSION=5.11.0 export JNA_VERSION=5.11.0
I2PFIREFOX_VERSION=0.0.36 I2PFIREFOX_VERSION=1.0.1
export I2PFIREFOX_VERSION=0.0.36 export I2PFIREFOX_VERSION=1.0.1
# Comment this out to build from an alternate branch or # Comment this out to build from an alternate branch or
# the tip of the master branch. # the tip of the master branch.
VERSIONMAJOR=1 VERSIONMAJOR=1

View File

@ -46,7 +46,7 @@ public class CopyConfigDir extends WindowsServiceUtil {
if (copyDirectory(file, new File(newPath))) if (copyDirectory(file, new File(newPath)))
return false; return false;
if (file.isFile()) if (file.isFile())
if (!copyFile(file, new File(newPath), true)) if (0 == copyFile(file, new File(newPath), true))
return false; return false;
} }
return true; return true;
@ -61,37 +61,49 @@ public class CopyConfigDir extends WindowsServiceUtil {
if (file.isDirectory()) if (file.isDirectory())
if (!copyConfigDirectory(file, new File(newPath))) if (!copyConfigDirectory(file, new File(newPath)))
return false; return false;
if (file.isFile()) if (file.isFile()) {
if (!copyFileNeverOverwrite( int cnr = copyFileNeverOverwrite(file, new File(newPath));
file, if (0 == cnr)
new File(newPath))) // new File(workDir, file.toString())))
return false; 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; return true;
} }
public static boolean copyFileNeverOverwrite(String basePath, public static int copyFileNeverOverwrite(String basePath, String workPath) {
String workPath) {
File baseFile = new File(basePath); File baseFile = new File(basePath);
File workFile = new File(workPath); File workFile = new File(workPath);
return copyFileNeverOverwrite(baseFile, workFile); 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); return copyFile(basePath, workPath, false);
} }
public static boolean copyFile(File basePath, File workPath, public static int copyFile(File basePath, File workPath, boolean overWrite) {
boolean overWrite) {
if (!basePath.exists()) { if (!basePath.exists()) {
logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying"); logger.info(basePath.getAbsolutePath() + " doesn't exist, not copying");
return false; return 0;
} }
if (!overWrite && workPath.exists()) { if (!overWrite && workPath.exists()) {
logger.info(workPath.getAbsolutePath() + logger.info(workPath.getAbsolutePath() +
" already exists, not overwriting"); " already exists, not overwriting");
return true; return -1;
} }
File workDir = workPath.getParentFile(); File workDir = workPath.getParentFile();
@ -111,12 +123,12 @@ public class CopyConfigDir extends WindowsServiceUtil {
} }
in.close(); in.close();
out.close(); out.close();
return true; return 1;
} catch (Throwable e) { } catch (Throwable e) {
logger.warning(e.toString()); logger.warning(e.toString());
logger.warning("failed to copy " + basePath.getAbsolutePath() + " to " + logger.warning("failed to copy " + basePath.getAbsolutePath() + " to " +
workPath.getAbsolutePath()); workPath.getAbsolutePath());
return false; return 0;
} }
} }

View File

@ -36,7 +36,7 @@ public class WinLauncher extends CopyConfigDir {
public static void main(String[] args) { public static void main(String[] args) {
setupLauncher(); setupLauncher();
initLogger(); initLogger();
boolean privateBrowsing = false; int privateBrowsing = 0;
boolean usabilityMode = false; boolean usabilityMode = false;
boolean chromiumFirst = false; boolean chromiumFirst = false;
int proxyTimeoutTime = 200; int proxyTimeoutTime = 200;
@ -46,7 +46,7 @@ public class WinLauncher extends CopyConfigDir {
if (args.length > 0) { if (args.length > 0) {
for (String arg : args) { for (String arg : args) {
if (arg.equals("-private")) { if (arg.equals("-private")) {
privateBrowsing = true; privateBrowsing = 1;
logger.info( logger.info(
"Private browsing is true, profile will be discarded at end of session."); "Private browsing is true, profile will be discarded at end of session.");
} else if (arg.equals("-chromium")) { } else if (arg.equals("-chromium")) {
@ -153,15 +153,26 @@ public class WinLauncher extends CopyConfigDir {
} }
private static void fixServiceConfig() { private static void fixServiceConfig() {
if (osName() != "windows")
return;
// If the user installed the Easy bundle before installing the // 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. // wrong update URL. Check for it, and change it back if necessary.
// closes #23 // 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()) { if (isInstalled("i2p") || checkProgramFilesInstall()) {
i2pRouter = new Router(routerconf, System.getProperties());
String newsURL = i2pRouter.getConfigSetting("router.newsURL"); String newsURL = i2pRouter.getConfigSetting("router.newsURL");
if (newsURL != null) { if (newsURL != null) {
if (newsURL.contains("win/beta")) { if (newsURL.contains("http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news/win/beta/news.su3")) {
logger.info( logger.info(
"checked router.newsURL config, containes win/beta in a service install, invalid update type"); "checked router.newsURL config, containes win/beta in a service install, invalid update type");
if (i2pRouter.saveConfig("router.newsURL", ServiceUpdaterString())) { if (i2pRouter.saveConfig("router.newsURL", ServiceUpdaterString())) {
@ -172,7 +183,7 @@ public class WinLauncher extends CopyConfigDir {
} }
String backupNewsURL = i2pRouter.getConfigSetting("router.backupNewsURL"); String backupNewsURL = i2pRouter.getConfigSetting("router.backupNewsURL");
if (backupNewsURL != null) { if (backupNewsURL != null) {
if (backupNewsURL.contains("win/beta")) { if (backupNewsURL.contains("http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/win/beta/news.su3")) {
logger.info( logger.info(
"checked router.backupNewsURL config, containes win/beta in a service install, invalid update type"); "checked router.backupNewsURL config, containes win/beta in a service install, invalid update type");
if (i2pRouter.saveConfig("router.backupNewsURL", if (i2pRouter.saveConfig("router.backupNewsURL",
@ -184,9 +195,9 @@ public class WinLauncher extends CopyConfigDir {
} }
String updateURL = i2pRouter.getConfigSetting("router.updateURL"); String updateURL = i2pRouter.getConfigSetting("router.updateURL");
if (updateURL != null) { if (updateURL != null) {
if (updateURL.contains("i2pwinupdate.su3")) { if (updateURL.contains("http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3")) {
logger.info( 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", if (i2pRouter.saveConfig("router.updateURL",
ServiceStaticUpdaterString())) { ServiceStaticUpdaterString())) {
logger.info("updated routerconsole.browser config " + logger.info("updated routerconsole.browser config " +
@ -230,7 +241,7 @@ public class WinLauncher extends CopyConfigDir {
return home; return home;
} }
private static boolean launchBrowser(boolean privateBrowsing, private static boolean launchBrowser(int privateBrowsing,
boolean usabilityMode, boolean usabilityMode,
boolean chromiumFirst, boolean chromiumFirst,
int proxyTimeoutTime, int proxyTimeoutTime,

View File

@ -4,7 +4,7 @@ UniCode true
!define APPNAME "I2PBrowser-Launcher" !define APPNAME "I2PBrowser-Launcher"
!define COMPANYNAME "I2P" !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 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 LAUNCH_TEXT "Start I2P?"
!define LICENSE_TITLE "Many Licenses" !define LICENSE_TITLE "Many Licenses"
!define CONSOLE_URL "http://127.0.0.1:7657/home" !define CONSOLE_URL "http://127.0.0.1:7657/home"
@ -13,11 +13,11 @@ UniCode true
!include i2pbrowser-jpackage.nsi !include i2pbrowser-jpackage.nsi
!include FindProcess.nsh !include FindProcess.nsh
var I2PINSTEXE var INSTDIR
SetOverwrite on SetOverwrite on
!define I2PINSTEXE !define INSTDIR
!define I2PINSTEXE_USERMODE "$LOCALAPPDATA\i2p" !define I2PINSTEXE_USERMODE "$LOCALAPPDATA\i2p"
!define RAM_NEEDED_FOR_64BIT 0x80000000 !define RAM_NEEDED_FOR_64BIT 0x80000000
@ -122,18 +122,18 @@ PageEx license
PageExEnd PageExEnd
PageEx directory PageEx directory
dirtext "${I2P_MESSAGE}" dirtext "${I2P_MESSAGE}"
dirvar $I2PINSTEXE dirvar $INSTDIR
PageCallbacks routerDetect PageCallbacks routerDetect
PageExEnd PageExEnd
Page instfiles Page instfiles
Function .onInit Function .onInit
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}" StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
UserInfo::GetAccountType UserInfo::GetAccountType
pop $0 pop $0
${If} $0 != "admin" ${If} $0 != "admin"
StrCpy $INSTDIR "$LOCALAPPDATA\${COMPANYNAME}\${APPNAME}" StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}" StrCpy $INSTDIR "${I2PINSTEXE_USERMODE}"
${EndIf} ${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY !insertmacro MUI_LANGDLL_DISPLAY
#Call ShouldInstall64Bit #Call ShouldInstall64Bit
@ -141,34 +141,22 @@ Function .onInit
FunctionEnd FunctionEnd
Function routerDetect Function routerDetect
createDirectory $I2PINSTEXE createDirectory $INSTDIR
SetOutPath $I2PINSTEXE\app SetOutPath $INSTDIR\app
File /a /r "I2P\app\" File /a /r "I2P\app\"
SetOutPath $I2PINSTEXE\runtime SetOutPath $INSTDIR\runtime
File /a /r "I2P\runtime\" File /a /r "I2P\runtime\"
SetOutPath $I2PINSTEXE SetOutPath $INSTDIR\config
File /a /r "I2P\config\"
SetOutPath $INSTDIR
File /a /r "I2P\I2P.exe" File /a /r "I2P\I2P.exe"
# The NSIS Installer uses an ico icon, the jpackage-only ones use png # The NSIS Installer uses an ico icon, the jpackage-only ones use png
File /a /r "I2P\ui2pbrowser_icon.ico" File /a /r "I2P\ui2pbrowser_icon.ico"
File "I2P\config\jpackaged"
createDirectory "$I2PINSTEXE\" createDirectory "$INSTDIR\"
SetOutPath "$I2PINSTEXE\" SetOutPath "$INSTDIR\"
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"
File /a /r "I2P/config/certificates" File /a /r "I2P/config/certificates"
File /a /r "I2P/config/geoip" File /a /r "I2P/config/geoip"
File /a /r "I2P/config/i2ptunnel.config"
FunctionEnd FunctionEnd
Function installerFunction Function installerFunction
@ -178,29 +166,20 @@ Function installerFunction
Sleep 500 Sleep 500
${LoopWhile} $0 <> 0 ${LoopWhile} $0 <> 0
${EndIf} ${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 # set the installation directory as the destination for the following actions
createDirectory $INSTDIR createDirectory $INSTDIR
SetOutPath $INSTDIR SetOutPath $INSTDIR
File ui2pbrowser_icon.ico File ui2pbrowser_icon.ico
# Update jpackaged I2P router, if it exists # Update jpackaged I2P router
${If} ${FileExists} "$I2PINSTEXE\jpackaged"
createDirectory $I2PINSTEXE
SetOutPath $I2PINSTEXE
${If} ${Silent}
ReadEnvStr $0 OLD_I2P_VERSION
${If} $0 < ${I2P_VERSION}
call routerDetect call routerDetect
${EndIf}
${Else}
call routerDetect
${EndIf}
${EndIf}
# Install the launcher scripts # Install the launcher scripts
createDirectory "$INSTDIR" createDirectory "$INSTDIR"
#SetOutPath "$INSTDIR" #SetOutPath "$INSTDIR"
@ -211,13 +190,13 @@ Function installerFunction
SetOutPath "$INSTDIR\licenses" SetOutPath "$INSTDIR\licenses"
File /a /r "licenses/*" File /a /r "licenses/*"
SetOutPath "$I2PINSTEXE" SetOutPath "$INSTDIR"
createDirectory "$SMPROGRAMS\${APPNAME}" createDirectory "$SMPROGRAMS\${APPNAME}"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Browse I2P.lnk" "$I2PINSTEXE\I2P.exe" "" "$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" "$I2PINSTEXE\I2P.exe -private" "" "$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.lnk" "$INSTDIR\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 - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
SetShellVarContext current SetShellVarContext current
@ -225,8 +204,8 @@ Function installerFunction
IfFileExists "$LOCALAPPDATA\I2P\eepsite\docroot" +2 0 IfFileExists "$LOCALAPPDATA\I2P\eepsite\docroot" +2 0
File /a /r "I2P\eepsite" File /a /r "I2P\eepsite"
createDirectory "$I2PINSTEXE" createDirectory "$INSTDIR"
SetOutPath "$I2PINSTEXE" SetOutPath "$INSTDIR"
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
# create the uninstaller # create the uninstaller
@ -245,12 +224,13 @@ SectionEnd
# uninstaller section start # uninstaller section start
Section "uninstall" Section "uninstall"
# Uninstall the launcher scripts # Uninstall the launcher scripts
Delete $INSTDIR\* rmDir /r "$INSTDIR\app"
rmDir /r "$INSTDIR\" rmDir /r "$INSTDIR\config"
${If} ${FileExists} "$I2PINSTEXE\jpackaged" rmDir /r "$INSTDIR\runtime"
Delete $I2PINSTEXE\* Delete "$INSTDIR\ui2pbrowser_icon.ico"
rmDir /r "$I2PINSTEXE" Delete "$INSTDIR\windowsUItoopie2.png"
${EndIf} Delete "$INSTDIR\I2P.exe"
# Remove shortcuts and folders # Remove shortcuts and folders
Delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" Delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"
@ -262,10 +242,24 @@ Section "uninstall"
Delete "$DESKTOP\${APPNAME}.lnk" Delete "$DESKTOP\${APPNAME}.lnk"
Delete "$DESKTOP\Private Browsing-${APPNAME}.lnk" Delete "$DESKTOP\Private Browsing-${APPNAME}.lnk"
rmDir /r "$SMPROGRAMS\${APPNAME}" rmDir /r "$SMPROGRAMS\${APPNAME}"
rmDir /r "$INSTDIR\firefox.profile.i2p\extensions"
rmDir /r "$INSTDIR\firefox.profile.i2p" #### SUPER SUPER EXTRA IMPORTANT!
rmDir /r "$LOCALAPPDATA\${APPNAME}" ### 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" rmDir /r "$INSTDIR"
${EndIf}
# delete the uninstaller # delete the uninstaller
Delete "$INSTDIR\uninstall-i2pbrowser.exe" Delete "$INSTDIR\uninstall-i2pbrowser.exe"
@ -280,8 +274,8 @@ SectionEnd
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
Function LaunchLink Function LaunchLink
SetOutPath "$I2PINSTEXE" SetOutPath "$INSTDIR"
StrCpy $OUTDIR $I2PINSTEXE StrCpy $OUTDIR $INSTDIR
${If} ${Silent} ${If} ${Silent}
ReadEnvStr $0 RESTART_I2P ReadEnvStr $0 RESTART_I2P
${If} $0 != "" ${If} $0 != ""

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

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

@ -0,0 +1,21 @@
#!/bin/sh
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

@ -12,4 +12,7 @@ fi
./clean.sh ./clean.sh
wsl make distclean wsl make distclean
./build.sh ./build.sh
cd "$SCRIPT_DIR/I2P" || exit 1
# ./lib/torbrowser.sh <- haha just kidding, but uncomment this to make it pack everything it needs into the tar.gz
cd "$SCRIPT_DIR" || exit 1
tar czvf I2P.tar.gz I2P tar czvf I2P.tar.gz I2P