Commit 7da60333 authored by Tails developers's avatar Tails developers
Browse files

Work around Tor Browser's hardcoded profile path when running Tor Launcher.

parent 5dbd3be9
......@@ -2,4 +2,27 @@
set -e
/usr/local/lib/tor-browser/Browser/firefox --app /usr/share/tor-launcher-standalone/application.ini
# 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/application
cp -r /usr/share/tor-launcher-standalone \
"${HOME}"/.tor-launcher/application/
mkdir -p "${HOME}"/.tor-launcher/Data/Browser/
cat << EOF > "${HOME}"/.tor-launcher/Data/Browser/profiles.ini
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=profile.default
EOF
mkdir -p "${HOME}"/.tor-launcher/Data/Browser/profile.default/preferences
ln -s /var/lib/tails-user-session/browser-locale.js \
"${HOME}"/.tor-launcher/Data/Browser/profile.default/preferences/locale.js
fi
/usr/local/lib/tor-browser/Browser/firefox --app "${HOME}"/.tor-launcher/application/tor-launcher-standalone/application.ini
......@@ -26,24 +26,6 @@ until pgrep -u "${LIVE_USERNAME}" nm-applet >/dev/null ; do
sleep 5
done
# Use the Tor Browser's hardcoded relative-patch only default profile
# dir. And no, -profile doesn't work together with -app.
if [ ! -e /usr/Data ]; then
mkdir -p /usr/Data/Browser/profile.default/preferences
cat << EOF > /usr/Data/Browser/profiles.ini
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=profile.default
EOF
ln -s /var/lib/tails-user-session/browser-locale.js \
/usr/Data/Browser/profile.default/preferences/locale.js
chown -R tor-launcher:tor-launcher /usr/Data
fi
export LANG
export DISPLAY=':0.0'
export XAUTHORITY="`echo /var/run/gdm3/auth-for-${LIVE_USERNAME}-*/database`"
......
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