Commit 2db6d171 authored by anonym's avatar anonym
Browse files

Make the -profile Tor Launcher workaround simpler.

... instead of the crazy workaround we had to use before. It turns out
you *can* use -app and -profile together, but only if -profile is
given last. It may be that it was fixed recently, because I'm pretty
sure it didn't work last time I wroked on this.

Also, in /usr/share/TorBrowser/Data/Browser (which is the "default"
profile directory relative to the Tor Launcher applocation.ini file)
the Caches directory must exist and be accessible for the tor-launcher
user even if -profile is used, so we just have to ensure it exists.

Will-fix: #7943
parent 92f7b928
......@@ -5,26 +5,12 @@ set -e
# Import exec_unconfined_firefox() and configure_best_tor_launcher_locale()
. /usr/local/lib/tails-shell-library/tor-browser.sh
# The Tor Browser hardcodes the default profile dir to ../.. from the
# folder storing the application.ini file supplied via -app. Sadly,
# -profile doesn't work together with -app. Therefore we copy the
# whole Tor Launcher application (just ~350 KB) into the user's home
# so we can get the profile directory in a sane place.
if [ ! -e "${HOME}"/.tor-launcher ]; then
mkdir -p "${HOME}"/.tor-launcher
cp -r /usr/share/tor-launcher-standalone "${HOME}"/.tor-launcher/tor-launcher-standalone
mkdir -p "${HOME}"/.tor-launcher/TorBrowser/Data/Browser/
cat << EOF > "${HOME}"/.tor-launcher/TorBrowser/Data/Browser/profiles.ini
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=profile.default
EOF
mkdir -p "${HOME}"/.tor-launcher/TorBrowser/Data/Browser/profile.default/preferences
configure_best_tor_launcher_locale "${HOME}"/.tor-launcher/TorBrowser/Data/Browser/profile.default
PROFILE="${HOME}/.tor-launcher/profile.default"
if [ ! -d "${PROFILE}" ]; then
mkdir -p "${PROFILE}"
configure_best_tor_launcher_locale "${PROFILE}"
fi
exec_unconfined_firefox -app "${HOME}"/.tor-launcher/tor-launcher-standalone/application.ini
exec_unconfined_firefox \
-app /usr/share/tor-launcher-standalone/application.ini \
-profile "${PROFILE}"
......@@ -27,6 +27,14 @@ fi
# Get LANG
. /etc/default/locale
# The Tor Browser hardcodes the default profile dir to inside
# ../TorBrowser/Data/Browser/ from the folder storing the
# application.ini file supplied via -app. We can use -profile to load
# it from a different place, but then the Caches directory
# must still exist and be accessible in the above folder.
mkdir -p /usr/share/TorBrowser/Data/Browser/Caches
chmod -R a+rX /usr/share/TorBrowser
until pgrep -u "${LIVE_USERNAME}" '^ibus-daemon' >/dev/null ; do
sleep 5
done
......
......@@ -53,7 +53,7 @@ def xul_application_info(application)
new_tab_button_image = "I2PBrowserNewTabButton.png"
when "Tor Launcher"
user = "tor-launcher"
cmd_regex = "#{binary} -app /home/#{user}/\.tor-launcher/tor-launcher-standalone/application\.ini"
cmd_regex = "#{binary} -app /usr/share/tor-launcher-standalone/application\.ini"
chroot = ""
new_tab_button_image = nil
address_bar_image = nil
......
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