summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2015-09-11 22:35:48 +0200
committeranonym <anonym@riseup.net>2016-02-09 17:29:14 +0100
commit36f9c2e63a2013d627082fd05dd9e29a70afb313 (patch)
treebe6ddfd00bfddd26da6c9206489abd4f7ede7d97
parent06bc25133af394ed2bda2586484d35678a47663e (diff)
Introduce TOR_LAUNCHER_INSTALL to the tor-browser library.
To simplify some paths.
-rwxr-xr-xconfig/chroot_local-hooks/10-tbb21
-rwxr-xr-xconfig/chroot_local-hooks/20-xul-ext_symlinks5
-rwxr-xr-xconfig/chroot_local-includes/usr/local/bin/tor-launcher5
-rw-r--r--config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh3
4 files changed, 20 insertions, 14 deletions
diff --git a/config/chroot_local-hooks/10-tbb b/config/chroot_local-hooks/10-tbb
index 6be4f53..ac47e06 100755
--- a/config/chroot_local-hooks/10-tbb
+++ b/config/chroot_local-hooks/10-tbb
@@ -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,
diff --git a/config/chroot_local-hooks/20-xul-ext_symlinks b/config/chroot_local-hooks/20-xul-ext_symlinks
index 5331fae..68a3de4 100755
--- a/config/chroot_local-hooks/20-xul-ext_symlinks
+++ b/config/chroot_local-hooks/20-xul-ext_symlinks
@@ -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"
diff --git a/config/chroot_local-includes/usr/local/bin/tor-launcher b/config/chroot_local-includes/usr/local/bin/tor-launcher
index 9a4f7a6..9bc4167 100755
--- a/config/chroot_local-includes/usr/local/bin/tor-launcher
+++ b/config/chroot_local-includes/usr/local/bin/tor-launcher
@@ -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}"
diff --git a/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh b/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
index 94b1ce9..a365bc7 100644
--- a/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
+++ b/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
@@ -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}"