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

Bypass Tor connection wizard in sd-whonix with default connection settings #2099

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
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
48 changes: 48 additions & 0 deletions debian/securedrop-whonix-config.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
# postinst script for securedrop-whonix-config
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
configure)

# Set Tor connection preference in 50_user.conf file, if no configuration has been set.
# See https://github.com/freedomofpress/securedrop-workstation/issues/1096
# Users who wish to use Tor bridges will have to remove the changes in 50_user.conf
# and step through the anon connection wizard again.
if ! grep -F -q "DisableNetwork 0" /usr/local/etc/torrc.d/50_user.conf /usr/local/etc/torrc.d/40_tor_control_panel.conf; then
echo "DisableNetwork 0" >> /usr/local/etc/torrc.d/50_user.conf
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
Loading