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