forked from tailsjoin/tailsjoin
-
Notifications
You must be signed in to change notification settings - Fork 5
/
tailsjoin.sh
executable file
·185 lines (153 loc) · 4.82 KB
/
tailsjoin.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/bin/bash
set -e
clear
# Check for root.
if [[ $(id -u) = "0" ]]; then
echo "
YOU SHOULD NOT RUN THIS SCRIPT AS ROOT!
YOU WILL BE PROMPTED FOR THE ADMIN PASS WHEN NEEDED.
"
read -p "PRESS ENTER TO EXIT SCRIPT, AND RUN AGAIN AS amnesia. "
exit 0
fi
# Make sure user has chosen the correct script.
echo "
THIS SCRIPT WILL INSTALL JOINMARKET AND ITS DEPENDENCIES ON
A MINIMAL TAILS OS WITHOUT A LOCAL BLOCKCHAIN. YOU WILL BE
USING THE BLOCKR.IO API FOR BLOCKCHAIN LOOKUPS (ALWAYS OVER TOR).
"
read -p "PRESS ENTER TO CONTINUE. "
clear
# Check for persistence.
if [[ $(pwd | grep -c Persistent) = "0" && -e /home/amnesia/Persistent ]]; then
echo "
IT SEEMS YOU HAVE PERSISTENCE ENABLED, BUT YOU ARE IN THE FOLDER:
"$PWD"
IF YOU MOVE THE tailsjoin/ FOLDER TO /home/amnesia/Persistent/
YOUR INSTALL WILL SURVIVE REBOOTS, OTHERWISE IT WILL NOT.
"
read -p "QUIT THE SCRIPT NOW TO MOVE? (y/n) " q
if [[ "$q" = "y" || "$q" = "Y" ]]; then
exit 0
else
clear
fi
fi
# Update apt-get sources.
echo "
ENTER PASSWORD TO UPDATE SOURCES.
"
sudo apt-get update
clear
# Install dependencies for building libsodium.
echo "
ENTER PASSWORD TO INSTALL: 'gcc', 'libc6-dev', and 'make'
(NEEDED TO BUILD LIBSODIUM CRYPTO LIBRARY)
"
sudo apt-get install -y gcc libc6-dev make
clear
# Clone JoinMarket.
git clone https://github.com/chris-belcher/joinmarket ../joinmarket
clear
# Get libsodium, sig, and import key.
echo "
DOWNLOADING LIBSODIUM SOURCE AND SIGNING KEY...
"
gpg --recv-keys 54A2B8892CC3D6A597B92B6C210627AABA709FE1
echo "54A2B8892CC3D6A597B92B6C210627AABA709FE1:6" | gpg --import-ownertrust -
curl -x socks5://127.0.0.1:9050 -# -L -O http://download.libsodium.org/libsodium/releases/libsodium-1.0.4.tar.gz -O http://download.libsodium.org/libsodium/releases/libsodium-1.0.4.tar.gz.sig
clear
# Verify download.
echo "
VERIFYING THE DOWNLOAD...
"
gpg --verify libsodium-1.0.4.tar.gz.sig libsodium-1.0.4.tar.gz
echo "
PLEASE REVIEW THE TEXT ABOVE.
IT WILL EITHER SAY GOOD SIG OR BAD SIG.
"
read -p "IS IT A GOOD SIG? (y/n) " x
while [[ "$x" = "n" || "$x" = "N" ]]; do
clear
echo "
SECURELY DELETING FILES AND DOWNLOADING AGAIN...
"
srm -drv libsodium*
curl -x socks5://127.0.0.1:9050 -# -L -O http://download.libsodium.org/libsodium/releases/libsodium-1.0.4.tar.gz -O http://download.libsodium.org/libsodium/releases/libsodium-1.0.4.tar.gz.sig
gpg --verify libsodium-1.0.4.tar.gz.sig libsodium-1.0.4.tar.gz
echo "
PLEASE REVIEW THE TEXT ABOVE.
IT WILL EITHER SAY GOOD SIG OR BAD SIG.
"
read -p "IS IT A GOOD SIG? (y/n) " x
done
clear
# Build and install libsodium.
tar xf libsodium*.tar.gz
rm -rf libsodium*.tar.gz*
if [[ $(pwd | grep -c Persistent) = "1" ]]; then
echo "
BUILDING AND INSTALLING LIBSODIUM TO SURVIVE REBOOTS...
"
mkdir ../joinmarket/libsodium
( cd libsodium-1.0.4/ && ./configure --prefix=$(pwd) && make && make install )
mv libsodium-1.0.4/lib/libsodium.* ../joinmarket/libsodium/
sed -i "s|\/usr\/local\/lib|$(pwd | sed 's|tailsjoin|joinmarket\/libsodium|')|" ../joinmarket/libnacl/__init__.py
( cd ../joinmarket && git commit -a -m "Tailsjoin survive reboots" )
else
echo "
BUILDING, LIBSODIUM...
"
( cd libsodium-1.0.4/ && ./configure && make )
echo "
LIBSODIUM SUCCESSFULLY BULIT. ENTER PASSWORD TO INSTALL.
"
( cd libsodium-1.0.4/ && sudo make install )
fi
rm -rf libsodium*
clear
# Set JoinMarket config for tor and blockr.
echo "[BLOCKCHAIN]
blockchain_source = blockr
# blockchain_source options: blockr, bitcoin-rpc, json-rpc, regtest
# for instructions on bitcoin-rpc read https://github.com/chris-belcher/joinmarket/wiki/Running-JoinMarket-with-Bitcoin-Core-full-node
network = mainnet
rpc_host = localhost
rpc_port = 8332
rpc_user = bitcoin
rpc_password = password
[MESSAGING]
#host = irc.cyberguerrilla.org
channel = joinmarket-pit
port = 6697
usessl = true
socks5 = false
socks5_host = localhost
socks5_port = 9050
# for tor
host = 6dvj6v5imhny3anf.onion
# The host below is an alternative if the above isn't working.
#host = a2jutl5hpza43yog.onion
maker_timeout_sec = 60
[POLICY]
# merge_algorithm options: greedy, default, gradual
merge_algorithm = default" > ../joinmarket/joinmarket.cfg
# Final notes.
echo "
JOINMARKET SUCCESSFULLY INSTALLED AND CONFIGURED!
IF YOU HAVE PERSISTENCE ENABLED, AND YOU RAN THIS
SCRIPT FROM WITHIN THE FOLDER: /home/amnesia/Persistent,
THEN YOUR INSTALL WILL SURVIVE REBOOTS AND YOU NEVER
HAVE TO RUN THIS SCRIPT AGAIN.
SOME USEFUL LINKS:
YOUR JOINMARKET FOLDER LOCATION:
$(pwd | sed 's|tailsjoin|joinmarket|')
DETAILED USE GUIDE FOR TAILS (WITH PICTURES):
https://github.com/tailsjoin/tailsjoin/wiki/Detailed-Minimal-Setup-Guide
HIDDEN SERVICE ORDERBOOK WATCHER:
http://ruc47yiosooolrzw.onion
JOINMARKET PROJECT OFFICIAL GITHUB:
https://github.com/chris-belcher/joinmarket
"
read -p "PRESS ENTER TO EXIT. "
exit 0