Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly declare onion services as v2 for existing installs #4092

Merged
merged 2 commits into from
Feb 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions install_files/securedrop-config/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ allow_apt_user_in_iptables() {
"$rules_v4"
fi
}
# Tor 0.3.5.x series now defaults to v3 onion URLs, but SecureDrop currently
# uses v2 onion URLs. We must explictly set this definition in torrc to avoid
# breakage when upgrading from Tor 0.3.4.x to 0.3.5.x.
set_v2_hidserv_in_torrc() {
if [ -f /etc/tor/torrc ]; then
if ! grep -q HiddenServiceVersion /etc/tor/torrc ; then
perl -pi -e 's/^(HiddenServiceDir.*)$/$1\nHiddenServiceVersion 2/' /etc/tor/torrc
fi
fi
}

case "$1" in
configure)
Expand All @@ -61,6 +71,7 @@ case "$1" in
fi

allow_apt_user_in_iptables
set_v2_hidserv_in_torrc
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down