aboutsummaryrefslogtreecommitdiff
path: root/template/install-on-ubuntu1804.html.j2
diff options
context:
space:
mode:
Diffstat (limited to 'template/install-on-ubuntu1804.html.j2')
-rw-r--r--template/install-on-ubuntu1804.html.j2512
1 files changed, 512 insertions, 0 deletions
diff --git a/template/install-on-ubuntu1804.html.j2 b/template/install-on-ubuntu1804.html.j2
new file mode 100644
index 00000000..32d4dc91
--- /dev/null
+++ b/template/install-on-ubuntu1804.html.j2
@@ -0,0 +1,512 @@
1{% extends "common/base.j2" %}
2{% block body_content %}
3<article class="container">
4<!--<article> -->
5<header>
6 <h2>{{ _("Tutorial: GNUnet on Ubuntu 18.04") }}</h2>
7</header>
8<section>
9 <h3>{{ _("Introduction") }}</h3>
10 <p>
11 Welcome to the hopefully painless GNUnet tutorial for Ubuntu 18.04!
12 It provides very concrete instructions on how to compile, install
13 and configure a current version of GNUnet. The goal is to support
14 newcomers, either end users or developers, who want to get in touch
15 with GNUnet for the first time. After installing GNUnet we will make
16 sure that out new GNUnet installation is working correctly.
17 </p>
18 <p>
19 <b>Attention: If you came across the official gnunet package for
20 Ubuntu 18.04, ignore it! It is ancient and not compatible with
21 current GNUnet installations.</b>
22 </p>
23 <p>
24 Now let's start!
25 </p>
26</section>
27<section>
28 <h3>{{ _("Requirements") }}</h3>
29 <p>
30 First let's install the following Ubuntu 18.04 packages to use
31 GNUnet painlessly. Optional dependencies are listed in Appendix
32 A. They are required for some experimental GNUnet features.
33 </p>
34 <code>
35 $ sudo apt install git libtool autoconf autopoint \<br>
36 build-essential libgcrypt-dev libidn11-dev zlib1g-dev \<br>
37 libunistring-dev libglpk-dev miniupnpc libextractor-dev \<br>
38 libjansson-dev libcurl4-gnutls-dev gnutls-bin libsqlite3-dev \<br>
39 openssl libnss3-tools libmicrohttpd-dev libopus-dev libpulse-dev \<br>
40 libogg-dev
41 </code>
42</section>
43<section>
44 <h3>{{ _("Make an installation directory") }}</h3>
45 <p>
46 Next we create a directory in our home directory where we store
47 the source code later. We should keep this directory after
48 installation because it contains Makefiles that can be used for
49 uninstalling GNUnet again (see chapter *Uninstall GNUnet and its
50 dependencies*).
51 </p>
52 <code>
53 $ mkdir ~/gnunet_installation
54 </code>
55</section>
56<section>
57 <h3>{{ _("Get the source code") }}</h3>
58 <p>
59 We download the GNUnet source code using git.
60 </p>
61 <code>
62 $ cd ~/gnunet_installation<br>
63 $ git clone --depth 1 https://gnunet.org/git/gnunet.git<br>
64 </code>
65</section>
66<section>
67 <h3>{{ _("Compile and Install") }}</h3>
68 <p>
69 Installing GNUnet is not hard. We have two options:
70 installing a *production version* and installing a *development version*. If
71 you want to start writing GNUnet applications or join the GNUnet development
72 choose the development version (it will print more debug output and contains
73 debug symbols that can be displayed with a debugger). Otherwise choose the
74 production version.
75 </p>
76</section>
77<section>
78 <h4>{{ _("Option 1: GNUnet for production / usage") }}</h4>
79 <code>
80 $ cd ~/gnunet_installation/gnunet<br>
81 $ ./bootstrap<br>
82 $ ./configure --prefix=$GNUNET_PREFIX --disable-documentation --with-microhttpd=/opt/libmicrohttpd<br>
83 $ sudo addgroup gnunetdns<br>
84 $ sudo adduser --system --group --disabled-login --home /var/lib/gnunet gnunet<br>
85 $ make -j$(nproc || echo -n 1)<br>
86 $ sudo make install
87 </code>
88</section>
89<section>
90 <h4>{{ _("Option 2: GNUnet for development") }}</h4>
91
92 <code>
93 $ cd ~/gnunet_installation/gnunet<br>
94 $ ./bootstrap<br>
95 $ export GNUNET_PREFIX=/usr<br>
96 $ export CFLAGS="-g -Wall -O0"<br>
97 $ ./configure --prefix=$GNUNET_PREFIX --disable-documentation --enable-logging=verbose <br>
98 $ make -j$(nproc || echo -n 1)<br>
99 $ sudo make install
100 </code>
101
102 <!--
103<h4>{{ _("Install GNUnet plugin for name resolution") }}</h4>
104 So now it gets a bit nasty. It's not so bad. All we have to do is copy a file and edit another one. The file we need to copy is GNUnet's plugin for the Name Service Switch (NSS) in unix systems. Different unixes expect it in different locations and GNUnet's build system does not try to guess. On Ubuntu 18.04 we have to do
105
106 <code>
107 $ sudo cp /usr/lib/gnunet/nss/libnss_gns.so.2 /lib/$(uname -m)-linux-gnu/
108 </code>
109
110 <p>The next step is activating the GNUnet plugin we just copied in the NSS
111 config. It is located in `/etc/nsswitch.conf`. It should contain a line
112 starting with "hosts" similar to this (at least "files" and "dns" should be
113 there):</p>
114
115 <code>
116 $ cat /etc/nsswitch.conf<br>
117 hosts: files mdns4_minimal [NOTFOUND=return] dns
118 </code>
119
120 <p><b>Attention: Once we modified `etc/nsswitch.conf` DNS resolution will only
121 be possible as long as is GNUnet is running. We can leave the next step out,
122 but then we will not be able to use GNUnet's name resolution in external
123 applications.</b></p>
124
125 <p>We save a copy of the original file and then modify the line using sed:</p>
126
127 <code>
128 $ sudo cp /etc/nsswitch.conf /etc/nsswitch.conf.original<br>
129 $ sudo sed -i -E 's/^(hosts:.*) dns/\1 gns [NOTFOUND=return] dns/' /etc/nsswitch.conf
130 </code>
131
132 <p>Now in the line starting with "hosts" should contain an entry "gns [NOTFOUND=return]" before the "dns" entry like this:</p>
133
134 <code>
135 hosts: files mdns4_minimal [NOTFOUND=return] gns [NOTFOUND=return] dns
136 </code>
137
138 <p>That's it. It wasn't that nasty, was it?</p>
139-->
140</section>
141<section>
142 <h3>{{ _("Configuration") }}</h3>
143
144 <p>
145 Congratulations! GNUnet is now installed! Before we start it we
146 need to create a configuration file. By default GNUnet looks in
147 our home directory for the file `~/.config/gnunet.conf`. We can
148 start with an empty file for now:
149 </p>
150 <br />
151 <code>
152 $ touch ~/.config/gnunet.conf
153 </code>
154 <br />
155 <p>
156 It's reccomended that you increase your bandwidth restrictions
157 from the acutely low defaults. The example below sets the WAN
158 and LAN limits to the value "unlimited".
159 </p>
160 <br />
161 <code>
162 $ gnunet-config -s ats -o WAN_QUOTA_IN -V unlimited<br />
163 $ gnunet-config -s ats -o WAN_QUOTA_OUT -V unlimited<br />
164 $ gnunet-config -s ats -o LAN_QUOTA_IN -V unlimited<br />
165 $ gnunet-config -s ats -o LAN_QUOTA_OUT -V unlimited<br />
166 </code>
167 <br />
168 <p>
169 Now we can start it with the command line tool `gnunet-arm`
170 (Automatic Restart Manager).
171 </p>
172
173 <code>
174 $ gnunet-arm -s
175 </code>
176
177 <p>
178 It starts the default GNUnet services. We can list them with the `-I` option:
179 </p>
180
181 <code>
182 $ gnunet-arm -I<br>
183 Running services:<br>
184 ats (gnunet-service-ats)<br>
185 revocation (gnunet-service-revocation)<br>
186 set (gnunet-service-set)<br>
187 nat (gnunet-service-nat)<br>
188 transport (gnunet-service-transport)<br>
189 peerstore (gnunet-service-peerstore)<br>
190 hostlist (gnunet-daemon-hostlist)<br>
191 identity (gnunet-service-identity)<br>
192 namecache (gnunet-service-namecache)<br>
193 peerinfo (gnunet-service-peerinfo)<br>
194 datastore (gnunet-service-datastore)<br>
195 zonemaster (gnunet-service-zonemaster)<br>
196 zonemaster-monitor (gnunet-service-zonemaster-monitor)<br>
197 nse (gnunet-service-nse)<br>
198 cadet (gnunet-service-cadet)<br>
199 dht (gnunet-service-dht)<br>
200 core (gnunet-service-core)<br>
201 gns (gnunet-service-gns)<br>
202 statistics (gnunet-service-statistics)<br>
203 topology (gnunet-daemon-topology)<br>
204 fs (gnunet-service-fs)<br>
205 namestore (gnunet-service-namestore)<br>
206 vpn (gnunet-service-vpn)
207 </code>
208
209 <p>
210 For stopping GNUnet again we can use the `-e` option.
211 </p>
212
213 <code>
214 $ gnunet-arm -e
215 </code>
216</section>
217<section>
218 <h3>{{ _("Make sure it works") }}</h3>
219
220 <p>
221 Let's try out some of GNUnet's use cases. Some should be done before others:
222 </p>
223
224 <ul>
225 <li>filesharing</li>
226 <li>A simple chat using CADET</li>
227 <li>Name resolution using GNS on the command line</li>
228 <li>Name resolution using GNS with a browser (do it on the command line first)</li>
229 <li>Serving a website using VPN (do name resolution with a browser first)</li>
230 </ul>
231</section>
232<section>
233 <h4>{{ _("filesharing") }}</h4>
234
235 <p>
236 Let's publish a file in the GNUnet filesharing network. We use the keywords
237 ("commons" and "state") so other people will be able to search for the file.
238 </p>
239
240 <p>
241 We can choose any file and describe it with meaningful keywords (using the
242 `-k` command line option).
243 </p>
244
245 <code>
246 $ gnunet-publish -k commons -k state ostrom.pdf<br>
247 Publishing `/home/myself/ostrom.pdf' done.<br>
248 URI is `gnunet://fs/chk/M57SXDJ72EWS25CT6307KKJ8K0GCNSPTAZ649NA1NS10MJB4A1GZ9EN4Y02KST9VA5BHE8B335RPXQVBWVZ587Y83WQ7J3DHMBX30Q8.DHNGBN4CB2DBX1QRZ1R0B1Q18WTEAK4R94S9D57C9JMJJ3H7SSQDCV4D1218C4S2VP085AMQQSMG18FCP6NQMZQZJ91XR5NBX7YF0V0.42197237'.
249 </code>
250
251 <p>
252 Finding the file by keyword works with `gnunet-search`.
253 </p>
254
255 <code>
256 $ gnunet-search commons<br>
257 #1:<br>
258 gnunet-download -o "ostrom.pdf" gnunet://fs/chk/M57SXDJ72EWS25CT6307KKJ8K0GCNSPTAZ649NA1NS10MJB4A1GZ9EN4Y02KST9VA5BHE8B335RPXQVBWVZ587Y83WQ7J3DHMBX30Q8.DHNGBN4CB2DBX1QRZ1R0B1Q18WTEAK4R94S9D57C9JMJJ3H7SSQDCV4D1218C4S2VP085AMQQSMG18FCP6NQMZQZJ91XR5NBX7YF0V0.42197237
259 </code>
260
261 <p>
262 It gives us the command line call to download the file (and store it as
263 ostrom.pdf)!
264 </p>
265</section>
266<section>
267 <h4>{{ _("CADET (and Chat)") }}</h4>
268
269 <p>
270 We can use the `gnunet-cadet` command line tool to open a port and from
271 another machine connect to this port and chat or transfer data. First we need
272 our *peer ID* of the GNUnet peer opening the port.
273 </p>
274
275 <code>
276 $ gnunet-peerinfo -s<br>
277 I am peer `P4T5GHS1PCZ06R82D3KW8Z8J1113BQZWAWGYHTZ8G1ZXMWXQGAVG'.
278 </code>
279
280 <p>
281 Now we open the port (it can be any string!):
282 </p>
283
284 <code>
285 $ gnunet-cadet -o my-secret-port
286 </code>
287
288 <p>On the other machine we can connect using the peer ID and the port and start chatting!</p>
289
290 <code>
291 $ gnunet-cadet P4T5GHS1PCZ06R82D3KW8Z8J1113BQZWAWGYHTZ8G1ZXMWXQGAVG my-secret-port
292 </code>
293</section>
294<section>
295 <h4>{{ _("Name resolution using GNS on the command line") }}</h4>
296
297 <p>GNS is the GNU name service, a fully decentralized alternatice to DNS. We'll publish an IP address in a GNS record try to resolve it on the command line. First we need an identity which is the
298 equivalent to a zone in DNS. We'll call it "myself" and create it using the
299 `gnunet-identity` command line tool. Instead of "myself" you can surely use your
300 nick or any other name. </p>
301
302 <code>
303 $ gnunet-identity -C myself
304 </code>
305
306 <p>We can check if it worked using the same tool. We expect the name of our identity and the corresponding public key to be displayed.</p>
307
308 <code>
309 $ gnunet-identity -d<br>
310 myself - HWTYD3P5D77JVFNVMZ1M5T10V4SZYNMY3PCGQCSVENKD6ZCRKPMG
311 </code>
312
313 <p>
314 Now we add a public `A` record to our zone. It has the name "ccc", a value
315 of "195.54.164.39" and it expires after one day.
316 </p>
317
318 <code>
319 $ gnunet-namestore -z myself -a -e "1 d" -p -t A -n ccc -V 195.54.164.39
320 </code>
321
322 <p>Now we can query that record using the command line tool `gnunet-gns`.</p>
323
324 <code>
325 $ gnunet-gns -t A -u ccc.myself<br>
326 ccc.myself:<br>
327 Got `A' record: 195.54.164.39
328 </code>
329
330 <p>
331 So it worked! But only resolving our own records is boring. So we
332 can give our identity (the public key of it to be precise) to
333 someone else so they can try to resolve our records, too. The
334 other person (Bob) has to add it to his namestore like this:
335 </p>
336
337 <code>
338 $ gnunet-namestore -z myself -a -e never -p -t PKEY -n alice -V HWTYD3P5D77JVFNVMZ1M5T10V4SZYNMY3PCGQCSVENKD6ZCRKPMG
339 </code>
340
341 <p>
342 Our identity in Bobs namestore is a public record (-p) and never
343 expires (-e never). Now Bob (let's assume he has called his
344 identity myself, too) should be able to resolve our "ccc" record,
345 too!
346 </p>
347
348 <code>
349 $ gnunet-gns -t A -u ccc.alice.myself<br>
350 ccc.alice.myself:<br>
351 Got `A' record: 195.54.164.39
352 </code>
353
354 <p>
355 It can continue like this. A friend of Bob would be able to
356 resolve our records too because Bob published our identity in a
357 public record. Bobs friend would simply use "ccc.alice.bob.myself"
358 to resolve our "ccc" record.
359 </p>
360</section>
361<section>
362 <h4>{{ _("Name resolution using GNS with a browser") }}</h4>
363
364 <p>
365 In the previous use case "Name resolution using GNS on the command line" we got an idea
366 about what GNS is about, but now let's use it with a browser, to make it actually useful. Currently Firefox and Chromium are known to work.
367 </p>
368
369 <p>
370 Many websites enforce HTTPS and thus provide certificates for
371 their hostnames (and not our GNS names). Browsers don't like wrong
372 hostnames in certificates and will present error messages. So GNUnet
373 has to trick them by generating own certificates for our GNS
374 names. This means we need to create our own certificate authority
375 and tell our browser about it. Luckily there's a script for it:
376 </p>
377
378 <code>
379 $ gnunet-gns-proxy-setup-ca
380 </code>
381
382 <p>After executing this script the Browser has to be restarted.</p>
383
384 <p>
385 GNUnet provides a proxy service (gnunet-gns-proxy) that the
386 browser can send DNS and HTTP traffic to. It will try to resolve
387 names with GNS first and forward the rest of the DNS traffic to
388 the system's DNS resolver. It will also take care of the HTTP
389 traffic, so the browser gets valid certificates and the web server
390 will not be confused by our GNS hostnames. Our GNS namestore
391 doesn't know about any DNS hostnames yet, so we have to store
392 them, too. For our "ccc" A record, we have to store a LEHO (legacy
393 hostname) record, too. It must contain the website's original DNS
394 hostname:
395 </p>
396
397 <code>
398 $ gnunet-namestore -z myself -a -e "1 d" -p -t LEHO -n ccc -V www.ccc.de
399 </code>
400
401 <p>Now let's start gnunet-gns-proxy.</p>
402
403 <code>
404 $ /usr/lib/gnunet/libexec/gnunet-gns-proxy
405 </code>
406
407 <p>
408 Our browser has to be configured so it uses our proxy. In Firefox
409 we have to set these options under "about:config":
410 </p>
411
412 <code>
413 network.proxy.socks: localhost<br>
414 network.proxy.socks_port: 7777<br>
415 network.proxy.socks_remote_dns true<br>
416 network.proxy.type: 1
417 </code>
418
419 <p>
420 To tell Chromium to use the proxy, it has to be started with the
421 "--proxy-server" command line option:
422 </p>
423
424 <code>
425 $ chromium --proxy-server="socks5://127.0.0.1:7777"
426 </code>
427
428 <p>
429 Now we should be able to resolve our GNS names in the browser! We
430 just have to type "https://ccc.myself" into the address bar. If
431 our friend Bob prepared his system, too, he can resolve our record
432 by typing "ccc.alice.myself".
433 </p>
434</section>
435<section>
436 <h4>{{ _("VPN") }}</h4>
437
438 <p>
439 TBD
440 </p>
441</section>
442<section>
443 <h3>{{ _("Uninstall GNUnet and its dependencies") }}</h3>
444
445 <code>
446 $ cd ~/gnunet_installation/gnunet<br>
447 $ sudo make uninstall<br>
448 $ cd ~/gnunet_installation/libmicrohttpd<br>
449 $ sudo make uninstall<br>
450 $ sudo apt remove git libtool autoconf autopoint build-essential libgcrypt-dev libidn11-dev zlib1g-dev libunistring-dev libglpk-dev miniupnpc libextractor-dev libjansson-dev libcurl4-gnutls-dev libsqlite3-dev<br>
451 $ sudo apt autoremove<br>
452 $ sudo userdel -r gnunet<br>
453 $ sudo groupdel gnunet<br>
454 $ sudo groupdel gnunetdns<br>
455 $ sudo mv /etc/nsswitch.conf.original /etc/nsswitch.conf<br>
456 $ sudo rm /lib/$(uname -m)-linux-gnu/libnss_gns.so.2
457 </code>
458</section>
459<section>
460 <h3>{{ _("Appendix A: Optional GNUnet features") }}</h3>
461
462 <p>
463 TBD
464 </p>
465</section>
466<section>
467 <h3>{{ _("Troubleshooting") }}</h3>
468</section>
469<section>
470 <h4>{{ _("You can't reach other people's nodes") }}</h4>
471
472 <p>
473 Should our computer not have reached the open GNUnet network automatically,
474 we can manually instruct our node how to reach the nodes of our friends. This
475 works by exchanging HELLO strings. This is how we get a hello string for our
476 computer.
477 </p>
478
479 <code>
480 $ gnunet-peerinfo -gn
481 </code>
482
483 <p>
484 We can now pass this string to our friends "out of band" (using whatever
485 existing chat or messaging technology). If the string contains some private IP
486 networks we don't want to share, we can carefully edit them out.
487 </p>
488
489 <p>
490 Once we receive such strings from our friends, we can add them like
491 this:
492 </p>
493
494 <code>
495 gnunet-peerinfo -p <string>
496 </code>
497
498 <p>Now our GNUnet nodes can attempt reaching each other directly. This may
499 still fail due to NAT traversal issues.</p>
500
501 <!--<h4>{{ _("OMG you guys broke my internet") }}</h4>
502
503 <p>We can replace `/etc/nsswitch.conf` with the backup we made earlier
504 (`/etc/nsswitch.conf.original`). Now DNS resolution should work again without a
505 running GNUnet.</p>
506
507 <code>
508 $ cp /etc/nsswitch.conf.original /etc/nsswitch.conf
509 </code>-->
510</section>
511</article>
512{% endblock body_content %}