Add tor-dam installation. ut

This commit is contained in:
parazyd 2018-01-23 13:17:13 +01:00
parent f4b106e2f6
commit f6d06241c7
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
2 changed files with 29 additions and 0 deletions

3
config
View File

@ -24,6 +24,8 @@ multichain_url="https://www.multichain.com/download/multichain-${multichain_vers
stem_version="1.6.0"
stem_url="https://git.torproject.org/stem.git"
tordam_url="github.com/parazyd/tor-dam/..."
size="4098"
filesystem="btrfs"
@ -47,6 +49,7 @@ extra_packages+=(
redis-tools
redis-server
paxctl
net-tools
python2.7
python3

View File

@ -132,6 +132,32 @@ EOF
chroot-script install-golang || zerr
}
## }}}
## {{{ blend_install_tordam()
blend_install_tordam() {
fn blend_install_tordam
req=(strapdir tordam_url)
ckreq || return 1
notice "installing tor-dam in $strapdir"
cat <<EOF | sudo tee ${strapdir}/install-tordam >/dev/null
#!/bin/sh
sudo -u decode go get -u ${tordam_url}
cd /home/decode/go/src/github.com/decodeproject/tor-dam
# A random password for the Tor Controlport auth
torpass="$(echo "$(shuf -n 2 /usr/share/dict/words --random-source=/dev/urandom | tr '\n' '-')")"
sed -i python/damhs.py -e 's/topkek/${torpass}/'
sed -i python/damauth.py -e 's/topkek/${torpass}/'
make install
torpass="$(tor --hash-password "${torpass}")"
sed -e 's/User tor/User debian-tor/' \
-e 's/HashedControlPassword .*/HashedControlPassword ${torpass}/' \
< contrib/torrc > /etc/tor/torrc
EOF
chroot-script install-tordam || zerr
}
## }}}
## {{{ blend_install_netdata()
blend_install_netdata() {
fn blend_install_netdata