summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2015-09-11 22:05:30 +0200
committeranonym <anonym@riseup.net>2016-02-09 17:20:48 +0100
commit2db6d171d900819247b469a81e1aaf9edf3c10f4 (patch)
treea5d767cbaefce5af4f05b3161e75b9e5dcd8c3df
parent92f7b9282c3c7cb5b9a54d04007789a83f9376d8 (diff)
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
-rwxr-xr-xconfig/chroot_local-includes/usr/bin/tor-launcher28
-rwxr-xr-xconfig/chroot_local-includes/usr/local/sbin/tails-tor-launcher8
-rw-r--r--features/step_definitions/browser.rb2
3 files changed, 16 insertions, 22 deletions
diff --git a/config/chroot_local-includes/usr/bin/tor-launcher b/config/chroot_local-includes/usr/bin/tor-launcher
index 8ffa59a..8a0711b 100755
--- a/config/chroot_local-includes/usr/bin/tor-launcher
+++ b/config/chroot_local-includes/usr/bin/tor-launcher
@@ -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}"
diff --git a/config/chroot_local-includes/usr/local/sbin/tails-tor-launcher b/config/chroot_local-includes/usr/local/sbin/tails-tor-launcher
index f8ffb7d..d6737f9 100755
--- a/config/chroot_local-includes/usr/local/sbin/tails-tor-launcher
+++ b/config/chroot_local-includes/usr/local/sbin/tails-tor-launcher
@@ -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
diff --git a/features/step_definitions/browser.rb b/features/step_definitions/browser.rb
index 6b5aabf..e3d1028 100644
--- a/features/step_definitions/browser.rb
+++ b/features/step_definitions/browser.rb
@@ -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