tor-launcher 1.07 KB
Newer Older
1 2 3 4
#!/bin/sh

set -e

5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# 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