aboutsummaryrefslogtreecommitdiff
path: root/doc/documentation/chapters/installation.texi
blob: d66d72ae576a60cd5fb21a4184d2818f33ce162a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@node Installing GNUnet
@chapter Installing GNUnet

This guide is intended for those who want to install Gnunet from source. For instructions on how to install GNUnet as a binary package please refer to the official documentation of your operating system or package manager.

@node Getting the Source Code
@section Installing dependencies
GNUnet needs few libraries and applications for being able to run and another few optional ones for using certain features. Preferably they should be installed with a package manager. Just in case we include a link to the project websites.

The mandatory libraries and applications are
@itemize @bullet
@item libtool
@item autoconf >= version 2.59
@item automake >= version 1.11.1
@item pkg-config
@item libgcrypt >= version 1.6
@item libextractor
@item libidn
@item libmicrohttpd >= version 0.9.52
@item libnss 
@item libunistring
@item gettext
@item glibc
@item libgmp
@item gnutls
@item libcurl (has to be linked to GnuTLS) or libgnurl
@item zlib
@end itemize

In addition GNUnet needs one of of these three databases
@itemize @bullet
@item sqlite + libsqlite (the default, requires no further configuration)
@item postgres + libpq
@item mysql + libmysqlclient
@end itemize

These are the dependencies only required for certain features
@itemize @bullet
@item Texinfo (for building the documentation)
@item Texlive (for building the documentation)
@item miniupnpc (for traversing NAT boxes more reliably)
@item libopus (for running the GNUnet conversation telephony application)
@item libpulse (for running the GNUnet conversation telephony application)
@item libogg (for running the GNUnet conversation telephony application)
@item bluez (for bluetooth support)
@item libpbc (for attribute-based encryption and the identity provider subsystem)
@item libgabe (for attribute-based encryption and the identity provider subsystem)
@end itemize


@section Getting the Source Code
You can either download the source code using git (you obviously need git installed) or as an archive.

Using git type
@example
git clone https://gnunet.org/git/gnunet.git
@end example

The archive can be found at @uref{https://gnunet.org/downloads}. Extract it using a graphical archive tool or @code{tar}:
@example
tar xzvf gnunet-0.11.0pre66.tar.gz
@end example

In the next chapter we will assume that the source code is available in the home directory at @code{~/gnunet}.

@section Create @code{gnunet} user and group
The GNUnet services should be run as a dedicated user called @code{gnunet}. For using them a user should be in the same group as this system user.

Create user @code{gnunet} who is member of the group @code{gnunet} and specify a home directory where the GNUnet services will store persistant data such as information about peers.
@example
$ sudo useradd --system --groups gnunet --home-dir /var/lib/gnunet
@end example

Now add your own user to the @code{gnunet} group.
@example
$ sudo adduser alice gnunet
@end example

@section Preparing and Compiling the Source Code
For preparing the source code for compilation a bootstrap script and @code{configure} has to be run from the source code directory. When running @code{configure} the following options can be specified to customize the compilation and installation process:

@itemize @bullet
@item @code{--disable-documentation} - don't build the configuration documents
@item @code{--enable-looging=[LOGLEVEL]} - choose a loglevel (@code{debug}, @code{info}, @code{warning} or @code{error})
@item @code{--prefix=[PATH]} - the directory where the GNUnet libraries and binaries will be installed
@item @code{--with-extractor=[PATH]} - the path to libextractor
@item @code{--with-libidn=[PATH]} - the path to libidn
@item @code{--with-microhttpd=[PATH]} - the path to libmicrohttpd
@item @code{--with-sqlite=[PATH]} - the path to libsqlite
@item @code{--with-zlib=[PATH]} - the path to zlib
@item @code{--with-sudo=[PATH]} - path to the sudo binary (no need to run @code{make install} as root if specified)
@end itemize

The following example configures the installation prefix @code{/usr/lib} and disables building the documentation
@example
$ cd ~/gnunet
$ ./bootstrap
$ configure --prefix=/usr/lib --disable-configuration
@end example

After running the bootstrap script and @code{configure} successfully the source code can be compiled with make. Here @code{-j5} specifies that 5 threads should be used.
@example
$ make -j5
@end example


@section Installation
The compiled binaries can be installed using @code{make install}. It needs to be run as root (or with sudo) because some binaries need the @code{suid} bit set. Without that some GNUnet subsystems (such as VPN) will not work.

@example
$ sudo make install
@end example

One important library is the GNS plugin for NSS (the name services switch) which allows using GNS (the GNU name system) in the normal DNS resolution process. Unfortunately NSS expects it in a specific location (probably @code{/lib}) which may differ from the installation prefix (see @code{--prefix} option in the previous section). This is why the pugin has to be installed manually.

Find the directory where nss plugins are installed on your system, e.g.

@example
$ ls -l /lib/libnss_*
/lib/libnss_mymachines.so.2
/lib/libnss_resolve.so.2
/lib/libnss_myhostname.so.2
/lib/libnss_systemd.so.2
@end example

Copy the GNS NSS plugin to that directory:

@example
cp ~/gnunet/src/gns/nss/libnss_gns.so.2 /lib
@end example

Now, to activate the plugin, you need to edit your @code{/etc/nsswitch.conf} where you should find a line like this:

@example
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
@end example

The exact details may differ a bit, which is fine. Add the text @code{"gns [NOTFOUND=return]"} after @code{"files"}. 

@example
hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4
@end example

Optionally, if GNS shall be used with a browser, execute the GNS CA-setup script. It will isetup the GNS Certificate Authority with the user's browser.
@example
$ gnunet-gns-proxy-setup-ca
@end example

Finally install a configuration file in @code{~/.gnunet/gnunet.conf}. Below you find an example config which allows you to start GNUnet.

@example
[arm]
SYSTEM_ONLY = NO
USER_ONLY = NO

[transport]
PLUGINS = tcp
@end example