Upstream tor package

This commit is contained in:
Bob Mottram 2017-06-03 19:21:50 +01:00
parent 109d6bf848
commit 6e2668ab1c
2 changed files with 22 additions and 6 deletions

View File

@ -946,7 +946,12 @@ EOF
if [[ $VARIANT == "usb" ]]; then
# tor
chroot "$rootdir" apt-get -y install tor
echo "deb $TOR_PACKAGE_UPSTREAM $DEBIAN_VERSION main" | sudo tee -a $rootdir/etc/apt/sources.list.d/tor.list
echo "deb-src $TOR_PACKAGE_UPSTREAM $DEBIAN_VERSION main" | sudo tee -a $rootdir/etc/apt/sources.list.d/tor.list
chroot "$rootdir" gpg --keyserver keys.gnupg.net --recv $TOR_GPG_KEY
chroot "$rootdir" gpg --export $TOR_GPG_KEY | sudo apt-key add -
chroot "$rootdir" apt-get update
chroot "$rootdir" apt-get -yq install tor deb.torproject.org-keyring
# xmpp client
chroot "$rootdir" echo "deb ftp://ftp.gajim.org/debian unstable main" > /etc/apt/sources.list.d/gajim.list
@ -1069,9 +1074,17 @@ function image_setup_utils {
chroot "$rootdir" apt-get -yq install fail2ban vim-common python3 unattended-upgrades
# Tor and ssh over tor
chroot "$rootdir" apt-get -yq install tor connect-proxy
echo "deb $TOR_PACKAGE_UPSTREAM $DEBIAN_VERSION main" | sudo tee -a $rootdir/etc/apt/sources.list.d/tor.list
echo "deb-src $TOR_PACKAGE_UPSTREAM $DEBIAN_VERSION main" | sudo tee -a $rootdir/etc/apt/sources.list.d/tor.list
chroot "$rootdir" gpg --keyserver keys.gnupg.net --recv $TOR_GPG_KEY
chroot "$rootdir" gpg --export $TOR_GPG_KEY | sudo apt-key add -
chroot "$rootdir" apt-get update
chroot "$rootdir" apt-get -yq install tor deb.torproject.org-keyring connect-proxy
chroot "$rootdir" connect-proxy
sed -i 's|#Log notice file.*|Log notice file /dev/null|g' $rootdir/etc/tor/torrc
sed -i 's|Log notice file.*|Log notice file /dev/null|g' $rootdir/etc/tor/torrc
sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" $rootdir/etc/tor/torrc
sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" $rootdir/etc/tor/torrc
if ! grep -q 'Host *.onion' $rootdir/root/.ssh/config; then
if [ ! -d $rootdir/root/.ssh ]; then
mkdir $rootdir/root/.ssh

View File

@ -31,6 +31,9 @@
# The maximum amount of traffic per day in gigabytes
TOR_MAX_TRAFFIC_PER_DAY_GB=3
TOR_PACKAGE_UPSTREAM='http://deb.torproject.org/torproject.org'
TOR_GPG_KEY='A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89'
function add_email_hostname {
extra_email_hostname="$1"
email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
@ -275,10 +278,10 @@ function install_tor {
return
fi
echo "deb http://deb.torproject.org/torproject.org $DEBIAN_VERSION main" | sudo tee -a /etc/apt/sources.list.d/tor.list
echo "deb-src http://deb.torproject.org/torproject.org $DEBIAN_VERSION main" | sudo tee -a /etc/apt/sources.list.d/tor.list
gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
echo "deb $TOR_PACKAGE_UPSTREAM $DEBIAN_VERSION main" | sudo tee -a /etc/apt/sources.list.d/tor.list
echo "deb-src $TOR_PACKAGE_UPSTREAM $DEBIAN_VERSION main" | sudo tee -a /etc/apt/sources.list.d/tor.list
gpg --keyserver keys.gnupg.net --recv $TOR_GPG_KEY
gpg --export $TOR_GPG_KEY | sudo apt-key add -
apt-get update
apt-get -yq install tor deb.torproject.org-keyring
if [ ! -f /etc/tor/torrc ]; then