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

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