Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / doc / documentation / chapters / installation.texi
1 @node GNUnet Installation Handbook
2 @chapter GNUnet Installation Handbook
3
4 This handbook describes how to install (build setup, compilation) and
5 setup (configuration, start) GNUnet 0.10.x. After following these
6 instructions you should be able to install and then start user-interfaces
7 to interact with the network.
8
9 This manual is far from complete, and we welcome informed contributions,
10 be it in the form of new chapters or insightful comments.
11
12 @menu
13 * Dependencies::
14 * Pre-installation notes::
15 * Generic installation instructions::
16 * Build instructions for Ubuntu 12.04 using Git::
17 * Build Instructions for Microsoft Windows Platforms::
18 * Build instructions for Debian 7.5::
19 * Installing GNUnet from Git on Ubuntu 14.4::
20 * Build instructions for Debian 8::
21 * Outdated build instructions for previous revisions::
22 @c * Portable GNUnet::
23 * The graphical configuration interface::
24 * How to start and stop a GNUnet peer::
25 @end menu
26
27 @node Dependencies
28 @section Dependencies
29 @c %**end of header
30
31 This section lists the various known dependencies for
32 GNUnet @value{EDITION}.
33 Suggestions for missing dependencies or wrong version numbers are welcome.
34
35 @menu
36 * External dependencies::
37 * Fixing libgnurl build issues::
38 * Optional dependencies::
39 * Internal dependencies::
40 @end menu
41
42 @node External dependencies
43 @subsection External dependencies
44 @c %**end of header
45
46 These packages must be installed before a typical GNUnet installation
47 can be performed:
48
49 @itemize @bullet
50 @item autoconf
51 @item automake
52 @item pkg-config
53 @item libltdl
54 @item gstreamer
55 @item gst-plugins-base
56 @item perl
57 @item python (only 2.7 supported)@footnote{tests and gnunet-qr}
58 @item jansson
59 @item nss
60 @item glib
61 @item gmp
62 @item bluez
63 @item miniupnpc
64 @item gettext
65 @item which
66 @item texinfo
67 @item GNU libmicrohttpd @geq{} 0.9.30 @footnote{We recommend to build it
68 with a GnuTLS version that was configured with libunbound}
69 @item GNU libextractor @geq{} 1.0
70 @item GNU libtool @geq{} 2.2
71 @item GNU libunistring @geq{} 0.9.1.1
72 @item GNU libidn @geq{} 1.0.0
73 @item @uref{https://gnupg.org/software/libgcrypt/, GNU libgcrypt} @geq{}
74 @uref{https://gnupg.org/ftp/gcrypt/libgcrypt/, 1.6.0}
75 @item @uref{https://gnutls.org/, GnuTLS} @geq{} 3.2.7
76 @footnote{We recommend to compile with libunbound for DANE support;
77 GnuTLS also requires GNU nettle 2.7 (update: GnuTLS 3.2.7 appears NOT
78 to work against GNU nettle > 2.7, due to some API updatings done by
79 nettle. Thus it should be compiled against nettle 2.7
80 and, in case you get some error on the reference to `rpl_strerror' being
81 undefined, follow the instructions on
82 @uref{http://lists.gnupg.org/pipermail/gnutls-devel/2013-November/006588.html, this}
83 post (and the link inside it)).}
84 @item @uref{https://gnunet.org/gnurl, gnURL} libgnurl @geq{} 7.34.0
85 @footnote{must be compiled after @code{GnuTLS}}
86 @item libglpk @geq{} 4.45
87 @item @uref{http://www.openssl.org/, OpenSSL} @geq{} 1.0
88 @item TeX Live @geq{} 2012, optional (for gnunet-bcd)
89 @item Texinfo @geq{} 5.2 (for documentation)
90 @item libsqlite @geq{} 3.8.0 @footnote{(note that the code will
91 compile and often work with lower version numbers, but you may get subtle
92 bugs with respect to quota management in certain rare cases);
93 alternatively, MySQL or Postgres can also be installed, but those
94 databases will require more complex configurations (not
95 recommended for first-time users)}
96 @item zlib
97 @end itemize
98
99 @node Fixing libgnurl build issues
100 @subsection Fixing libgnurl build issues
101
102 If you have to compile libgnurl from source since the version included in
103 your distribution is to old you perhaps get an error message while
104 running the @file{configure} script:
105
106 @example
107 $ configure
108 ...
109 checking for 64-bit curl_off_t data type... unknown
110 checking for 32-bit curl_off_t data type... unknown
111 checking for 16-bit curl_off_t data type... unknown
112 configure: error: cannot find data type for curl_off_t.
113 @end example
114
115 @noindent
116 Solution:
117
118 Before running the configure script, set:
119
120 @example
121 CFLAGS="-I. -I$BUILD_ROOT/include"
122 @end example
123
124 @node Optional dependencies
125 @subsection Optional dependencies
126
127 These applications must be installed for various experimental or otherwise
128 optional features such as @code{gnunet-conversation}, @code{gnunet-gtk}.
129
130 @itemize @bullet
131 @item libpulse 2.0 or higher, optional (for gnunet-conversation)
132 @item libopus 1.0.1 or higher, optional (for gnunet-conversation)
133 @item libogg 1.3.0 or higher, optional (for gnunet-conversation)
134 @item certool (binary) optional @footnote{for convenient installation of
135 the GNS proxy (available as part of Debian's libnss3-tools)}
136 @item python-zbar 0.10 or higher, optional (for gnunet-qr)
137 @item Gtk+ 3.0 or higher, optional (for gnunet-gtk)
138 @item libgladeui must match Gtk+ version, optional (for gnunet-gtk)
139 @item libqrencode 3.0 or higher, optional (for gnunet-namestore-gtk)
140 @end itemize
141
142 @node Internal dependencies
143 @subsection Internal dependencies
144
145 This section tries to give an overview of what processes a typical GNUnet
146 peer running a particular application would consist of. All of the
147 processes listed here should be automatically started by
148 @code{gnunet-arm -s}.
149 The list is given as a rough first guide to users for failure diagnostics.
150 Ideally, end-users should never have to worry about these internal
151 dependencies. 
152 In terms of internal dependencies, a minimum file-sharing system consists
153 of the following GNUnet processes (in order of dependency):
154
155 @itemize @bullet
156 @item gnunet-service-arm
157 @item gnunet-service-resolver (required by all)
158 @item gnunet-service-statistics (required by all)
159 @item gnunet-service-peerinfo
160 @item gnunet-service-transport (requires peerinfo)
161 @item gnunet-service-core (requires transport)
162 @item gnunet-daemon-hostlist (requires core)
163 @item gnunet-daemon-topology (requires hostlist, peerinfo)
164 @item gnunet-service-datastore
165 @item gnunet-service-dht (requires core)
166 @item gnunet-service-identity
167 @item gnunet-service-fs (requires identity, mesh, dht, datastore, core)
168 @end itemize
169
170 @noindent
171 A minimum VPN system consists of the following GNUnet processes (in
172 order of dependency):
173
174 @itemize @bullet
175 @item gnunet-service-arm
176 @item gnunet-service-resolver (required by all)
177 @item gnunet-service-statistics (required by all)
178 @item gnunet-service-peerinfo
179 @item gnunet-service-transport (requires peerinfo)
180 @item gnunet-service-core (requires transport)
181 @item gnunet-daemon-hostlist (requires core)
182 @item gnunet-service-dht (requires core)
183 @item gnunet-service-mesh (requires dht, core)
184 @item gnunet-service-dns (requires dht)
185 @item gnunet-service-regex (requires dht)
186 @item gnunet-service-vpn (requires regex, dns, mesh, dht)
187 @end itemize
188
189 @noindent
190 A minimum GNS system consists of the following GNUnet processes (in
191 order of dependency):
192
193 @itemize @bullet
194 @item gnunet-service-arm
195 @item gnunet-service-resolver (required by all)
196 @item gnunet-service-statistics (required by all)
197 @item gnunet-service-peerinfo
198 @item gnunet-service-transport (requires peerinfo)
199 @item gnunet-service-core (requires transport)
200 @item gnunet-daemon-hostlist (requires core)
201 @item gnunet-service-dht (requires core)
202 @item gnunet-service-mesh (requires dht, core)
203 @item gnunet-service-dns (requires dht)
204 @item gnunet-service-regex (requires dht)
205 @item gnunet-service-vpn (requires regex, dns, mesh, dht)
206 @item gnunet-service-identity
207 @item gnunet-service-namestore (requires identity)
208 @item gnunet-service-gns (requires vpn, dns, dht, namestore, identity)
209 @end itemize
210
211 @node Pre-installation notes
212 @section Pre-installation notes
213
214 Please note that in the code instructions for the installation,
215 @emph{#} indicates commands run as privileged root user and
216 @emph{$} shows commands run as unprivileged ("normal") system user.
217
218
219 @node Generic installation instructions
220 @section Generic installation instructions
221
222 First, in addition to the GNUnet sources you might require downloading the
223 latest version of various dependencies, depending on how recent the
224 software versions in your distribution of GNU/Linux are.
225 Most distributions do not include sufficiently recent versions of these
226 dependencies.
227 Thus, a typically installation on a "modern" GNU/Linux distribution
228 requires you to install the following dependencies (ideally in this
229 order):
230
231 @itemize @bullet
232 @item libgpgerror and libgcrypt
233 @item libnettle and libunbound (possibly from distribution), GnuTLS
234 @item libgnurl (read the README)
235 @item GNU libmicrohttpd
236 @item GNU libextractor
237 @end itemize
238
239 Make sure to first install the various mandatory and optional
240 dependencies including development headers from your distribution.
241
242 Other dependencies that you should strongly consider to install is a
243 database (MySQL, sqlite or Postgres).
244 The following instructions will assume that you installed at least sqlite.
245 For most distributions you should be able to find pre-build packages for
246 the database. Again, make sure to install the client libraries and the
247 respective development headers (if they are packaged separately) as well.
248
249 You can find specific, detailed instructions for installing of the
250 dependencies (and possibly the rest of the GNUnet installation) in the
251 platform-specific descriptions, which can be found in the Index.
252 Please consult them now.
253 If your distribution is not listed, please study the instructions for
254 Debian stable carefully as you try to install the dependencies for your
255 own distribution.
256 Contributing additional instructions for further platforms is always
257 appreciated.
258 Please take in mind that operating system development tends to move at
259 a rather fast speed. Due to this you should be aware that some of
260 the instructionss could be outdated by the time you are reading this.
261 If you find a mistake, please tell us about it (or even better: send
262 a patch to the documentation to fix it!).
263
264 Before proceeding further, please double-check the dependency list.
265 Note that in addition to satisfying the dependencies, you might have to
266 make sure that development headers for the various libraries are also
267 installed.
268 There maybe files for other distributions, or you might be able to find
269 equivalent packages for your distribution.
270
271 While it is possible to build and install GNUnet without having root
272 access, we will assume that you have full control over your system in
273 these instructions.
274 First, you should create a system user @emph{gnunet} and an additional
275 group @emph{gnunetdns}. On Debian and Ubuntu GNU/Linux, type:
276
277 @example
278 # adduser --system --home /var/lib/gnunet --group \
279 --disabled-password gnunet
280 # addgroup --system gnunetdns
281 @end example
282
283 @noindent
284 On other Unixes, this should have the same effect:
285
286 @example
287 # useradd --system --groups gnunet --home-dir /var/lib/gnunet
288 # addgroup --system gnunetdns
289 @end example
290
291 Now compile and install GNUnet using:
292
293 @example
294 $ tar xvf gnunet-0.10.?.tar.gz
295 $ cd gnunet-0.10.?
296 $ ./configure --with-sudo=sudo --with-nssdir=/lib
297 $ make
298 $ sudo make install
299 @end example
300
301 If you want to be able to enable DEBUG-level log messages, add
302 @code{--enable-logging=verbose} to the end of the
303 @code{./configure} command.
304 DEBUG-level log messages are in English-only and should only be useful for
305 developers (or for filing really detailed bug reports). 
306
307 Finally, you probably want to compile @code{gnunet-gtk}, which
308 includes gnunet-setup (graphical tool for configuration)
309 and @code{gnunet-fs-gtk} (graphical tool for file-sharing):
310
311 @example
312 $ tar xvf gnunet-gtk-0.10.?.tar.gz
313 $ cd gnunet-gtk-0.10.?
314 $ ./configure --with-gnunet=/usr/local/
315 $ make
316 $ sudo make install
317 $ cd ..
318 # just to be safe run this:
319 $ sudo ldconfig
320 @end example
321
322 @noindent
323 Next, edit the file @file{/etc/gnunet.conf} to contain the following:
324
325 @example
326 [arm]
327 SYSTEM_ONLY = YES
328 USER_ONLY = NO
329 @end example
330
331 @noindent
332 You may need to update your ld.so cache to include files installed in
333 @file{/usr/local/lib}:
334
335 @example
336 # ldconfig
337 @end example
338
339 @noindent
340 Then, switch from user root to user gnunet to start the peer:
341
342 @example
343 # su -s /bin/sh - gnunet
344 $ gnunet-arm -c /etc/gnunet.conf -s
345 @end example
346
347 You may also want to add the last line in the gnunet users @file{crontab}
348 prefixed with @code{@@reboot} so that it is executed whenever the system
349 is booted:
350
351 @example
352 @@reboot /usr/local/bin/gnunet-arm -c /etc/gnunet.conf -s@
353 @end example
354
355 @noindent
356 This will only start the system-wide GNUnet services.
357 Type exit to get back your root shell.
358 Now, you need to configure the per-user part. For each
359 $USER on the system, run:
360
361 @example
362 # adduser $USER gnunet
363 @end example
364
365 @noindent
366 to allow them to access the system-wide GNUnet services. Then, each
367 user should create a configuration file @file{~/.config/gnunet.conf}
368 with the lines:
369
370 @example
371 [arm]
372 SYSTEM_ONLY = NO
373 USER_ONLY = YES
374 DEFAULTSERVICES = gns
375 @end example
376
377 @noindent
378 and start the per-user services using
379
380 @example
381 $ gnunet-arm -c ~/.config/gnunet.conf -s
382 @end example
383
384 @noindent
385 Again, adding a @code{crontab} entry to autostart the peer is advised:
386
387 @example
388 @@reboot /usr/local/bin/gnunet-arm -c $HOME/.config/gnunet.conf -s
389 @end example
390
391 @noindent
392 Note that some GNUnet services (such as SOCKS5 proxies) may need a
393 system-wide TCP port for each user.
394 For those services, systems with more than one user may require each user
395 to specify a different port number in their personal configuration file.
396
397 Finally, the user should perform the basic initial setup for the GNU Name
398 System. This is done by running two commands:
399
400 @example
401 $ gnunet-gns-import.sh
402 $ gnunet-gns-proxy-setup-ca
403 @end example
404
405 @noindent
406 The first generates the default zones, wheras the second setups the GNS
407 Certificate Authority with the user's browser. Now, to actiave GNS in the
408 normal DNS resolution process, you need to edit your
409 @file{/etc/nsswitch.conf} where you should find a line like this:
410
411 @example
412 hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
413 @end example
414
415 @noindent
416 The exact details may differ a bit, which is fine. Add the text
417 @emph{"gns [NOTFOUND=return]"} after @emph{"files"}.
418 Keep in mind that we included a backslash ("\") here just for
419 markup reasons. You should write the text below on @b{one line}
420 and @b{without} the "\":
421
422 @example
423 hosts: files gns [NOTFOUND=return] mdns4_minimal \
424 [NOTFOUND=return] dns mdns4
425 @end example
426
427 @c FIXME: Document new behavior.
428 You might want to make sure that @file{/lib/libnss_gns.so.2} exists on
429 your system, it should have been created during the installation. 
430
431 @node Build instructions for Ubuntu 12.04 using Git
432 @section Build instructions for Ubuntu 12.04 using Git
433
434
435 @menu
436 * Install the required build tools::
437 * Install libgcrypt 1.6 and libgpg-error::
438 * Install gnutls with DANE support::
439 * Install libgnurl::
440 * Install libmicrohttpd from Git::
441 * Install libextractor from Git::
442 * Install GNUnet dependencies::
443 * Build GNUnet::
444 * Install the GNUnet-gtk user interface from Git::
445 @end menu
446
447 @node  Install the required build tools
448 @subsection  Install the required build tools
449
450 First, make sure Git is installed on your system:
451
452 @example
453 $ sudo apt-get install git
454 @end example
455
456 Install the essential buildtools:
457
458 @example
459 $ sudo apt-get install automake autopoint autoconf libtool
460 @end example
461
462 @node Install libgcrypt 1.6 and libgpg-error
463 @subsection Install libgcrypt 1.6 and libgpg-error
464
465 @example
466 $ wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.bz2
467 $ tar xf libgpg-error-1.12.tar.bz2
468 $ cd libgpg-error-1.12
469 $ ./configure
470 $ sudo make install ; cd ..
471 @end example
472
473 @node Install gnutls with DANE support
474 @subsection Install gnutls with DANE support
475
476 @example
477 $ wget http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz
478 $ tar xf nettle-2.7.1.tar.gz
479 $ cd nettle-2.7.1
480 $ ./configure
481 $ sudo make install ; cd ..
482 @end example
483
484 @example
485 $ wget https://www.nlnetlabs.nl/downloads/ldns/ldns-1.6.16.tar.gz
486 $ tar xf ldns-1.6.16.tar.gz
487 $ cd ldns-1.6.16
488 $ ./configure
489 $ sudo make install ; cd ..
490 @end example
491
492 @example
493 $ wget https://unbound.net/downloads/unbound-1.4.21.tar.gz
494 $ tar xf unbound-1.4.21.tar.gz
495 $ cd unbound-1.4.21
496 $ ./configure
497 $ sudo make install ; cd ..
498 @end example
499
500 @example
501 $ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.17.tar.xz
502 $ tar xf gnutls-3.1.17.tar.xz
503 $ cd gnutls-3.1.17
504 $ ./configure
505 $ sudo make install ; cd ..
506 @end example
507
508 @example
509 $ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.0.tar.bz2
510 $ tar xf libgcrypt-1.6.0.tar.bz2
511 $ cd libgcrypt-1.6.0
512 $ ./configure
513 $ sudo make install ; cd ..
514 @end example
515
516 @node Install libgnurl
517 @subsection Install libgnurl
518
519 @example
520 $ wget https://gnunet.org/sites/default/files/gnurl-7.34.0.tar.bz2
521 $ tar xf gnurl-7.34.0.tar.bz2
522 $ cd gnurl-7.34.0
523 $ ./configure --enable-ipv6 --with-gnutls --without-libssh2 \
524   --without-libmetalink --without-winidn --without-librtmp \
525   --without-nghttp2 --without-nss --without-cyassl \
526   --without-polarssl --without-ssl --without-winssl \
527   --without-darwinssl --disable-sspi --disable-ntlm-wb \
528   --disable-ldap --disable-rtsp --disable-dict --disable-telnet \
529   --disable-tftp --disable-pop3 --disable-imap --disable-smtp \
530   --disable-gopher --disable-file --disable-ftp
531 $ sudo make install ; cd ..
532 @end example
533
534 @node Install libmicrohttpd from Git
535 @subsection Install libmicrohttpd from Git
536
537 @example
538 $ git clone https://gnunet.org/git/libmicrohttpd
539 $ cd libmicrohttpd/
540 $ ./bootstrap
541 $ ./configure
542 $ sudo make install ; cd ..
543 @end example
544
545 @node  Install libextractor from Git
546 @subsection  Install libextractor from Git
547
548 Install libextractor dependencies:
549
550 @example
551 $ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \
552  libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \
553  libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \
554  g++
555 @end example
556
557 Build libextractor:
558
559 @example
560 $ git clone https://gnunet.org/git/libextractor
561 $ cd libextractor
562 $ ./bootstrap
563 $ ./configure
564 $ sudo make install ; cd ..
565 @end example
566
567 @node Install GNUnet dependencies
568 @subsection Install GNUnet dependencies
569
570 @example
571 $ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \
572  libpulse-dev libbluetooth-dev libsqlite-dev
573 @end example
574
575 Install libopus:
576
577 @example
578 $ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
579 $ tar xf opus-1.1.tar.gz
580 $ cd opus-1.1/
581 $ ./configure
582 $ sudo make install ; cd ..
583 @end example
584
585 Choose one or more database backends:
586
587 SQLite3:
588 @example
589 $ sudo apt-get install libsqlite3-dev
590 @end example
591 MySQL:
592 @example
593 $ sudo apt-get install libmysqlclient-dev
594 @end example
595 PostgreSQL:
596 @example
597 $ sudo apt-get install libpq-dev postgresql
598 @end example
599
600
601
602 @node Build GNUnet
603 @subsection Build GNUnet
604
605
606
607 @menu
608 * Configuring the installation path::
609 * Configuring the system::
610 * Installing components requiring sudo permission::
611 * Build::
612 @end menu
613
614 @node Configuring the installation path
615 @subsubsection Configuring the installation path
616
617 You can specify the location of the GNUnet installation by setting the
618 prefix when calling the configure script with @code{--prefix=DIRECTORY}
619
620 @example
621 $ export PATH=$PATH:DIRECTORY/bin
622 @end example
623
624 @node Configuring the system
625 @subsubsection Configuring the system
626
627 Please make sure NOW that you have created a user and group 'gnunet'
628 and additionally a group 'gnunetdns':
629
630 @example
631 $ sudo addgroup gnunet
632 $ sudo addgroup gnunetdns
633 $ sudo adduser gnunet
634 @end example
635
636 Each GNUnet user should be added to the 'gnunet' group (may
637 require fresh login to come into effect):
638
639 @example
640 $ sudo useradd -G  gnunet
641 @end example
642
643 @node Installing components requiring sudo permission
644 @subsubsection Installing components requiring sudo permission
645
646 Some components, like the nss plugin required for GNS, may require root
647 permissions. To allow these few components to be installed use:
648
649 @example
650 $ ./configure --with-sudo
651 @end example
652
653 @node Build
654 @subsubsection Build
655
656 @example
657 $ git clone https://gnunet.org/git/gnunet/
658 $ cd gnunet/
659 $ ./bootstrap
660 @end example
661
662 Use the required configure call including the optional installation prefix
663 PREFIX or the sudo permissions:
664
665 @example
666 $ ./configure [ --with-sudo | --with-prefix=PREFIX ]
667 @end example
668
669 @example
670 $ make; sudo make install
671 @end example
672
673 After installing it, you need to create an empty configuration file:
674
675 @example
676 mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf
677 @end example
678
679 And finally you can start GNUnet with:
680
681 @example
682 $ gnunet-arm -s
683 @end example
684
685 @node Install the GNUnet-gtk user interface from Git
686 @subsection Install the GNUnet-gtk user interface from Git
687
688
689 Install depencies:
690
691 @example
692 $ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \
693 libqrencode-dev
694 @end example
695
696 To build GNUnet (with an optional prefix)and execute:
697
698 @example
699 $ git clone https://gnunet.org/git/gnunet-gtk/
700 $ cd gnunet-gtk/
701 $ ./bootstrap
702 $ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY
703 $ make; sudo make install
704 @end example
705
706 @node Build Instructions for Microsoft Windows Platforms
707 @section Build Instructions for Microsoft Windows Platforms
708
709 @menu
710 * Introduction to building on MS Windows::
711 * Requirements::
712 * Dependencies & Initial Setup::
713 * GNUnet Installation::
714 * Adjusting Windows for running and testing GNUnet::
715 * Building the GNUnet Installer::
716 * Using GNUnet with Netbeans on Windows::
717 @end menu
718
719 @node Introduction to building on MS Windows
720 @subsection Introduction to building on MS Windows
721
722
723 This document is a guide to building GNUnet and its dependencies on
724 Windows platforms. GNUnet development is mostly done under GNU/Linux and
725 especially git checkouts may not build out of the box.
726 We regret any inconvenience, and if you have problems, please report
727 them.
728
729 @node Requirements
730 @subsection Requirements
731
732 The Howto is based upon a @strong{Windows Server 2008 32bit}
733 @strong{Installation}, @strong{sbuild} and thus a
734 @uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW}
735 (W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild
736 is a convenient set of scripts which creates a working msys/mingw
737 installation and installs most dependencies required for GNUnet.
738
739 As of the point of the creation of these instructions,
740 GNUnet @strong{requires} a Windows @strong{Server} 2003 or
741 newer for full feature support.
742 Windows Vista and later will also work, but
743 @strong{non-server version can not run a VPN-Exit-Node} as the NAT
744 features have been removed as of Windows Vista.
745
746 @node Dependencies & Initial Setup
747 @subsection Dependencies & Initial Setup
748
749
750 @itemize @bullet
751
752 @item
753 Install a fresh version of @strong{Python 2.x}, even if you are using a
754 x64-OS, install a 32-bit version for use with sbuild.
755 Python 3.0 currently is incompatible.
756
757 @item
758 Install your favorite @uref{http://code.google.com/p/tortoisegit/, GIT} &
759 @uref{http://tortoisesvn.net/, SVN}-clients.
760
761 @item
762 You will also need some archive-manager like
763 @uref{http://www.7-zip.org/, 7zip}.
764
765 @item
766 Pull a copy of sbuild to a directory of your choice, which will be used
767 in the remainder of this guide. For now, we will use
768 @file{c:\gnunet\sbuild\}
769
770 @item
771 in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages
772 @strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild
773 to compile/install those for us.
774
775 @item
776 Follow LRN's sbuild installation instructions.-
777 @end itemize
778
779 Please note that sbuild may (or will most likely) fail during
780 installation, thus you really HAVE to @strong{check the logfiles} created
781 during the installation process.
782 Certain packages may fail to build initially due to missing dependencies,
783 thus you may have to
784 @strong{substitute those with binary-versions initially}. Later on once
785 dependencies are satisfied you can re-build the newer package versions.
786
787 @strong{It is normal that you may have to repeat this step multiple times
788 and there is no uniform way to fix all compile-time issues, as the
789 build-process of many of the dependencies installed are rather unstable
790 on win32 and certain releases may not even compile at all.}
791
792 Most dependencies for GNUnet have been set up by sbuild, thus we now
793 should add the @file{bin/} directories in your new msys and mingw
794 installations to PATH. You will want to create a backup of your finished
795 msys-environment by now.
796
797 @node GNUnet Installation
798 @subsection GNUnet Installation
799
800 First, we need to launch our msys-shell, you can do this via
801
802 @file{C:\gnunet\sbuild\msys\msys.bat}
803
804 You might wish to take a look at this file and adjust some
805 login-parameters to your msys environment.
806
807 Also, sbuild added two pointpoints to your msys-environment, though those
808 might remain invisible:
809
810 @itemize @bullet
811
812 @item
813 /mingw, which will mount your mingw-directory from sbuild/mingw and the
814 other one is
815
816 @item
817 /src which contains all the installation sources sbuild just compiled.
818 @end itemize
819
820 Check out the current GNUnet sources (git HEAD) from the
821 GNUnet repository "gnunet.git", we will do this in your home directory:
822
823 @code{git clone https://gnunet.org/git/gnunet/ ~/gnunet}
824
825 Now, we will first need to bootstrap the checked out installation and then
826 configure it accordingly.
827
828 @example
829 cd ~/gnunet
830 ./bootstrap
831 STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \
832 ./configure --prefix=/ --docdir=/share/doc/gnunet \
833 --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \
834 --with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \
835 --with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \
836 --enable-expensivetests --enable-experimental --with-qrencode=/mingw \
837 --enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log
838 @end example
839
840 The parameters above will configure for a reasonable GNUnet installation
841 to the your msys-root directory.
842 Depending on which features your would like to build or you may need to
843 specify additional dependencies. Sbuild installed most libs into
844 the /mingw subdirectory, so remember to prefix library locations with
845 this path.
846
847 Like on a unixoid system, you might want to use your home directory as
848 prefix for your own GNUnet installation for development, without tainting
849 the buildenvironment. Just change the "prefix" parameter to point towards
850 ~/ in this case.
851
852 Now it's time to compile GNUnet as usual. Though this will take some time,
853 so you may fetch yourself a coffee or some Mate now...
854
855 @example
856 make ; make install
857 @end example
858
859 @node Adjusting Windows for running and testing GNUnet
860 @subsection Adjusting Windows for running and testing GNUnet
861
862 Assuming the build succeeded and you
863 @strong{added the bin directory of your GNUnet to PATH}, you can now use
864 your gnunet-installation as usual.
865 Remember that UAC or the windows firewall may popup initially, blocking
866 further execution of gnunet until you acknowledge them.
867
868 You will also have to take the usual steps to get peer-to-peer (p2p)
869 software running properly (port forwarding, ...),
870 and GNUnet will require administrative permissions as it may even
871 install a device-driver (in case you are using gnunet-vpn and/or
872 gnunet-exit).
873
874 @node Building the GNUnet Installer
875 @subsection Building the GNUnet Installer
876
877 The GNUnet installer is made with
878 @uref{http://nsis.sourceforge.net/, NSIS}.
879 The installer script is located in @file{contrib\win} in the
880 GNUnet source tree.
881
882 @node Using GNUnet with Netbeans on Windows
883 @subsection Using GNUnet with Netbeans on Windows
884
885 TODO
886
887 @node Build instructions for Debian 7.5
888 @section Build instructions for Debian 7.5
889
890
891 These are the installation instructions for Debian 7.5. They were tested
892 using a minimal, fresh Debian 7.5 AMD64 installation without non-free
893 software (no contrib or non-free).
894 By "minimal", we mean that during installation, we did not select any
895 desktop environment, servers or system utilities during the "tasksel"
896 step. Note that the packages and the dependencies that we will install
897 during this chapter take about 1.5 GB of disk space.
898 Combined with GNUnet and space for objects during compilation, you should
899 not even attempt this unless you have about 2.5 GB free after the minimal
900 Debian installation.
901 Using these instructions to build a VM image is likely to require a
902 minimum of 4-5 GB for the VM (as you will likely also want a desktop
903 manager).
904
905 GNUnet's security model assumes that your @file{/home} directory is
906 encrypted. Thus, if possible, you should encrypt your home partition
907 (or per-user home directory).
908
909 Naturally, the exact details of the starting state for your installation
910 should not matter much. For example, if you selected any of those
911 installation groups you might simply already have some of the necessary
912 packages installed.
913 We did this for testing, as this way we are less likely to forget to
914 mention a required package.
915 Note that we will not install a desktop environment, but of course you
916 will need to install one to use GNUnet's graphical user interfaces.
917 Thus, it is suggested that you simply install the desktop environment of
918 your choice before beginning with the instructions.
919
920
921
922 @menu
923 * Update::
924 * Stable? Hah!::
925 * Update again::
926 * Installing packages::
927 * Installing dependencies from source::
928 * Installing GNUnet from source::
929 * But wait there is more!::
930 @end menu
931
932 @node Update
933 @subsection Update
934
935 After any installation, you should begin by running
936
937 @example
938 # apt-get update ; apt-get upgrade
939 @end example
940
941 to ensure that all of your packages are up-to-date. Note that the "#" is
942 used to indicate that you need to type in this command as "root"
943 (or prefix with "sudo"), whereas "$" is used to indicate typing in a
944 command as a normal user.
945
946 @node Stable? Hah!
947 @subsection Stable? Hah!
948
949 Yes, we said we start with a Debian 7.5 "stable" system. However, to
950 reduce the amount of compilation by hand, we will begin by allowing the
951 installation of packages from the testing and unstable distributions as
952 well.
953 We will stick to "stable" packages where possible, but some packages will
954 be taken from the other distributions.
955 Start by modifying @file{/etc/apt/sources.list} to contain the
956 following (possibly adjusted to point to your mirror of choice):
957
958 @example
959 # These were there before:
960 deb http://ftp.de.debian.org/debian/ wheezy main
961 deb-src http://ftp.de.debian.org/debian/ wheezy main
962 deb http://security.debian.org/ wheezy/updates main
963 deb-src http://security.debian.org/ wheezy/updates main
964 deb http://ftp.de.debian.org/debian/ wheezy-updates main
965 deb-src http://ftp.de.debian.org/debian/ wheezy-updates main
966
967 # Add these lines (feel free to adjust the mirror):
968 deb http://ftp.de.debian.org/debian/ testing main
969 deb http://ftp.de.debian.org/debian/ unstable main
970 @end example
971
972 The next step is to create/edit your @file{/etc/apt/preferences}
973 file to look like this:
974
975 @example
976 Package: *
977 Pin: release a=stable,n=wheezy
978 Pin-Priority: 700
979
980 Package: *
981 Pin: release o=Debian,a=testing
982 Pin-Priority: 650
983
984 Package: *
985 Pin: release o=Debian,a=unstable
986 Pin-Priority: 600
987 @end example
988
989 You can read more about Apt Preferences here and here.
990 Note that other pinnings are likely to also work for GNUnet, the key
991 thing is that you need some packages from unstable (as shown below).
992 However, as unstable is unlikely to be comprehensive (missing packages)
993 or might be problematic (crashing packages), you probably want others
994 from stable and/or testing.
995
996 @node Update again
997 @subsection Update again
998
999 Now, run again@
1000
1001 @example
1002 # apt-get update@
1003 # apt-get upgrade@
1004 @end example
1005
1006 to ensure that all your new distribution indices are downloaded, and
1007 that your pinning is correct: the upgrade step should cause no changes
1008 at all.
1009
1010 @node Installing packages
1011 @subsection Installing packages
1012
1013 We begin by installing a few Debian packages from stable:@
1014
1015 @example
1016 # apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \
1017   libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \
1018   texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \
1019   libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \
1020   libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \
1021   librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \
1022   libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \
1023   libqrencode-dev libgladeui-dev nasm texlive-latex-extra \
1024   libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev
1025 @end example
1026
1027 After that, we install a few more packages from unstable:@
1028
1029 @example
1030 # apt-get install -t unstable nettle-dev libgstreamer1.0-dev \
1031   gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
1032   libgstreamer-plugins-base1.0-dev
1033 @end example
1034
1035 @node Installing dependencies from source
1036 @subsection Installing dependencies from source
1037
1038 Next, we need to install a few dependencies from source.
1039 You might want to do this as a "normal" user and only run the
1040 @code{make install} steps as root (hence the @code{sudo} in the
1041 commands below). Also, you do this from any
1042 directory. We begin by downloading all dependencies, then extracting the
1043 sources, and finally compiling and installing the libraries:@
1044
1045 @example
1046 $ wget https://libav.org/releases/libav-9.10.tar.xz
1047 $ wget http://ftp.gnu.org/gnu/libextractor/libextractor-1.3.tar.gz
1048 $ wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.bz2
1049 $ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.0.tar.bz2
1050 $ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz
1051 $ wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.33.tar.gz
1052 $ wget https://gnunet.org/sites/default/files/gnurl-7.34.0.tar.bz2
1053 $ tar xvf libextractor-1.3.tar.gz
1054 $ tar xvf libgpg-error-1.12.tar.bz2
1055 $ tar xvf libgcrypt-1.6.0.tar.bz2
1056 $ tar xvf gnutls-3.2.7.tar.xz
1057 $ tar xvf libmicrohttpd-0.9.33.tar.gz
1058 $ tar xvf gnurl-7.34.0.tar.bz2
1059 $ cd libav-0.9 ; ./configure --enable-shared;
1060 $ make; sudo make install; cd ..
1061 $ cd libextractor-1.3 ; ./configure;
1062 $ make ; sudo make install; cd ..
1063 $ cd libgpg-error-1.12; ./configure;
1064 $ make ; sudo make install; cd ..
1065 $ cd libgcrypt-1.6.0; ./configure --with-gpg-error-prefix=/usr/local;
1066 $ make ; sudo make install ; cd ..
1067 $ cd gnutls-3.2.7 ; ./configure;
1068 $ make ; sudo make install ; cd ..
1069 $ cd libmicrohttpd-0.9.33; ./configure;
1070 $ make ; sudo make install ; cd ..
1071 $ cd gnurl-7.34.0
1072 $ ./configure --enable-ipv6 --with-gnutls=/usr/local --without-libssh2 \
1073  --without-libmetalink --without-winidn --without-librtmp \
1074  --without-nghttp2 --without-nss --without-cyassl --without-polarssl \
1075  --without-ssl --without-winssl --without-darwinssl --disable-sspi \
1076  --disable-ntlm-wb --disable-ldap --disable-rtsp --disable-dict \
1077  --disable-telnet --disable-tftp --disable-pop3 --disable-imap \
1078  --disable-smtp --disable-gopher --disable-file --disable-ftp
1079 $ make ; sudo make install; cd ..
1080 @end example
1081
1082 @node Installing GNUnet from source
1083 @subsection Installing GNUnet from source
1084
1085
1086 For this, simply follow the generic installation instructions from
1087 here.
1088
1089 @node But wait there is more!
1090 @subsection But wait there is more!
1091
1092 So far, we installed all of the packages and dependencies required to
1093 ensure that all of GNUnet would be built.
1094 However, while for example the plugins to interact with the MySQL or
1095 Postgres databases have been created, we did not actually install or
1096 configure those databases. Thus, you will need to install
1097 and configure those databases or stick with the default Sqlite database.
1098 Sqlite is usually fine for most applications, but MySQL can offer better
1099 performance and Postgres better resillience.
1100
1101
1102 @node Installing GNUnet from Git on Ubuntu 14.4
1103 @section Installing GNUnet from Git on Ubuntu 14.4
1104
1105 @strong{Install the required build tools:}
1106
1107 @example
1108 $ sudo apt-get install git automake autopoint autoconf
1109 @end example
1110
1111 @strong{Install the required dependencies}
1112
1113 @example
1114 $ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \
1115  libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \
1116  libmicrohttpd-dev libgnutls28-dev
1117 @end example
1118
1119 @strong{Choose one or more database backends}
1120
1121 @itemize @bullet
1122
1123 @item SQLite3:
1124
1125 @example
1126 $ sudo apt-get install libsqlite3-dev
1127 @end example
1128
1129 @item MySQL:
1130
1131 @example
1132 $ sudo apt-get install libmysqlclient-dev
1133 @end example
1134
1135 @item PostgreSQL:
1136
1137 @example
1138 $ sudo apt-get install libpq-dev postgresql
1139 @end example
1140
1141 @end itemize
1142
1143 @strong{Install the optional dependencies for gnunet-conversation:}
1144
1145 @example
1146 $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
1147 @end example
1148
1149 @strong{Install the libgrypt 1.6.1:}
1150
1151 @itemize @bullet
1152
1153 @item For Ubuntu 14.04:
1154
1155 @example
1156 $ sudo apt-get install libgcrypt20-dev
1157 @end example
1158
1159 @item For Ubuntu older 14.04:
1160
1161 @example
1162 $ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2
1163 $ tar xf libgcrypt-1.6.1.tar.bz2
1164 $ cd libgcrypt-1.6.1
1165 $ ./configure
1166 $ sudo make install
1167 $ cd ..
1168 @end example
1169
1170 @end itemize
1171
1172 @strong{Install libgnurl}
1173
1174 @example
1175 $ wget https://gnunet.org/sites/default/files/gnurl-7.35.0.tar.bz2
1176 $ tar xf gnurl-7.35.0.tar.bz2
1177 $ cd gnurl-7.35.0
1178 $ ./configure --enable-ipv6 --with-gnutls --without-libssh2 \
1179  --without-libmetalink --without-winidn --without-librtmp \
1180  --without-nghttp2 --without-nss --without-cyassl --without-polarssl \
1181  --without-ssl --without-winssl --without-darwinssl --disable-sspi \
1182  --disable-ntlm-wb --disable-ldap --disable-rtsp --disable-dict \
1183  --disable-telnet --disable-tftp --disable-pop3 --disable-imap \
1184  --disable-smtp --disable-gopher --disable-file --disable-ftp
1185 $ sudo make install
1186 $ cd ..
1187 @end example
1188
1189 @strong{Install GNUnet}
1190
1191 @example
1192 $ git clone https://gnunet.org/git/gnunet/
1193 $ cd gnunet/
1194 $ ./bootstrap
1195 @end example
1196
1197 If you want to:
1198
1199 @itemize @bullet
1200
1201 @item Install to a different directory:
1202
1203 @example
1204 --prefix=PREFIX
1205 @end example
1206
1207 @item
1208 Have sudo permission, but do not want to compile as root:
1209
1210 @example
1211 --with-sudo
1212 @end example
1213
1214 @item
1215 Want debug message enabled:
1216
1217 @example
1218 --enable-logging=verbose
1219 @end example
1220
1221 @end itemize
1222
1223
1224 @example
1225 $ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose]
1226 $ make; sudo make install
1227 @end example
1228
1229 After installing it, you need to create an empty configuration file:
1230
1231 @example
1232 touch ~/.config/gnunet.conf
1233 @end example
1234
1235 And finally you can start GNUnet with
1236
1237 @example
1238 $ gnunet-arm -s
1239 @end example
1240
1241 @node Build instructions for Debian 8
1242 @section Build instructions for Debian 8
1243 @c FIXME: I -> we
1244
1245 These are the installation instructions for Debian 8. They were tested
1246 sing a fresh Debian 8 AMD64 installation without non-free software (no
1247 contrib or non-free). During installation, I only selected "lxde" for the
1248 desktop environment.
1249 Note that the packages and the dependencies that we will install during
1250 this chapter take about 1.5 GB of disk space. Combined with GNUnet and
1251 space for objects during compilation, you should not even attempt this
1252 unless you have about 2.5 GB free after the Debian installation.
1253 Using these instructions to build a VM image is likely to require a
1254 minimum of 4-5 GB for the VM (as you will likely also want a desktop
1255 manager).
1256
1257 GNUnet's security model assumes that your @code{/home} directory is
1258 encrypted.
1259 Thus, if possible, you should encrypt your entire disk, or at least just
1260 your home partition (or per-user home directory).
1261
1262 Naturally, the exact details of the starting state for your installation
1263 should not matter much.
1264 For example, if you selected any of those installation groups you might
1265 simply already have some of the necessary packages installed. Thus, it is
1266 suggested that you simply install the desktop environment of your choice
1267 before beginning with the instructions.
1268
1269
1270 @menu
1271 * Update Debian::
1272 * Installing Debian Packages::
1273 * Installing Dependencies from Source2::
1274 * Installing GNUnet from Source2::
1275 * But wait (again) there is more!::
1276 @end menu
1277
1278 @node Update Debian
1279 @subsection Update Debian
1280
1281 After any installation, you should begin by running
1282
1283 @example
1284 # apt-get update
1285 # apt-get upgrade
1286 @end example
1287
1288 to ensure that all of your packages are up-to-date. Note that the "#" is
1289 used to indicate that you need to type in this command as "root" (or
1290 prefix with "sudo"), whereas "$" is used to indicate typing in a command
1291 as a normal user.
1292
1293 @node Installing Debian Packages
1294 @subsection Installing Debian Packages
1295
1296 We begin by installing a few Debian packages from stable:
1297
1298 @example
1299 # apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ 
1300 libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \
1301 libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \
1302 libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \
1303 libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \
1304 libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \
1305 texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \
1306 libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
1307 libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \
1308 libgcrypt20-dev libmicrohttpd-dev
1309 @end example
1310
1311 @node Installing Dependencies from Source2
1312 @subsection Installing Dependencies from Source2
1313
1314 Yes, we said we start with a Debian 8 "stable" system, but because Debian
1315 linked GnuTLS without support for DANE, we need to compile a few things,
1316 in addition to GNUnet, still by hand. Yes, you can run GNUnet using the
1317 respective Debian packages, but then you will not get DANE support.
1318
1319 Next, we need to install a few dependencies from source. You might want
1320 to do this as a "normal" user and only run the @code{make install} steps
1321 as root (hence the @code{sudo} in the commands below). Also, you do this
1322 from any directory. We begin by downloading all dependencies, then
1323 extracting the sources, and finally compiling and installing the
1324 libraries:
1325
1326 @example
1327 $ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz
1328 $ wget https://gnunet.org/sites/default/files/gnurl-7.40.0.tar.bz2
1329 $ tar xvf gnutls-3.3.12.tar.xz
1330 $ tar xvf gnurl-7.40.0.tar.bz2
1331 $ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd ..
1332 $ cd gnurl-7.40.0
1333 $ ./configure --enable-ipv6 --with-gnutls=/usr/local --without-libssh2 \
1334 --without-libmetalink --without-winidn --without-librtmp \
1335 --without-nghttp2 --without-nss --without-cyassl --without-polarssl \
1336 --without-ssl --without-winssl --without-darwinssl --disable-sspi \
1337 --disable-ntlm-wb --disable-ldap --disable-rtsp --disable-dict \
1338 --disable-telnet --disable-tftp --disable-pop3 --disable-imap \
1339 --disable-smtp --disable-gopher --disable-file --disable-ftp \
1340 --disable-smb
1341 $ make ; sudo make install; cd ..
1342 @end example
1343
1344 @node Installing GNUnet from Source2
1345 @subsection Installing GNUnet from Source2
1346
1347 For this, simply follow the generic installation instructions from@
1348 here.
1349
1350 @node But wait (again) there is more!
1351 @subsection But wait (again) there is more!
1352
1353 So far, we installed all of the packages and dependencies required to
1354 ensure that all of GNUnet would be built. However, while for example the
1355 plugins to interact with the MySQL or Postgres databases have been
1356 created, we did not actually install or configure those databases.
1357 Thus, you will need to install and configure those databases or stick
1358 with the default Sqlite database. Sqlite is usually fine for most
1359 applications, but MySQL can offer better performance and Postgres better
1360 resillience.
1361
1362 @node Outdated build instructions for previous revisions
1363 @section Outdated build instructions for previous revisions
1364
1365 This chapter contains a collection of outdated, older installation guides.
1366 They are mostly intended to serve as a starting point for writing
1367 up-to-date instructions and should not be expected to work for
1368 GNUnet 0.10.x.
1369 A set of older installation instructions can also be found in the
1370 file @file{doc/outdated-and-old-installation-instructions.txt} in the
1371 source tree of GNUnet.
1372
1373 This file covers old instructions which no longer receive security
1374 updates or any kind of support.
1375
1376 @menu
1377 * Installing GNUnet 0.10.1 on Ubuntu 14.04::
1378 * Building GLPK for MinGW::
1379 * GUI build instructions for Ubuntu 12.04 using Subversion::
1380 @c * Installation with gnunet-update::
1381 * Instructions for Microsoft Windows Platforms (Old)::
1382 @end menu
1383
1384
1385 @node Installing GNUnet 0.10.1 on Ubuntu 14.04
1386 @subsection Installing GNUnet 0.10.1 on Ubuntu 14.04
1387
1388 Install the required dependencies:
1389
1390 @example
1391 $ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \
1392  libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \
1393  libmicrohttpd-dev libgnutls28-dev
1394 @end example
1395
1396 Choose one or more database backends:
1397
1398 @itemize @bullet
1399
1400 @item SQLite3
1401
1402 @example
1403  $ sudo apt-get install libsqlite3-dev@
1404 @end example
1405
1406 @item MySQL
1407
1408 @example
1409 $ sudo apt-get install libmysqlclient-dev@
1410 @end example
1411
1412 @item PostgreSQL
1413
1414 @example
1415  $ sudo apt-get install libpq-dev postgresql@
1416 @end example
1417
1418 @end itemize
1419
1420 Install the optional dependencies for gnunet-conversation:
1421
1422 @example
1423  $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
1424 @end example
1425
1426 Install libgcrypt 1.6:
1427
1428 @itemize @bullet
1429
1430 @item For Ubuntu 14.04:
1431
1432 @example
1433 $ sudo apt-get install libgcrypt20-dev
1434 @end example
1435
1436 @item For Ubuntu older than 14.04:
1437
1438 @example
1439 wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2
1440 $ tar xf libgcrypt-1.6.1.tar.bz2
1441 $ cd libgcrypt-1.6.1
1442 $ ./configure
1443 $ sudo make install
1444 $ cd ..
1445 @end example
1446 @end itemize
1447
1448 Install libgnurl:
1449
1450 @example
1451 $ wget https://gnunet.org/sites/default/files/gnurl-7.35.0.tar.bz2
1452 $ tar xf gnurl-7.35.0.tar.bz2
1453 $ cd gnurl-7.35.0
1454 $ ./configure --enable-ipv6 --with-gnutls --without-libssh2 \
1455 --without-libmetalink --without-winidn --without-librtmp
1456 --without-nghttp2 --without-nss --without-cyassl --without-polarssl \
1457 --without-ssl --without-winssl --without-darwinssl --disable-sspi \
1458 --disable-ntlm-wb --disable-ldap --disable-rtsp --disable-dict \
1459 --disable-telnet --disable-tftp --disable-pop3 --disable-imap \
1460 --disable-smtp --disable-gopher --disable-file --disable-ftp
1461 $ sudo make install@
1462 $ cd ..@
1463 @end example
1464
1465 Install GNUnet:
1466
1467 @example
1468 $ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz
1469 $ tar xf gnunet-0.10.1.tar.gz
1470 $ cd gnunet-0.10.1
1471 @end example
1472
1473 If you want to:
1474
1475 @itemize @bullet
1476
1477 @item
1478 Install to a different directory:
1479
1480 @example
1481 --prefix=PREFIX
1482 @end example
1483
1484 @item
1485 Have sudo permission, but do not want to compile as root:
1486
1487 @example
1488 --with-sudo
1489 @end example
1490
1491 @item
1492 Want debug message enabled:
1493
1494 @example
1495 --enable-logging=verbose
1496 @end example
1497
1498 @end itemize
1499
1500 @example
1501 $ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose]
1502 $ make; sudo make install
1503 @end example
1504
1505 After installing it, you need to create an empty configuration file:
1506
1507 @example
1508 touch ~/.config/gnunet.conf
1509 @end example
1510
1511 And finally you can start GNUnet with
1512
1513 @example
1514 $ gnunet-arm -s
1515 @end example
1516
1517 @node Building GLPK for MinGW
1518 @subsection Building GLPK for MinGW
1519
1520 GNUnet now requires the GNU Linear Programming Kit (GLPK).
1521 Since there's is no package you can install with @code{mingw-get} you
1522 have to compile it from source:
1523
1524 @itemize @bullet
1525
1526 @item Download the latest version from
1527 @uref{http://ftp.gnu.org/gnu/glpk/}
1528
1529 @item Unzip the downloaded source tarball using your favourite
1530 unzipper application In the MSYS shell
1531
1532 @item change to the respective directory 
1533
1534 @item Configure glpk for "i686-pc-mingw32":
1535
1536 @example
1537 ./configure '--build=i686-pc-mingw32'
1538 @end example
1539
1540 @item run
1541
1542 @example
1543 make install check
1544 @end example
1545
1546 @end itemize
1547
1548 MinGW does not automatically detect the correct buildtype so you have to
1549 specify it manually.
1550
1551
1552 @node GUI build instructions for Ubuntu 12.04 using Subversion
1553 @subsection GUI build instructions for Ubuntu 12.04 using Subversion
1554
1555 After installing GNUnet you can continue installing the GNUnet GUI tools:
1556
1557 First, install the required dependencies:
1558
1559 @example
1560 $ sudo apt-get install libgladeui-dev libqrencode-dev
1561 @end example
1562
1563 Please ensure that the GNUnet shared libraries can be found by the linker.
1564 If you installed GNUnet libraries in a non standard path
1565 (say GNUNET_PREFIX=/usr/local/lib/), you can
1566
1567 @itemize @bullet
1568
1569 @item set the environmental variable permanently to:
1570
1571 @example
1572 LD_LIBRARY_PATH=$GNUNET_PREFIX
1573 @end example
1574
1575 @item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf}
1576
1577 @end itemize
1578
1579 Now you can checkout and compile the GNUnet GUI tools:
1580
1581 @example
1582 $ git clone https://gnunet.org/git/gnunet-gtk
1583 $ cd gnunet-gtk
1584 $ ./bootstrap
1585 $ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/..
1586 $ make install
1587 @end example
1588
1589 @c @node Installation with gnunet-update
1590 @c @subsection Installation with gnunet-update
1591
1592 @c gnunet-update project is an effort to introduce updates to GNUnet
1593 @c installations. An interesting to-be-implemented-feature of gnunet-update
1594 @c is that these updates are propagated through GNUnet's peer-to-peer
1595 @c network. More information about gnunet-update can be found at
1596 @c @c FIXME: Use correct cgit URL
1597 @c @uref{https://gnunet.org/git/gnunet-update.git/tree/plain/README}.
1598
1599 @c While the project is still under development, we have implemented the
1600 @c following features which we believe may be helpful for users and we
1601 @c would like them to be tested:
1602
1603 @c @itemize @bullet
1604
1605 @c @item
1606 @c Packaging GNUnet installation along with its run-time dependencies into
1607 @c update packages
1608
1609 @c @item
1610 @c Installing update packages into compatible hosts
1611
1612 @c @item
1613 @c Updating an existing installation (which had been installed by
1614 @c gnunet-update) to a newer one
1615
1616 @c @end itemize
1617
1618 @c The above said features of gnunet-update are currently available for
1619 @c testing on GNU/Linux systems.
1620
1621 @c The following is a guide to help you get started with gnunet-update.
1622 @c It shows you how to install the testing binary packages of GNUnet
1623 @c 0.9.1 we have at @uref{https://gnunet.org/install/}.
1624
1625 @c gnunet-update needs the following dependencies:
1626
1627 @c @itemize @bullet
1628 @c @item
1629 @c python @geq{} 2.6
1630
1631 @c @item
1632 @c gnupg
1633
1634 @c @item
1635 @c python-gpgme
1636 @c @end itemize
1637
1638
1639 @c Checkout gnunet-update:
1640
1641 @c @c FIXME: git!
1642 @c @example
1643 @c $ svn checkout -r24905 https://gnunet.org/svn/gnunet-update@
1644 @c @end example
1645
1646 @c For security reasons, all packages released for gnunet-update from us are
1647 @c signed with the key at @uref{https://gnunet.org/install/key.txt}.
1648 @c You would need to import this key into your gpg key ring.
1649 @c gnunet-update uses this key to verify the integrity of the packages it
1650 @c installs:
1651
1652 @c @example
1653 @c $ gpg --recv-keys 7C613D78@
1654 @c @end example
1655
1656 @c Download the packages relevant to your architecture (currently I have
1657 @c access to GNU/Linux machines on x86_64 and i686, so only two for now,
1658 @c hopefully more later) from https://gnunet.org/install/.
1659
1660 @c To install the downloaded package into the directory /foo:
1661
1662 @c @example
1663 @c gnunet-update/bin/gnunet-update install downloaded/package /foo
1664 @c @end example
1665
1666 @c The installer reports the directories into which shared libraries and
1667 @c dependencies have been installed. You may need to add the reported shared
1668 @c library installation paths to LD_LIBRARY_PATH before you start running any
1669 @c installed binaries.
1670
1671 @c Please report bugs at https://gnunet.org/bugs/ under the project
1672 @c 'gnunet-update'.
1673
1674 @node Instructions for Microsoft Windows Platforms (Old)
1675 @subsection Instructions for Microsoft Windows Platforms (Old)
1676
1677 This document is a @b{DEPRECATED} installation guide for GNUnet on
1678 Windows.
1679 It will not work for recent GNUnet versions, but maybe it will be of
1680 some use if problems arise. 
1681
1682 The Windows build uses a UNIX emulator for Windows,
1683 @uref{http://www.mingw.org/, MinGW}, to build the executable modules.
1684 These modules run natively on Windows and do not require additional
1685 emulation software besides the usual dependencies.
1686
1687 GNUnet development is mostly done under GNU/Linux and especially git
1688 checkouts may not build out of the box.
1689 We regret any inconvenience, and if you have problems, please report them.
1690
1691 @menu
1692 * Hardware and OS requirements::
1693 * Software installation::
1694 * Building libextractor and GNUnet::
1695 * Installer::
1696 * Source::
1697 @end menu
1698      
1699 @node Hardware and OS requirements
1700 @subsubsection Hardware and OS requirements
1701
1702 @itemize @bullet
1703
1704 @item Pentium II or equivalent processor, @geq{} 350 MHz
1705
1706 @item 128 MB RAM
1707
1708 @item 600 MB free disk space
1709
1710 @item Windows 2000 or Windows XP are recommended
1711
1712 @end itemize
1713
1714 @node Software installation
1715 @subsubsection Software installation
1716
1717 @itemize @bullet
1718
1719 @item
1720 @strong{Compression software}@
1721
1722 The software packages GNUnet depends on are usually compressed using UNIX
1723 tools like @command{tar}, @command{gzip}, @command{xzip} and
1724 @command{bzip2}.
1725 If you do not already have an utility that is able to extract such
1726 archives, get @uref{http://www.7-zip.org/, 7-Zip}.
1727
1728 @item
1729 @strong{UNIX environment}@
1730
1731 The MinGW project provides the compiler toolchain that is used to build
1732 GNUnet.
1733 Get the following packages from the
1734 @uref{http://sourceforge.net/projects/mingw/files/, MinGW} project:
1735
1736 @itemize @bullet
1737
1738 @item GCC core
1739 @item GCC g++
1740 @item MSYS
1741 @item MSYS Developer Tool Kit (msysDTK)
1742 @item MSYS Developer Tool Kit - msys-autoconf (bin)
1743 @item MSYS Developer Tool Kit - msys-automake (bin)
1744 @item MinGW Runtime
1745 @item MinGW Utilities
1746 @item Windows API
1747 @item Binutils
1748 @item make
1749 @item pdcurses
1750 @item GDB (snapshot)
1751 @end itemize
1752
1753 @itemize @bullet
1754
1755
1756 @item Install MSYS (to c:\mingw, for example.)@
1757 Do @strong{not} use spaces in the pathname.
1758 For example, avoid a location such as @file{c:\program files\mingw}.
1759
1760 @item Install MinGW runtime, utilities and GCC to a subdirectory
1761 (to @file{c:\mingw\mingw}, for example)
1762
1763 @item Install the Development Kit to the MSYS directory
1764 (@file{c:\mingw})
1765
1766 @item Create a batch file bash.bat in your MSYS directory with
1767 the files:
1768
1769 @example
1770 bin\sh.exe --login
1771 @end example
1772
1773 This batch file opens a shell which is used to invoke the build
1774 processes.
1775 MinGW's standard shell (@command{msys.bat}) is not suitable
1776 because it opens a separate console window.
1777 On Vista, @command{bash.bat} needs to be run as Administrator. 
1778
1779 @item
1780 Start @command{bash.sh} and rename
1781 @file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems:
1782
1783 @example
1784 mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken
1785 @end example
1786
1787 @item
1788 Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and
1789 remove the declaration of DATADIR from
1790 (@file{c:\mingw\mingw\include\objidl.h} (lines 55-58)
1791
1792 @item
1793 Unpack autoconf, automake to the MSYS directory (@file{c:\mingw})
1794
1795 @item
1796 Install all other packages to the MinGW directory (@file{c:\mingw\mingw\})
1797 @end itemize
1798
1799
1800 @item @strong{GNU Libtool}@
1801 GNU Libtool is required to use shared libraries.
1802 Get the prebuilt package from here and unpack it to the
1803 MinGW directory (@file{c:\mingw})
1804
1805 @item @strong{Pthreads}@
1806 GNUnet uses the portable POSIX thread library for multi-threading:
1807
1808 @itemize @bullet
1809
1810 @item Save
1811 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a}
1812 (x86) or
1813 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a}
1814 (x64) as libpthread.a into the @file{lib}
1815 directory (@file{c:\mingw\mingw\lib\libpthread.a}).
1816
1817 @item Save
1818 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll}
1819 (x86) or
1820 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a}
1821 (x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}).
1822
1823 @item Download all header files from
1824 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/}
1825 to the @file{include} directory (@file{c:\mingw\mingw\include}).
1826 @end itemize
1827
1828
1829 @item @strong{GNU MP}@
1830 GNUnet uses the GNU Multiple Precision library for special cryptographic
1831 operations. Get the GMP binary package from the
1832 @uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and
1833 unpack it to the MinGW directory (@file{c:\mingw\mingw})
1834
1835 @item @strong{GNU Gettext}@
1836 GNU gettext is used to provide national language support.
1837 Get the prebuilt package from hereand unpack it to the MinGW
1838 directory (@file{c:\mingw\mingw})
1839
1840 @item @strong{GNU iconv}@
1841 GNU Libiconv is used for character encoding conversion.
1842 Get the prebuilt package from here and unpack it to the MinGW
1843 directory (@file{c:\mingw\mingw}).
1844
1845 @item @strong{SQLite}@
1846 GNUnet uses the SQLite database to store data.
1847 Get the prebuilt binary from here and unpack it to your MinGW directory. 
1848
1849 @item @strong{MySQL}@
1850 As an alternative to SQLite, GNUnet also supports MySQL.
1851
1852 @itemize @bullet
1853
1854 @item Get the binary installer from the
1855 @uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project}
1856 (version 4.1), install it and follow the instructions in
1857 @file{README.mysql}.
1858
1859 @item  Create a temporary build directory (@file{c:\mysql})
1860
1861 @item Copy the directories @file{include\} and @file{lib\} from the
1862 MySQL directory to the new directory
1863
1864 @item Get the patches from
1865 @uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and
1866 @uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the
1867 latter is only required for MySQL
1868
1869 @example
1870 patch -p 0
1871 @end example
1872
1873 @item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll}
1874
1875 @item  Change to @file{lib\} and create an import library:
1876
1877 @example
1878 dlltool --input-def ../include/libmySQL.def \
1879 --dllname libmysql.dll \
1880 --output-lib libmysqlclient.a -k
1881 @end example
1882
1883 @item  Copy include\* to include\mysql\ 
1884
1885 @item  Pass @code{--with-mysql=/c/mysql} to
1886 @command{./configure} and copy @file{libmysql.dll}
1887 to your PATH or GNUnet's @file{bin} directory
1888 @end itemize
1889
1890
1891 @item @strong{GTK+}@
1892 @command{gnunet-gtk} and @command{libextractor} depend on GTK.
1893 Get the the binary and developer packages of @command{atk},
1894 @command{glib}, @command{gtk}, @command{iconv},
1895 @command{gettext-runtime}, @command{pango} from
1896 @uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them
1897 to the MinGW directory (@file{c:\mingw\mingw}).
1898 @c FIXME: The URL below for pkg-config seems wrong.
1899 Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and
1900 @command{libpng} and unpack them to the MinGW directory
1901 (@file{c:\mingw\mingw}).
1902 Here is an all-in-one package for the
1903 @uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies}
1904 . Do not overwrite any existing files!
1905
1906 @item @strong{Glade}@
1907 @command{gnunet-gtk} and @command{gnunet-setup} were created using
1908 this interface builder
1909
1910 @itemize @bullet
1911
1912 @item Get the Glade and libglade (-bin and -devel) packages
1913 (without GTK!) from
1914 @uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to
1915 the MinGW directory (@file{c:\mingw\mingw}).
1916
1917 @item Get @command{libxml} from here and unpack it to the MinGW
1918 directory (@file{c:\mingw\mingw}).
1919 @end itemize
1920
1921 @c FIXME: URLs
1922 @item @strong{zLib}@
1923 @command{libextractor} requires @command{zLib} to decompress some file
1924 formats. GNUnet uses it to (de)compress meta-data.
1925 Get zLib from here (Signature) and unpack it to the MinGW directory
1926 (@file{c:\mingw\mingw}).
1927
1928 @item @strong{Bzip2}@
1929 @command{libextractor} also requires @command{Bzip2} to
1930 decompress some file formats.
1931 Get the Bzip2 (binary and developer package) from
1932 @uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and
1933 unpack it to the MinGW directory (@file{c:\mingw\mingw}).
1934
1935 @item @strong{Libgcrypt}@
1936 @command{Libgcrypt} provides the cryptographic functions used by GNUnet.
1937 Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here},
1938 compile and place it in the MinGW directory
1939 (@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to
1940 compile GNUnet.
1941
1942 @item @strong{PlibC}@
1943 PlibC emulates Unix functions under Windows. Get PlibC from here and
1944 unpack it to the MinGW directory (c:\mingw\mingw)
1945
1946 @item @strong{OGG Vorbis}@
1947 @command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files.
1948 Get the packages
1949 @uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg}
1950 and
1951 @uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis}
1952 from the
1953 @uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build}
1954 and unpack them to the MinGW directory (c:\mingw\mingw).
1955
1956 @item @strong{Exiv2}@
1957 (lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data.
1958 Download
1959 @uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2}
1960 and unpack it to the MSYS directory (c:\mingw).
1961 @end itemize
1962
1963 @node Building libextractor and GNUnet
1964 @subsubsection Building libextractor and GNUnet
1965
1966 Before you compile @command{libextractor} or @command{GNUnet},
1967 be sure to set @code{PKG_CONFIG_PATH}:
1968
1969 @example
1970 export PKG_CONFIG_PATH=/mingw/lib/pkgconfig
1971 @end example
1972
1973 @noindent
1974 @xref{GNUnet Installation Handbook}, for basic instructions on building
1975 @command{libextractor} and @command{GNUnet}.
1976 By default, all modules that are created in this way contain
1977 debug information and are quite large. To compile release versions
1978 (small and fast) set the variable @code{CFLAGS}:
1979
1980 @example
1981 export CFLAGS='-O2 -march=pentium -fomit-frame-pointer' 
1982 ./configure --prefix=$HOME --with-extractor=$HOME
1983 @end example
1984
1985 @node Installer
1986 @subsubsection Installer
1987
1988 The GNUnet installer is made with
1989 @uref{http://nsis.sourceforge.net/, NSIS}. The installer script is
1990 located in @file{contrib\win} in the GNUnet source tree.
1991
1992 @node Source
1993 @subsubsection Source
1994
1995 @c FIXME: URL
1996 The sources of all dependencies are available here. 
1997
1998 @c @node Portable GNUnet
1999 @c @section Portable GNUnet
2000
2001 @c Quick instructions on how to use the most recent GNUnet on most GNU/Linux
2002 @c distributions
2003
2004 @c Currently this has only been tested on Ubuntu 12.04, 12.10, 13.04, Debian
2005 @c and CentOS 6, but it should work on almost any GNU/Linux distribution.
2006 @c More in-detail information can be found in the handbook.
2007
2008 @c Note 2017-10: Currently this section assumes the old SVN repo of GNUnet
2009 @c which no longer exists.
2010
2011 @c @menu
2012 @c * Prerequisites::
2013 @c * Download & set up gnunet-update::
2014 @c * Install GNUnet::
2015 @c @end menu
2016
2017 @c @node Prerequisites
2018 @c @subsection Prerequisites
2019
2020 @c Open a terminal and paste this line into it to install all required tools
2021 @c needed:
2022
2023 @c @example
2024 @c sudo apt-get install python-gpgme subversion
2025 @c @end example
2026
2027 @c @node Download & set up gnunet-update
2028 @c @subsection Download & set up gnunet-update
2029
2030 @c The following command will download a working version of gnunet-update
2031 @c with the subversion tool and import the public key which is needed for
2032 @c authentication:
2033
2034 @c @example
2035 @c svn checkout -r24905 https://gnunet.org/svn/gnunet-update ~/gnunet-update
2036 @c cd ~/gnunet-update
2037 @c gpg --keyserver "hkp://keys.gnupg.net" --recv-keys 7C613D78
2038 @c @end example
2039
2040 @c @node Install GNUnet
2041 @c @subsection Install GNUnet
2042
2043 @c Download and install GNUnet binaries which can be found here and set
2044 @c library paths:
2045
2046 @c @example
2047 @c wget -P /tmp https://gnunet.org/install/packs/gnunet-0.9.4-`uname -m`.tgz
2048 @c ./bin/gnunet-update install /tmp/gnunet-0.9*.tgz ~
2049 @c echo "PATH DEFAULT=$@{PATH@}:$HOME/bin" >> ~/.pam_environment
2050 @c echo -e "$@{HOME@}/lib\n$@{HOME@}/lib/gnunet-deps" | sudo tee \
2051 @c  /etc/ld.so.conf.d/gnunet.conf > /dev/null
2052 @c sudo ldconfig
2053 @c @end example
2054
2055 @c You may need to re-login once after executing these last commands
2056
2057 @c That's it, GNUnet is installed in your home directory now. GNUnet can be
2058 @c configured and afterwards started by executing:
2059
2060 @c @example
2061 @c gnunet-arm -s
2062 @c @end example
2063
2064 @node The graphical configuration interface
2065 @section The graphical configuration interface
2066
2067 If you also would like to use @command{gnunet-gtk} and
2068 @command{gnunet-setup} (highly recommended for beginners), do:
2069
2070 @example
2071 wget -P /tmp \
2072 https://gnunet.org/install/packs/gnunet-0.9.4-gtk-0.9.4-`uname -m`.tgz
2073 sh ~/gnunet-update/bin/gnunet-update install /tmp/gnunet-*gtk*.tgz ~
2074 sudo ldconfig
2075 @end example
2076
2077 Now you can run @command{gnunet-setup} for easy configuration of your
2078 GNUnet peer.
2079
2080 @menu
2081 * Configuring your peer::
2082 * Configuring the Friend-to-Friend (F2F) mode::
2083 * Configuring the hostlist to bootstrap::
2084 * Configuration of the HOSTLIST proxy settings::
2085 * Configuring your peer to provide a hostlist ::
2086 * Configuring the datastore::
2087 * Configuring the MySQL database::
2088 * Reasons for using MySQL::
2089 * Reasons for not using MySQL::
2090 * Setup Instructions::
2091 * Testing::
2092 * Performance Tuning::
2093 * Setup for running Testcases::
2094 * Configuring the Postgres database::
2095 * Reasons to use Postgres::
2096 * Reasons not to use Postgres::
2097 * Manual setup instructions::
2098 * Testing the setup manually::
2099 * Configuring the datacache::
2100 * Configuring the file-sharing service::
2101 * Configuring logging::
2102 * Configuring the transport service and plugins::
2103 * Configuring the wlan transport plugin::
2104 * Configuring HTTP(S) reverse proxy functionality using Apache or nginx::
2105 * Blacklisting peers::
2106 * Configuration of the HTTP and HTTPS transport plugins::
2107 * Configuring the GNU Name System::
2108 * Configuring the GNUnet VPN::
2109 * Bandwidth Configuration::
2110 * Configuring NAT::
2111 * Peer configuration for distributions::
2112 @end menu
2113
2114 @node Configuring your peer
2115 @subsection Configuring your peer
2116
2117 This chapter will describe the various configuration options in GNUnet.
2118
2119 The easiest way to configure your peer is to use the
2120 @command{gnunet-setup} tool.
2121 @command{gnunet-setup} is part of the @command{gnunet-gtk}
2122 application. You might have to install it separately.
2123
2124 Many of the specific sections from this chapter actually are linked from
2125 within @command{gnunet-setup} to help you while using the setup tool.
2126
2127 While you can also configure your peer by editing the configuration
2128 file by hand, this is not recommended for anyone except for developers
2129 as it requires a more in-depth understanding of the configuration files
2130 and internal dependencies of GNUnet.
2131
2132
2133 @node Configuring the Friend-to-Friend (F2F) mode
2134 @subsection Configuring the Friend-to-Friend (F2F) mode
2135
2136 GNUnet knows three basic modes of operation:
2137 @itemize @bullet
2138 @item In standard "peer-to-peer" mode,
2139 your peer will connect to any peer.
2140 @item In the pure "friend-to-friend"
2141 mode, your peer will ONLY connect to peers from a list of friends
2142 specified in the configuration.
2143 @item Finally, in mixed mode,
2144 GNUnet will only connect to arbitrary peers if it
2145 has at least a specified number of connections to friends.
2146 @end itemize
2147
2148 When configuring any of the F2F ("friend-to-friend") modes,
2149 you first need to create a file with the peer identities
2150 of your friends. Ask your friends to run
2151
2152 @example
2153 $ gnunet-peerinfo -sq
2154 @end example
2155
2156 @noindent
2157 The resulting output of this command needs to be added to your
2158 @file{friends} file, which is simply a plain text file with one line
2159 per friend with the output from the above command.
2160
2161 You then specify the location of your @file{friends} file in the
2162 "FRIENDS" option of the "topology" section.
2163
2164 Once you have created the @file{friends} file, you can tell GNUnet to only
2165 connect to your friends by setting the "FRIENDS-ONLY" option (again in
2166 the "topology" section) to YES.
2167
2168 If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a
2169 minimum number of friends to have (before connecting to arbitrary peers)
2170 under the "MINIMUM-FRIENDS" option.
2171
2172 If you want to operate in normal P2P-only mode, simply set
2173 "MINIMUM-FRIENDS" to zero and "FRIENDS_ONLY" to NO.
2174 This is the default.
2175
2176 @node Configuring the hostlist to bootstrap
2177 @subsection Configuring the hostlist to bootstrap
2178
2179 After installing the software you need to get connected to the GNUnet
2180 network. The configuration file included in your download is already
2181 configured to connect you to the GNUnet network.
2182 In this section the relevant configuration settings are explained.
2183
2184 To get an initial connection to the GNUnet network and to get to know
2185 peers already connected to the network you can use the so called
2186 "bootstrap servers".
2187 These servers can give you a list of peers connected to the network.
2188 To use these bootstrap servers you have to configure the hostlist daemon
2189 to activate bootstrapping.
2190
2191 To activate bootstrapping, edit the @code{[hostlist]}-section in your
2192 configuration file. You have to set the argument "-b" in the
2193 options line:
2194
2195 @example
2196 [hostlist]
2197 OPTIONS = -b
2198 @end example
2199
2200 Additionally you have to specify which server you want to use.
2201 The default bootstrapping server is
2202 "@uref{http://v10.gnunet.org/hostlist, http://v10.gnunet.org/hostlist}".
2203 [^] To set the server you have to edit the line "SERVERS" in the hostlist
2204 section. To use the default server you should set the lines to
2205
2206 @example
2207 SERVERS = http://v10.gnunet.org/hostlist [^]
2208 @end example
2209
2210 @noindent
2211 To use bootstrapping your configuration file should include these lines:
2212
2213 @example
2214 [hostlist]
2215 OPTIONS = -b
2216 SERVERS = http://v10.gnunet.org/hostlist [^]
2217 @end example
2218
2219 @noindent
2220 Besides using bootstrap servers you can configure your GNUnet peer to
2221 recieve hostlist advertisements.
2222 Peers offering hostlists to other peers can send advertisement messages
2223 to peers that connect to them. If you configure your peer to receive these
2224 messages, your peer can download these lists and connect to the peers
2225 included. These lists are persistent, which means that they are saved to
2226 your hard disk regularly and are loaded during startup.
2227
2228 To activate hostlist learning you have to add the "-e" switch to the
2229 OPTIONS line in the hostlist section:
2230
2231 @example
2232 [hostlist]
2233 OPTIONS = -b -e
2234 @end example
2235
2236 @noindent
2237 Furthermore you can specify in which file the lists are saved.
2238 To save the lists in the file "hostlists.file" just add the line:
2239
2240 @example
2241 HOSTLISTFILE = hostlists.file
2242 @end example
2243
2244 @noindent
2245 Best practice is to activate both bootstrapping and hostlist learning.
2246 So your configuration file should include these lines:
2247
2248 @example
2249 [hostlist]
2250 OPTIONS = -b -e
2251 HTTPPORT = 8080
2252 SERVERS = http://v10.gnunet.org/hostlist [^]
2253 HOSTLISTFILE = $SERVICEHOME/hostlists.file
2254 @end example
2255
2256 @node Configuration of the HOSTLIST proxy settings
2257 @subsection Configuration of the HOSTLIST proxy settings
2258
2259 The hostlist client can be configured to use a proxy to connect to the
2260 hostlist server.
2261 This functionality can be configured in the configuration file directly
2262 or using the gnunet-setup tool. 
2263
2264 The hostlist client supports the following proxy types at the moment:
2265
2266 @itemize @bullet
2267 @item HTTP and HTTP 1.0 only proxy
2268 @item SOCKS 4/4a/5/5 with hostname
2269 @end itemize
2270
2271 In addition authentication at the proxy with username and password can be
2272 configured. 
2273
2274 To configure proxy support for the hostlist client in the
2275 @command{gnunet-setup} tool, select the "hostlist" tab and select
2276 the appropriate proxy type.
2277 The hostname or IP address (including port if required) has to be entered
2278 in the "Proxy hostname" textbox. If required, enter username and password
2279 in the "Proxy username" and "Proxy password" boxes.
2280 Be aware that this information will be stored in the configuration in
2281 plain text (TODO: Add explanation and generalize the part in Chapter 3.6
2282 about the encrypted home).
2283
2284 To provide these options directly in the configuration, you can
2285 enter the following settings in the @code{[hostlist]} section of
2286 the configuration:
2287
2288 @example
2289 # Type of proxy server,
2290 # Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
2291 # Default: HTTP
2292 # PROXY_TYPE = HTTP
2293
2294 # Hostname or IP of proxy server
2295 # PROXY =
2296 # User name for proxy server
2297 # PROXY_USERNAME =
2298 # User password for proxy server
2299 # PROXY_PASSWORD =
2300 @end example
2301
2302 @node Configuring your peer to provide a hostlist
2303 @subsection Configuring your peer to provide a hostlist
2304
2305 If you operate a peer permanently connected to GNUnet you can configure
2306 your peer to act as a hostlist server, providing other peers the list of
2307 peers known to him.
2308
2309 Yor server can act as a bootstrap server and peers needing to obtain a
2310 list of peers can contact it to download this list.
2311 To download this hostlist the peer uses HTTP.
2312 For this reason you have to build your peer with libcurl and microhttpd
2313 support. How you build your peer with this options can be found here:
2314 @uref{https://gnunet.org/generic_installation}
2315
2316 To configure your peer to act as a bootstrap server you have to add the
2317 @code{-p} option to OPTIONS in the @code{[hostlist]} section of your
2318 configuration file. Besides that you have to specify a port number for
2319 the http server.
2320 In conclusion you have to add the following lines:
2321
2322 @example
2323 [hostlist]
2324 HTTPPORT = 12980
2325 OPTIONS = -p
2326 @end example
2327
2328 @noindent
2329 If your peer acts as a bootstrap server other peers should know about
2330 that. You can advertise the hostlist your are providing to other peers.
2331 Peers connecting to your peer will get a message containing an
2332 advertisement for your hostlist and the URL where it can be downloaded.
2333 If this peer is in learning mode, it will test the hostlist and, in the
2334 case it can obtain the list successfully, it will save it for
2335 bootstrapping.
2336
2337 To activate hostlist advertisement on your peer, you have to set the
2338 following lines in your configuration file:
2339
2340 @example
2341 [hostlist]
2342 EXTERNAL_DNS_NAME = example.org
2343 HTTPPORT = 12981
2344 OPTIONS = -p -a
2345 @end example
2346
2347 @noindent
2348 With this configuration your peer will a act as a bootstrap server and
2349 advertise this hostlist to other peers connecting to it.
2350 The URL used to download the list will be
2351 @code{@uref{http://example.org:12981/, http://example.org:12981/}}.
2352
2353 Please notice:
2354
2355 @itemize @bullet
2356 @item The hostlist is not human readable, so you should not try to
2357 download it using your webbrowser. Just point your GNUnet peer to the
2358 address!
2359 @item Advertising without providing a hostlist does not make sense and
2360 will not work.
2361 @end itemize
2362
2363 @node Configuring the datastore
2364 @subsection Configuring the datastore
2365
2366 The datastore is what GNUnet uses to for long-term storage of file-sharing
2367 data. Note that long-term does not mean 'forever' since content does have
2368 an expiration date, and of course storage space is finite (and hence
2369 sometimes content may have to be discarded).
2370
2371 Use the "QUOTA" option to specify how many bytes of storage space you are
2372 willing to dedicate to GNUnet.
2373
2374 In addition to specifying the maximum space GNUnet is allowed to use for
2375 the datastore, you need to specify which database GNUnet should use to do
2376 so. Currently, you have the choice between sqLite, MySQL and Postgres.
2377
2378 @node Configuring the MySQL database
2379 @subsection Configuring the MySQL database
2380
2381 This section describes how to setup the MySQL database for GNUnet.
2382
2383 Note that the mysql plugin does NOT work with mysql before 4.1 since we
2384 need prepared statements.
2385 We are generally testing the code against MySQL 5.1 at this point.
2386
2387 @node Reasons for using MySQL
2388 @subsection Reasons for using MySQL
2389
2390 @itemize @bullet
2391
2392 @item On up-to-date hardware wher
2393 mysql can be used comfortably, this module
2394 will have better performance than the other database choices (according
2395 to our tests).
2396
2397 @item Its often possible to recover the mysql database from internal
2398 inconsistencies. Some of the other databases do not support repair.
2399 @end itemize
2400
2401 @node Reasons for not using MySQL
2402 @subsection Reasons for not using MySQL
2403
2404 @itemize @bullet
2405 @item Memory usage (likely not an issue if you have more than 1 GB)
2406 @item Complex manual setup
2407 @end itemize
2408
2409 @node Setup Instructions
2410 @subsection Setup Instructions
2411
2412 @itemize @bullet
2413
2414 @item In @code{gnunet.conf} set in section "DATASTORE" the value for
2415 "DATABASE" to "mysql".
2416
2417 @item Access mysql as root:
2418
2419 @example
2420 $ mysql -u root -p 
2421 @end example
2422
2423 @noindent
2424 and issue the following commands, replacing $USER with the username
2425 that will be running gnunet-arm (so typically "gnunet"):
2426
2427 @example
2428 CREATE DATABASE gnunet;
2429 GRANT select,insert,update,delete,create,alter,drop,create \
2430 temporary tables ON gnunet.* TO $USER@@localhost;
2431 SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like');
2432 FLUSH PRIVILEGES;
2433 @end example
2434
2435 @item
2436 In the $HOME directory of $USER, create a @file{.my.cnf} file with the
2437 following lines
2438
2439 @example
2440 [client]
2441 user=$USER
2442 password=$the_password_you_like
2443 @end example
2444
2445 @end itemize
2446
2447 Thats it. Note that @file{.my.cnf} file is a slight security risk unless
2448 its on a safe partition. The @file{$HOME/.my.cnf} can of course be
2449 a symbolic link.
2450 Luckily $USER has only priviledges to mess up GNUnet's tables,
2451 which should be pretty harmless.
2452
2453 @node Testing
2454 @subsection Testing
2455
2456 You should briefly try if the database connection works. First, login
2457 as $USER. Then use:
2458
2459 @example
2460 $ mysql -u $USER
2461 mysql> use gnunet;
2462 @end example
2463
2464 @noindent
2465 If you get the message "Database changed" it probably works.
2466
2467 If you get "ERROR 2002: Can't connect to local MySQL server@
2468 through socket '/tmp/mysql.sock' (2)" it may be resolvable by
2469
2470 @example
2471 ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
2472 @end example
2473
2474 so there may be some additional trouble depending on your mysql setup.
2475
2476 @node Performance Tuning
2477 @subsection Performance Tuning
2478
2479 For GNUnet, you probably want to set the option
2480
2481 @example
2482 innodb_flush_log_at_trx_commit = 0
2483 @end example
2484
2485 @noindent
2486 for a rather dramatic boost in MySQL performance. However, this reduces
2487 the "safety" of your database as with this options you may loose
2488 transactions during a power outage.
2489 While this is totally harmless for GNUnet, the option applies to all
2490 applications using MySQL. So you should set it if (and only if) GNUnet is
2491 the only application on your system using MySQL.
2492
2493 @node Setup for running Testcases
2494 @subsection Setup for running Testcases
2495
2496 If you want to run the testcases, you must create a second database
2497 "gnunetcheck" with the same username and password. This database will
2498 then be used for testing ("make check").
2499
2500 @node Configuring the Postgres database
2501 @subsection Configuring the Postgres database
2502
2503 This text describes how to setup the Postgres database for GNUnet.
2504
2505 This Postgres plugin was developed for Postgres 8.3 but might work for
2506 earlier versions as well.
2507
2508 @node Reasons to use Postgres
2509 @subsection Reasons to use Postgres
2510
2511 @itemize @bullet
2512 @item Easier to setup than MySQL
2513 @item Real database
2514 @end itemize
2515
2516 @node Reasons not to use Postgres
2517 @subsection Reasons not to use Postgres
2518
2519 @itemize @bullet
2520 @item Quite slow
2521 @item Still some manual setup required
2522 @end itemize
2523
2524 @node Manual setup instructions
2525 @subsection Manual setup instructions
2526
2527 @itemize @bullet
2528 @item In @code{gnunet.conf} set in section "DATASTORE" the value for
2529 "DATABASE" to "postgres".
2530 @item Access Postgres to create a user:@
2531
2532 @table @asis
2533 @item with Postgres 8.x, use:
2534
2535 @example
2536 # su - postgres
2537 $ createuser
2538 @end example
2539
2540 @noindent
2541 and enter the name of the user running GNUnet for the role interactively.
2542 Then, when prompted, do not set it to superuser, allow the creation of
2543 databases, and do not allow the creation of new roles.@
2544
2545 @item with Postgres 9.x, use:
2546
2547 @example
2548 # su - postgres
2549 $ createuser -d $GNUNET_USER
2550 @end example
2551
2552 @noindent
2553 where $GNUNET_USER is the name of the user running GNUnet.@
2554
2555 @end table
2556
2557
2558 @item
2559 As that user (so typically as user "gnunet"), create a database (or two):
2560
2561 @example
2562 $ createdb gnunet
2563 # this way you can run "make check"
2564 $ createdb gnunetcheck
2565 @end example
2566
2567 @end itemize
2568
2569 Now you should be able to start @code{gnunet-arm}.
2570
2571 @node Testing the setup manually
2572 @subsection Testing the setup manually
2573
2574 You may want to try if the database connection works. First, again login
2575 as the user who will run @command{gnunet-arm}. Then use:
2576
2577 @example
2578 $ psql gnunet # or gnunetcheck
2579 gnunet=> \dt
2580 @end example
2581
2582 @noindent
2583 If, after you have started @command{gnunet-arm} at least once, you get
2584 a @code{gn090} table here, it probably works.
2585
2586 @node Configuring the datacache
2587 @subsection Configuring the datacache
2588 @c %**end of header
2589
2590 The datacache is what GNUnet uses for storing temporary data. This data is
2591 expected to be wiped completely each time GNUnet is restarted (or the
2592 system is rebooted).
2593
2594 You need to specify how many bytes GNUnet is allowed to use for the
2595 datacache using the "QUOTA" option in the section "dhtcache".
2596 Furthermore, you need to specify which database backend should be used to
2597 store the data. Currently, you have the choice between
2598 sqLite, MySQL and Postgres.
2599
2600 @node Configuring the file-sharing service
2601 @subsection Configuring the file-sharing service
2602
2603 In order to use GNUnet for file-sharing, you first need to make sure
2604 that the file-sharing service is loaded.
2605 This is done by setting the AUTOSTART option in section "fs" to "YES".
2606 Alternatively, you can run
2607
2608 @example
2609 $ gnunet-arm -i fs
2610 @end example
2611
2612 @noindent
2613 to start the file-sharing service by hand.
2614
2615 Except for configuring the database and the datacache the only important
2616 option for file-sharing is content migration.
2617
2618 Content migration allows your peer to cache content from other peers as
2619 well as send out content stored on your system without explicit requests.
2620 This content replication has positive and negative impacts on both system
2621 performance and privacy.
2622
2623 FIXME: discuss the trade-offs. Here is some older text about it...
2624
2625 Setting this option to YES allows gnunetd to migrate data to the local
2626 machine. Setting this option to YES is highly recommended for efficiency.
2627 Its also the default. If you set this value to YES, GNUnet will store
2628 content on your machine that you cannot decrypt.
2629 While this may protect you from liability if the judge is sane, it may
2630 not (IANAL). If you put illegal content on your machine yourself, setting
2631 this option to YES will probably increase your chances to get away with it
2632 since you can plausibly deny that you inserted the content.
2633 Note that in either case, your anonymity would have to be broken first
2634 (which may be possible depending on the size of the GNUnet network and the
2635 strength of the adversary).
2636
2637 @node Configuring logging
2638 @subsection Configuring logging
2639
2640 Logging in GNUnet 0.9.0 is controlled via the "-L" and "-l" options.
2641 Using @code{-L}, a log level can be specified. With log level
2642 @code{ERROR} only serious errors are logged.
2643 The default log level is @code{WARNING} which causes anything of
2644 concern to be logged.
2645 Log level @code{INFO} can be used to log anything that might be
2646 interesting information whereas
2647 @code{DEBUG} can be used by developers to log debugging messages
2648 (but you need to run @code{./configure} with
2649 @code{--enable-logging=verbose} to get them compiled).
2650 The @code{-l} option is used to specify the log file.
2651
2652 Since most GNUnet services are managed by @code{gnunet-arm}, using the
2653 @code{-l} or @code{-L} options directly is not possible.
2654 Instead, they can be specified using the "OPTIONS" configuration value in
2655 the respective section for the respective service.
2656 In order to enable logging globally without editing the "OPTIONS" values
2657 for each service, @code{gnunet-arm} supports a "GLOBAL_POSTFIX" option.
2658 The value specified here is given as an extra option to all services for
2659 which the configuration does contain a service-specific "OPTIONS" field.
2660
2661 "GLOBAL_POSTFIX" can contain the special sequence "@{@}" which is replaced
2662 by the name of the service that is being started. Furthermore,
2663 @code{GLOBAL_POSTFIX} is special in that sequences starting with "$"
2664 anywhere in the string are expanded (according to options in "PATHS");
2665 this expansion otherwise is only happening for filenames and then the "$"
2666 must be the first character in the option. Both of these restrictions do
2667 not apply to "GLOBAL_POSTFIX".
2668 Note that specifying @code{%} anywhere in the "GLOBAL_POSTFIX" disables
2669 both of these features.
2670
2671 In summary, in order to get all services to log at level "INFO" to
2672 log-files called @code{SERVICENAME-logs}, the following global prefix
2673 should be used:
2674
2675 @example
2676 GLOBAL_POSTFIX = -l $SERVICEHOME/@{@}-logs -L INFO
2677 @end example
2678
2679 @node Configuring the transport service and plugins
2680 @subsection Configuring the transport service and plugins
2681
2682 The transport service in GNUnet is responsible to maintain basic
2683 connectivity to other peers.
2684 Besides initiating and keeping connections alive it is also responsible
2685 for address validation.
2686
2687 The GNUnet transport supports more than one transport protocol.
2688 These protocols are configured together with the transport service.
2689
2690 The configuration section for the transport service itself is quite
2691 similar to all the other services
2692
2693 @example
2694 AUTOSTART = YES
2695 @@UNIXONLY@@ PORT = 2091
2696 HOSTNAME = localhost
2697 HOME = $SERVICEHOME
2698 CONFIG = $DEFAULTCONFIG
2699 BINARY = gnunet-service-transport
2700 #PREFIX = valgrind
2701 NEIGHBOUR_LIMIT = 50
2702 ACCEPT_FROM = 127.0.0.1;
2703 ACCEPT_FROM6 = ::1;
2704 PLUGINS = tcp udp
2705 UNIXPATH = /tmp/gnunet-service-transport.sock
2706 @end example
2707
2708 Different are the settings for the plugins to load @code{PLUGINS}.
2709 The first setting specifies which transport plugins to load.
2710
2711 @itemize @bullet
2712 @item transport-unix
2713 A plugin for local only communication with UNIX domain sockets. Used for
2714 testing and available on unix systems only. Just set the port
2715
2716 @example
2717 [transport-unix]
2718 PORT = 22086
2719 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2720 @end example
2721
2722 @item transport-tcp
2723 A plugin for communication with TCP. Set port to 0 for client mode with
2724 outbound only connections
2725
2726 @example
2727 [transport-tcp]
2728 # Use 0 to ONLY advertise as a peer behind NAT (no port binding)
2729 PORT = 2086
2730 ADVERTISED_PORT = 2086
2731 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2732 # Maximum number of open TCP connections allowed
2733 MAX_CONNECTIONS = 128
2734 @end example
2735
2736 @item transport-udp
2737 A plugin for communication with UDP. Supports peer discovery using
2738 broadcasts.
2739
2740 @example
2741 [transport-udp]
2742 PORT = 2086
2743 BROADCAST = YES
2744 BROADCAST_INTERVAL = 30 s
2745 MAX_BPS = 1000000
2746 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2747 @end example
2748
2749 @item transport-http
2750 HTTP and HTTPS support is split in two part: a client plugin initiating
2751 outbound connections and a server part accepting connections from the
2752 client. The client plugin just takes the maximum number of connections as
2753 an argument.
2754
2755 @example
2756 [transport-http_client]
2757 MAX_CONNECTIONS = 128
2758 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2759 @end example
2760
2761 @example
2762 [transport-https_client]
2763 MAX_CONNECTIONS = 128
2764 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2765 @end example
2766
2767 @noindent
2768 The server has a port configured and the maximum nunber of connections.
2769 The HTTPS part has two files with the certificate key and the certificate
2770 file.
2771
2772 The server plugin supports reverse proxies, so a external hostname can be
2773 set using the @code{EXTERNAL_HOSTNAME} setting.
2774 The webserver under this address should forward the request to the peer
2775 and the configure port.
2776
2777 @example
2778 [transport-http_server]
2779 EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet
2780 PORT = 1080
2781 MAX_CONNECTIONS = 128
2782 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2783 @end example
2784
2785 @example
2786 [transport-https_server]
2787 PORT = 4433
2788 CRYPTO_INIT = NORMAL
2789 KEY_FILE = https.key
2790 CERT_FILE = https.cert
2791 MAX_CONNECTIONS = 128
2792 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2793 @end example
2794
2795 @item transport-wlan
2796
2797 The next section describes how to setup the WLAN plugin,
2798 so here only the settings. Just specify the interface to use:
2799
2800 @example
2801 [transport-wlan]
2802 # Name of the interface in monitor mode (typically monX)
2803 INTERFACE = mon0
2804 # Real hardware, no testing
2805 TESTMODE = 0
2806 TESTING_IGNORE_KEYS = ACCEPT_FROM;
2807 @end example
2808 @end itemize
2809
2810 @node Configuring the wlan transport plugin
2811 @subsection Configuring the wlan transport plugin
2812
2813 The wlan transport plugin enables GNUnet to send and to receive data on a
2814 wlan interface.
2815 It has not to be connected to a wlan network as long as sender and
2816 receiver are on the same channel. This enables you to get connection to
2817 GNUnet where no internet access is possible, for example during
2818 catastrophes or when censorship cuts you off from the internet.
2819
2820
2821 @menu
2822 * Requirements for the WLAN plugin::
2823 * Configuration::
2824 * Before starting GNUnet::
2825 * Limitations and known bugs::
2826 @end menu
2827
2828
2829 @node Requirements for the WLAN plugin
2830 @subsubsection Requirements for the WLAN plugin
2831
2832 @itemize @bullet
2833
2834 @item wlan network card with monitor support and packet injection
2835 (see @uref{http://www.aircrack-ng.org/, aircrack-ng.org})
2836
2837 @item Linux kernel with mac80211 stack, introduced in 2.6.22, tested with
2838 2.6.35 and 2.6.38
2839
2840 @item Wlantools to create the a monitor interface, tested with airmon-ng
2841 of the aircrack-ng package
2842 @end itemize
2843
2844 @node Configuration
2845 @subsubsection Configuration
2846
2847 There are the following options for the wlan plugin (they should be like
2848 this in your default config file, you only need to adjust them if the
2849 values are incorrect for your system)
2850
2851 @example
2852 # section for the wlan transport plugin
2853 [transport-wlan]
2854 # interface to use, more information in the
2855 # "Before starting GNUnet" section of the handbook.
2856 INTERFACE = mon0
2857 # testmode for developers:
2858 # 0 use wlan interface,
2859 #1 or 2 use loopback driver for tests 1 = server, 2 = client
2860 TESTMODE = 0
2861 @end example
2862
2863 @node Before starting GNUnet
2864 @subsubsection Before starting GNUnet
2865
2866 Before starting GNUnet, you have to make sure that your wlan interface is
2867 in monitor mode.
2868 One way to put the wlan interface into monitor mode (if your interface
2869 name is wlan0) is by executing:
2870
2871 @example
2872 sudo airmon-ng start wlan0
2873 @end example
2874
2875 @noindent
2876 Here is an example what the result should look like:
2877
2878 @example
2879 Interface Chipset Driver
2880 wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0]
2881 (monitor mode enabled on mon0)
2882 @end example
2883
2884 @noindent
2885 The monitor interface is mon0 is the one that you have to put into the
2886 configuration file.
2887
2888 @node Limitations and known bugs
2889 @subsubsection Limitations and known bugs
2890
2891 Wlan speed is at the maximum of 1 Mbit/s because support for choosing the
2892 wlan speed with packet injection was removed in newer kernels.
2893 Please pester the kernel developers about fixing this.
2894
2895 The interface channel depends on the wlan network that the card is
2896 connected to. If no connection has been made since the start of the
2897 computer, it is usually the first channel of the card.
2898 Peers will only find each other and communicate if they are on the same
2899 channel. Channels must be set manually (i.e. using
2900 @code{iwconfig wlan0 channel 1}).
2901
2902
2903 @node Configuring HTTP(S) reverse proxy functionality using Apache or nginx
2904 @subsection Configuring HTTP(S) reverse proxy functionality using Apache or nginx
2905
2906 The HTTP plugin supports data transfer using reverse proxies. A reverse
2907 proxy forwards the HTTP request he receives with a certain URL to another
2908 webserver, here a GNUnet peer.
2909
2910 So if you have a running Apache or nginx webserver you can configure it to
2911 be a GNUnet reverse proxy. Especially if you have a well-known webiste
2912 this improves censorship resistance since it looks as normal surfing
2913 behaviour.
2914
2915 To do so, you have to do two things:
2916
2917 @itemize @bullet
2918 @item Configure your webserver to forward the GNUnet HTTP traffic
2919 @item Configure your GNUnet peer to announce the respective address
2920 @end itemize
2921
2922 As an example we want to use GNUnet peer running:
2923
2924 @itemize @bullet
2925
2926 @item HTTP server plugin on @code{gnunet.foo.org:1080}
2927
2928 @item HTTPS server plugin on @code{gnunet.foo.org:4433}
2929
2930 @item A apache or nginx webserver on
2931 @uref{http://www.foo.org/, http://www.foo.org:80/}
2932
2933 @item A apache or nginx webserver on https://www.foo.org:443/
2934 @end itemize
2935
2936 And we want the webserver to accept GNUnet traffic under
2937 @code{http://www.foo.org/bar/}. The required steps are described here:
2938
2939 @strong{Configure your Apache2 HTTP webserver}
2940
2941 First of all you need mod_proxy installed.
2942
2943 Edit your webserver configuration. Edit
2944 @code{/etc/apache2/apache2.conf} or the site-specific configuration file.
2945
2946 In the respective @code{server config},@code{virtual host} or
2947 @code{directory} section add the following lines:
2948
2949 @example
2950 ProxyTimeout 300
2951 ProxyRequests Off
2952 <Location /bar/ >
2953 ProxyPass http://gnunet.foo.org:1080/
2954 ProxyPassReverse http://gnunet.foo.org:1080/
2955 </Location>
2956 @end example
2957
2958 @noindent
2959 @strong{Configure your Apache2 HTTPS webserver}
2960
2961 We assume that you already have an HTTPS server running, if not please
2962 check how to configure a HTTPS host. An easy to use example is the
2963 @file{apache2/sites-available/default-ssl} example configuration file.
2964
2965 In the respective HTTPS @code{server config},@code{virtual host} or
2966 @code{directory} section add the following lines:
2967
2968 @example
2969 SSLProxyEngine On
2970 ProxyTimeout 300
2971 ProxyRequests Off
2972 <Location /bar/ >
2973 ProxyPass https://gnunet.foo.org:4433/
2974 ProxyPassReverse https://gnunet.foo.org:4433/
2975 </Location>
2976 @end example
2977
2978 @noindent
2979 More information about the apache mod_proxy configuration can be found
2980 here: @uref{http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass}
2981 .
2982
2983 @strong{Configure your nginx HTTPS webserver}
2984
2985 Since nginx does not support chunked encoding, you first of all have to
2986 install @code{chunkin}: @uref{http://wiki.nginx.org/HttpChunkinModule}.
2987
2988 To enable chunkin add:
2989
2990 @example
2991 chunkin on;
2992 error_page 411 = @@my_411_error;
2993 location @@my_411_error @{
2994 chunkin_resume;
2995 @}
2996 @end example
2997
2998 @noindent
2999 Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
3000 the site-specific configuration file.
3001
3002 In the @code{server} section add:
3003
3004 @example
3005 location /bar/
3006 @{
3007 proxy_pass http://gnunet.foo.org:1080/;
3008 proxy_buffering off;
3009 proxy_connect_timeout 5; # more than http_server
3010 proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
3011 proxy_http_version 1.1; # 1.0 default
3012 proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
3013 @}
3014 @end example
3015
3016 @noindent
3017 @strong{Configure your nginx HTTPS webserver}
3018
3019 Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
3020 the site-specific configuration file.
3021
3022 In the @code{server} section add:
3023
3024 @example
3025 ssl_session_timeout 6m;
3026 location /bar/
3027 @{
3028 proxy_pass https://gnunet.foo.org:4433/;
3029 proxy_buffering off;
3030 proxy_connect_timeout 5; # more than http_server
3031 proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
3032 proxy_http_version 1.1; # 1.0 default
3033 proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
3034 @}
3035 @end example
3036
3037 @noindent
3038 @strong{Configure your GNUnet peer}
3039
3040 To have your GNUnet peer announce the address, you have to specify the
3041 @code{EXTERNAL_HOSTNAME} option in the @code{[transport-http_server]}
3042 section:
3043
3044 @example
3045 [transport-http_server]
3046 EXTERNAL_HOSTNAME = http://www.foo.org/bar/
3047 @end example
3048
3049 @noindent
3050 and/or @code{[transport-https_server]} section:
3051
3052 @example
3053 [transport-https_server]
3054 EXTERNAL_HOSTNAME = https://www.foo.org/bar/
3055 @end example
3056
3057 @noindent
3058 Now restart your webserver and your peer...
3059
3060 @node Blacklisting peers
3061 @subsection Blacklisting peers
3062
3063 Transport service supports to deny connecting to a specific peer of to a
3064 specific peer with a specific transport plugin using te blacklisting
3065 component of transport service. With@ blacklisting it is possible to deny
3066 connections to specific peers of@ to use a specific plugin to a specific
3067 peer. Peers can be blacklisted using@ the configuration or a blacklist
3068 client can be asked.
3069
3070 To blacklist peers using the configuration you have to add a section to
3071 your configuration containing the peer id of the peer to blacklist and
3072 the plugin@ if required.
3073
3074 Examples:
3075
3076 To blacklist connections to P565... on peer AG2P... using tcp add:
3077
3078 @c FIXME: This is too long and produces errors in the pdf.
3079 @example
3080 [transport-blacklist AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
3081 P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp
3082 @end example
3083
3084 To blacklist connections to P565... on peer AG2P... using all plugins add:
3085
3086 @example
3087 [transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
3088 P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G =
3089 @end example
3090
3091 You can also add a blacklist client usign the blacklist API. On a
3092 blacklist check, blacklisting first checks internally if the peer is
3093 blacklisted and if not, it asks the blacklisting clients. Clients are
3094 asked if it is OK to connect to a peer ID, the plugin is omitted.
3095
3096 On blacklist check for (peer, plugin)
3097 @itemize @bullet
3098 @item Do we have a local blacklist entry for this peer and this plugin?@
3099 @item YES: disallow connection@
3100 @item Do we have a local blacklist entry for this peer and all plugins?@
3101 @item YES: disallow connection@
3102 @item Does one of the clients disallow?@
3103 @item YES: disallow connection
3104 @end itemize
3105
3106 @node Configuration of the HTTP and HTTPS transport plugins
3107 @subsection Configuration of the HTTP and HTTPS transport plugins
3108
3109 The client parts of the http and https transport plugins can be configured
3110 to use a proxy to connect to the hostlist server. This functionality can
3111 be configured in the configuration file directly or using the
3112 gnunet-setup tool.
3113
3114 Both the HTTP and HTTPS clients support the following proxy types at
3115 the moment:
3116
3117 @itemize @bullet
3118 @item HTTP 1.1 proxy
3119 @item SOCKS 4/4a/5/5 with hostname
3120 @end itemize
3121
3122 In addition authentication at the proxy with username and password can be
3123 configured.
3124
3125 To configure proxy support for the clients in the gnunet-setup tool,
3126 select the "transport" tab and activate the respective plugin. Now you
3127 can select the appropriate proxy type. The hostname or IP address
3128 (including port if required) has to be entered in the "Proxy hostname"
3129 textbox. If required, enter username and password in the "Proxy username"
3130 and "Proxy password" boxes. Be aware that these information will be stored
3131 in the configuration in plain text.
3132
3133 To configure these options directly in the configuration, you can
3134 configure the following settings in the @code{[transport-http_client]}
3135 and @code{[transport-https_client]} section of the configuration:
3136
3137 @example
3138 # Type of proxy server,
3139 # Valid values: HTTP, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
3140 # Default: HTTP
3141 # PROXY_TYPE = HTTP
3142
3143 # Hostname or IP of proxy server
3144 # PROXY =
3145 # User name for proxy server
3146 # PROXY_USERNAME =
3147 # User password for proxy server
3148 # PROXY_PASSWORD =
3149 @end example
3150
3151 @node Configuring the GNU Name System
3152 @subsection Configuring the GNU Name System
3153
3154 @menu
3155 * Configuring system-wide DNS interception::
3156 * Configuring the GNS nsswitch plugin::
3157 * Configuring GNS on W32::
3158 * GNS Proxy Setup::
3159 * Setup of the GNS CA::
3160 * Testing the GNS setup::
3161 * Automatic Shortening in the GNU Name System::
3162 @end menu
3163
3164
3165 @node Configuring system-wide DNS interception
3166 @subsubsection Configuring system-wide DNS interception
3167
3168 Before you install GNUnet, make sure you have a user and group 'gnunet'
3169 as well as an empty group 'gnunetdns'.
3170
3171 When using GNUnet with system-wide DNS interception, it is absolutely
3172 necessary for all GNUnet service processes to be started by
3173 @code{gnunet-service-arm} as user and group 'gnunet'. You also need to be
3174 sure to run @code{make install} as root (or use the @code{sudo} option to
3175 configure) to grant GNUnet sufficient privileges.
3176
3177 With this setup, all that is required for enabling system-wide DNS
3178 interception is for some GNUnet component (VPN or GNS) to request it.
3179 The @code{gnunet-service-dns} will then start helper programs that will
3180 make the necessary changes to your firewall (@code{iptables}) rules.
3181
3182 Note that this will NOT work if your system sends out DNS traffic to a
3183 link-local IPv6 address, as in this case GNUnet can intercept the traffic,
3184 but not inject the responses from the link-local IPv6 address. Hence you
3185 cannot use system-wide DNS interception in conjunction with link-local
3186 IPv6-based DNS servers. If such a DNS server is used, it will bypass
3187 GNUnet's DNS traffic interception.
3188
3189 Using the GNU Name System (GNS) requires two different configuration
3190 steps.
3191 First of all, GNS needs to be integrated with the operating system. Most
3192 of this section is about the operating system level integration.
3193
3194 Additionally, each individual user who wants to use the system must also
3195 initialize their GNS zones. This can be done by running (after starting
3196 GNUnet)
3197
3198 @example
3199 $ gnunet-gns-import.sh
3200 @end example
3201
3202 @noindent
3203 after the local GNUnet peer has been started. Note that the namestore (in
3204 particular the namestore database backend) should not be reconfigured
3205 afterwards (as records are not automatically migrated between backends).
3206
3207 The remainder of this chapter will detail the various methods for
3208 configuring the use of GNS with your operating system.
3209
3210 At this point in time you have different options depending on your OS:
3211
3212 @table @asis
3213
3214 @item Use the gnunet-gns-proxy This approach works for all operating
3215 systems and is likely the easiest. However, it enables GNS only for
3216 browsers, not for other applications that might be using DNS, such as SSH.
3217 Still, using the proxy is required for using HTTP with GNS and is thus
3218 recommended for all users. To do this, you simply have to run the
3219 @code{gnunet-gns-proxy-setup-ca} script as the user who will run the
3220 browser (this will create a GNS certificate authority (CA) on your system
3221 and import its key into your browser), then start @code{gnunet-gns-proxy}
3222 and inform your browser to use the Socks5 proxy which
3223 @code{gnunet-gns-proxy} makes available by default on port 7777.
3224 @item Use a nsswitch plugin (recommended on GNU systems)
3225 This approach has the advantage of offering fully personalized resolution
3226 even on multi-user systems. A potential disadvantage is that some
3227 applications might be able to bypass GNS.
3228 @item Use a W32 resolver plugin (recommended on W32)
3229 This is currently the only option on W32 systems.
3230 @item Use system-wide DNS packet interception
3231 This approach is recommended for the GNUnet VPN. It can be used to handle
3232 GNS at the same time; however, if you only use this method, you will only
3233 get one root zone per machine (not so great for multi-user systems).
3234 @end table
3235
3236 You can combine system-wide DNS packet interception with the nsswitch
3237 plugin.
3238 The setup of the system-wide DNS interception is described here. All of
3239 the other GNS-specific configuration steps are described in the following
3240 sections.
3241
3242 @node Configuring the GNS nsswitch plugin
3243 @subsubsection Configuring the GNS nsswitch plugin
3244
3245 The Name Service Switch (NSS) is a facility in Unix-like operating systems
3246 @footnote{More accurate: NSS is a functionality of the GNU C Library}
3247 that provides a variety of sources for common configuration databases and
3248 name resolution mechanisms.
3249 A superuser (system administrator) usually configures the
3250 operating system's name services using the file
3251 @file{/etc/nsswitch.conf}.
3252
3253 GNS provides a NSS plugin to integrate GNS name resolution with the
3254 operating system's name resolution process.
3255 To use the GNS NSS plugin you have to either
3256
3257 @itemize @bullet
3258 @item install GNUnet as root or
3259 @item compile GNUnet with the @code{--with-sudo=yes} switch.
3260 @end itemize
3261
3262 Name resolution is controlled by the @emph{hosts} section in the NSS
3263 configuration. By default this section first performs a lookup in the
3264 @file{/etc/hosts} file and then in DNS.
3265 The nsswitch file should contain a line similar to:
3266
3267 @example
3268 hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4
3269 @end example
3270
3271 @noindent
3272 Here the GNS NSS plugin can be added to perform a GNS lookup before
3273 performing a DNS lookup.
3274 The GNS NSS plugin has to be added to the "hosts" section in
3275 @file{/etc/nsswitch.conf} file before DNS related plugins:
3276
3277 @example
3278 ...
3279 hosts: files gns [NOTFOUND=return] dns mdns4_minimal mdns4
3280 ...
3281 @end example
3282
3283 @noindent
3284 The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not
3285 found in GNS it will not be queried in DNS.
3286
3287 @node Configuring GNS on W32
3288 @subsubsection Configuring GNS on W32
3289
3290 This document is a guide to configuring GNU Name System on W32-compatible
3291 platforms.
3292
3293 After GNUnet is installed, run the w32nsp-install tool:
3294
3295 @example
3296 w32nsp-install.exe libw32nsp-0.dll
3297 @end example
3298
3299 @noindent
3300 ('0' is the library version of W32 NSP; it might increase in the future,
3301 change the invocation accordingly).
3302
3303 This will install GNS namespace provider into the system and allow other
3304 applications to resolve names that end in '@strong{gnu}'
3305 and '@strong{zkey}'. Note that namespace provider requires
3306 gnunet-gns-helper-service-w32 to be running, as well as gns service
3307 itself (and its usual dependencies).
3308
3309 Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353},
3310 and this is where gnunet-gns-helper-service-w32 should be listening to
3311 (and is configured to listen to by default).
3312
3313 To uninstall the provider, run:
3314
3315 @example
3316 w32nsp-uninstall.exe
3317 @end example
3318
3319 @noindent
3320 (uses provider GUID to uninstall it, does not need a dll name).
3321
3322 Note that while MSDN claims that other applications will only be able to
3323 use the new namespace provider after re-starting, in reality they might
3324 stat to use it without that. Conversely, they might stop using the
3325 provider after it's been uninstalled, even if they were not re-started.
3326 W32 will not permit namespace provider library to be deleted or
3327 overwritten while the provider is installed, and while there is at least
3328 one process still using it (even after it was uninstalled).
3329
3330 @node GNS Proxy Setup
3331 @subsubsection GNS Proxy Setup
3332
3333 When using the GNU Name System (GNS) to browse the WWW, there are several
3334 issues that can be solved by adding the GNS Proxy to your setup:
3335
3336 @itemize @bullet
3337
3338 @item If the target website does not support GNS, it might assume that it
3339 is operating under some name in the legacy DNS system (such as
3340 example.com). It may then attempt to set cookies for that domain, and the
3341 web server might expect a @code{Host: example.com} header in the request
3342 from your browser.
3343 However, your browser might be using @code{example.gnu} for the
3344 @code{Host} header and might only accept (and send) cookies for
3345 @code{example.gnu}. The GNS Proxy will perform the necessary translations
3346 of the hostnames for cookies and HTTP headers (using the LEHO record for
3347 the target domain as the desired substitute).
3348
3349 @item If using HTTPS, the target site might include an SSL certificate
3350 which is either only valid for the LEHO domain or might match a TLSA
3351 record in GNS. However, your browser would expect a valid certificate for
3352 @code{example.gnu}, not for some legacy domain name. The proxy will
3353 validate the certificate (either against LEHO or TLSA) and then
3354 on-the-fly produce a valid certificate for the exchange, signed by your
3355 own CA. Assuming you installed the CA of your proxy in your browser's
3356 certificate authority list, your browser will then trust the
3357 HTTPS/SSL/TLS connection, as the hostname mismatch is hidden by the proxy.
3358
3359 @item Finally, the proxy will in the future indicate to the server that it
3360 speaks GNS, which will enable server operators to deliver GNS-enabled web
3361 sites to your browser (and continue to deliver legacy links to legacy
3362 browsers)
3363 @end itemize
3364
3365 @node Setup of the GNS CA
3366 @subsubsection Setup of the GNS CA
3367
3368 First you need to create a CA certificate that the proxy can use.
3369 To do so use the provided script gnunet-gns-proxy-ca:
3370
3371 @example
3372 $ gnunet-gns-proxy-setup-ca
3373 @end example
3374
3375 @noindent
3376 This will create a personal certification authority for you and add this
3377 authority to the firefox and chrome database. The proxy will use the this
3378 CA certificate to generate @code{*.gnu} client certificates on the fly.
3379
3380 Note that the proxy uses libcurl. Make sure your version of libcurl uses
3381 GnuTLS and NOT OpenSSL. The proxy will @b{not} work with libcurl compiled
3382 against OpenSSL.
3383
3384 You can check the configuration your libcurl was build with by
3385 running:
3386
3387 @example
3388 curl --version
3389 @end example
3390
3391 the output will look like this (without the linebreaks):
3392
3393 @example
3394 gnurl --version
3395 curl 7.56.0 (x86_64-unknown-linux-gnu) libcurl/7.56.0 \
3396 GnuTLS/3.5.13 zlib/1.2.11 libidn2/2.0.4
3397 Release-Date: 2017-10-08
3398 Protocols: http https 
3399 Features: AsynchDNS IDN IPv6 Largefile NTLM SSL libz \
3400 TLS-SRP UnixSockets HTTPS-proxy
3401 @end example
3402
3403 @node Testing the GNS setup
3404 @subsubsection Testing the GNS setup
3405
3406 Now for testing purposes we can create some records in our zone to test
3407 the SSL functionality of the proxy:
3408
3409 @example
3410 $ gnunet-namestore -a -e "1 d" -n "homepage" -t A -V 131.159.74.67
3411 $ gnunet-namestore -a -e "1 d" -n "homepage" -t LEHO -V "gnunet.org"
3412 @end example
3413
3414 @noindent
3415 At this point we can start the proxy. Simply execute
3416
3417 @example
3418 $ gnunet-gns-proxy
3419 @end example
3420
3421 @noindent
3422 Configure your browser to use this SOCKSv5 proxy on port 7777 and visit
3423 this link.
3424 If you use @command{Firefox} (or one of its deriviates/forks such as
3425 Icecat) you also have to go to @code{about:config} and set the key
3426 @code{network.proxy.socks_remote_dns} to @code{true}.
3427
3428 When you visit @code{https://homepage.gnu/}, you should get to the
3429 @code{https://gnunet.org/} frontpage and the browser (with the correctly
3430 configured proxy) should give you a valid SSL certificate for
3431 @code{homepage.gnu} and no warnings. It should look like this:
3432
3433 @c FIXME: Image does not exist, create it or save it from Drupal?
3434 @c @image{images/gnunethpgns.png,5in,, picture of homepage.gnu in Webbrowser}
3435
3436 @node Automatic Shortening in the GNU Name System
3437 @subsubsection Automatic Shortening in the GNU Name System
3438
3439 This page describes a possible option for 'automatic name shortening',
3440 which you can choose to enable with the GNU Name System.
3441
3442 When GNS encounters a name for the first time, it can use the 'NICK'
3443 record of the originating zone to automatically generate a name for the
3444 zone. If automatic shortening is enabled, those auto-generated names will
3445 be placed (as private records) into your personal 'shorten' zone (to
3446 prevent confusion with manually selected names).
3447 Then, in the future, if the same name is encountered again, GNS will
3448 display the shortened name instead (the first time, the long name will
3449 still be used as shortening typically happens asynchronously as looking up
3450 the 'NICK' record takes some time). Using this feature can be a convenient
3451 way to avoid very long @code{.gnu} names; however, note that names from
3452 the shorten-zone are assigned on a first-come-first-serve basis and should
3453 not be trusted. Furthermore, if you enable this feature, you will no
3454 longer see the full delegation chain for zones once shortening has been
3455 applied.
3456
3457 @node Configuring the GNUnet VPN
3458 @subsection Configuring the GNUnet VPN
3459
3460 @menu
3461 * IPv4 address for interface::
3462 * IPv6 address for interface::
3463 * Configuring the GNUnet VPN DNS::
3464 * Configuring the GNUnet VPN Exit Service::
3465 * IP Address of external DNS resolver::
3466 * IPv4 address for Exit interface::
3467 * IPv6 address for Exit interface::
3468 @end menu
3469
3470 Before configuring the GNUnet VPN, please make sure that system-wide DNS
3471 interception is configured properly as described in the section on the
3472 GNUnet DNS setup. @pxref{Configuring the GNU Name System},
3473 if you haven't done so already.
3474
3475 The default options for the GNUnet VPN are usually sufficient to use
3476 GNUnet as a Layer 2 for your Internet connection.
3477 However, what you always have to specify is which IP protocol you want
3478 to tunnel: IPv4, IPv6 or both.
3479 Furthermore, if you tunnel both, you most likely should also tunnel
3480 all of your DNS requests.
3481 You theoretically can tunnel "only" your DNS traffic, but that usually
3482 makes little sense.
3483
3484 The other options as shown on the gnunet-setup tool are:
3485
3486 @node IPv4 address for interface
3487 @subsubsection IPv4 address for interface
3488
3489 This is the IPv4 address the VPN interface will get. You should pick an
3490 'private' IPv4 network that is not yet in use for you system. For example,
3491 if you use @code{10.0.0.1/255.255.0.0} already, you might use
3492 @code{10.1.0.1/255.255.0.0}.
3493 If you use @code{10.0.0.1/255.0.0.0} already, then you might use
3494 @code{192.168.0.1/255.255.0.0}.
3495 If your system is not in a private IP-network, using any of the above will
3496 work fine.
3497 You should try to make the mask of the address big enough
3498 (@code{255.255.0.0} or, even better, @code{255.0.0.0}) to allow more
3499 mappings of remote IP Addresses into this range.
3500 However, even a @code{255.255.255.0} mask will suffice for most users.
3501
3502 @node IPv6 address for interface
3503 @subsubsection IPv6 address for interface
3504
3505 The IPv6 address the VPN interface will get. Here you can specify any
3506 non-link-local address (the address should not begin with @code{fe80:}).
3507 A subnet Unique Local Unicast (@code{fd00::/8} prefix) that you are
3508 currently not using would be a good choice.
3509
3510 @node Configuring the GNUnet VPN DNS
3511 @subsubsection Configuring the GNUnet VPN DNS
3512
3513 To resolve names for remote nodes, activate the DNS exit option.
3514
3515 @node Configuring the GNUnet VPN Exit Service
3516 @subsubsection Configuring the GNUnet VPN Exit Service
3517
3518 If you want to allow other users to share your Internet connection (yes,
3519 this may be dangerous, just as running a Tor exit node) or want to
3520 provide access to services on your host (this should be less dangerous,
3521 as long as those services are secure), you have to enable the GNUnet exit
3522 daemon.
3523
3524 You then get to specify which exit functions you want to provide. By
3525 enabling the exit daemon, you will always automatically provide exit
3526 functions for manually configured local services (this component of the
3527 system is under
3528 development and not documented further at this time). As for those
3529 services you explicitly specify the target IP address and port, there is
3530 no significant security risk in doing so.
3531
3532 Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet.
3533 Being a DNS exit is usually pretty harmless. However, enabling IPv4 or
3534 IPv6-exit without further precautions may enable adversaries to access
3535 your local network, send spam, attack other systems from your Internet
3536 connection and to other mischief that will appear to come from your
3537 machine. This may or may not get you into legal trouble.
3538 If you want to allow IPv4 or IPv6-exit functionality, you should strongly
3539 consider adding additional firewall rules manually to protect your local
3540 network and to restrict outgoing TCP traffic (i.e. by not allowing access
3541 to port 25). While we plan to improve exit-filtering in the future,
3542 you're currently on your own here.
3543 Essentially, be prepared for any kind of IP-traffic to exit the respective
3544 TUN interface (and GNUnet will enable IP-forwarding and NAT for the
3545 interface automatically).
3546
3547 Additional configuration options of the exit as shown by the gnunet-setup
3548 tool are:
3549
3550 @node IP Address of external DNS resolver
3551 @subsubsection IP Address of external DNS resolver
3552
3553 If DNS traffic is to exit your machine, it will be send to this DNS
3554 resolver. You can specify an IPv4 or IPv6 address.
3555
3556 @node IPv4 address for Exit interface
3557 @subsubsection IPv4 address for Exit interface
3558
3559 This is the IPv4 address the Interface will get. Make the mask of the
3560 address big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more
3561 mappings of IP addresses into this range. As for the VPN interface, any
3562 unused, private IPv4 address range will do.
3563
3564 @node IPv6 address for Exit interface
3565 @subsubsection IPv6 address for Exit interface
3566
3567 The public IPv6 address the interface will get. If your kernel is not a
3568 very recent kernel and you are willing to manually enable IPv6-NAT, the
3569 IPv6 address you specify here must be a globally routed IPv6 address of
3570 your host.
3571
3572 Suppose your host has the address @code{2001:4ca0::1234/64}, then
3573 using @code{2001:4ca0::1:0/112} would be fine (keep the first 64 bits,
3574 then change at least one bit in the range before the bitmask, in the
3575 example above we changed bit 111 from 0 to 1).
3576
3577 You may also have to configure your router to route traffic for the entire
3578 subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this
3579 should be automatic with IPv6, but obviously anything can be
3580 disabled).
3581
3582 @node Bandwidth Configuration
3583 @subsection Bandwidth Configuration
3584
3585 You can specify how many bandwidth GNUnet is allowed to use to receive
3586 and send data. This is important for users with limited bandwidth or
3587 traffic volume.
3588
3589 @node Configuring NAT
3590 @subsection Configuring NAT
3591
3592 Most hosts today do not have a normal global IP address but instead are
3593 behind a router performing Network Address Translation (NAT) which assigns
3594 each host in the local network a private IP address.
3595 As a result, these machines cannot trivially receive inbound connections
3596 from the Internet. GNUnet supports NAT traversal to enable these machines
3597 to receive incoming connections from other peers despite their
3598 limitations.
3599
3600 In an ideal world, you can press the "Attempt automatic configuration"
3601 button in gnunet-setup to automatically configure your peer correctly.
3602 Alternatively, your distribution might have already triggered this
3603 automatic configuration during the installation process.
3604 However, automatic configuration can fail to determine the optimal
3605 settings, resulting in your peer either not receiving as many connections
3606 as possible, or in the worst case it not connecting to the network at all.
3607
3608 To manually configure the peer, you need to know a few things about your
3609 network setup. First, determine if you are behind a NAT in the first
3610 place.
3611 This is always the case if your IP address starts with "10.*" or
3612 "192.168.*". Next, if you have control over your NAT router, you may
3613 choose to manually configure it to allow GNUnet traffic to your host.
3614 If you have configured your NAT to forward traffic on ports 2086 (and
3615 possibly 1080) to your host, you can check the "NAT ports have been opened
3616 manually" option, which corresponds to the "PUNCHED_NAT" option in the
3617 configuration file. If you did not punch your NAT box, it may still be
3618 configured to support UPnP, which allows GNUnet to automatically
3619 configure it. In that case, you need to install the "upnpc" command,
3620 enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal
3621 via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the
3622 configuration file).
3623
3624 Some NAT boxes can be traversed using the autonomous NAT traversal method.
3625 This requires certain GNUnet components to be installed with "SUID"
3626 prividledges on your system (so if you're installing on a system you do
3627 not have administrative rights to, this will not work).
3628 If you installed as 'root', you can enable autonomous NAT traversal by
3629 checking the "Enable NAT traversal using ICMP method".
3630 The ICMP method requires a way to determine your NAT's external (global)
3631 IP address. This can be done using either UPnP, DynDNS, or by manual
3632 configuration. If you have a DynDNS name or know your external IP address,
3633 you should enter that name under "External (public) IPv4 address" (which
3634 corresponds to the "EXTERNAL_ADDRESS" option in the configuration file).
3635 If you leave the option empty, GNUnet will try to determine your external
3636 IP address automatically (which may fail, in which case autonomous
3637 NAT traversal will then not work).
3638
3639 Finally, if you yourself are not behind NAT but want to be able to
3640 connect to NATed peers using autonomous NAT traversal, you need to check
3641 the "Enable connecting to NATed peers using ICMP method" box.
3642
3643
3644 @node Peer configuration for distributions
3645 @subsection Peer configuration for distributions
3646
3647 The "GNUNET_DATA_HOME" in "[path]" in @file{/etc/gnunet.conf} should be
3648 manually set to "/var/lib/gnunet/data/" as the default
3649 "~/.local/share/gnunet/" is probably not that appropriate in this case.
3650 Similarly, distributions may consider pointing "GNUNET_RUNTIME_DIR" to
3651 "/var/run/gnunet/" and "GNUNET_HOME" to "/var/lib/gnunet/". Also, should a
3652 distribution decide to override system defaults, all of these changes
3653 should be done in a custom @file{/etc/gnunet.conf} and not in the files
3654 in the @file{config.d/} directory.
3655
3656 Given the proposed access permissions, the "gnunet-setup" tool must be
3657 run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it
3658 modifies the system configuration). As always, gnunet-setup should be run
3659 after the GNUnet peer was stopped using "gnunet-arm -e". Distributions
3660 might want to include a wrapper for gnunet-setup that allows the
3661 desktop-user to "sudo" (i.e. using gtksudo) to the "gnunet" user account
3662 and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in
3663 sequence.
3664
3665 @node How to start and stop a GNUnet peer
3666 @section How to start and stop a GNUnet peer
3667
3668 This section describes how to start a GNUnet peer. It assumes that you
3669 have already compiled and installed GNUnet and its' dependencies.
3670 Before you start a GNUnet peer, you may want to create a configuration
3671 file using gnunet-setup (but you do not have to).
3672 Sane defaults should exist in your
3673 @file{$GNUNET_PREFIX/share/gnunet/config.d/} directory, so in practice
3674 you could simply start without any configuration. If you want to
3675 configure your peer later, you need to stop it before invoking the
3676 @code{gnunet-setup} tool to customize further and to test your
3677 configuration (@code{gnunet-setup} has build-in test functions).
3678
3679 The most important option you might have to still set by hand is in
3680 [PATHS]. Here, you use the option "GNUNET_HOME" to specify the path where
3681 GNUnet should store its data.
3682 It defaults to @code{$HOME/}, which again should work for most users.
3683 Make sure that the directory specified as GNUNET_HOME is writable to
3684 the user that you will use to run GNUnet (note that you can run frontends
3685 using other users, GNUNET_HOME must only be accessible to the user used to
3686 run the background processes).
3687
3688 You will also need to make one central decision: should all of GNUnet be
3689 run under your normal UID, or do you want distinguish between system-wide
3690 (user-independent) GNUnet services and personal GNUnet services. The
3691 multi-user setup is slightly more complicated, but also more secure and
3692 generally recommended.
3693
3694 @menu
3695 * The Single-User Setup::
3696 * The Multi-User Setup::
3697 * Killing GNUnet services::
3698 * Access Control for GNUnet::
3699 @end menu
3700
3701 @node The Single-User Setup
3702 @subsection The Single-User Setup
3703
3704 For the single-user setup, you do not need to do anything special and can
3705 just start the GNUnet background processes using @code{gnunet-arm}.
3706 By default, GNUnet looks in @file{~/.config/gnunet.conf} for a
3707 configuration (or @code{$XDG_CONFIG_HOME/gnunet.conf} if@
3708 @code{$XDG_CONFIG_HOME} is defined). If your configuration lives
3709 elsewhere, you need to pass the @code{-c FILENAME} option to all GNUnet
3710 commands.
3711
3712 Assuming the configuration file is called @file{~/.config/gnunet.conf},
3713 you start your peer using the @code{gnunet-arm} command (say as user
3714 @code{gnunet}) using:
3715
3716 @example
3717 gnunet-arm -c ~/.config/gnunet.conf -s
3718 @end example
3719
3720 @noindent
3721 The "-s" option here is for "start". The command should return almost
3722 instantly. If you want to stop GNUnet, you can use:
3723
3724 @example
3725 gnunet-arm -c ~/.config/gnunet.conf -e
3726 @end example
3727
3728 @noindent
3729 The "-e" option here is for "end".
3730
3731 Note that this will only start the basic peer, no actual applications
3732 will be available.
3733 If you want to start the file-sharing service, use (after starting
3734 GNUnet):
3735
3736 @example
3737 gnunet-arm -c ~/.config/gnunet.conf -i fs
3738 @end example
3739
3740 @noindent
3741 The "-i fs" option here is for "initialize" the "fs" (file-sharing)
3742 application. You can also selectively kill only file-sharing support using
3743
3744 @example
3745 gnunet-arm -c ~/.config/gnunet.conf -k fs
3746 @end example
3747
3748 @noindent
3749 Assuming that you want certain services (like file-sharing) to be always
3750 automatically started whenever you start GNUnet, you can activate them by
3751 setting "FORCESTART=YES" in the respective section of the configuration
3752 file (for example, "[fs]"). Then GNUnet with file-sharing support would
3753 be started whenever you@ enter:
3754
3755 @example
3756 gnunet-arm -c ~/.config/gnunet.conf -s
3757 @end example
3758
3759 @noindent
3760 Alternatively, you can combine the two options:
3761
3762 @example
3763 gnunet-arm -c ~/.config/gnunet.conf -s -i fs
3764 @end example
3765
3766 @noindent
3767 Using @code{gnunet-arm} is also the preferred method for initializing
3768 GNUnet from @code{init}.
3769
3770 Finally, you should edit your @code{crontab} (using the @code{crontab}
3771 command) and insert a line@
3772
3773 @example
3774 @@reboot gnunet-arm -c ~/.config/gnunet.conf -s
3775 @end example
3776
3777 to automatically start your peer whenever your system boots.
3778
3779 @node The Multi-User Setup
3780 @subsection The Multi-User Setup
3781
3782 This requires you to create a user @code{gnunet} and an additional group
3783 @code{gnunetdns}, prior to running @code{make install} during
3784 installation.
3785 Then, you create a configuration file @file{/etc/gnunet.conf} which should
3786 contain the lines:@
3787
3788 @example
3789 [arm]
3790 SYSTEM_ONLY = YES
3791 USER_ONLY = NO
3792 @end example
3793
3794 @noindent
3795 Then, perform the same steps to run GNUnet as in the per-user
3796 configuration, except as user @code{gnunet} (including the
3797 @code{crontab} installation).
3798 You may also want to run @code{gnunet-setup} to configure your peer
3799 (databases, etc.).
3800 Make sure to pass @code{-c /etc/gnunet.conf} to all commands. If you
3801 run @code{gnunet-setup} as user @code{gnunet}, you might need to change
3802 permissions on @file{/etc/gnunet.conf} so that the @code{gnunet} user can
3803 write to the file (during setup).
3804
3805 Afterwards, you need to perform another setup step for each normal user
3806 account from which you want to access GNUnet. First, grant the normal user
3807 (@code{$USER}) permission to the group gnunet:
3808
3809 @example
3810 # adduser $USER gnunet
3811 @end example
3812
3813 @noindent
3814 Then, create a configuration file in @file{~/.config/gnunet.conf} for the
3815 $USER with the lines:
3816
3817 @example
3818 [arm]
3819 SYSTEM_ONLY = NO
3820 USER_ONLY = YES
3821 @end example
3822
3823 @noindent
3824 This will ensure that @code{gnunet-arm} when started by the normal user
3825 will only run services that are per-user, and otherwise rely on the
3826 system-wide services.
3827 Note that the normal user may run gnunet-setup, but the
3828 configuration would be ineffective as the system-wide services will use
3829 @file{/etc/gnunet.conf} and ignore options set by individual users.
3830
3831 Again, each user should then start the peer using
3832 @file{gnunet-arm -s} --- and strongly consider adding logic to start
3833 the peer automatically to their crontab.
3834
3835 Afterwards, you should see two (or more, if you have more than one USER)
3836 @code{gnunet-service-arm} processes running in your system.
3837
3838 @node Killing GNUnet services
3839 @subsection Killing GNUnet services
3840
3841 It is not necessary to stop GNUnet services explicitly when shutting
3842 down your computer.
3843
3844 It should be noted that manually killing "most" of the
3845 @code{gnunet-service} processes is generally not a successful method for
3846 stopping a peer (since @code{gnunet-service-arm} will instantly restart
3847 them). The best way to explicitly stop a peer is using
3848 @code{gnunet-arm -e}; note that the per-user services may need to be
3849 terminated before the system-wide services will terminate normally.
3850
3851 @node Access Control for GNUnet
3852 @subsection Access Control for GNUnet
3853
3854 This chapter documents how we plan to make access control work within the
3855 GNUnet system for a typical peer. It should be read as a best-practice
3856 installation guide for advanced users and builders of binary
3857 distributions. The recommendations in this guide apply to POSIX-systems
3858 with full support for UNIX domain sockets only.
3859
3860 Note that this is an advanced topic. The discussion presumes a very good
3861 understanding of users, groups and file permissions. Normal users on
3862 hosts with just a single user can just install GNUnet under their own
3863 account (and possibly allow the installer to use SUDO to grant additional
3864 permissions for special GNUnet tools that need additional rights).
3865 The discussion below largely applies to installations where multiple users
3866 share a system and to installations where the best possible security is
3867 paramount.
3868
3869 A typical GNUnet system consists of components that fall into four
3870 categories:
3871
3872 @table @asis
3873
3874 @item User interfaces
3875 User interfaces are not security sensitive and are supposed to be run and
3876 used by normal system users.
3877 The GTK GUIs and most command-line programs fall into this category.
3878 Some command-line tools (like gnunet-transport) should be excluded as they
3879 offer low-level access that normal users should not need.
3880 @item System services and support tools
3881 System services should always run and offer services that can then be
3882 accessed by the normal users.
3883 System services do not require special permissions, but as they are not
3884 specific to a particular user, they probably should not run as a
3885 particular user. Also, there should typically only be one GNUnet peer per
3886 host. System services include the gnunet-service and gnunet-daemon
3887 programs; support tools include command-line programs such as gnunet-arm.
3888 @item Priviledged helpers
3889 Some GNUnet components require root rights to open raw sockets or perform
3890 other special operations. These gnunet-helper binaries are typically
3891 installed SUID and run from services or daemons.
3892 @item Critical services
3893 Some GNUnet services (such as the DNS service) can manipulate the service
3894 in deep and possibly highly security sensitive ways. For example, the DNS
3895 service can be used to intercept and alter any DNS query originating from
3896 the local machine. Access to the APIs of these critical services and their
3897 priviledged helpers must be tightly controlled.
3898 @end table
3899
3900 @c FIXME: The titles of these chapters are too long in the index.
3901
3902 @menu
3903 * Recommendation - Disable access to services via TCP::
3904 * Recommendation - Run most services as system user "gnunet"::
3905 * Recommendation - Control access to services using group "gnunet"::
3906 * Recommendation - Limit access to certain SUID binaries by group "gnunet"::
3907 * Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"::
3908 * Differences between "make install" and these recommendations::
3909 @end menu
3910
3911 @node Recommendation - Disable access to services via TCP
3912 @subsubsection Recommendation - Disable access to services via TCP
3913
3914 GNUnet services allow two types of access: via TCP socket or via UNIX
3915 domain socket.
3916 If the service is available via TCP, access control can only be
3917 implemented by restricting connections to a particular range of IP
3918 addresses.
3919 This is acceptable for non-critical services that are supposed to be
3920 available to all users on the local system or local network.
3921 However, as TCP is generally less efficient and it is rarely the case
3922 that a single GNUnet peer is supposed to serve an entire local network,
3923 the default configuration should disable TCP access to all GNUnet
3924 services on systems with support for UNIX domain sockets.
3925 As of GNUnet 0.9.2, configuration files with TCP access disabled should be
3926 generated by default. Users can re-enable TCP access to particular
3927 services simply by specifying a non-zero port number in the section of
3928 the respective service.
3929
3930
3931 @node Recommendation - Run most services as system user "gnunet"
3932 @subsubsection Recommendation - Run most services as system user "gnunet"
3933
3934 GNUnet's main services should be run as a separate user "gnunet" in a
3935 special group "gnunet".
3936 The user "gnunet" should start the peer using "gnunet-arm -s" during
3937 system startup. The home directory for this user should be
3938 @file{/var/lib/gnunet} and the configuration file should be
3939 @file{/etc/gnunet.conf}.
3940 Only the @code{gnunet} user should have the right to access
3941 @file{/var/lib/gnunet} (@emph{mode: 700}).
3942
3943 @node Recommendation - Control access to services using group "gnunet"
3944 @subsubsection Recommendation - Control access to services using group "gnunet"
3945
3946 Users that should be allowed to use the GNUnet peer should be added to the
3947 group "gnunet". Using GNUnet's access control mechanism for UNIX domain
3948 sockets, those services that are considered useful to ordinary users
3949 should be made available by setting "UNIX_MATCH_GID=YES" for those
3950 services.
3951 Again, as shipped, GNUnet provides reasonable defaults.
3952 Permissions to access the transport and core subsystems might additionally
3953 be granted without necessarily causing security concerns.
3954 Some services, such as DNS, must NOT be made accessible to the "gnunet"
3955 group (and should thus only be accessible to the "gnunet" user and
3956 services running with this UID).
3957
3958 @node Recommendation - Limit access to certain SUID binaries by group "gnunet"
3959 @subsubsection Recommendation - Limit access to certain SUID binaries by group "gnunet"
3960
3961 Most of GNUnet's SUID binaries should be safe even if executed by normal
3962 users. However, it is possible to reduce the risk a little bit more by
3963 making these binaries owned by the group "gnunet" and restricting their
3964 execution to user of the group "gnunet" as well (4750).
3965
3966 @node Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"
3967 @subsubsection Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"
3968
3969 A special group "gnunetdns" should be created for controlling access to
3970 the "gnunet-helper-dns".
3971 The binary should then be owned by root and be in group "gnunetdns" and
3972 be installed SUID and only be group-executable (2750).
3973 @b{Note that the group "gnunetdns" should have no users in it at all,
3974 ever.}
3975 The "gnunet-service-dns" program should be executed by user "gnunet" (via
3976 gnunet-service-arm) with the binary owned by the user "root" and the group
3977 "gnunetdns" and be SGID (2700). This way, @strong{only}
3978 "gnunet-service-dns" can change its group to "gnunetdns" and execute the
3979 helper, and the helper can then run as root (as per SUID).
3980 Access to the API offered by "gnunet-service-dns" is in turn restricted
3981 to the user "gnunet" (not the group!), which means that only
3982 "benign" services can manipulate DNS queries using "gnunet-service-dns".
3983
3984 @node Differences between "make install" and these recommendations
3985 @subsubsection Differences between "make install" and these recommendations
3986
3987 The current build system does not set all permissions automatically based
3988 on the recommendations above. In particular, it does not use the group
3989 "gnunet" at all (so setting gnunet-helpers other than the
3990 gnunet-helper-dns to be owned by group "gnunet" must be done manually).
3991 Furthermore, 'make install' will silently fail to set the DNS binaries to
3992 be owned by group "gnunetdns" unless that group already exists (!).
3993 An alternative name for the "gnunetdns" group can be specified using the
3994 @code{--with-gnunetdns=GRPNAME} configure option.
3995