aboutsummaryrefslogtreecommitdiff
path: root/doc/documentation/chapters/installation.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/documentation/chapters/installation.texi')
-rw-r--r--doc/documentation/chapters/installation.texi3995
1 files changed, 3995 insertions, 0 deletions
diff --git a/doc/documentation/chapters/installation.texi b/doc/documentation/chapters/installation.texi
new file mode 100644
index 000000000..dfd94d037
--- /dev/null
+++ b/doc/documentation/chapters/installation.texi
@@ -0,0 +1,3995 @@
1@node GNUnet Installation Handbook
2@chapter GNUnet Installation Handbook
3
4This handbook describes how to install (build setup, compilation) and
5setup (configuration, start) GNUnet 0.10.x. After following these
6instructions you should be able to install and then start user-interfaces
7to interact with the network.
8
9This manual is far from complete, and we welcome informed contributions,
10be 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
31This section lists the various known dependencies for
32GNUnet @value{EDITION}.
33Suggestions 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
46These packages must be installed before a typical GNUnet installation
47can 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
68with 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;
77GnuTLS also requires GNU nettle 2.7 (update: GnuTLS 3.2.7 appears NOT
78to work against GNU nettle > 2.7, due to some API updatings done by
79nettle. Thus it should be compiled against nettle 2.7
80and, in case you get some error on the reference to `rpl_strerror' being
81undefined, follow the instructions on
82@uref{http://lists.gnupg.org/pipermail/gnutls-devel/2013-November/006588.html, this}
83post (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
91compile and often work with lower version numbers, but you may get subtle
92bugs with respect to quota management in certain rare cases);
93alternatively, MySQL or Postgres can also be installed, but those
94databases will require more complex configurations (not
95recommended for first-time users)}
96@item zlib
97@end itemize
98
99@node Fixing libgnurl build issues
100@subsection Fixing libgnurl build issues
101
102If you have to compile libgnurl from source since the version included in
103your distribution is to old you perhaps get an error message while
104running the @file{configure} script:
105
106@example
107$ configure
108...
109checking for 64-bit curl_off_t data type... unknown
110checking for 32-bit curl_off_t data type... unknown
111checking for 16-bit curl_off_t data type... unknown
112configure: error: cannot find data type for curl_off_t.
113@end example
114
115@noindent
116Solution:
117
118Before running the configure script, set:
119
120@example
121CFLAGS="-I. -I$BUILD_ROOT/include"
122@end example
123
124@node Optional dependencies
125@subsection Optional dependencies
126
127These applications must be installed for various experimental or otherwise
128optional 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
135the 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
145This section tries to give an overview of what processes a typical GNUnet
146peer running a particular application would consist of. All of the
147processes listed here should be automatically started by
148@code{gnunet-arm -s}.
149The list is given as a rough first guide to users for failure diagnostics.
150Ideally, end-users should never have to worry about these internal
151dependencies.
152In terms of internal dependencies, a minimum file-sharing system consists
153of 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
171A minimum VPN system consists of the following GNUnet processes (in
172order 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
190A minimum GNS system consists of the following GNUnet processes (in
191order 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
214Please 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
222First, in addition to the GNUnet sources you might require downloading the
223latest version of various dependencies, depending on how recent the
224software versions in your distribution of GNU/Linux are.
225Most distributions do not include sufficiently recent versions of these
226dependencies.
227Thus, a typically installation on a "modern" GNU/Linux distribution
228requires you to install the following dependencies (ideally in this
229order):
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
239Make sure to first install the various mandatory and optional
240dependencies including development headers from your distribution.
241
242Other dependencies that you should strongly consider to install is a
243database (MySQL, sqlite or Postgres).
244The following instructions will assume that you installed at least sqlite.
245For most distributions you should be able to find pre-build packages for
246the database. Again, make sure to install the client libraries and the
247respective development headers (if they are packaged separately) as well.
248
249You can find specific, detailed instructions for installing of the
250dependencies (and possibly the rest of the GNUnet installation) in the
251platform-specific descriptions, which can be found in the Index.
252Please consult them now.
253If your distribution is not listed, please study the instructions for
254Debian stable carefully as you try to install the dependencies for your
255own distribution.
256Contributing additional instructions for further platforms is always
257appreciated.
258Please take in mind that operating system development tends to move at
259a rather fast speed. Due to this you should be aware that some of
260the instructionss could be outdated by the time you are reading this.
261If you find a mistake, please tell us about it (or even better: send
262a patch to the documentation to fix it!).
263
264Before proceeding further, please double-check the dependency list.
265Note that in addition to satisfying the dependencies, you might have to
266make sure that development headers for the various libraries are also
267installed.
268There maybe files for other distributions, or you might be able to find
269equivalent packages for your distribution.
270
271While it is possible to build and install GNUnet without having root
272access, we will assume that you have full control over your system in
273these instructions.
274First, you should create a system user @emph{gnunet} and an additional
275group @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
284On 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
291Now 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
301If 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.
304DEBUG-level log messages are in English-only and should only be useful for
305developers (or for filing really detailed bug reports).
306
307Finally, you probably want to compile @code{gnunet-gtk}, which
308includes gnunet-setup (graphical tool for configuration)
309and @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
323Next, edit the file @file{/etc/gnunet.conf} to contain the following:
324
325@example
326[arm]
327SYSTEM_ONLY = YES
328USER_ONLY = NO
329@end example
330
331@noindent
332You 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
340Then, 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
347You may also want to add the last line in the gnunet users @file{crontab}
348prefixed with @code{@@reboot} so that it is executed whenever the system
349is booted:
350
351@example
352@@reboot /usr/local/bin/gnunet-arm -c /etc/gnunet.conf -s@
353@end example
354
355@noindent
356This will only start the system-wide GNUnet services.
357Type exit to get back your root shell.
358Now, 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
366to allow them to access the system-wide GNUnet services. Then, each
367user should create a configuration file @file{~/.config/gnunet.conf}
368with the lines:
369
370@example
371[arm]
372SYSTEM_ONLY = NO
373USER_ONLY = YES
374DEFAULTSERVICES = gns
375@end example
376
377@noindent
378and start the per-user services using
379
380@example
381$ gnunet-arm -c ~/.config/gnunet.conf -s
382@end example
383
384@noindent
385Again, 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
392Note that some GNUnet services (such as SOCKS5 proxies) may need a
393system-wide TCP port for each user.
394For those services, systems with more than one user may require each user
395to specify a different port number in their personal configuration file.
396
397Finally, the user should perform the basic initial setup for the GNU Name
398System. 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
406The first generates the default zones, wheras the second setups the GNS
407Certificate Authority with the user's browser. Now, to actiave GNS in the
408normal DNS resolution process, you need to edit your
409@file{/etc/nsswitch.conf} where you should find a line like this:
410
411@example
412hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
413@end example
414
415@noindent
416The exact details may differ a bit, which is fine. Add the text
417@emph{"gns [NOTFOUND=return]"} after @emph{"files"}.
418Keep in mind that we included a backslash ("\") here just for
419markup reasons. You should write the text below on @b{one line}
420and @b{without} the "\":
421
422@example
423hosts: files gns [NOTFOUND=return] mdns4_minimal \
424[NOTFOUND=return] dns mdns4
425@end example
426
427@c FIXME: Document new behavior.
428You might want to make sure that @file{/lib/libnss_gns.so.2} exists on
429your 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
450First, make sure Git is installed on your system:
451
452@example
453$ sudo apt-get install git
454@end example
455
456Install 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
548Install 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
557Build 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
575Install 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
585Choose one or more database backends:
586
587SQLite3:
588@example
589$ sudo apt-get install libsqlite3-dev
590@end example
591MySQL:
592@example
593$ sudo apt-get install libmysqlclient-dev
594@end example
595PostgreSQL:
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
617You can specify the location of the GNUnet installation by setting the
618prefix 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
627Please make sure NOW that you have created a user and group 'gnunet'
628and additionally a group 'gnunetdns':
629
630@example
631$ sudo addgroup gnunet
632$ sudo addgroup gnunetdns
633$ sudo adduser gnunet
634@end example
635
636Each GNUnet user should be added to the 'gnunet' group (may
637require 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
646Some components, like the nss plugin required for GNS, may require root
647permissions. 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
662Use the required configure call including the optional installation prefix
663PREFIX 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
673After installing it, you need to create an empty configuration file:
674
675@example
676mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf
677@end example
678
679And 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
689Install depencies:
690
691@example
692$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \
693libqrencode-dev
694@end example
695
696To 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
723This document is a guide to building GNUnet and its dependencies on
724Windows platforms. GNUnet development is mostly done under GNU/Linux and
725especially git checkouts may not build out of the box.
726We regret any inconvenience, and if you have problems, please report
727them.
728
729@node Requirements
730@subsection Requirements
731
732The 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
736is a convenient set of scripts which creates a working msys/mingw
737installation and installs most dependencies required for GNUnet.
738
739As of the point of the creation of these instructions,
740GNUnet @strong{requires} a Windows @strong{Server} 2003 or
741newer for full feature support.
742Windows Vista and later will also work, but
743@strong{non-server version can not run a VPN-Exit-Node} as the NAT
744features 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
753Install a fresh version of @strong{Python 2.x}, even if you are using a
754x64-OS, install a 32-bit version for use with sbuild.
755Python 3.0 currently is incompatible.
756
757@item
758Install your favorite @uref{http://code.google.com/p/tortoisegit/, GIT} &
759@uref{http://tortoisesvn.net/, SVN}-clients.
760
761@item
762You will also need some archive-manager like
763@uref{http://www.7-zip.org/, 7zip}.
764
765@item
766Pull a copy of sbuild to a directory of your choice, which will be used
767in the remainder of this guide. For now, we will use
768@file{c:\gnunet\sbuild\}
769
770@item
771in @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
773to compile/install those for us.
774
775@item
776Follow LRN's sbuild installation instructions.-
777@end itemize
778
779Please note that sbuild may (or will most likely) fail during
780installation, thus you really HAVE to @strong{check the logfiles} created
781during the installation process.
782Certain packages may fail to build initially due to missing dependencies,
783thus you may have to
784@strong{substitute those with binary-versions initially}. Later on once
785dependencies 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
788and there is no uniform way to fix all compile-time issues, as the
789build-process of many of the dependencies installed are rather unstable
790on win32 and certain releases may not even compile at all.}
791
792Most dependencies for GNUnet have been set up by sbuild, thus we now
793should add the @file{bin/} directories in your new msys and mingw
794installations to PATH. You will want to create a backup of your finished
795msys-environment by now.
796
797@node GNUnet Installation
798@subsection GNUnet Installation
799
800First, we need to launch our msys-shell, you can do this via
801
802@file{C:\gnunet\sbuild\msys\msys.bat}
803
804You might wish to take a look at this file and adjust some
805login-parameters to your msys environment.
806
807Also, sbuild added two pointpoints to your msys-environment, though those
808might remain invisible:
809
810@itemize @bullet
811
812@item
813/mingw, which will mount your mingw-directory from sbuild/mingw and the
814other one is
815
816@item
817/src which contains all the installation sources sbuild just compiled.
818@end itemize
819
820Check out the current GNUnet sources (git HEAD) from the
821GNUnet repository "gnunet.git", we will do this in your home directory:
822
823@code{git clone https://gnunet.org/git/gnunet/ ~/gnunet}
824
825Now, we will first need to bootstrap the checked out installation and then
826configure it accordingly.
827
828@example
829cd ~/gnunet
830./bootstrap
831STRIP=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
840The parameters above will configure for a reasonable GNUnet installation
841to the your msys-root directory.
842Depending on which features your would like to build or you may need to
843specify additional dependencies. Sbuild installed most libs into
844the /mingw subdirectory, so remember to prefix library locations with
845this path.
846
847Like on a unixoid system, you might want to use your home directory as
848prefix for your own GNUnet installation for development, without tainting
849the buildenvironment. Just change the "prefix" parameter to point towards
850~/ in this case.
851
852Now it's time to compile GNUnet as usual. Though this will take some time,
853so you may fetch yourself a coffee or some Mate now...
854
855@example
856make ; 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
862Assuming the build succeeded and you
863@strong{added the bin directory of your GNUnet to PATH}, you can now use
864your gnunet-installation as usual.
865Remember that UAC or the windows firewall may popup initially, blocking
866further execution of gnunet until you acknowledge them.
867
868You will also have to take the usual steps to get peer-to-peer (p2p)
869software running properly (port forwarding, ...),
870and GNUnet will require administrative permissions as it may even
871install a device-driver (in case you are using gnunet-vpn and/or
872gnunet-exit).
873
874@node Building the GNUnet Installer
875@subsection Building the GNUnet Installer
876
877The GNUnet installer is made with
878@uref{http://nsis.sourceforge.net/, NSIS}.
879The installer script is located in @file{contrib\win} in the
880GNUnet source tree.
881
882@node Using GNUnet with Netbeans on Windows
883@subsection Using GNUnet with Netbeans on Windows
884
885TODO
886
887@node Build instructions for Debian 7.5
888@section Build instructions for Debian 7.5
889
890
891These are the installation instructions for Debian 7.5. They were tested
892using a minimal, fresh Debian 7.5 AMD64 installation without non-free
893software (no contrib or non-free).
894By "minimal", we mean that during installation, we did not select any
895desktop environment, servers or system utilities during the "tasksel"
896step. Note that the packages and the dependencies that we will install
897during this chapter take about 1.5 GB of disk space.
898Combined with GNUnet and space for objects during compilation, you should
899not even attempt this unless you have about 2.5 GB free after the minimal
900Debian installation.
901Using these instructions to build a VM image is likely to require a
902minimum of 4-5 GB for the VM (as you will likely also want a desktop
903manager).
904
905GNUnet's security model assumes that your @file{/home} directory is
906encrypted. Thus, if possible, you should encrypt your home partition
907(or per-user home directory).
908
909Naturally, the exact details of the starting state for your installation
910should not matter much. For example, if you selected any of those
911installation groups you might simply already have some of the necessary
912packages installed.
913We did this for testing, as this way we are less likely to forget to
914mention a required package.
915Note that we will not install a desktop environment, but of course you
916will need to install one to use GNUnet's graphical user interfaces.
917Thus, it is suggested that you simply install the desktop environment of
918your 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
935After any installation, you should begin by running
936
937@example
938# apt-get update ; apt-get upgrade
939@end example
940
941to ensure that all of your packages are up-to-date. Note that the "#" is
942used 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
944command as a normal user.
945
946@node Stable? Hah!
947@subsection Stable? Hah!
948
949Yes, we said we start with a Debian 7.5 "stable" system. However, to
950reduce the amount of compilation by hand, we will begin by allowing the
951installation of packages from the testing and unstable distributions as
952well.
953We will stick to "stable" packages where possible, but some packages will
954be taken from the other distributions.
955Start by modifying @file{/etc/apt/sources.list} to contain the
956following (possibly adjusted to point to your mirror of choice):
957
958@example
959# These were there before:
960deb http://ftp.de.debian.org/debian/ wheezy main
961deb-src http://ftp.de.debian.org/debian/ wheezy main
962deb http://security.debian.org/ wheezy/updates main
963deb-src http://security.debian.org/ wheezy/updates main
964deb http://ftp.de.debian.org/debian/ wheezy-updates main
965deb-src http://ftp.de.debian.org/debian/ wheezy-updates main
966
967# Add these lines (feel free to adjust the mirror):
968deb http://ftp.de.debian.org/debian/ testing main
969deb http://ftp.de.debian.org/debian/ unstable main
970@end example
971
972The next step is to create/edit your @file{/etc/apt/preferences}
973file to look like this:
974
975@example
976Package: *
977Pin: release a=stable,n=wheezy
978Pin-Priority: 700
979
980Package: *
981Pin: release o=Debian,a=testing
982Pin-Priority: 650
983
984Package: *
985Pin: release o=Debian,a=unstable
986Pin-Priority: 600
987@end example
988
989You can read more about Apt Preferences here and here.
990Note that other pinnings are likely to also work for GNUnet, the key
991thing is that you need some packages from unstable (as shown below).
992However, as unstable is unlikely to be comprehensive (missing packages)
993or might be problematic (crashing packages), you probably want others
994from stable and/or testing.
995
996@node Update again
997@subsection Update again
998
999Now, run again@
1000
1001@example
1002# apt-get update@
1003# apt-get upgrade@
1004@end example
1005
1006to ensure that all your new distribution indices are downloaded, and
1007that your pinning is correct: the upgrade step should cause no changes
1008at all.
1009
1010@node Installing packages
1011@subsection Installing packages
1012
1013We 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
1027After 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
1038Next, we need to install a few dependencies from source.
1039You 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
1041commands below). Also, you do this from any
1042directory. We begin by downloading all dependencies, then extracting the
1043sources, 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
1086For this, simply follow the generic installation instructions from
1087here.
1088
1089@node But wait there is more!
1090@subsection But wait there is more!
1091
1092So far, we installed all of the packages and dependencies required to
1093ensure that all of GNUnet would be built.
1094However, while for example the plugins to interact with the MySQL or
1095Postgres databases have been created, we did not actually install or
1096configure those databases. Thus, you will need to install
1097and configure those databases or stick with the default Sqlite database.
1098Sqlite is usually fine for most applications, but MySQL can offer better
1099performance 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
1197If 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
1208Have sudo permission, but do not want to compile as root:
1209
1210@example
1211--with-sudo
1212@end example
1213
1214@item
1215Want 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
1229After installing it, you need to create an empty configuration file:
1230
1231@example
1232touch ~/.config/gnunet.conf
1233@end example
1234
1235And 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
1245These are the installation instructions for Debian 8. They were tested
1246sing a fresh Debian 8 AMD64 installation without non-free software (no
1247contrib or non-free). During installation, I only selected "lxde" for the
1248desktop environment.
1249Note that the packages and the dependencies that we will install during
1250this chapter take about 1.5 GB of disk space. Combined with GNUnet and
1251space for objects during compilation, you should not even attempt this
1252unless you have about 2.5 GB free after the Debian installation.
1253Using these instructions to build a VM image is likely to require a
1254minimum of 4-5 GB for the VM (as you will likely also want a desktop
1255manager).
1256
1257GNUnet's security model assumes that your @code{/home} directory is
1258encrypted.
1259Thus, if possible, you should encrypt your entire disk, or at least just
1260your home partition (or per-user home directory).
1261
1262Naturally, the exact details of the starting state for your installation
1263should not matter much.
1264For example, if you selected any of those installation groups you might
1265simply already have some of the necessary packages installed. Thus, it is
1266suggested that you simply install the desktop environment of your choice
1267before 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
1281After any installation, you should begin by running
1282
1283@example
1284# apt-get update
1285# apt-get upgrade
1286@end example
1287
1288to ensure that all of your packages are up-to-date. Note that the "#" is
1289used to indicate that you need to type in this command as "root" (or
1290prefix with "sudo"), whereas "$" is used to indicate typing in a command
1291as a normal user.
1292
1293@node Installing Debian Packages
1294@subsection Installing Debian Packages
1295
1296We begin by installing a few Debian packages from stable:
1297
1298@example
1299# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \
1300libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \
1301libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \
1302libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \
1303libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \
1304libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \
1305texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \
1306libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
1307libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \
1308libgcrypt20-dev libmicrohttpd-dev
1309@end example
1310
1311@node Installing Dependencies from Source2
1312@subsection Installing Dependencies from Source2
1313
1314Yes, we said we start with a Debian 8 "stable" system, but because Debian
1315linked GnuTLS without support for DANE, we need to compile a few things,
1316in addition to GNUnet, still by hand. Yes, you can run GNUnet using the
1317respective Debian packages, but then you will not get DANE support.
1318
1319Next, we need to install a few dependencies from source. You might want
1320to do this as a "normal" user and only run the @code{make install} steps
1321as root (hence the @code{sudo} in the commands below). Also, you do this
1322from any directory. We begin by downloading all dependencies, then
1323extracting the sources, and finally compiling and installing the
1324libraries:
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
1347For this, simply follow the generic installation instructions from@
1348here.
1349
1350@node But wait (again) there is more!
1351@subsection But wait (again) there is more!
1352
1353So far, we installed all of the packages and dependencies required to
1354ensure that all of GNUnet would be built. However, while for example the
1355plugins to interact with the MySQL or Postgres databases have been
1356created, we did not actually install or configure those databases.
1357Thus, you will need to install and configure those databases or stick
1358with the default Sqlite database. Sqlite is usually fine for most
1359applications, but MySQL can offer better performance and Postgres better
1360resillience.
1361
1362@node Outdated build instructions for previous revisions
1363@section Outdated build instructions for previous revisions
1364
1365This chapter contains a collection of outdated, older installation guides.
1366They are mostly intended to serve as a starting point for writing
1367up-to-date instructions and should not be expected to work for
1368GNUnet 0.10.x.
1369A set of older installation instructions can also be found in the
1370file @file{doc/outdated-and-old-installation-instructions.txt} in the
1371source tree of GNUnet.
1372
1373This file covers old instructions which no longer receive security
1374updates 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
1388Install 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
1396Choose 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
1420Install the optional dependencies for gnunet-conversation:
1421
1422@example
1423 $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
1424@end example
1425
1426Install 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
1439wget 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
1448Install 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
1465Install 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
1473If you want to:
1474
1475@itemize @bullet
1476
1477@item
1478Install to a different directory:
1479
1480@example
1481--prefix=PREFIX
1482@end example
1483
1484@item
1485Have sudo permission, but do not want to compile as root:
1486
1487@example
1488--with-sudo
1489@end example
1490
1491@item
1492Want 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
1505After installing it, you need to create an empty configuration file:
1506
1507@example
1508touch ~/.config/gnunet.conf
1509@end example
1510
1511And 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
1520GNUnet now requires the GNU Linear Programming Kit (GLPK).
1521Since there's is no package you can install with @code{mingw-get} you
1522have 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
1530unzipper 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
1543make install check
1544@end example
1545
1546@end itemize
1547
1548MinGW does not automatically detect the correct buildtype so you have to
1549specify 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
1555After installing GNUnet you can continue installing the GNUnet GUI tools:
1556
1557First, install the required dependencies:
1558
1559@example
1560$ sudo apt-get install libgladeui-dev libqrencode-dev
1561@end example
1562
1563Please ensure that the GNUnet shared libraries can be found by the linker.
1564If 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
1572LD_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
1579Now 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
1677This document is a @b{DEPRECATED} installation guide for GNUnet on
1678Windows.
1679It will not work for recent GNUnet versions, but maybe it will be of
1680some use if problems arise.
1681
1682The Windows build uses a UNIX emulator for Windows,
1683@uref{http://www.mingw.org/, MinGW}, to build the executable modules.
1684These modules run natively on Windows and do not require additional
1685emulation software besides the usual dependencies.
1686
1687GNUnet development is mostly done under GNU/Linux and especially git
1688checkouts may not build out of the box.
1689We 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
1722The software packages GNUnet depends on are usually compressed using UNIX
1723tools like @command{tar}, @command{gzip}, @command{xzip} and
1724@command{bzip2}.
1725If you do not already have an utility that is able to extract such
1726archives, get @uref{http://www.7-zip.org/, 7-Zip}.
1727
1728@item
1729@strong{UNIX environment}@
1730
1731The MinGW project provides the compiler toolchain that is used to build
1732GNUnet.
1733Get 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.)@
1757Do @strong{not} use spaces in the pathname.
1758For 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
1767the files:
1768
1769@example
1770bin\sh.exe --login
1771@end example
1772
1773This batch file opens a shell which is used to invoke the build
1774processes.
1775MinGW's standard shell (@command{msys.bat}) is not suitable
1776because it opens a separate console window.
1777On Vista, @command{bash.bat} needs to be run as Administrator.
1778
1779@item
1780Start @command{bash.sh} and rename
1781@file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems:
1782
1783@example
1784mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken
1785@end example
1786
1787@item
1788Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and
1789remove the declaration of DATADIR from
1790(@file{c:\mingw\mingw\include\objidl.h} (lines 55-58)
1791
1792@item
1793Unpack autoconf, automake to the MSYS directory (@file{c:\mingw})
1794
1795@item
1796Install all other packages to the MinGW directory (@file{c:\mingw\mingw\})
1797@end itemize
1798
1799
1800@item @strong{GNU Libtool}@
1801GNU Libtool is required to use shared libraries.
1802Get the prebuilt package from here and unpack it to the
1803MinGW directory (@file{c:\mingw})
1804
1805@item @strong{Pthreads}@
1806GNUnet 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}
1815directory (@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/}
1825to the @file{include} directory (@file{c:\mingw\mingw\include}).
1826@end itemize
1827
1828
1829@item @strong{GNU MP}@
1830GNUnet uses the GNU Multiple Precision library for special cryptographic
1831operations. Get the GMP binary package from the
1832@uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and
1833unpack it to the MinGW directory (@file{c:\mingw\mingw})
1834
1835@item @strong{GNU Gettext}@
1836GNU gettext is used to provide national language support.
1837Get the prebuilt package from hereand unpack it to the MinGW
1838directory (@file{c:\mingw\mingw})
1839
1840@item @strong{GNU iconv}@
1841GNU Libiconv is used for character encoding conversion.
1842Get the prebuilt package from here and unpack it to the MinGW
1843directory (@file{c:\mingw\mingw}).
1844
1845@item @strong{SQLite}@
1846GNUnet uses the SQLite database to store data.
1847Get the prebuilt binary from here and unpack it to your MinGW directory.
1848
1849@item @strong{MySQL}@
1850As 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
1862MySQL 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
1867latter is only required for MySQL
1868
1869@example
1870patch -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
1878dlltool --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}
1887to 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.
1893Get 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
1897to the MinGW directory (@file{c:\mingw\mingw}).
1898@c FIXME: The URL below for pkg-config seems wrong.
1899Get @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}).
1902Here 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
1908this 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
1915the MinGW directory (@file{c:\mingw\mingw}).
1916
1917@item Get @command{libxml} from here and unpack it to the MinGW
1918directory (@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
1924formats. GNUnet uses it to (de)compress meta-data.
1925Get 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
1930decompress some file formats.
1931Get the Bzip2 (binary and developer package) from
1932@uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and
1933unpack it to the MinGW directory (@file{c:\mingw\mingw}).
1934
1935@item @strong{Libgcrypt}@
1936@command{Libgcrypt} provides the cryptographic functions used by GNUnet.
1937Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here},
1938compile and place it in the MinGW directory
1939(@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to
1940compile GNUnet.
1941
1942@item @strong{PlibC}@
1943PlibC emulates Unix functions under Windows. Get PlibC from here and
1944unpack 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.
1948Get the packages
1949@uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg}
1950and
1951@uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis}
1952from the
1953@uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build}
1954and 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.
1958Download
1959@uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2}
1960and 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
1966Before you compile @command{libextractor} or @command{GNUnet},
1967be sure to set @code{PKG_CONFIG_PATH}:
1968
1969@example
1970export 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}.
1976By default, all modules that are created in this way contain
1977debug information and are quite large. To compile release versions
1978(small and fast) set the variable @code{CFLAGS}:
1979
1980@example
1981export 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
1988The GNUnet installer is made with
1989@uref{http://nsis.sourceforge.net/, NSIS}. The installer script is
1990located in @file{contrib\win} in the GNUnet source tree.
1991
1992@node Source
1993@subsubsection Source
1994
1995@c FIXME: URL
1996The 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
2067If you also would like to use @command{gnunet-gtk} and
2068@command{gnunet-setup} (highly recommended for beginners), do:
2069
2070@example
2071wget -P /tmp \
2072https://gnunet.org/install/packs/gnunet-0.9.4-gtk-0.9.4-`uname -m`.tgz
2073sh ~/gnunet-update/bin/gnunet-update install /tmp/gnunet-*gtk*.tgz ~
2074sudo ldconfig
2075@end example
2076
2077Now you can run @command{gnunet-setup} for easy configuration of your
2078GNUnet 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
2117This chapter will describe the various configuration options in GNUnet.
2118
2119The 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}
2122application. You might have to install it separately.
2123
2124Many of the specific sections from this chapter actually are linked from
2125within @command{gnunet-setup} to help you while using the setup tool.
2126
2127While you can also configure your peer by editing the configuration
2128file by hand, this is not recommended for anyone except for developers
2129as it requires a more in-depth understanding of the configuration files
2130and 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
2136GNUnet knows three basic modes of operation:
2137@itemize @bullet
2138@item In standard "peer-to-peer" mode,
2139your peer will connect to any peer.
2140@item In the pure "friend-to-friend"
2141mode, your peer will ONLY connect to peers from a list of friends
2142specified in the configuration.
2143@item Finally, in mixed mode,
2144GNUnet will only connect to arbitrary peers if it
2145has at least a specified number of connections to friends.
2146@end itemize
2147
2148When configuring any of the F2F ("friend-to-friend") modes,
2149you first need to create a file with the peer identities
2150of your friends. Ask your friends to run
2151
2152@example
2153$ gnunet-peerinfo -sq
2154@end example
2155
2156@noindent
2157The 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
2159per friend with the output from the above command.
2160
2161You then specify the location of your @file{friends} file in the
2162"FRIENDS" option of the "topology" section.
2163
2164Once you have created the @file{friends} file, you can tell GNUnet to only
2165connect to your friends by setting the "FRIENDS-ONLY" option (again in
2166the "topology" section) to YES.
2167
2168If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a
2169minimum number of friends to have (before connecting to arbitrary peers)
2170under the "MINIMUM-FRIENDS" option.
2171
2172If you want to operate in normal P2P-only mode, simply set
2173"MINIMUM-FRIENDS" to zero and "FRIENDS_ONLY" to NO.
2174This is the default.
2175
2176@node Configuring the hostlist to bootstrap
2177@subsection Configuring the hostlist to bootstrap
2178
2179After installing the software you need to get connected to the GNUnet
2180network. The configuration file included in your download is already
2181configured to connect you to the GNUnet network.
2182In this section the relevant configuration settings are explained.
2183
2184To get an initial connection to the GNUnet network and to get to know
2185peers already connected to the network you can use the so called
2186"bootstrap servers".
2187These servers can give you a list of peers connected to the network.
2188To use these bootstrap servers you have to configure the hostlist daemon
2189to activate bootstrapping.
2190
2191To activate bootstrapping, edit the @code{[hostlist]}-section in your
2192configuration file. You have to set the argument "-b" in the
2193options line:
2194
2195@example
2196[hostlist]
2197OPTIONS = -b
2198@end example
2199
2200Additionally you have to specify which server you want to use.
2201The 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
2204section. To use the default server you should set the lines to
2205
2206@example
2207SERVERS = http://v10.gnunet.org/hostlist [^]
2208@end example
2209
2210@noindent
2211To use bootstrapping your configuration file should include these lines:
2212
2213@example
2214[hostlist]
2215OPTIONS = -b
2216SERVERS = http://v10.gnunet.org/hostlist [^]
2217@end example
2218
2219@noindent
2220Besides using bootstrap servers you can configure your GNUnet peer to
2221recieve hostlist advertisements.
2222Peers offering hostlists to other peers can send advertisement messages
2223to peers that connect to them. If you configure your peer to receive these
2224messages, your peer can download these lists and connect to the peers
2225included. These lists are persistent, which means that they are saved to
2226your hard disk regularly and are loaded during startup.
2227
2228To activate hostlist learning you have to add the "-e" switch to the
2229OPTIONS line in the hostlist section:
2230
2231@example
2232[hostlist]
2233OPTIONS = -b -e
2234@end example
2235
2236@noindent
2237Furthermore you can specify in which file the lists are saved.
2238To save the lists in the file "hostlists.file" just add the line:
2239
2240@example
2241HOSTLISTFILE = hostlists.file
2242@end example
2243
2244@noindent
2245Best practice is to activate both bootstrapping and hostlist learning.
2246So your configuration file should include these lines:
2247
2248@example
2249[hostlist]
2250OPTIONS = -b -e
2251HTTPPORT = 8080
2252SERVERS = http://v10.gnunet.org/hostlist [^]
2253HOSTLISTFILE = $SERVICEHOME/hostlists.file
2254@end example
2255
2256@node Configuration of the HOSTLIST proxy settings
2257@subsection Configuration of the HOSTLIST proxy settings
2258
2259The hostlist client can be configured to use a proxy to connect to the
2260hostlist server.
2261This functionality can be configured in the configuration file directly
2262or using the gnunet-setup tool.
2263
2264The 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
2271In addition authentication at the proxy with username and password can be
2272configured.
2273
2274To configure proxy support for the hostlist client in the
2275@command{gnunet-setup} tool, select the "hostlist" tab and select
2276the appropriate proxy type.
2277The hostname or IP address (including port if required) has to be entered
2278in the "Proxy hostname" textbox. If required, enter username and password
2279in the "Proxy username" and "Proxy password" boxes.
2280Be aware that this information will be stored in the configuration in
2281plain text (TODO: Add explanation and generalize the part in Chapter 3.6
2282about the encrypted home).
2283
2284To provide these options directly in the configuration, you can
2285enter the following settings in the @code{[hostlist]} section of
2286the 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
2305If you operate a peer permanently connected to GNUnet you can configure
2306your peer to act as a hostlist server, providing other peers the list of
2307peers known to him.
2308
2309Yor server can act as a bootstrap server and peers needing to obtain a
2310list of peers can contact it to download this list.
2311To download this hostlist the peer uses HTTP.
2312For this reason you have to build your peer with libcurl and microhttpd
2313support. How you build your peer with this options can be found here:
2314@uref{https://gnunet.org/generic_installation}
2315
2316To 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
2318configuration file. Besides that you have to specify a port number for
2319the http server.
2320In conclusion you have to add the following lines:
2321
2322@example
2323[hostlist]
2324HTTPPORT = 12980
2325OPTIONS = -p
2326@end example
2327
2328@noindent
2329If your peer acts as a bootstrap server other peers should know about
2330that. You can advertise the hostlist your are providing to other peers.
2331Peers connecting to your peer will get a message containing an
2332advertisement for your hostlist and the URL where it can be downloaded.
2333If this peer is in learning mode, it will test the hostlist and, in the
2334case it can obtain the list successfully, it will save it for
2335bootstrapping.
2336
2337To activate hostlist advertisement on your peer, you have to set the
2338following lines in your configuration file:
2339
2340@example
2341[hostlist]
2342EXTERNAL_DNS_NAME = example.org
2343HTTPPORT = 12981
2344OPTIONS = -p -a
2345@end example
2346
2347@noindent
2348With this configuration your peer will a act as a bootstrap server and
2349advertise this hostlist to other peers connecting to it.
2350The URL used to download the list will be
2351@code{@uref{http://example.org:12981/, http://example.org:12981/}}.
2352
2353Please notice:
2354
2355@itemize @bullet
2356@item The hostlist is not human readable, so you should not try to
2357download it using your webbrowser. Just point your GNUnet peer to the
2358address!
2359@item Advertising without providing a hostlist does not make sense and
2360will not work.
2361@end itemize
2362
2363@node Configuring the datastore
2364@subsection Configuring the datastore
2365
2366The datastore is what GNUnet uses to for long-term storage of file-sharing
2367data. Note that long-term does not mean 'forever' since content does have
2368an expiration date, and of course storage space is finite (and hence
2369sometimes content may have to be discarded).
2370
2371Use the "QUOTA" option to specify how many bytes of storage space you are
2372willing to dedicate to GNUnet.
2373
2374In addition to specifying the maximum space GNUnet is allowed to use for
2375the datastore, you need to specify which database GNUnet should use to do
2376so. Currently, you have the choice between sqLite, MySQL and Postgres.
2377
2378@node Configuring the MySQL database
2379@subsection Configuring the MySQL database
2380
2381This section describes how to setup the MySQL database for GNUnet.
2382
2383Note that the mysql plugin does NOT work with mysql before 4.1 since we
2384need prepared statements.
2385We 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
2393mysql can be used comfortably, this module
2394will have better performance than the other database choices (according
2395to our tests).
2396
2397@item Its often possible to recover the mysql database from internal
2398inconsistencies. 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
2424and issue the following commands, replacing $USER with the username
2425that will be running gnunet-arm (so typically "gnunet"):
2426
2427@example
2428CREATE DATABASE gnunet;
2429GRANT select,insert,update,delete,create,alter,drop,create \
2430temporary tables ON gnunet.* TO $USER@@localhost;
2431SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like');
2432FLUSH PRIVILEGES;
2433@end example
2434
2435@item
2436In the $HOME directory of $USER, create a "@file{.my.cnf}" file with the
2437following lines
2438
2439@example
2440[client]
2441user=$USER
2442password=$the_password_you_like
2443@end example
2444
2445@end itemize
2446
2447Thats it. Note that @file{.my.cnf} file is a slight security risk unless
2448its on a safe partition. The @file{$HOME/.my.cnf} can of course be
2449a symbolic link.
2450Luckily $USER has only priviledges to mess up GNUnet's tables,
2451which should be pretty harmless.
2452
2453@node Testing
2454@subsection Testing
2455
2456You should briefly try if the database connection works. First, login
2457as $USER. Then use:
2458
2459@example
2460$ mysql -u $USER
2461mysql> use gnunet;
2462@end example
2463
2464@noindent
2465If you get the message "Database changed" it probably works.
2466
2467If you get "ERROR 2002: Can't connect to local MySQL server@
2468through socket '/tmp/mysql.sock' (2)" it may be resolvable by
2469
2470@example
2471ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
2472@end example
2473
2474so there may be some additional trouble depending on your mysql setup.
2475
2476@node Performance Tuning
2477@subsection Performance Tuning
2478
2479For GNUnet, you probably want to set the option
2480
2481@example
2482innodb_flush_log_at_trx_commit = 0
2483@end example
2484
2485@noindent
2486for a rather dramatic boost in MySQL performance. However, this reduces
2487the "safety" of your database as with this options you may loose
2488transactions during a power outage.
2489While this is totally harmless for GNUnet, the option applies to all
2490applications using MySQL. So you should set it if (and only if) GNUnet is
2491the only application on your system using MySQL.
2492
2493@node Setup for running Testcases
2494@subsection Setup for running Testcases
2495
2496If you want to run the testcases, you must create a second database
2497"gnunetcheck" with the same username and password. This database will
2498then be used for testing ("make check").
2499
2500@node Configuring the Postgres database
2501@subsection Configuring the Postgres database
2502
2503This text describes how to setup the Postgres database for GNUnet.
2504
2505This Postgres plugin was developed for Postgres 8.3 but might work for
2506earlier 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
2541and enter the name of the user running GNUnet for the role interactively.
2542Then, when prompted, do not set it to superuser, allow the creation of
2543databases, 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
2553where $GNUNET_USER is the name of the user running GNUnet.@
2554
2555@end table
2556
2557
2558@item
2559As 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
2569Now you should be able to start @code{gnunet-arm}.
2570
2571@node Testing the setup manually
2572@subsection Testing the setup manually
2573
2574You may want to try if the database connection works. First, again login
2575as the user who will run @command{gnunet-arm}. Then use:
2576
2577@example
2578$ psql gnunet # or gnunetcheck
2579gnunet=> \dt
2580@end example
2581
2582@noindent
2583If, after you have started @command{gnunet-arm} at least once, you get
2584a @code{gn090} table here, it probably works.
2585
2586@node Configuring the datacache
2587@subsection Configuring the datacache
2588@c %**end of header
2589
2590The datacache is what GNUnet uses for storing temporary data. This data is
2591expected to be wiped completely each time GNUnet is restarted (or the
2592system is rebooted).
2593
2594You need to specify how many bytes GNUnet is allowed to use for the
2595datacache using the "QUOTA" option in the section "dhtcache".
2596Furthermore, you need to specify which database backend should be used to
2597store the data. Currently, you have the choice between
2598sqLite, MySQL and Postgres.
2599
2600@node Configuring the file-sharing service
2601@subsection Configuring the file-sharing service
2602
2603In order to use GNUnet for file-sharing, you first need to make sure
2604that the file-sharing service is loaded.
2605This is done by setting the AUTOSTART option in section "fs" to "YES".
2606Alternatively, you can run
2607
2608@example
2609$ gnunet-arm -i fs
2610@end example
2611
2612@noindent
2613to start the file-sharing service by hand.
2614
2615Except for configuring the database and the datacache the only important
2616option for file-sharing is content migration.
2617
2618Content migration allows your peer to cache content from other peers as
2619well as send out content stored on your system without explicit requests.
2620This content replication has positive and negative impacts on both system
2621performance and privacy.
2622
2623FIXME: discuss the trade-offs. Here is some older text about it...
2624
2625Setting this option to YES allows gnunetd to migrate data to the local
2626machine. Setting this option to YES is highly recommended for efficiency.
2627Its also the default. If you set this value to YES, GNUnet will store
2628content on your machine that you cannot decrypt.
2629While this may protect you from liability if the judge is sane, it may
2630not (IANAL). If you put illegal content on your machine yourself, setting
2631this option to YES will probably increase your chances to get away with it
2632since you can plausibly deny that you inserted the content.
2633Note 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
2635strength of the adversary).
2636
2637@node Configuring logging
2638@subsection Configuring logging
2639
2640Logging in GNUnet 0.9.0 is controlled via the "-L" and "-l" options.
2641Using "-L", a log level can be specified. With log level "@code{ERROR}"
2642only serious errors are logged.
2643The default log level is "@code{WARNING}" which causes anything of
2644concern to be logged.
2645Log level "@code{INFO}" can be used to log anything that might be
2646interesting 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).
2650The "-l" option is used to specify the log file.
2651
2652Since most GNUnet services are managed by @code{gnunet-arm}, using the
2653"-l" or "-L" options directly is not possible.
2654Instead, they can be specified using the "OPTIONS" configuration value in
2655the respective section for the respective service.
2656In order to enable logging globally without editing the "OPTIONS" values
2657for each service, @code{gnunet-arm} supports a "GLOBAL_POSTFIX" option.
2658The value specified here is given as an extra option to all services for
2659which the configuration does contain a service-specific "OPTIONS" field.
2660
2661"GLOBAL_POSTFIX" can contain the special sequence "@{@}" which is replaced
2662by the name of the service that is being started. Furthermore,
2663@code{GLOBAL_POSTFIX} is special in that sequences starting with "$"
2664anywhere in the string are expanded (according to options in "PATHS");
2665this expansion otherwise is only happening for filenames and then the "$"
2666must be the first character in the option. Both of these restrictions do
2667not apply to "GLOBAL_POSTFIX".
2668Note that specifying @code{%} anywhere in the "GLOBAL_POSTFIX" disables
2669both of these features.
2670
2671In summary, in order to get all services to log at level "INFO" to
2672log-files called @code{SERVICENAME-logs}, the following global prefix
2673should be used:
2674
2675@example
2676GLOBAL_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
2682The transport service in GNUnet is responsible to maintain basic
2683connectivity to other peers.
2684Besides initiating and keeping connections alive it is also responsible
2685for address validation.
2686
2687The GNUnet transport supports more than one transport protocol.
2688These protocols are configured together with the transport service.
2689
2690The configuration section for the transport service itself is quite
2691similar to all the other services
2692
2693@example
2694AUTOSTART = YES
2695@@UNIXONLY@@ PORT = 2091
2696HOSTNAME = localhost
2697HOME = $SERVICEHOME
2698CONFIG = $DEFAULTCONFIG
2699BINARY = gnunet-service-transport
2700#PREFIX = valgrind
2701NEIGHBOUR_LIMIT = 50
2702ACCEPT_FROM = 127.0.0.1;
2703ACCEPT_FROM6 = ::1;
2704PLUGINS = tcp udp
2705UNIXPATH = /tmp/gnunet-service-transport.sock
2706@end example
2707
2708Different are the settings for the plugins to load @code{PLUGINS}.
2709The first setting specifies which transport plugins to load.
2710
2711@itemize @bullet
2712@item transport-unix
2713A plugin for local only communication with UNIX domain sockets. Used for
2714testing and available on unix systems only. Just set the port
2715
2716@example
2717[transport-unix]
2718PORT = 22086
2719TESTING_IGNORE_KEYS = ACCEPT_FROM;
2720@end example
2721
2722@item transport-tcp
2723A plugin for communication with TCP. Set port to 0 for client mode with
2724outbound only connections
2725
2726@example
2727[transport-tcp]
2728# Use 0 to ONLY advertise as a peer behind NAT (no port binding)
2729PORT = 2086
2730ADVERTISED_PORT = 2086
2731TESTING_IGNORE_KEYS = ACCEPT_FROM;
2732# Maximum number of open TCP connections allowed
2733MAX_CONNECTIONS = 128
2734@end example
2735
2736@item transport-udp
2737A plugin for communication with UDP. Supports peer discovery using
2738broadcasts.
2739
2740@example
2741[transport-udp]
2742PORT = 2086
2743BROADCAST = YES
2744BROADCAST_INTERVAL = 30 s
2745MAX_BPS = 1000000
2746TESTING_IGNORE_KEYS = ACCEPT_FROM;
2747@end example
2748
2749@item transport-http
2750HTTP and HTTPS support is split in two part: a client plugin initiating
2751outbound connections and a server part accepting connections from the
2752client. The client plugin just takes the maximum number of connections as
2753an argument.
2754
2755@example
2756[transport-http_client]
2757MAX_CONNECTIONS = 128
2758TESTING_IGNORE_KEYS = ACCEPT_FROM;
2759@end example
2760
2761@example
2762[transport-https_client]
2763MAX_CONNECTIONS = 128
2764TESTING_IGNORE_KEYS = ACCEPT_FROM;
2765@end example
2766
2767@noindent
2768The server has a port configured and the maximum nunber of connections.
2769The HTTPS part has two files with the certificate key and the certificate
2770file.
2771
2772The server plugin supports reverse proxies, so a external hostname can be
2773set using the @code{EXTERNAL_HOSTNAME} setting.
2774The webserver under this address should forward the request to the peer
2775and the configure port.
2776
2777@example
2778[transport-http_server]
2779EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet
2780PORT = 1080
2781MAX_CONNECTIONS = 128
2782TESTING_IGNORE_KEYS = ACCEPT_FROM;
2783@end example
2784
2785@example
2786[transport-https_server]
2787PORT = 4433
2788CRYPTO_INIT = NORMAL
2789KEY_FILE = https.key
2790CERT_FILE = https.cert
2791MAX_CONNECTIONS = 128
2792TESTING_IGNORE_KEYS = ACCEPT_FROM;
2793@end example
2794
2795@item transport-wlan
2796
2797The next section describes how to setup the WLAN plugin,
2798so 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)
2803INTERFACE = mon0
2804# Real hardware, no testing
2805TESTMODE = 0
2806TESTING_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
2813The wlan transport plugin enables GNUnet to send and to receive data on a
2814wlan interface.
2815It has not to be connected to a wlan network as long as sender and
2816receiver are on the same channel. This enables you to get connection to
2817GNUnet where no internet access is possible, for example during
2818catastrophes 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
28382.6.35 and 2.6.38
2839
2840@item Wlantools to create the a monitor interface, tested with airmon-ng
2841of the aircrack-ng package
2842@end itemize
2843
2844@node Configuration
2845@subsubsection Configuration
2846
2847There are the following options for the wlan plugin (they should be like
2848this in your default config file, you only need to adjust them if the
2849values 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.
2856INTERFACE = mon0
2857# testmode for developers:
2858# 0 use wlan interface,
2859#1 or 2 use loopback driver for tests 1 = server, 2 = client
2860TESTMODE = 0
2861@end example
2862
2863@node Before starting GNUnet
2864@subsubsection Before starting GNUnet
2865
2866Before starting GNUnet, you have to make sure that your wlan interface is
2867in monitor mode.
2868One way to put the wlan interface into monitor mode (if your interface
2869name is wlan0) is by executing:
2870
2871@example
2872sudo airmon-ng start wlan0
2873@end example
2874
2875@noindent
2876Here is an example what the result should look like:
2877
2878@example
2879Interface Chipset Driver
2880wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0]
2881(monitor mode enabled on mon0)
2882@end example
2883
2884@noindent
2885The monitor interface is mon0 is the one that you have to put into the
2886configuration file.
2887
2888@node Limitations and known bugs
2889@subsubsection Limitations and known bugs
2890
2891Wlan speed is at the maximum of 1 Mbit/s because support for choosing the
2892wlan speed with packet injection was removed in newer kernels.
2893Please pester the kernel developers about fixing this.
2894
2895The interface channel depends on the wlan network that the card is
2896connected to. If no connection has been made since the start of the
2897computer, it is usually the first channel of the card.
2898Peers will only find each other and communicate if they are on the same
2899channel. 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
2906The HTTP plugin supports data transfer using reverse proxies. A reverse
2907proxy forwards the HTTP request he receives with a certain URL to another
2908webserver, here a GNUnet peer.
2909
2910So if you have a running Apache or nginx webserver you can configure it to
2911be a GNUnet reverse proxy. Especially if you have a well-known webiste
2912this improves censorship resistance since it looks as normal surfing
2913behaviour.
2914
2915To 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
2922As 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
2936And 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
2941First of all you need mod_proxy installed.
2942
2943Edit your webserver configuration. Edit
2944@code{/etc/apache2/apache2.conf} or the site-specific configuration file.
2945
2946In the respective @code{server config},@code{virtual host} or
2947@code{directory} section add the following lines:
2948
2949@example
2950ProxyTimeout 300
2951ProxyRequests Off
2952<Location /bar/ >
2953ProxyPass http://gnunet.foo.org:1080/
2954ProxyPassReverse http://gnunet.foo.org:1080/
2955</Location>
2956@end example
2957
2958@noindent
2959@strong{Configure your Apache2 HTTPS webserver}
2960
2961We assume that you already have an HTTPS server running, if not please
2962check how to configure a HTTPS host. An easy to use example is the
2963@file{apache2/sites-available/default-ssl} example configuration file.
2964
2965In the respective HTTPS @code{server config},@code{virtual host} or
2966@code{directory} section add the following lines:
2967
2968@example
2969SSLProxyEngine On
2970ProxyTimeout 300
2971ProxyRequests Off
2972<Location /bar/ >
2973ProxyPass https://gnunet.foo.org:4433/
2974ProxyPassReverse https://gnunet.foo.org:4433/
2975</Location>
2976@end example
2977
2978@noindent
2979More information about the apache mod_proxy configuration can be found
2980here: @uref{http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass}
2981.
2982
2983@strong{Configure your nginx HTTPS webserver}
2984
2985Since nginx does not support chunked encoding, you first of all have to
2986install @code{chunkin}: @uref{http://wiki.nginx.org/HttpChunkinModule}.
2987
2988To enable chunkin add:
2989
2990@example
2991chunkin on;
2992error_page 411 = @@my_411_error;
2993location @@my_411_error @{
2994chunkin_resume;
2995@}
2996@end example
2997
2998@noindent
2999Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
3000the site-specific configuration file.
3001
3002In the @code{server} section add:
3003
3004@example
3005location /bar/
3006@{
3007proxy_pass http://gnunet.foo.org:1080/;
3008proxy_buffering off;
3009proxy_connect_timeout 5; # more than http_server
3010proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
3011proxy_http_version 1.1; # 1.0 default
3012proxy_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
3019Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
3020the site-specific configuration file.
3021
3022In the @code{server} section add:
3023
3024@example
3025ssl_session_timeout 6m;
3026location /bar/
3027@{
3028proxy_pass https://gnunet.foo.org:4433/;
3029proxy_buffering off;
3030proxy_connect_timeout 5; # more than http_server
3031proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
3032proxy_http_version 1.1; # 1.0 default
3033proxy_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
3040To have your GNUnet peer announce the address, you have to specify the
3041@code{EXTERNAL_HOSTNAME} option in the @code{[transport-http_server]}
3042section:
3043
3044@example
3045[transport-http_server]
3046EXTERNAL_HOSTNAME = http://www.foo.org/bar/
3047@end example
3048
3049@noindent
3050and/or @code{[transport-https_server]} section:
3051
3052@example
3053[transport-https_server]
3054EXTERNAL_HOSTNAME = https://www.foo.org/bar/
3055@end example
3056
3057@noindent
3058Now restart your webserver and your peer...
3059
3060@node Blacklisting peers
3061@subsection Blacklisting peers
3062
3063Transport service supports to deny connecting to a specific peer of to a
3064specific peer with a specific transport plugin using te blacklisting
3065component of transport service. With@ blacklisting it is possible to deny
3066connections to specific peers of@ to use a specific plugin to a specific
3067peer. Peers can be blacklisted using@ the configuration or a blacklist
3068client can be asked.
3069
3070To blacklist peers using the configuration you have to add a section to
3071your configuration containing the peer id of the peer to blacklist and
3072the plugin@ if required.
3073
3074Examples:
3075
3076To 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]
3081P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp
3082@end example
3083
3084To blacklist connections to P565... on peer AG2P... using all plugins add:
3085
3086@example
3087[transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
3088P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G =
3089@end example
3090
3091You can also add a blacklist client usign the blacklist API. On a
3092blacklist check, blacklisting first checks internally if the peer is
3093blacklisted and if not, it asks the blacklisting clients. Clients are
3094asked if it is OK to connect to a peer ID, the plugin is omitted.
3095
3096On 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
3109The client parts of the http and https transport plugins can be configured
3110to use a proxy to connect to the hostlist server. This functionality can
3111be configured in the configuration file directly or using the
3112gnunet-setup tool.
3113
3114Both the HTTP and HTTPS clients support the following proxy types at
3115the moment:
3116
3117@itemize @bullet
3118@item HTTP 1.1 proxy
3119@item SOCKS 4/4a/5/5 with hostname
3120@end itemize
3121
3122In addition authentication at the proxy with username and password can be
3123configured.
3124
3125To configure proxy support for the clients in the gnunet-setup tool,
3126select the "transport" tab and activate the respective plugin. Now you
3127can select the appropriate proxy type. The hostname or IP address
3128(including port if required) has to be entered in the "Proxy hostname"
3129textbox. If required, enter username and password in the "Proxy username"
3130and "Proxy password" boxes. Be aware that these information will be stored
3131in the configuration in plain text.
3132
3133To configure these options directly in the configuration, you can
3134configure the following settings in the @code{[transport-http_client]}
3135and @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
3168Before you install GNUnet, make sure you have a user and group 'gnunet'
3169as well as an empty group 'gnunetdns'.
3170
3171When using GNUnet with system-wide DNS interception, it is absolutely
3172necessary for all GNUnet service processes to be started by
3173@code{gnunet-service-arm} as user and group 'gnunet'. You also need to be
3174sure to run @code{make install} as root (or use the @code{sudo} option to
3175configure) to grant GNUnet sufficient privileges.
3176
3177With this setup, all that is required for enabling system-wide DNS
3178interception is for some GNUnet component (VPN or GNS) to request it.
3179The @code{gnunet-service-dns} will then start helper programs that will
3180make the necessary changes to your firewall (@code{iptables}) rules.
3181
3182Note that this will NOT work if your system sends out DNS traffic to a
3183link-local IPv6 address, as in this case GNUnet can intercept the traffic,
3184but not inject the responses from the link-local IPv6 address. Hence you
3185cannot use system-wide DNS interception in conjunction with link-local
3186IPv6-based DNS servers. If such a DNS server is used, it will bypass
3187GNUnet's DNS traffic interception.
3188
3189Using the GNU Name System (GNS) requires two different configuration
3190steps.
3191First of all, GNS needs to be integrated with the operating system. Most
3192of this section is about the operating system level integration.
3193
3194Additionally, each individual user who wants to use the system must also
3195initialize their GNS zones. This can be done by running (after starting
3196GNUnet)
3197
3198@example
3199$ gnunet-gns-import.sh
3200@end example
3201
3202@noindent
3203after the local GNUnet peer has been started. Note that the namestore (in
3204particular the namestore database backend) should not be reconfigured
3205afterwards (as records are not automatically migrated between backends).
3206
3207The remainder of this chapter will detail the various methods for
3208configuring the use of GNS with your operating system.
3209
3210At 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
3215systems and is likely the easiest. However, it enables GNS only for
3216browsers, not for other applications that might be using DNS, such as SSH.
3217Still, using the proxy is required for using HTTP with GNS and is thus
3218recommended 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
3220browser (this will create a GNS certificate authority (CA) on your system
3221and import its key into your browser), then start @code{gnunet-gns-proxy}
3222and 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)
3225This approach has the advantage of offering fully personalized resolution
3226even on multi-user systems. A potential disadvantage is that some
3227applications might be able to bypass GNS.
3228@item Use a W32 resolver plugin (recommended on W32)
3229This is currently the only option on W32 systems.
3230@item Use system-wide DNS packet interception
3231This approach is recommended for the GNUnet VPN. It can be used to handle
3232GNS at the same time; however, if you only use this method, you will only
3233get one root zone per machine (not so great for multi-user systems).
3234@end table
3235
3236You can combine system-wide DNS packet interception with the nsswitch
3237plugin.
3238The setup of the system-wide DNS interception is described here. All of
3239the other GNS-specific configuration steps are described in the following
3240sections.
3241
3242@node Configuring the GNS nsswitch plugin
3243@subsubsection Configuring the GNS nsswitch plugin
3244
3245The 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}
3247that provides a variety of sources for common configuration databases and
3248name resolution mechanisms.
3249A superuser (system administrator) usually configures the
3250operating system's name services using the file
3251@file{/etc/nsswitch.conf}.
3252
3253GNS provides a NSS plugin to integrate GNS name resolution with the
3254operating system's name resolution process.
3255To 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
3262Name resolution is controlled by the @emph{hosts} section in the NSS
3263configuration. By default this section first performs a lookup in the
3264@file{/etc/hosts} file and then in DNS.
3265The nsswitch file should contain a line similar to:
3266
3267@example
3268hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4
3269@end example
3270
3271@noindent
3272Here the GNS NSS plugin can be added to perform a GNS lookup before
3273performing a DNS lookup.
3274The 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...
3279hosts: files gns [NOTFOUND=return] dns mdns4_minimal mdns4
3280...
3281@end example
3282
3283@noindent
3284The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not
3285found in GNS it will not be queried in DNS.
3286
3287@node Configuring GNS on W32
3288@subsubsection Configuring GNS on W32
3289
3290This document is a guide to configuring GNU Name System on W32-compatible
3291platforms.
3292
3293After GNUnet is installed, run the w32nsp-install tool:
3294
3295@example
3296w32nsp-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,
3301change the invocation accordingly).
3302
3303This will install GNS namespace provider into the system and allow other
3304applications to resolve names that end in '@strong{gnu}'
3305and '@strong{zkey}'. Note that namespace provider requires
3306gnunet-gns-helper-service-w32 to be running, as well as gns service
3307itself (and its usual dependencies).
3308
3309Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353},
3310and this is where gnunet-gns-helper-service-w32 should be listening to
3311(and is configured to listen to by default).
3312
3313To uninstall the provider, run:
3314
3315@example
3316w32nsp-uninstall.exe
3317@end example
3318
3319@noindent
3320(uses provider GUID to uninstall it, does not need a dll name).
3321
3322Note that while MSDN claims that other applications will only be able to
3323use the new namespace provider after re-starting, in reality they might
3324stat to use it without that. Conversely, they might stop using the
3325provider after it's been uninstalled, even if they were not re-started.
3326W32 will not permit namespace provider library to be deleted or
3327overwritten while the provider is installed, and while there is at least
3328one process still using it (even after it was uninstalled).
3329
3330@node GNS Proxy Setup
3331@subsubsection GNS Proxy Setup
3332
3333When using the GNU Name System (GNS) to browse the WWW, there are several
3334issues 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
3339is operating under some name in the legacy DNS system (such as
3340example.com). It may then attempt to set cookies for that domain, and the
3341web server might expect a @code{Host: example.com} header in the request
3342from your browser.
3343However, 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
3346of the hostnames for cookies and HTTP headers (using the LEHO record for
3347the target domain as the desired substitute).
3348
3349@item If using HTTPS, the target site might include an SSL certificate
3350which is either only valid for the LEHO domain or might match a TLSA
3351record in GNS. However, your browser would expect a valid certificate for
3352@code{example.gnu}, not for some legacy domain name. The proxy will
3353validate the certificate (either against LEHO or TLSA) and then
3354on-the-fly produce a valid certificate for the exchange, signed by your
3355own CA. Assuming you installed the CA of your proxy in your browser's
3356certificate authority list, your browser will then trust the
3357HTTPS/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
3360speaks GNS, which will enable server operators to deliver GNS-enabled web
3361sites to your browser (and continue to deliver legacy links to legacy
3362browsers)
3363@end itemize
3364
3365@node Setup of the GNS CA
3366@subsubsection Setup of the GNS CA
3367
3368First you need to create a CA certificate that the proxy can use.
3369To 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
3376This will create a personal certification authority for you and add this
3377authority to the firefox and chrome database. The proxy will use the this
3378CA certificate to generate @code{*.gnu} client certificates on the fly.
3379
3380Note that the proxy uses libcurl. Make sure your version of libcurl uses
3381GnuTLS and NOT OpenSSL. The proxy will @b{not} work with libcurl compiled
3382against OpenSSL.
3383
3384You can check the configuration your libcurl was build with by
3385running:
3386
3387@example
3388curl --version
3389@end example
3390
3391the output will look like this (without the linebreaks):
3392
3393@example
3394gnurl --version
3395curl 7.56.0 (x86_64-unknown-linux-gnu) libcurl/7.56.0 \
3396GnuTLS/3.5.13 zlib/1.2.11 libidn2/2.0.4
3397Release-Date: 2017-10-08
3398Protocols: http https
3399Features: AsynchDNS IDN IPv6 Largefile NTLM SSL libz \
3400TLS-SRP UnixSockets HTTPS-proxy
3401@end example
3402
3403@node Testing the GNS setup
3404@subsubsection Testing the GNS setup
3405
3406Now for testing purposes we can create some records in our zone to test
3407the 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
3415At this point we can start the proxy. Simply execute
3416
3417@example
3418$ gnunet-gns-proxy
3419@end example
3420
3421@noindent
3422Configure your browser to use this SOCKSv5 proxy on port 7777 and visit
3423this link.
3424If you use @command{Firefox} (or one of its deriviates/forks such as
3425Icecat) you also have to go to @code{about:config} and set the key
3426@code{network.proxy.socks_remote_dns} to @code{true}.
3427
3428When you visit @code{https://homepage.gnu/}, you should get to the
3429@code{https://gnunet.org/} frontpage and the browser (with the correctly
3430configured 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
3439This page describes a possible option for 'automatic name shortening',
3440which you can choose to enable with the GNU Name System.
3441
3442When GNS encounters a name for the first time, it can use the 'NICK'
3443record of the originating zone to automatically generate a name for the
3444zone. If automatic shortening is enabled, those auto-generated names will
3445be placed (as private records) into your personal 'shorten' zone (to
3446prevent confusion with manually selected names).
3447Then, in the future, if the same name is encountered again, GNS will
3448display the shortened name instead (the first time, the long name will
3449still be used as shortening typically happens asynchronously as looking up
3450the 'NICK' record takes some time). Using this feature can be a convenient
3451way to avoid very long @code{.gnu} names; however, note that names from
3452the shorten-zone are assigned on a first-come-first-serve basis and should
3453not be trusted. Furthermore, if you enable this feature, you will no
3454longer see the full delegation chain for zones once shortening has been
3455applied.
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
3470Before configuring the GNUnet VPN, please make sure that system-wide DNS
3471interception is configured properly as described in the section on the
3472GNUnet DNS setup. @pxref{Configuring the GNU Name System},
3473if you haven't done so already.
3474
3475The default options for the GNUnet VPN are usually sufficient to use
3476GNUnet as a Layer 2 for your Internet connection.
3477However, what you always have to specify is which IP protocol you want
3478to tunnel: IPv4, IPv6 or both.
3479Furthermore, if you tunnel both, you most likely should also tunnel
3480all of your DNS requests.
3481You theoretically can tunnel "only" your DNS traffic, but that usually
3482makes little sense.
3483
3484The other options as shown on the gnunet-setup tool are:
3485
3486@node IPv4 address for interface
3487@subsubsection IPv4 address for interface
3488
3489This 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,
3491if 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}.
3493If 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}.
3495If your system is not in a private IP-network, using any of the above will
3496work fine.
3497You 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
3499mappings of remote IP Addresses into this range.
3500However, 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
3505The IPv6 address the VPN interface will get. Here you can specify any
3506non-link-local address (the address should not begin with "@code{fe80:}").
3507A subnet Unique Local Unicast (@code{fd00::/8} prefix) that you are
3508currently not using would be a good choice.
3509
3510@node Configuring the GNUnet VPN DNS
3511@subsubsection Configuring the GNUnet VPN DNS
3512
3513To 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
3518If you want to allow other users to share your Internet connection (yes,
3519this may be dangerous, just as running a Tor exit node) or want to
3520provide access to services on your host (this should be less dangerous,
3521as long as those services are secure), you have to enable the GNUnet exit
3522daemon.
3523
3524You then get to specify which exit functions you want to provide. By
3525enabling the exit daemon, you will always automatically provide exit
3526functions for manually configured local services (this component of the
3527system is under
3528development and not documented further at this time). As for those
3529services you explicitly specify the target IP address and port, there is
3530no significant security risk in doing so.
3531
3532Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet.
3533Being a DNS exit is usually pretty harmless. However, enabling IPv4 or
3534IPv6-exit without further precautions may enable adversaries to access
3535your local network, send spam, attack other systems from your Internet
3536connection and to other mischief that will appear to come from your
3537machine. This may or may not get you into legal trouble.
3538If you want to allow IPv4 or IPv6-exit functionality, you should strongly
3539consider adding additional firewall rules manually to protect your local
3540network and to restrict outgoing TCP traffic (i.e. by not allowing access
3541to port 25). While we plan to improve exit-filtering in the future,
3542you're currently on your own here.
3543Essentially, be prepared for any kind of IP-traffic to exit the respective
3544TUN interface (and GNUnet will enable IP-forwarding and NAT for the
3545interface automatically).
3546
3547Additional configuration options of the exit as shown by the gnunet-setup
3548tool are:
3549
3550@node IP Address of external DNS resolver
3551@subsubsection IP Address of external DNS resolver
3552
3553If DNS traffic is to exit your machine, it will be send to this DNS
3554resolver. You can specify an IPv4 or IPv6 address.
3555
3556@node IPv4 address for Exit interface
3557@subsubsection IPv4 address for Exit interface
3558
3559This is the IPv4 address the Interface will get. Make the mask of the
3560address big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more
3561mappings of IP addresses into this range. As for the VPN interface, any
3562unused, private IPv4 address range will do.
3563
3564@node IPv6 address for Exit interface
3565@subsubsection IPv6 address for Exit interface
3566
3567The public IPv6 address the interface will get. If your kernel is not a
3568very recent kernel and you are willing to manually enable IPv6-NAT, the
3569IPv6 address you specify here must be a globally routed IPv6 address of
3570your host.
3571
3572Suppose your host has the address @code{2001:4ca0::1234/64}, then
3573using @code{2001:4ca0::1:0/112} would be fine (keep the first 64 bits,
3574then change at least one bit in the range before the bitmask, in the
3575example above we changed bit 111 from 0 to 1).
3576
3577You may also have to configure your router to route traffic for the entire
3578subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this
3579should be automatic with IPv6, but obviously anything can be
3580disabled).
3581
3582@node Bandwidth Configuration
3583@subsection Bandwidth Configuration
3584
3585You can specify how many bandwidth GNUnet is allowed to use to receive
3586and send data. This is important for users with limited bandwidth or
3587traffic volume.
3588
3589@node Configuring NAT
3590@subsection Configuring NAT
3591
3592Most hosts today do not have a normal global IP address but instead are
3593behind a router performing Network Address Translation (NAT) which assigns
3594each host in the local network a private IP address.
3595As a result, these machines cannot trivially receive inbound connections
3596from the Internet. GNUnet supports NAT traversal to enable these machines
3597to receive incoming connections from other peers despite their
3598limitations.
3599
3600In an ideal world, you can press the "Attempt automatic configuration"
3601button in gnunet-setup to automatically configure your peer correctly.
3602Alternatively, your distribution might have already triggered this
3603automatic configuration during the installation process.
3604However, automatic configuration can fail to determine the optimal
3605settings, resulting in your peer either not receiving as many connections
3606as possible, or in the worst case it not connecting to the network at all.
3607
3608To manually configure the peer, you need to know a few things about your
3609network setup. First, determine if you are behind a NAT in the first
3610place.
3611This 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
3613choose to manually configure it to allow GNUnet traffic to your host.
3614If you have configured your NAT to forward traffic on ports 2086 (and
3615possibly 1080) to your host, you can check the "NAT ports have been opened
3616manually" option, which corresponds to the "PUNCHED_NAT" option in the
3617configuration file. If you did not punch your NAT box, it may still be
3618configured to support UPnP, which allows GNUnet to automatically
3619configure it. In that case, you need to install the "upnpc" command,
3620enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal
3621via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the
3622configuration file).
3623
3624Some NAT boxes can be traversed using the autonomous NAT traversal method.
3625This requires certain GNUnet components to be installed with "SUID"
3626prividledges on your system (so if you're installing on a system you do
3627not have administrative rights to, this will not work).
3628If you installed as 'root', you can enable autonomous NAT traversal by
3629checking the "Enable NAT traversal using ICMP method".
3630The ICMP method requires a way to determine your NAT's external (global)
3631IP address. This can be done using either UPnP, DynDNS, or by manual
3632configuration. If you have a DynDNS name or know your external IP address,
3633you should enter that name under "External (public) IPv4 address" (which
3634corresponds to the "EXTERNAL_ADDRESS" option in the configuration file).
3635If you leave the option empty, GNUnet will try to determine your external
3636IP address automatically (which may fail, in which case autonomous
3637NAT traversal will then not work).
3638
3639Finally, if you yourself are not behind NAT but want to be able to
3640connect to NATed peers using autonomous NAT traversal, you need to check
3641the "Enable connecting to NATed peers using ICMP method" box.
3642
3643
3644@node Peer configuration for distributions
3645@subsection Peer configuration for distributions
3646
3647The "GNUNET_DATA_HOME" in "[path]" in @file{/etc/gnunet.conf} should be
3648manually set to "/var/lib/gnunet/data/" as the default
3649"~/.local/share/gnunet/" is probably not that appropriate in this case.
3650Similarly, distributions may consider pointing "GNUNET_RUNTIME_DIR" to
3651"/var/run/gnunet/" and "GNUNET_HOME" to "/var/lib/gnunet/". Also, should a
3652distribution decide to override system defaults, all of these changes
3653should be done in a custom @file{/etc/gnunet.conf} and not in the files
3654in the @file{config.d/} directory.
3655
3656Given the proposed access permissions, the "gnunet-setup" tool must be
3657run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it
3658modifies the system configuration). As always, gnunet-setup should be run
3659after the GNUnet peer was stopped using "gnunet-arm -e". Distributions
3660might want to include a wrapper for gnunet-setup that allows the
3661desktop-user to "sudo" (i.e. using gtksudo) to the "gnunet" user account
3662and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in
3663sequence.
3664
3665@node How to start and stop a GNUnet peer
3666@section How to start and stop a GNUnet peer
3667
3668This section describes how to start a GNUnet peer. It assumes that you
3669have already compiled and installed GNUnet and its' dependencies.
3670Before you start a GNUnet peer, you may want to create a configuration
3671file using gnunet-setup (but you do not have to).
3672Sane defaults should exist in your
3673@file{$GNUNET_PREFIX/share/gnunet/config.d/} directory, so in practice
3674you could simply start without any configuration. If you want to
3675configure your peer later, you need to stop it before invoking the
3676@code{gnunet-setup} tool to customize further and to test your
3677configuration (@code{gnunet-setup} has build-in test functions).
3678
3679The 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
3681GNUnet should store its data.
3682It defaults to @code{$HOME/}, which again should work for most users.
3683Make sure that the directory specified as GNUNET_HOME is writable to
3684the user that you will use to run GNUnet (note that you can run frontends
3685using other users, GNUNET_HOME must only be accessible to the user used to
3686run the background processes).
3687
3688You will also need to make one central decision: should all of GNUnet be
3689run under your normal UID, or do you want distinguish between system-wide
3690(user-independent) GNUnet services and personal GNUnet services. The
3691multi-user setup is slightly more complicated, but also more secure and
3692generally 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
3704For the single-user setup, you do not need to do anything special and can
3705just start the GNUnet background processes using @code{gnunet-arm}.
3706By default, GNUnet looks in @file{~/.config/gnunet.conf} for a
3707configuration (or @code{$XDG_CONFIG_HOME/gnunet.conf} if@
3708@code{$XDG_CONFIG_HOME} is defined). If your configuration lives
3709elsewhere, you need to pass the @code{-c FILENAME} option to all GNUnet
3710commands.
3711
3712Assuming the configuration file is called @file{~/.config/gnunet.conf},
3713you start your peer using the @code{gnunet-arm} command (say as user
3714@code{gnunet}) using:
3715
3716@example
3717gnunet-arm -c ~/.config/gnunet.conf -s
3718@end example
3719
3720@noindent
3721The "-s" option here is for "start". The command should return almost
3722instantly. If you want to stop GNUnet, you can use:
3723
3724@example
3725gnunet-arm -c ~/.config/gnunet.conf -e
3726@end example
3727
3728@noindent
3729The "-e" option here is for "end".
3730
3731Note that this will only start the basic peer, no actual applications
3732will be available.
3733If you want to start the file-sharing service, use (after starting
3734GNUnet):
3735
3736@example
3737gnunet-arm -c ~/.config/gnunet.conf -i fs
3738@end example
3739
3740@noindent
3741The "-i fs" option here is for "initialize" the "fs" (file-sharing)
3742application. You can also selectively kill only file-sharing support using
3743
3744@example
3745gnunet-arm -c ~/.config/gnunet.conf -k fs
3746@end example
3747
3748@noindent
3749Assuming that you want certain services (like file-sharing) to be always
3750automatically started whenever you start GNUnet, you can activate them by
3751setting "FORCESTART=YES" in the respective section of the configuration
3752file (for example, "[fs]"). Then GNUnet with file-sharing support would
3753be started whenever you@ enter:
3754
3755@example
3756gnunet-arm -c ~/.config/gnunet.conf -s
3757@end example
3758
3759@noindent
3760Alternatively, you can combine the two options:
3761
3762@example
3763gnunet-arm -c ~/.config/gnunet.conf -s -i fs
3764@end example
3765
3766@noindent
3767Using @code{gnunet-arm} is also the preferred method for initializing
3768GNUnet from @code{init}.
3769
3770Finally, you should edit your @code{crontab} (using the @code{crontab}
3771command) and insert a line@
3772
3773@example
3774@@reboot gnunet-arm -c ~/.config/gnunet.conf -s
3775@end example
3776
3777to automatically start your peer whenever your system boots.
3778
3779@node The Multi-User Setup
3780@subsection The Multi-User Setup
3781
3782This requires you to create a user @code{gnunet} and an additional group
3783@code{gnunetdns}, prior to running @code{make install} during
3784installation.
3785Then, you create a configuration file @file{/etc/gnunet.conf} which should
3786contain the lines:@
3787
3788@example
3789[arm]
3790SYSTEM_ONLY = YES
3791USER_ONLY = NO
3792@end example
3793
3794@noindent
3795Then, perform the same steps to run GNUnet as in the per-user
3796configuration, except as user @code{gnunet} (including the
3797@code{crontab} installation).
3798You may also want to run @code{gnunet-setup} to configure your peer
3799(databases, etc.).
3800Make sure to pass @code{-c /etc/gnunet.conf} to all commands. If you
3801run @code{gnunet-setup} as user @code{gnunet}, you might need to change
3802permissions on @file{/etc/gnunet.conf} so that the @code{gnunet} user can
3803write to the file (during setup).
3804
3805Afterwards, you need to perform another setup step for each normal user
3806account 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
3814Then, create a configuration file in @file{~/.config/gnunet.conf} for the
3815$USER with the lines:
3816
3817@example
3818[arm]
3819SYSTEM_ONLY = NO
3820USER_ONLY = YES
3821@end example
3822
3823@noindent
3824This will ensure that @code{gnunet-arm} when started by the normal user
3825will only run services that are per-user, and otherwise rely on the
3826system-wide services.
3827Note that the normal user may run gnunet-setup, but the
3828configuration would be ineffective as the system-wide services will use
3829@file{/etc/gnunet.conf} and ignore options set by individual users.
3830
3831Again, each user should then start the peer using
3832@file{gnunet-arm -s} --- and strongly consider adding logic to start
3833the peer automatically to their crontab.
3834
3835Afterwards, 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
3841It is not necessary to stop GNUnet services explicitly when shutting
3842down your computer.
3843
3844It should be noted that manually killing "most" of the
3845@code{gnunet-service} processes is generally not a successful method for
3846stopping a peer (since @code{gnunet-service-arm} will instantly restart
3847them). 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
3849terminated before the system-wide services will terminate normally.
3850
3851@node Access Control for GNUnet
3852@subsection Access Control for GNUnet
3853
3854This chapter documents how we plan to make access control work within the
3855GNUnet system for a typical peer. It should be read as a best-practice
3856installation guide for advanced users and builders of binary
3857distributions. The recommendations in this guide apply to POSIX-systems
3858with full support for UNIX domain sockets only.
3859
3860Note that this is an advanced topic. The discussion presumes a very good
3861understanding of users, groups and file permissions. Normal users on
3862hosts with just a single user can just install GNUnet under their own
3863account (and possibly allow the installer to use SUDO to grant additional
3864permissions for special GNUnet tools that need additional rights).
3865The discussion below largely applies to installations where multiple users
3866share a system and to installations where the best possible security is
3867paramount.
3868
3869A typical GNUnet system consists of components that fall into four
3870categories:
3871
3872@table @asis
3873
3874@item User interfaces
3875User interfaces are not security sensitive and are supposed to be run and
3876used by normal system users.
3877The GTK GUIs and most command-line programs fall into this category.
3878Some command-line tools (like gnunet-transport) should be excluded as they
3879offer low-level access that normal users should not need.
3880@item System services and support tools
3881System services should always run and offer services that can then be
3882accessed by the normal users.
3883System services do not require special permissions, but as they are not
3884specific to a particular user, they probably should not run as a
3885particular user. Also, there should typically only be one GNUnet peer per
3886host. System services include the gnunet-service and gnunet-daemon
3887programs; support tools include command-line programs such as gnunet-arm.
3888@item Priviledged helpers
3889Some GNUnet components require root rights to open raw sockets or perform
3890other special operations. These gnunet-helper binaries are typically
3891installed SUID and run from services or daemons.
3892@item Critical services
3893Some GNUnet services (such as the DNS service) can manipulate the service
3894in deep and possibly highly security sensitive ways. For example, the DNS
3895service can be used to intercept and alter any DNS query originating from
3896the local machine. Access to the APIs of these critical services and their
3897priviledged 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
3914GNUnet services allow two types of access: via TCP socket or via UNIX
3915domain socket.
3916If the service is available via TCP, access control can only be
3917implemented by restricting connections to a particular range of IP
3918addresses.
3919This is acceptable for non-critical services that are supposed to be
3920available to all users on the local system or local network.
3921However, as TCP is generally less efficient and it is rarely the case
3922that a single GNUnet peer is supposed to serve an entire local network,
3923the default configuration should disable TCP access to all GNUnet
3924services on systems with support for UNIX domain sockets.
3925As of GNUnet 0.9.2, configuration files with TCP access disabled should be
3926generated by default. Users can re-enable TCP access to particular
3927services simply by specifying a non-zero port number in the section of
3928the 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
3934GNUnet's main services should be run as a separate user "gnunet" in a
3935special group "gnunet".
3936The user "gnunet" should start the peer using "gnunet-arm -s" during
3937system 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}.
3940Only 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
3946Users that should be allowed to use the GNUnet peer should be added to the
3947group "gnunet". Using GNUnet's access control mechanism for UNIX domain
3948sockets, those services that are considered useful to ordinary users
3949should be made available by setting "UNIX_MATCH_GID=YES" for those
3950services.
3951Again, as shipped, GNUnet provides reasonable defaults.
3952Permissions to access the transport and core subsystems might additionally
3953be granted without necessarily causing security concerns.
3954Some services, such as DNS, must NOT be made accessible to the "gnunet"
3955group (and should thus only be accessible to the "gnunet" user and
3956services 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
3961Most of GNUnet's SUID binaries should be safe even if executed by normal
3962users. However, it is possible to reduce the risk a little bit more by
3963making these binaries owned by the group "gnunet" and restricting their
3964execution 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
3969A special group "gnunetdns" should be created for controlling access to
3970the "gnunet-helper-dns".
3971The binary should then be owned by root and be in group "gnunetdns" and
3972be installed SUID and only be group-executable (2750).
3973@b{Note that the group "gnunetdns" should have no users in it at all,
3974ever.}
3975The "gnunet-service-dns" program should be executed by user "gnunet" (via
3976gnunet-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
3979helper, and the helper can then run as root (as per SUID).
3980Access to the API offered by "gnunet-service-dns" is in turn restricted
3981to 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
3987The current build system does not set all permissions automatically based
3988on the recommendations above. In particular, it does not use the group
3989"gnunet" at all (so setting gnunet-helpers other than the
3990gnunet-helper-dns to be owned by group "gnunet" must be done manually).
3991Furthermore, 'make install' will silently fail to set the DNS binaries to
3992be owned by group "gnunetdns" unless that group already exists (!).
3993An alternative name for the "gnunetdns" group can be specified using the
3994@code{--with-gnunetdns=GRPNAME} configure option.
3995