Commit f7629905 authored by Tails developers's avatar Tails developers
Browse files

Refactor default profile creation code.

parent 3ff10aef
......@@ -11,7 +11,6 @@ echo "Install the Tor Browser"
# 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
mkdir -p "${TBB_PROFILE}"
download_and_verify_files() {
local base_url bundles destination apt_proxy
......@@ -146,6 +145,25 @@ install_debian_extensions() {
"${destination}"/torbutton@torproject.org
}
create_default_profile() {
local tbb_install extensions_dir destination
tbb_install="${1}"
extensions_dir="${2}"
destination="${3}"
rsync -a --exclude bookmarks.html --exclude extensions \
"${tbb_install}"/Browser/TorBrowser/Data/Browser/profile.default/ \
"${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
ln -s "${ext}" "${destination}"/extensions/
done
}
# Get the below with `grep "tor-browser-linux32-.*\.tar.xz" sha256sums.txt`
BUNDLES="$(cat <<EOF
473780a5145859a8d516e76cb27be25b0baf16007ba50cd8ba78a536bc806fc5 tor-browser-linux32-tbb-nightly_ar.tar.xz
......@@ -187,17 +205,8 @@ FAKE_ICEWEASEL_VERSION=${FIREFOX_VERSION}+fake1
install_fake_iceweasel_pkg "${FAKE_ICEWEASEL_VERSION}"
install_debian_extensions "${TBB_EXT}"
rsync -a --exclude bookmarks.html --exclude extensions \
"${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default/ \
"${TBB_PROFILE}"/
# Remove TBB's default bridges
sed -i '/extensions\.torlauncher\.default_bridge\./d' "${TBB_PROFILE}"/preferences/extension-overrides.js
mkdir -p "${TBB_PROFILE}"/extensions
for ext in "${TBB_EXT}"/*; do
ln -s "${ext}" "${TBB_PROFILE}"/extensions/
done
mkdir -p "${TBB_PROFILE}"
create_default_profile "${TBB_INSTALL}"/Browser/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}"
......
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