-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·52 lines (43 loc) · 1.51 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·52 lines (43 loc) · 1.51 KB
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
#!/bin/bash
# One-shot setup: builds the Tor container, starts it, builds TorVPN.app,
# and offers to install it to /Applications.
set -euo pipefail
cd "$(dirname "$0")"
if ! command -v docker >/dev/null 2>&1; then
echo "Docker not found. Install Docker Desktop first: https://www.docker.com/products/docker-desktop/" >&2
exit 1
fi
if [ ! -f tor/torrc ]; then
echo "Using default torrc (plain Tor, no bridges — fine unless Tor is blocked on your network)..."
cp tor/torrc.default tor/torrc
fi
echo "Building and starting the Tor container..."
docker compose up -d --build
echo ""
echo "Waiting for Tor to bootstrap..."
for i in $(seq 1 30); do
if docker logs torvpn-tor 2>&1 | grep -q "Bootstrapped 100%"; then
echo "Tor is up."
break
fi
sleep 1
done
RESULT=$(curl -s --max-time 10 --socks5-hostname 127.0.0.1:9050 https://check.torproject.org/api/ip || echo '{"IsTor":false}')
echo "$RESULT"
echo ""
echo "Building TorVPN.app..."
chmod +x vpn/build.sh vpn/tor-vpn-on.sh vpn/tor-vpn-off.sh
(cd vpn && ./build.sh)
echo ""
read -r -p "Install TorVPN.app to /Applications? [y/N] " answer
if [[ "$answer" =~ ^[Yy]$ ]]; then
rm -rf /Applications/TorVPN.app
cp -R vpn/TorVPN.app /Applications/TorVPN.app
echo "Installed. Launching..."
open /Applications/TorVPN.app
else
echo "Skipped. Run it directly with: open vpn/TorVPN.app"
fi
echo ""
echo "Done. If your network blocks Tor and you need obfs4 bridges, run: tor/bridges.sh"
echo "(needs bash 4+: brew install bash, then /opt/homebrew/bin/bash tor/bridges.sh)"