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