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