Commit 402c5834 authored by anonym's avatar anonym
Browse files

Install Tor Browser's bundled Torbutton instead of custom .deb.

As of Torbutton 1.9.1.0 our extensions.torbutton.test_enabled pref is
part of upstream, so we don't have to maintain our custom .deb any
more! Note that we still patch our custom Torbutton with
0001-restore-status-panel-on-ff4.patch (inherited from Debian's
packaging) but it seems irrelevant for Tails.
parent 510f3561
...@@ -42,7 +42,7 @@ download_and_verify_files() { ...@@ -42,7 +42,7 @@ download_and_verify_files() {
} }
install_tor_browser() { install_tor_browser() {
local bundle destination tmp prep torbutton_xpi_path local bundle destination tmp prep
bundle="${1}" bundle="${1}"
destination="${2}" destination="${2}"
...@@ -72,18 +72,6 @@ install_tor_browser() { ...@@ -72,18 +72,6 @@ install_tor_browser() {
# really is not useful for us. # really is not useful for us.
rm "${prep}/TorBrowser/Data/Browser/profile.default/extensions/tor-launcher@torproject.org.xpi" rm "${prep}/TorBrowser/Data/Browser/profile.default/extensions/tor-launcher@torproject.org.xpi"
# Remove TBB's torbutton since the "Tor test" will fail and about:tor
# will report an error. We'll install our own Torbutton later, which
# has the extensions.torbutton.test_enabled boolean pref as a workaround.
torbutton_xpi_path="${prep}/TorBrowser/Data/Browser/profile.default/extensions/torbutton@torproject.org.xpi"
TORBUTTON_BUNDLED_VERSION="$(7z e -so ${torbutton_xpi_path} install.rdf | \
sed -n 's,^ <em:version>\([0-9\.]\+\)</em:version>,\1,p')"
if [ -z "${TORBUTTON_BUNDLED_VERSION}" ]; then
echo "Couldn't extract Torbutton's bundled version" >&2
exit 1
fi
rm "${torbutton_xpi_path}"
# The Tor Browser will fail, complaining about an incomplete profile, # The Tor Browser will fail, complaining about an incomplete profile,
# unless there's a readable TorBrowser/Data/Browser/Caches # unless there's a readable TorBrowser/Data/Browser/Caches
# in the directory where the firefox executable is located. # in the directory where the firefox executable is located.
...@@ -156,8 +144,6 @@ install_debian_extensions() { ...@@ -156,8 +144,6 @@ install_debian_extensions() {
apt-get install --yes "${@}" apt-get install --yes "${@}"
ln -s /usr/share/xul-ext/adblock-plus/ \ ln -s /usr/share/xul-ext/adblock-plus/ \
"${destination}"/'{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}' "${destination}"/'{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}'
ln -s /usr/share/xul-ext/torbutton/ \
"${destination}"/torbutton@torproject.org
} }
create_default_profile() { create_default_profile() {
...@@ -190,7 +176,7 @@ TBB_TARBALLS_BASE_URL="$(cat "${TBB_DIST_URL_FILE}")/${VERSION}" ...@@ -190,7 +176,7 @@ TBB_TARBALLS_BASE_URL="$(cat "${TBB_DIST_URL_FILE}")/${VERSION}"
# The Debian Iceweasel extensions we want to install and make # The Debian Iceweasel extensions we want to install and make
# available in the Tor Browser. # available in the Tor Browser.
DEBIAN_EXT_PKGS="xul-ext-adblock-plus xul-ext-torbutton" DEBIAN_EXT_PKGS="xul-ext-adblock-plus"
TMP="$(mktemp -d)" TMP="$(mktemp -d)"
download_and_verify_files "${TBB_TARBALLS_BASE_URL}" "${TBB_TARBALLS}" "${TMP}" download_and_verify_files "${TBB_TARBALLS_BASE_URL}" "${TBB_TARBALLS}" "${TMP}"
...@@ -214,15 +200,6 @@ FAKE_ICEWEASEL_VERSION=${FIREFOX_VERSION}+fake1 ...@@ -214,15 +200,6 @@ FAKE_ICEWEASEL_VERSION=${FIREFOX_VERSION}+fake1
install_fake_iceweasel_pkg "${FAKE_ICEWEASEL_VERSION}" install_fake_iceweasel_pkg "${FAKE_ICEWEASEL_VERSION}"
install_debian_extensions "${TBB_EXT}" ${DEBIAN_EXT_PKGS} install_debian_extensions "${TBB_EXT}" ${DEBIAN_EXT_PKGS}
# Make sure that we have installed a Torbutton based on the same
# version as the one bundled with the Tor Browser
TORBUTTON_VERSION="$(dpkg -s xul-ext-torbutton | \
sed -n 's/^Version: \(.*\)-[0-9]\+$/\1/p')"
if [ "${TORBUTTON_VERSION}" != "${TORBUTTON_BUNDLED_VERSION}" ]; then
echo "We have installed a Torbutton based on version '${TORBUTTON_VERSION}' but the version bundled with the Tor Browser is version '${TORBUTTON_BUNDLED_VERSION}'" >&2
exit 1
fi
mkdir -p "${TBB_PROFILE}" mkdir -p "${TBB_PROFILE}"
create_default_profile "${TBB_INSTALL}"/TorBrowser/Data/Browser/profile.default "${TBB_EXT}" "${TBB_PROFILE}" create_default_profile "${TBB_INSTALL}"/TorBrowser/Data/Browser/profile.default "${TBB_EXT}" "${TBB_PROFILE}"
......
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