Commit 36f9c2e6 authored by anonym's avatar anonym
Browse files

Introduce TOR_LAUNCHER_INSTALL to the tor-browser library.

To simplify some paths.
parent 06bc2513
......@@ -4,12 +4,13 @@ set -eu
echo "Install the Tor Browser"
# Import the TBB_INSTALL, TBB_PROFILE and TBB_EXT variables, which
# contains the paths we will split TBB's actual browser (binaries
# etc), user data and extension into. While this differs from how the
# TBB organizes the files, the end result will be the same, and it's
# practical since when creating a new browser profile we can simply
# copy the profile directory without duplicating all extensions.
# Import the TBB_INSTALL, TBB_PROFILE, TBB_EXT and
# TOR_LAUNCHER_INSTALL variables, which contains the paths we will
# split TBB's actual browser (binaries etc), user data and extension
# into. While this differs from how the TBB organizes the files, the
# end result will be the same, and it's practical since when creating
# a new browser profile we can simply copy the profile directory
# without duplicating all extensions.
. /usr/local/lib/tails-shell-library/tor-browser.sh
download_and_verify_files() {
......@@ -70,11 +71,11 @@ install_tor_browser() {
# profile but we want to keep it as a standalone application
# when Tails is started in "bridge mode".
torlauncher_xpi_path="${prep}/TorBrowser/Data/Browser/profile.default/extensions/tor-launcher@torproject.org.xpi"
7z x -o'/usr/local/lib/tor-launcher-standalone' "${torlauncher_xpi_path}"
7z x -o"${TOR_LAUNCHER_INSTALL}" "${torlauncher_xpi_path}"
torlauncher_version="$(sed -n \
's,^ <em:version>\([0-9\.]\+\)</em:version>,\1,p' \
'/usr/local/lib/tor-launcher-standalone/install.rdf')"
cat > '/usr/local/lib/tor-launcher-standalone/application.ini' << EOF
"${TOR_LAUNCHER_INSTALL}/install.rdf")"
cat > "${TOR_LAUNCHER_INSTALL}/application.ini" << EOF
[App]
Vendor=TorProject
Name=TorLauncher
......@@ -89,7 +90,7 @@ MaxVersion=*.*.*
[Shell]
Icon=icon.png
EOF
chmod -R a+rX '/usr/local/lib/tor-launcher-standalone'
chmod -R a+rX "${TOR_LAUNCHER_INSTALL}"
rm "${torlauncher_xpi_path}"
# The Tor Browser will fail, complaining about an incomplete profile,
......
......@@ -4,5 +4,8 @@ set -e
echo "Creating prefs override for Tor Launcher"
# Import the TOR_LAUNCHER_INSTALL variable.
. /usr/local/lib/tails-shell-library/tor-browser.sh
ln -s /etc/xul-ext/tor-launcher.js \
/usr/local/lib/tor-launcher-standalone/defaults/preferences/000system.js
"${TOR_LAUNCHER_INSTALL}/defaults/preferences/000system.js"
......@@ -2,7 +2,8 @@
set -e
# Import exec_unconfined_firefox() and configure_best_tor_launcher_locale()
# Import the TOR_LAUNCHER_INSTALL variable, and exec_unconfined_firefox()
# and configure_best_tor_launcher_locale()
. /usr/local/lib/tails-shell-library/tor-browser.sh
PROFILE="${HOME}/.tor-launcher/profile.default"
......@@ -12,5 +13,5 @@ if [ ! -d "${PROFILE}" ]; then
fi
exec_unconfined_firefox \
-app /usr/local/lib/tor-launcher-standalone/application.ini \
-app "${TOR_LAUNCHER_INSTALL}/application.ini" \
-profile "${PROFILE}"
......@@ -3,7 +3,8 @@
TBB_INSTALL=/usr/local/lib/tor-browser
TBB_PROFILE=/etc/tor-browser/profile
TBB_EXT=/usr/local/share/tor-browser-extensions
TOR_LAUNCHER_LOCALES_DIR=/usr/local/lib/tor-launcher-standalone/chrome/locale
TOR_LAUNCHER_INSTALL=/usr/local/lib/tor-launcher-standalone
TOR_LAUNCHER_LOCALES_DIR="${TOR_LAUNCHER_INSTALL}/chrome/locale"
exec_firefox() {
LD_LIBRARY_PATH="${TBB_INSTALL}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment