Commit 63e3deea authored by Tails developers's avatar Tails developers

Drop useless "Browser" sub-directory in the TBB installation.

It was a relic of the TBB 3.x times when the profile was located in
the parent directory of the TBB browser files.

Also patch Tails Greeter with the updated path. That patch should
be dropped once it's been upstreamed into Tails Greeter.
parent a6c9aab6
......@@ -48,34 +48,34 @@ install_tor_browser() {
tmp="$(mktemp -d)"
tar -xf "${bundle}" -C "${tmp}" tor-browser_en-US
prep="${tmp}"/tor-browser_en-US
prep="${tmp}"/tor-browser_en-US/Browser
# Enable our myspell/hunspell dictionaries. TBB only provides the
# one for en-US, but Debian's seems more comprehensive, so we'll
# only use Debian's dictionaries.
rm -f "${prep}"/Browser/dictionaries/*
rm -f "${prep}"/dictionaries/*
for f in /usr/share/hunspell/*.aff /usr/share/hunspell/*.dic; do
name="$(basename "${f}")"
ln -s "${f}" "${prep}"/Browser/dictionaries/"${name}"
ln -s "${f}" "${prep}"/dictionaries/"${name}"
done
# We don't want tor-launcher to be part of the regular browser
# profile. Moreover, for the stand-alone tor-launcher we use, we
# need our patched version. So, the version shipped in the TB
# really is not useful for us.
rm "${prep}/Browser/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.
rm "${prep}/Browser/TorBrowser/Data/Browser/profile.default/extensions/torbutton@torproject.org.xpi"
rm "${prep}/TorBrowser/Data/Browser/profile.default/extensions/torbutton@torproject.org.xpi"
mv "${prep}/Browser" "${destination}"/Browser
mv "${prep}" "${destination}"
# The Tor Browser will fail, complaining about an incomplete profile,
# unless there's a readable Browser/TorBrowser/Data/Browser/Caches
# in the directory where the firefox executable is located.
mkdir -p "${destination}"/Browser/TorBrowser/Data/Browser/Caches
mkdir -p "${destination}"/TorBrowser/Data/Browser/Caches
rm -r "${tmp}"
}
......@@ -146,20 +146,19 @@ install_debian_extensions() {
}
create_default_profile() {
local tbb_install extensions_dir destination
tbb_install="${1}"
extensions_dir="${2}"
local tbb_profile extensions_dir destination
tbb_profile="${1}"
tbb_extensions_dir="${2}"
destination="${3}"
rsync -a --exclude bookmarks.html --exclude extensions \
"${tbb_install}"/Browser/TorBrowser/Data/Browser/profile.default/ \
"${destination}"/
"${tbb_profile}"/ "${destination}"/
# Remove TBB's default bridges
sed -i '/extensions\.torlauncher\.default_bridge\./d' "${destination}"/preferences/extension-overrides.js
mkdir -p "${destination}"/extensions
for ext in "${extensions_dir}"/*; do
for ext in "${tbb_extensions_dir}"/*; do
ln -s "${ext}" "${destination}"/extensions/
done
}
......@@ -199,18 +198,18 @@ rm -r "${TMP}"
# Let's put all the extensions from TBB in the global extensions
# directory...
mv "${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default/extensions/* "${TBB_EXT}"
rmdir "${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default/extensions
mv "${TBB_INSTALL}"/TorBrowser/Data/Browser/profile.default/extensions/* "${TBB_EXT}"
rmdir "${TBB_INSTALL}"/TorBrowser/Data/Browser/profile.default/extensions
# ... and then install a few Iceweasel extension by using a fake
# Iceweasel equivs package to satisfy the dependencies.
FIREFOX_VERSION=$(get_firefox_version "${TBB_INSTALL}"/Browser/application.ini)
FIREFOX_VERSION=$(get_firefox_version "${TBB_INSTALL}"/application.ini)
FAKE_ICEWEASEL_VERSION=${FIREFOX_VERSION}+fake1
install_fake_iceweasel_pkg "${FAKE_ICEWEASEL_VERSION}"
install_debian_extensions "${TBB_EXT}"
mkdir -p "${TBB_PROFILE}"
create_default_profile "${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default "${TBB_EXT}" "${TBB_PROFILE}"
create_default_profile "${TBB_INSTALL}"/TorBrowser/Data/Browser/profile.default "${TBB_EXT}" "${TBB_PROFILE}"
chown -R root:root "${TBB_INSTALL}" "${TBB_PROFILE}" "${TBB_EXT}"
chmod -R a+rX "${TBB_INSTALL}" "${TBB_PROFILE}" "${TBB_EXT}"
......
......@@ -9,7 +9,7 @@ echo "Removing unwanted browser search plugins"
# Import the TBB_INSTALL variable
. /usr/local/lib/tails-shell-library/tor-browser.sh
PLUGIN_DIR="${TBB_INSTALL}"/Browser/browser/searchplugins
PLUGIN_DIR="${TBB_INSTALL}"/browser/searchplugins
rm "${PLUGIN_DIR}"/amazon*.xml
rm "${PLUGIN_DIR}"/bing*.xml
rm "${PLUGIN_DIR}"/eBay*.xml
......
......@@ -27,9 +27,9 @@ for LANGUAGE in $(find /usr/share/amnesia/browser/searchplugins/locale -maxdepth
continue
fi
for LOCALE in $LOCALES; do
mkdir -p "${TBB_INSTALL}"/Browser/distribution/searchplugins/locale/$LOCALE
mkdir -p "${TBB_INSTALL}"/distribution/searchplugins/locale/$LOCALE
for SEARCHPLUGIN in $(find "/usr/share/amnesia/browser/searchplugins/locale/$LANGUAGE" -maxdepth 1 -type f); do
ln -s "$SEARCHPLUGIN" "${TBB_INSTALL}"/Browser/distribution/searchplugins/locale/$LOCALE
ln -s "$SEARCHPLUGIN" "${TBB_INSTALL}"/distribution/searchplugins/locale/$LOCALE
done
done
done
......@@ -5,7 +5,7 @@ set -eu
# Import the TBB_INSTALL variable
. /usr/local/lib/tails-shell-library/tor-browser.sh
ua="$(unzip -q -p "${TBB_INSTALL}"/Browser/browser/omni.ja \
ua="$(unzip -q -p "${TBB_INSTALL}"/browser/omni.ja \
defaults/preferences/000-tor-browser.js | \
sed -n 's@^pref("general\.useragent\.override", "\(.*\)");$@\1@p')"
......
......@@ -5,7 +5,7 @@ TBB_PROFILE=/etc/tor-browser/profile
TBB_EXT=/usr/local/share/tor-browser-extensions
exec_firefox() {
LD_LIBRARY_PATH="${TBB_INSTALL}"/Browser
LD_LIBRARY_PATH="${TBB_INSTALL}"
export LD_LIBRARY_PATH
exec "${TBB_INSTALL}"/Browser/firefox "${@}"
exec "${TBB_INSTALL}"/firefox "${@}"
}
......@@ -122,7 +122,7 @@ set_chroot_browser_name () {
TOP=browser/chrome
REST=${SHORT}/locale
else
PACK="${CHROOT}/${TBB_INSTALL}/Browser/browser/omni.ja"
PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja"
TOP=chrome
REST=en-US/locale
fi
......
......@@ -20,8 +20,8 @@ for icon in /usr/share/icons/hicolor/*/apps/pidgin.png; do
done
# Set Tor Browser application icon
for icon in "${TBB_INSTALL}"/Browser/browser/chrome/icons/default/*.png \
"${TBB_INSTALL}"/Browser/browser/icons/*.png; do
for icon in "${TBB_INSTALL}"/browser/chrome/icons/default/*.png \
"${TBB_INSTALL}"/browser/icons/*.png; do
rm "$icon"
ln -s "/usr/share/icons/Windows8/apps/iceweasel.png" "$icon"
done
......
......@@ -122,7 +122,7 @@ set_chroot_browser_name () {
TOP=browser/chrome
REST=${SHORT}/locale
else
PACK="${CHROOT}/${TBB_INSTALL}/Browser/browser/omni.ja"
PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja"
TOP=chrome
REST=en-US/locale
fi
......
When Tails is built, the searchplugins defined in these directories
will be symlinked to the corresponding locale directory in
/usr/local/lib/tor-browser/Browser/distribution/searchplugins/locale with
/usr/local/lib/tor-browser/distribution/searchplugins/locale with
one twist: if a language has more than one locale, the searchplugins
will be symlinked in all the corresponding directories.
......@@ -3,7 +3,7 @@ Name=Tor Browser
Comment=Anonymous Web Browser
GenericName=Anonymous Web Browser
Categories=Network;
Icon=/usr/local/lib/tor-browser/Browser/browser/icons/mozicon128.png
Icon=/usr/local/lib/tor-browser/browser/icons/mozicon128.png
Terminal=false
Type=Application
Exec=/usr/local/bin/tor-browser
--- chroot.orig/etc/gdm3/PostLogin/Default 2014-10-09 23:57:25.319996058 +0000
+++ chroot/etc/gdm3/PostLogin/Default 2014-10-09 23:58:19.147993943 +0000
@@ -133,7 +133,7 @@
# Choose which browser language pack to use
LONG_LOCALE="$(echo ${TAILS_LOCALE_NAME} | sed -e 's/\..*$//' -e 's/_/-/')"
SHORT_LOCALE="$(echo ${LONG_LOCALE} | cut -d"-" -f1)"
-LANGPACK_DIR="/usr/local/lib/tor-browser/extensions"
+LANGPACK_DIR="/usr/local/share/tor-browser-extensions"
if [ -e "${LANGPACK_DIR}/langpack-${LONG_LOCALE}@firefox.mozilla.org.xpi" ]; then
BROWSER_LOCALE="${LONG_LOCALE}"
elif [ -e "${LANGPACK_DIR}/langpack-${SHORT_LOCALE}@firefox.mozilla.org.xpi" ]; then
......@@ -558,7 +558,7 @@ def xul_app_shared_lib_check(pid, chroot)
unwanted_native_libs = []
tbb_libs = @vm.execute_successfully(
". /usr/local/lib/tails-shell-library/tor-browser.sh; " +
"ls -1 #{chroot}${TBB_INSTALL}/Browser/*.so"
"ls -1 #{chroot}${TBB_INSTALL}/*.so"
).stdout.split
firefox_pmap_info = @vm.execute("pmap #{pid}").stdout
for lib in tbb_libs do
......@@ -587,7 +587,7 @@ Then /^(.*) uses all expected TBB shared libraries$/ do |application|
next if @skip_steps_while_restoring_background
binary = @vm.execute_successfully(
'. /usr/local/lib/tails-shell-library/tor-browser.sh; ' +
'echo ${TBB_INSTALL}/Browser/firefox'
'echo ${TBB_INSTALL}/firefox'
).stdout.chomp
case application
when "the Tor Browser"
......
......@@ -585,7 +585,7 @@ language.
* The Startpage search engine must be localized for the languages we ship a
searchplug for:
find /usr/local/lib/tor-browser/Browser/distribution/searchplugins/locale -iname startpage-*.xml
find /usr/local/lib/tor-browser/distribution/searchplugins/locale -iname startpage-*.xml
* The Wikipedia search engine must be localized for all languages.
- Except for Farsi, see [[!tails_ticket 6884]]
......
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