forked from ubuntu-ir/traktor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
traktor_debian.sh
71 lines (58 loc) · 2.14 KB
/
traktor_debian.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
clear
echo -e "Traktor v1.3\nTor will be automatically installed and configured…\n\n"
# Install Packages
sudo apt-get update > /dev/null
sudo apt install -y \
tor \
obfs4proxy \
polipo \
dnscrypt-proxy \
torbrowser-launcher \
apt-transport-tor
# Write Bridge
sudo wget https://ubuntu-ir.github.io/traktor/torrc -O /etc/tor/torrc > /dev/null
# Fix Apparmor problem
sudo sed -i '27s/PUx/ix/' /etc/apparmor.d/abstractions/tor
sudo apparmor_parser -r -v /etc/apparmor.d/system_tor
# Write Polipo config
echo 'logSyslog = true
logFile = /var/log/polipo/polipo.log
proxyAddress = "::0" # both IPv4 and IPv6
allowedClients = 127.0.0.1
socksParentProxy = "localhost:9050"
socksProxyType = socks5' | sudo tee /etc/polipo/config > /dev/null
sudo service polipo restart
# Set IP and Port on HTTP
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http host 127.0.0.1
gsettings set org.gnome.system.proxy.http port 8123
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '::1', '192.168.0.0/16', '10.0.0.0/8', '172.16.0.0/12']"
# Install Finish
echo "Install Finished successfully…"
# Wait for tor to establish connection
echo "Tor is trying to establish a connection. This may take long for some minutes. Please wait" | sudo tee /var/log/tor/log
bootstraped='n'
sudo service tor restart
while [ $bootstraped == 'n' ]; do
if sudo cat /var/log/tor/log | grep "Bootstrapped 100%: Done"; then
bootstraped='y'
else
sleep 1
fi
done
# Add tor repos
echo "deb tor+http://deb.torproject.org/torproject.org stable main" | sudo tee /etc/apt/sources.list.d/tor.list > /dev/null
# Fetching Tor signing key and adding it to the keyring
gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
# update tor from main repo
sudo apt-get update > /dev/null
sudo apt install -y \
tor \
obfs4proxy
# Fix Apparmor problem
sudo sed -i '27s/PUx/ix/' /etc/apparmor.d/abstractions/tor
sudo apparmor_parser -r -v /etc/apparmor.d/system_tor
# update finished
echo "Congratulations!!! Your computer is using Tor. may run torbrowser-launcher now."