summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2019-07-21 20:05:05 +0200
committersegfault <segfault@riseup.net>2019-07-21 20:05:05 +0200
commit737b5f89391a85151e88f35e6e7f17c9b3ef0ebb (patch)
treec7b98657dd8a8e18e0178e26e32cc9eaa399258d
parent4e02f0d1e25c1ec7bd2e80057958a1f9fbdaf114 (diff)
parentd735cbd8b8f14c8f3759293a37add134b14adda1 (diff)
Merge branch 'feature/16664-simplify-tor-has-bootstrapped+run-all-tests' into feature/16903-refactor-tails-documentationfeature/16903-refactor-tails-documentation
-rwxr-xr-xconfig/chroot_local-includes/etc/NetworkManager/dispatcher.d/10-tor.sh4
-rwxr-xr-xconfig/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh2
-rw-r--r--config/chroot_local-includes/lib/systemd/system/tails-tor-has-bootstrapped.target10
-rw-r--r--config/chroot_local-includes/lib/systemd/system/tails-wait-until-tor-has-bootstrapped.service7
-rwxr-xr-xconfig/chroot_local-includes/usr/local/bin/tor-browser2
-rwxr-xr-xconfig/chroot_local-includes/usr/local/sbin/tor-has-bootstrapped4
-rw-r--r--features/step_definitions/common_steps.rb1
-rw-r--r--features/support/helpers/misc_helpers.rb2
m---------submodules/pythonlib0
-rw-r--r--wiki/src/contribute/design.mdwn1
10 files changed, 11 insertions, 22 deletions
diff --git a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/10-tor.sh b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/10-tor.sh
index e0a1714..32304db 100755
--- a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/10-tor.sh
+++ b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/10-tor.sh
@@ -30,10 +30,6 @@ systemctl stop tor@default.service
# tordate/20-time.sh), so deleting it seems like a Good Thing(TM).
rm -f "${TOR_LOG}"
-# Let the rest of the system know that Tor is not working at the moment.
-# This matters e.g. if we have already bootstrapped.
-systemctl --no-block restart tails-tor-has-bootstrapped.target
-
# The Tor syscall sandbox is not compatible with managed proxies.
# We could possibly detect whether the user has configured any such
# thing via Tor Launcher later (e.g. in 60-tor-ready.sh),
diff --git a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh
index 91e8514..fcf18ad 100755
--- a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh
+++ b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh
@@ -19,7 +19,7 @@ export LANG
TEXTDOMAIN="tails"
export TEXTDOMAIN
-while ! /usr/local/sbin/tor-has-bootstrapped; do
+while ! /bin/systemctl --quiet is-active tails-tor-has-bootstrapped.target; do
sleep 1
done
diff --git a/config/chroot_local-includes/lib/systemd/system/tails-tor-has-bootstrapped.target b/config/chroot_local-includes/lib/systemd/system/tails-tor-has-bootstrapped.target
index 0aca04f..e514116 100644
--- a/config/chroot_local-includes/lib/systemd/system/tails-tor-has-bootstrapped.target
+++ b/config/chroot_local-includes/lib/systemd/system/tails-tor-has-bootstrapped.target
@@ -1,10 +1,8 @@
[Unit]
-Description=Tor has bootstrapped
+Description=Tor has Bootstrapped
Documentation=https://tails.boum.org/contribute/design/
-Requires=graphical.target
-Conflicts=rescue.service rescue.target
-After=graphical.target rescue.service rescue.target
-AllowIsolate=yes
+After=tails-wait-until-tor-has-bootstrapped.service
+BindsTo=tails-wait-until-tor-has-bootstrapped.service
[Install]
-WantedBy=graphical.target
+WantedBy=tails-wait-until-tor-has-bootstrapped.service \ No newline at end of file
diff --git a/config/chroot_local-includes/lib/systemd/system/tails-wait-until-tor-has-bootstrapped.service b/config/chroot_local-includes/lib/systemd/system/tails-wait-until-tor-has-bootstrapped.service
index 64f2afd..0f4046d 100644
--- a/config/chroot_local-includes/lib/systemd/system/tails-wait-until-tor-has-bootstrapped.service
+++ b/config/chroot_local-includes/lib/systemd/system/tails-wait-until-tor-has-bootstrapped.service
@@ -1,11 +1,12 @@
[Unit]
-Description=Wait for Tor to Have Bootstrapped
+Description=Tor has Bootstrapped
Documentation=https://tails.boum.org/contribute/design/
After=tor@default.service
-Before=tails-tor-has-bootstrapped.target
+BindsTo=tor@default.service
[Service]
Type=oneshot
+RemainAfterExit=yes
User=debian-tor
ExecStart=/bin/sh -c '. /usr/local/lib/tails-shell-library/tor.sh ; \
while ! tor_is_working ; do \
@@ -19,4 +20,4 @@ ProtectHome=yes
ProtectSystem=full
[Install]
-WantedBy=tails-tor-has-bootstrapped.target
+WantedBy=tor@default.service \ No newline at end of file
diff --git a/config/chroot_local-includes/usr/local/bin/tor-browser b/config/chroot_local-includes/usr/local/bin/tor-browser
index 14a6245..c22757e 100755
--- a/config/chroot_local-includes/usr/local/bin/tor-browser
+++ b/config/chroot_local-includes/usr/local/bin/tor-browser
@@ -68,7 +68,7 @@ start_browser() {
}
-if /usr/local/sbin/tor-has-bootstrapped || ask_for_confirmation; then
+if /bin/systemctl --quiet is-active tails-tor-has-bootstrapped.target || ask_for_confirmation; then
# Torbutton 1.5.1+ uses those environment variables
export TOR_SOCKS_HOST='127.0.0.1'
export TOR_SOCKS_PORT='9150'
diff --git a/config/chroot_local-includes/usr/local/sbin/tor-has-bootstrapped b/config/chroot_local-includes/usr/local/sbin/tor-has-bootstrapped
deleted file mode 100755
index 326e09a..0000000
--- a/config/chroot_local-includes/usr/local/sbin/tor-has-bootstrapped
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-/bin/systemctl --quiet is-active tor@default.service || exit 1
-/bin/systemctl --quiet is-active tails-tor-has-bootstrapped.target
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index 4f5601a..dfc1e2b 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -33,7 +33,6 @@ def post_snapshot_restore_hook
if $vm.has_network?
if $vm.execute("systemctl --quiet is-active tor@default.service").success?
$vm.execute("systemctl stop tor@default.service")
- $vm.execute("systemctl --no-block restart tails-tor-has-bootstrapped.target")
$vm.host_to_guest_time_sync
$vm.execute("systemctl start tor@default.service")
wait_until_tor_is_working
diff --git a/features/support/helpers/misc_helpers.rb b/features/support/helpers/misc_helpers.rb
index e9e7309..546ba11 100644
--- a/features/support/helpers/misc_helpers.rb
+++ b/features/support/helpers/misc_helpers.rb
@@ -161,7 +161,7 @@ class TorBootstrapFailure < StandardError
end
def wait_until_tor_is_working
- try_for(270) { $vm.execute('/usr/local/sbin/tor-has-bootstrapped').success? }
+ try_for(270) { $vm.execute('/bin/systemctl --quiet is-active tails-tor-has-bootstrapped.target').success? }
rescue Timeout::Error
# Save Tor logs before erroring out
File.open("#{$config["TMPDIR"]}/log.tor", 'w') { |file|
diff --git a/submodules/pythonlib b/submodules/pythonlib
-Subproject 2939c277b1c4df6f77b4a04abf8d718b2f7c2c0
+Subproject 130624a6393dec6db8723c3f55aa0e9a138fe78
diff --git a/wiki/src/contribute/design.mdwn b/wiki/src/contribute/design.mdwn
index e5cf219..af96a40 100644
--- a/wiki/src/contribute/design.mdwn
+++ b/wiki/src/contribute/design.mdwn
@@ -1057,7 +1057,6 @@ browser anyway:
- [[!tails_gitweb config/chroot_local-includes/lib/systemd/system/tails-wait-until-tor-has-bootstrapped.service]]
- [[!tails_gitweb config/chroot_local-includes/usr/lib/systemd/user/tails-wait-until-tor-has-bootstrapped.service]]
- [[!tails_gitweb config/chroot_local-includes/lib/systemd/system/tails-tor-has-bootstrapped-flag-file.service]]
-- [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tor-has-bootstrapped]]
Once Tor is ready to be used, the user is informed they can now use
the Internet: