diff options
Diffstat (limited to 'doc/chapters/installation.texi')
-rw-r--r-- | doc/chapters/installation.texi | 3625 |
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 | |||
4 | This handbook describes how to install (build setup, compilation) and setup | ||
5 | (configuration, start) GNUnet 0.10.x. After following these instructions you | ||
6 | should be able to install and then start user-interfaces to interact with the | ||
7 | network. | ||
8 | |||
9 | This manual is far from complete, and we welcome informed contributions, be it | ||
10 | in 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 | |||
33 | This document lists the various known dependencies for GNUnet 0.10.x. | ||
34 | Suggestions 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 | |||
48 | These packages must be installed before a typical GNUnet installation | ||
49 | can 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, | ||
61 | compile with libunbound for DANE support; GnuTLS also requires GNU | ||
62 | nettle 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 | ||
64 | against 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} | ||
67 | post (and the link inside it)). | ||
68 | @item @uref{https://gnunet.org/gnurl, gnURL} libgnurl 7.34.0 or higher, | ||
69 | must 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) | ||
77 | optional 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 | ||
81 | version numbers, but you may get subtle bugs with respect to quota management | ||
82 | in certain rare cases); alternatively, MySQL or Postgres can also be installed, | ||
83 | but those databases will require more complex configurations (not recommended | ||
84 | for 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 | |||
95 | If you have to compile libgnurl from source since the version included in your | ||
96 | distribution 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 | |||
108 | Solution: | ||
109 | |||
110 | Before 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 | |||
119 | This section tries to give an overview of what processes a typical GNUnet peer | ||
120 | running a particular application would consist of. All of the processes listed | ||
121 | here should be automatically started by @code{gnunet-arm -s}. The list is given | ||
122 | as a rough first guide to users for failure diagnostics. Ideally, end-users | ||
123 | should never have to worry about these internal dependencies. | ||
124 | |||
125 | In terms of internal dependencies, a minimum file-sharing system consists of | ||
126 | the 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 | |||
144 | A minimum VPN system consists of the following GNUnet processes (in order of | ||
145 | dependency): | ||
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 | |||
163 | A minimum GNS system consists of the following GNUnet processes (in order of | ||
164 | dependency): | ||
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 | |||
186 | Please 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 | |||
194 | First, in addition to the GNUnet sources you must download the latest version | ||
195 | of various dependencies. Most distributions do not include sufficiently recent | ||
196 | versions of these dependencies. Thus, a typically installation on a "modern" | ||
197 | GNU/Linux distribution requires you to install the following | ||
198 | dependencies (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 | ||
206 | dependencies including development headers from your distribution) | ||
207 | @end itemize | ||
208 | |||
209 | Other dependencies that you should strongly consider to install is a | ||
210 | database (MySQL, sqlite or Postgres). The following instructions will assume | ||
211 | that you installed at least sqlite. For most distributions you should be able | ||
212 | to find pre-build packages for the database. Again, make sure to install the | ||
213 | client libraries and the respective development headers (if they are | ||
214 | packaged separately) as well. | ||
215 | |||
216 | You can find specific, detailed instructions for installing of the dependencies | ||
217 | (and possibly the rest of the GNUnet installation) in the platform-specific | ||
218 | descriptions, which are linked from the bottom of this page. Please consult | ||
219 | them now. If your distribution is not listed, please study the instructions for | ||
220 | Debian stable carefully as you try to install the dependencies for your own | ||
221 | distribution. Contributing additional instructions for further platforms is | ||
222 | always appreciated. | ||
223 | |||
224 | Before proceeding further, please double-check the dependency list. Note that | ||
225 | in addition to satisfying the dependencies, you might have to make sure that | ||
226 | development headers for the various libraries are also installed. There maybe | ||
227 | files for other distributions, or you might be able to find equivalent packages | ||
228 | for your distribution. | ||
229 | |||
230 | While it is possible to build and install GNUnet without having root access, | ||
231 | we will assume that you have full control over your system in these | ||
232 | instructions. First, you should create a system user @emph{gnunet} and an additional | ||
233 | group @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 | |||
252 | If 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. | ||
254 | DEBUG-level log messages are in English-only and should only be useful for | ||
255 | developers (or for filing really detailed bug reports). | ||
256 | |||
257 | Finally, 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 | ||
259 | file-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 | }@ | ||
276 | You 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 | |||
283 | Then, 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 | |||
290 | You may also want to add the last line in the gnunet users @file{crontab} | ||
291 | prefixed with @code{@@reboot} so that it is executed whenever the system is | ||
292 | booted:@ | ||
293 | |||
294 | @code{@ | ||
295 | @@reboot /usr/local/bin/gnunet-arm -c /etc/gnunet.conf -s@ | ||
296 | }@ | ||
297 | |||
298 | This will only start the system-wide GNUnet services. Type exit to get back | ||
299 | your 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 | |||
306 | to allow them to access the system-wide GNUnet services. Then, each user should | ||
307 | create 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 | |||
316 | and start the per-user services using@ | ||
317 | |||
318 | @code{@ | ||
319 | $ gnunet-arm -c ~/.config/gnunet.conf -s@ | ||
320 | }@ | ||
321 | |||
322 | Again, 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 | |||
327 | Note that some GNUnet services (such as SOCKS5 proxies) may need a system-wide | ||
328 | TCP port for each user. For those services, systems with more than one user may | ||
329 | require each user to specify a different port number in their personal | ||
330 | configuration file. | ||
331 | |||
332 | Finally, the user should perform the basic initial setup for the GNU Name | ||
333 | System. 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 | |||
340 | The first generates the default zones, wheras the second setups the GNS | ||
341 | Certificate Authority with the user's browser. Now, to actiave GNS in the | ||
342 | normal DNS resolution process, you need to edit your @file{/etc/nsswitch.conf} | ||
343 | where you should find a line like this: | ||
344 | @example | ||
345 | hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 | ||
346 | @end example | ||
347 | |||
348 | |||
349 | The exact details may differ a bit, which is fine. Add the text | ||
350 | @emph{"gns [NOTFOUND=return]"} after @emph{"files"}: | ||
351 | @example | ||
352 | hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4 | ||
353 | @end example | ||
354 | |||
355 | |||
356 | You might want to make sure that @file{/lib/libnss_gns.so.2} exists on your | ||
357 | system, 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 | |||
380 | First, make sure Git is installed on your system:@ | ||
381 | |||
382 | $ sudo apt-get install git@ | ||
383 | |||
384 | Install 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 | |||
480 | Install 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 | |||
488 | Build 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 | |||
507 | Install 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 | |||
517 | Choose one or more database backends@ | ||
518 | |||
519 | @itemize @bullet | ||
520 | |||
521 | @item | ||
522 | SQLite3 @code{$ sudo apt-get install libsqlite3-dev} | ||
523 | |||
524 | @item | ||
525 | MySQL @code{$ sudo apt-get install libmysqlclient-dev} | ||
526 | |||
527 | @item | ||
528 | PostgreSQL @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 | |||
549 | You can specify the location of the GNUnet installation by setting the prefix | ||
550 | when 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 | |||
559 | Please make sure NOW that you have created a user and group 'gnunet'@ | ||
560 | and additionally a group 'gnunetdns':@ | ||
561 | @code{@ | ||
562 | $ sudo addgroup gnunet@ | ||
563 | $ sudo addgroup gnunetdns@ | ||
564 | $ sudo adduser gnunet@ | ||
565 | } | ||
566 | |||
567 | Each GNUnet user should be added to the 'gnunet' group (may@ | ||
568 | require 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 | |||
576 | Some components, like the nss plugin required for GNS, may require root | ||
577 | permissions. 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 | } | ||
590 | Use the required configure call including the optional installation prefix | ||
591 | PREFIX or the sudo permissions@ | ||
592 | @code{$ ./configure [ --with-sudo | --with-prefix=PREFIX ]}@ | ||
593 | @code{$ make; sudo make install} | ||
594 | |||
595 | After installing it, you need to create an empty configuration file:@ | ||
596 | @code{mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf} | ||
597 | |||
598 | And 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 | |||
605 | Install depencies:@ | ||
606 | @code{$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev libqrencode-dev} | ||
607 | |||
608 | To 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 | |||
636 | This document is a guide to building GNUnet and its dependencies on Windows | ||
637 | platforms. GNUnet development is mostly done under Linux and especially SVN | ||
638 | checkouts may not build out of the box. We regret any inconvenience, and if you | ||
639 | have problems, please report them. | ||
640 | |||
641 | @node Requirements | ||
642 | @subsection Requirements | ||
643 | |||
644 | The Howto is based upon a @strong{Windows Server 2008 32bit@strong{ | ||
645 | Installation, @strong{sbuild} and thus a @uref{http://www.mingw.org/wiki/MSYS, | ||
646 | MSYS+MinGW} (W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild | ||
647 | is a convenient set of scripts which creates a working msys/mingw installation | ||
648 | and installs most dependencies required for GNUnet. }} | ||
649 | |||
650 | As of the point of the creation of this Howto, GNUnet @strong{requires} a | ||
651 | Windows @strong{Server} 2003 or newer for full feature support. Windows Vista | ||
652 | and later will also work, but | ||
653 | @strong{non-server version can not run a VPN-Exit-Node} as the NAT features | ||
654 | have 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 | ||
663 | Install a fresh version of @strong{Python 2.x}, even if you are using a x64-OS, | ||
664 | install a 32-bit version for use with sbuild. Python 3.0 currently is | ||
665 | incompatible. | ||
666 | |||
667 | @item | ||
668 | Install your favorite @uref{http://code.google.com/p/tortoisegit/, GIT} & | ||
669 | @uref{http://tortoisesvn.net/, SVN}-clients. | ||
670 | |||
671 | @item | ||
672 | You will also need some archive-manager like @uref{http://www.7-zip.org/, 7zip}. | ||
673 | |||
674 | @item | ||
675 | Pull a copy of sbuild to a directory of your choice, which will be used in the | ||
676 | remainder of this guide. For now, we will use @file{c:\gnunet\sbuild\} | ||
677 | |||
678 | @item | ||
679 | in @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 | ||
681 | compile/install those for us. | ||
682 | |||
683 | @item | ||
684 | Follow LRN's sbuild installation instructions.- | ||
685 | @end itemize | ||
686 | |||
687 | Please note that sbuild may (or will most likely) fail during installation, | ||
688 | thus you really HAVE to @strong{check the logfiles} created during the | ||
689 | installation process. Certain packages may fail to build initially due to | ||
690 | missing dependencies, thus you may have to | ||
691 | @strong{substitute those with binary-versions initially}. Later on once | ||
692 | dependencies 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 | ||
695 | there is no uniform way to fix all compile-time issues, as the build-process | ||
696 | of many of the dependencies installed are rather unstable on win32 and certain | ||
697 | releases may not even compile at all.} | ||
698 | |||
699 | Most dependencies for GNUnet have been set up by sbuild, thus we now should add | ||
700 | the @file{bin/} directories in your new msys and mingw installations to PATH. | ||
701 | You will want to create a backup of your finished msys-environment by now. | ||
702 | |||
703 | @node GNUnet Installation | ||
704 | @subsection GNUnet Installation | ||
705 | |||
706 | First, we need to launch our msys-shell, you can do this via | ||
707 | |||
708 | @file{C:\gnunet\sbuild\msys\msys.bat} | ||
709 | |||
710 | You might wish to take a look at this file and adjust some login-parameters to | ||
711 | your msys environment. | ||
712 | |||
713 | Also, sbuild added two pointpoints to your msys-environment, though those | ||
714 | might 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 | |||
725 | Check out the current gnunet-sources (svn-head) from the gnunet-repository, | ||
726 | we will do this in your home directory: | ||
727 | |||
728 | @code{svn checkout https://gnunet.org/svn/gnunet/ ~/gnunet} | ||
729 | |||
730 | Now, we will first need to bootstrap the checked out installation and then | ||
731 | configure it accordingly. | ||
732 | |||
733 | @example | ||
734 | cd ~/gnunet@ | ||
735 | ./bootstrap@ | ||
736 | STRIP=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 | |||
739 | The parameters above will configure for a reasonable gnunet installation to the | ||
740 | your msys-root directory. Depending on which features your would like to build | ||
741 | or you may need to specify additional dependencies. Sbuild installed most libs | ||
742 | into the /mingw subdirectory, so remember to prefix library locations with | ||
743 | this path. | ||
744 | |||
745 | Like on a unixoid system, you might want to use your home directory as prefix | ||
746 | for your own gnunet installation for development, without tainting the | ||
747 | buildenvironment. Just change the "prefix" parameter to point towards | ||
748 | ~/ in this case. | ||
749 | |||
750 | Now it's time to compile gnunet as usual. Though this will take some time, so | ||
751 | you may fetch yourself a coffee or some Mate now... | ||
752 | |||
753 | @example | ||
754 | make@ | ||
755 | make install | ||
756 | @end example | ||
757 | |||
758 | @node Adjusting Windows for running and testing GNUnet | ||
759 | @subsection Adjusting Windows for running and testing GNUnet | ||
760 | |||
761 | Assuming the build succeeded and you | ||
762 | @strong{added the bin directory of your gnunet to PATH}, you can now use your | ||
763 | gnunet-installation as usual. Remember that UAC or the windows firewall may | ||
764 | popup initially, blocking further execution of gnunet until you acknowledge | ||
765 | them (duh!). | ||
766 | |||
767 | You will also have to take the usual steps to get p2p software running properly | ||
768 | (port forwarding, ...), and gnunet will require administrative permissions as | ||
769 | it may even install a device-driver (in case you are using gnunet-vpn and/or | ||
770 | gnunet-exit). | ||
771 | |||
772 | @node Building the GNUnet Installer | ||
773 | @subsection Building the GNUnet Installer | ||
774 | |||
775 | The GNUnet installer is made with @uref{http://nsis.sourceforge.net/, NSIS}@ | ||
776 | The 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 | |||
781 | TODO | ||
782 | |||
783 | @node Build instructions for Debian 7.5 | ||
784 | @section Build instructions for Debian 7.5 | ||
785 | |||
786 | |||
787 | These are the installation instructions for Debian 7.5. They were tested using | ||
788 | a 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 | ||
790 | did not select any desktop environment, servers or system utilities during the | ||
791 | "tasksel" step. Note that the packages and the dependencies that we will | ||
792 | install during this chapter take about 1.5 GB of disk space. Combined with | ||
793 | GNUnet and space for objects during compilation, you should not even attempt | ||
794 | this unless you have about 2.5 GB free after the minimal Debian installation. | ||
795 | Using these instructions to build a VM image is likely to require a minimum of | ||
796 | 4-5 GB for the VM (as you will likely also want a desktop manager). | ||
797 | |||
798 | GNUnet's security model assumes that your @file{/home} directory is encrypted. | ||
799 | Thus, if possible, you should encrypt your home partition | ||
800 | (or per-user home directory). | ||
801 | |||
802 | Naturally, the exact details of the starting state for your installation | ||
803 | should not matter much. For example, if you selected any of those installation | ||
804 | groups you might simply already have some of the necessary packages installed. | ||
805 | We did this for testing, as this way we are less likely to forget to mention a | ||
806 | required package. Note that we will not install a desktop environment, but of | ||
807 | course you will need to install one to use GNUnet's graphical user interfaces. | ||
808 | Thus, it is suggested that you simply install the desktop environment of your | ||
809 | choice 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 | |||
826 | After any installation, you should begin by running | ||
827 | |||
828 | @example | ||
829 | # apt-get update@ | ||
830 | # apt-get upgrade@ | ||
831 | @end example | ||
832 | |||
833 | to ensure that all of your packages are up-to-date. Note that the "#" is used | ||
834 | to 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 | ||
836 | as a normal user. | ||
837 | |||
838 | @node Stable? Hah! | ||
839 | @subsection Stable? Hah! | ||
840 | |||
841 | Yes, we said we start with a Debian 7.5 "stable" system. However, to reduce the | ||
842 | amount of compilation by hand, we will begin by allowing the installation of | ||
843 | packages 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 | ||
845 | other distributions. Start by modifying @file{/etc/apt/sources.list} to contain | ||
846 | the following (possibly adjusted to point to your mirror of choice): | ||
847 | @example | ||
848 | # These were there before: | ||
849 | deb http://ftp.de.debian.org/debian/ wheezy main | ||
850 | deb-src http://ftp.de.debian.org/debian/ wheezy main | ||
851 | deb http://security.debian.org/ wheezy/updates main | ||
852 | deb-src http://security.debian.org/ wheezy/updates main | ||
853 | deb http://ftp.de.debian.org/debian/ wheezy-updates main | ||
854 | deb-src http://ftp.de.debian.org/debian/ wheezy-updates main | ||
855 | |||
856 | # Add these lines (feel free to adjust the mirror): | ||
857 | deb http://ftp.de.debian.org/debian/ testing main | ||
858 | deb http://ftp.de.debian.org/debian/ unstable main | ||
859 | @end example | ||
860 | |||
861 | The next step is to create/edit your @file{/etc/apt/preferences} file to look | ||
862 | like this: | ||
863 | |||
864 | @example | ||
865 | Package: * | ||
866 | Pin: release a=stable,n=wheezy | ||
867 | Pin-Priority: 700 | ||
868 | |||
869 | Package: * | ||
870 | Pin: release o=Debian,a=testing | ||
871 | Pin-Priority: 650 | ||
872 | |||
873 | Package: * | ||
874 | Pin: release o=Debian,a=unstable | ||
875 | Pin-Priority: 600 | ||
876 | @end example | ||
877 | |||
878 | You can read more about Apt Preferences here and here. Note that other pinnings | ||
879 | are likely to also work for GNUnet, the key thing is that you need some | ||
880 | packages from unstable (as shown below). However, as unstable is unlikely to | ||
881 | be comprehensive (missing packages) or might be problematic (crashing packages), | ||
882 | you probably want others from stable and/or testing. | ||
883 | |||
884 | @node Update again | ||
885 | @subsection Update again | ||
886 | |||
887 | Now, run again@ | ||
888 | |||
889 | @example | ||
890 | # apt-get update@ | ||
891 | # apt-get upgrade@ | ||
892 | @end example | ||
893 | |||
894 | to ensure that all your new distribution indices are downloaded, and that your | ||
895 | pinning is correct: the upgrade step should cause no changes at all. | ||
896 | |||
897 | @node Installing packages | ||
898 | @subsection Installing packages | ||
899 | |||
900 | We 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 | |||
914 | After 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 | |||
925 | Next, we need to install a few dependencies from source. You might want to do | ||
926 | this 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 | ||
928 | directory. We begin by downloading all dependencies, then extracting the | ||
929 | sources, 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 | |||
966 | For this, simply follow the generic installation instructions from | ||
967 | here. | ||
968 | |||
969 | @node But wait there is more! | ||
970 | @subsection But wait there is more! | ||
971 | |||
972 | So far, we installed all of the packages and dependencies required to ensure | ||
973 | that all of GNUnet would be built. However, while for example the plugins to | ||
974 | interact with the MySQL or Postgres databases have been created, we did not | ||
975 | actually install or configure those databases. Thus, you will need to install | ||
976 | and configure those databases or stick with the default Sqlite database. | ||
977 | Sqlite is usually fine for most applications, but MySQL can offer better | ||
978 | performance 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 | |||
1048 | If you want to: | ||
1049 | @itemize @bullet | ||
1050 | |||
1051 | |||
1052 | @item | ||
1053 | Install to a different directory:@ | ||
1054 | --prefix=PREFIX | ||
1055 | |||
1056 | @item | ||
1057 | Have sudo permission, but do not want to compile as root:@ | ||
1058 | --with-sudo | ||
1059 | |||
1060 | @item | ||
1061 | Want 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 | |||
1071 | After installing it, you need to create an empty configuration file:@ | ||
1072 | @code{touch ~/.config/gnunet.conf} | ||
1073 | |||
1074 | And 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 | |||
1080 | These are the installation instructions for Debian 8. They were tested using a | ||
1081 | fresh Debian 8 AMD64 installation without non-free software (no contrib or | ||
1082 | non-free). During installation, I only selected "lxde" for the desktop | ||
1083 | environment. Note that the packages and the dependencies that we will install | ||
1084 | during this chapter take about 1.5 GB of disk space. Combined with GNUnet and | ||
1085 | space for objects during compilation, you should not even attempt this unless | ||
1086 | you have about 2.5 GB free after the Debian installation. Using these | ||
1087 | instructions to build a VM image is likely to require a minimum of 4-5 GB for | ||
1088 | the VM (as you will likely also want a desktop manager). | ||
1089 | |||
1090 | GNUnet's security model assumes that your @code{/home} directory is encrypted. | ||
1091 | Thus, if possible, you should encrypt your entire disk, or at least just your | ||
1092 | home partition (or per-user home directory). | ||
1093 | |||
1094 | Naturally, the exact details of the starting state for your installation should | ||
1095 | not matter much. For example, if you selected any of those installation groups | ||
1096 | you might simply already have some of the necessary packages installed. Thus, | ||
1097 | it is suggested that you simply install the desktop environment of your choice | ||
1098 | before 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 | |||
1112 | After any installation, you should begin by running@ | ||
1113 | @code{@ | ||
1114 | # apt-get update@ | ||
1115 | # apt-get upgrade@ | ||
1116 | }@ | ||
1117 | to ensure that all of your packages are up-to-date. Note that the "#" is used | ||
1118 | to 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 | ||
1120 | user. | ||
1121 | |||
1122 | @node Installing Debian Packages | ||
1123 | @subsection Installing Debian Packages | ||
1124 | |||
1125 | We 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 | |||
1142 | Yes, we said we start with a Debian 8 "stable" system, but because Debian | ||
1143 | linked GnuTLS without support for DANE, we need to compile a few things, in | ||
1144 | addition to GNUnet, still by hand. Yes, you can run GNUnet using the respective | ||
1145 | Debian packages, but then you will not get DANE support. | ||
1146 | |||
1147 | Next, we need to install a few dependencies from source. You might want to do | ||
1148 | this 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 | ||
1150 | directory. We begin by downloading all dependencies, then extracting the | ||
1151 | sources, 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 | |||
1173 | For this, simply follow the generic installation instructions from@ | ||
1174 | here. | ||
1175 | |||
1176 | @node But wait (again) there is more! | ||
1177 | @subsection But wait (again) there is more! | ||
1178 | |||
1179 | So far, we installed all of the packages and dependencies required to ensure | ||
1180 | that all of GNUnet would be built. However, while for example the plugins to | ||
1181 | interact with the MySQL or Postgres databases have been created, we did not | ||
1182 | actually install or configure those databases. Thus, you will need to install | ||
1183 | and configure those databases or stick with the default Sqlite database. Sqlite | ||
1184 | is usually fine for most applications, but MySQL can offer better performance | ||
1185 | and Postgres better resillience. | ||
1186 | |||
1187 | @node Outdated build instructions for previous revisions | ||
1188 | @section Outdated build instructions for previous revisions | ||
1189 | |||
1190 | This chapter contains a collection of outdated, older installation guides. They | ||
1191 | are mostly intended to serve as a starting point for writing up-to-date | ||
1192 | instructions and should not be expected to work for GNUnet 0.10.x. | ||
1193 | A set of older installation instructions can also be found in the | ||
1194 | @file{doc/outdated-and-old-installation-instructions.txt} in the source | ||
1195 | of GNUnet. This file covers old instructions which no longer receive | ||
1196 | security 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 | |||
1211 | Install 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 | |||
1219 | Choose one or more database backends@ | ||
1220 | SQLite3@ | ||
1221 | @code{@ | ||
1222 | $ sudo apt-get install libsqlite3-dev@ | ||
1223 | }@ | ||
1224 | MySQL@ | ||
1225 | @code{@ | ||
1226 | $ sudo apt-get install libmysqlclient-dev@ | ||
1227 | }@ | ||
1228 | PostgreSQL@ | ||
1229 | @code{@ | ||
1230 | $ sudo apt-get install libpq-dev postgresql@ | ||
1231 | } | ||
1232 | |||
1233 | Install the optional dependencies for gnunet-conversation:@ | ||
1234 | @code{@ | ||
1235 | $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev@ | ||
1236 | } | ||
1237 | |||
1238 | Install the libgrypt 1.6:@ | ||
1239 | For Ubuntu 14.04:@ | ||
1240 | @code{$ sudo apt-get install libgcrypt20-dev}@ | ||
1241 | For 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 | |||
1249 | Install 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 | |||
1265 | Install 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 | |||
1272 | If you want to: | ||
1273 | @itemize @bullet | ||
1274 | |||
1275 | @item | ||
1276 | Install to a different directory:@ | ||
1277 | --prefix=PREFIX | ||
1278 | |||
1279 | @item | ||
1280 | Have sudo permission, but do not want to compile as root:@ | ||
1281 | --with-sudo | ||
1282 | |||
1283 | @item | ||
1284 | Want 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 | |||
1293 | After installing it, you need to create an empty configuration file:@ | ||
1294 | @code{touch ~/.config/gnunet.conf} | ||
1295 | |||
1296 | And 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 | |||
1302 | GNUnet now requires the GNU Linear Programming Kit (GLPK). Since there's is no | ||
1303 | package you can install with @code{mingw-get} you have to compile it from | ||
1304 | source: | ||
1305 | |||
1306 | @itemize @bullet | ||
1307 | |||
1308 | @item | ||
1309 | Download the latest version from http://ftp.gnu.org/gnu/glpk/ | ||
1310 | |||
1311 | @item | ||
1312 | Unzip it using your favourite unzipper@ | ||
1313 | In the MSYS shell: | ||
1314 | |||
1315 | @item | ||
1316 | change to the respective directory | ||
1317 | |||
1318 | @item | ||
1319 | @code{./configure '--build=i686-pc-mingw32'} | ||
1320 | |||
1321 | @item | ||
1322 | run @code{make install check } | ||
1323 | |||
1324 | MinGW does not automatically detect the correct buildtype so you have to | ||
1325 | specify 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 | |||
1332 | After installing GNUnet you can continue installing the GNUnet GUI tools: | ||
1333 | |||
1334 | First, install the required dependencies: | ||
1335 | |||
1336 | @code{@ | ||
1337 | $ sudo apt-get install libgladeui-dev libqrencode-dev@ | ||
1338 | } | ||
1339 | |||
1340 | Please ensure that the GNUnet shared libraries can be found by the linker. If | ||
1341 | you installed GNUnet libraries in a non standard path (say | ||
1342 | GNUNET_PREFIX=/usr/local/lib/), you can | ||
1343 | @itemize @bullet | ||
1344 | |||
1345 | |||
1346 | @item | ||
1347 | set the environmental variable permanently to@ | ||
1348 | @code{LD_LIBRARY_PATH=$GNUNET_PREFIX} | ||
1349 | |||
1350 | @item | ||
1351 | or add @code{$GNUNET_PREFIX} to @code{/etc/ld.so.conf} | ||
1352 | @end itemize | ||
1353 | |||
1354 | |||
1355 | Now 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 | |||
1367 | gnunet-update project is an effort to introduce updates to GNUnet | ||
1368 | installations. An interesting to-be-implemented-feature of gnunet-update is | ||
1369 | that these updates are propagated through GNUnet's peer-to-peer network. More | ||
1370 | information about gnunet-update can be found at | ||
1371 | https://gnunet.org/svn/gnunet-update/README. | ||
1372 | |||
1373 | While the project is still under development, we have implemented the following | ||
1374 | features which we believe may be helpful for users and we would like them to be | ||
1375 | tested: | ||
1376 | |||
1377 | @itemize @bullet | ||
1378 | |||
1379 | @item | ||
1380 | Packaging GNUnet installation along with its run-time dependencies into update | ||
1381 | packages | ||
1382 | |||
1383 | @item | ||
1384 | Installing update packages into compatible hosts | ||
1385 | |||
1386 | @item | ||
1387 | Updating an existing installation (which had been installed by gnunet-update) | ||
1388 | to a newer one | ||
1389 | @end itemize | ||
1390 | |||
1391 | The above said features of gnunet-update are currently available for testing on | ||
1392 | GNU/Linux systems. | ||
1393 | |||
1394 | The following is a guide to help you get started with gnunet-update. It shows | ||
1395 | you how to install the testing binary packages of GNUnet 0.9.1 we have at | ||
1396 | https://gnunet.org/install/ | ||
1397 | |||
1398 | gnunet-update needs the following: | ||
1399 | |||
1400 | @itemize @bullet | ||
1401 | @item | ||
1402 | python ( 2.6 or above) | ||
1403 | |||
1404 | @item | ||
1405 | gnupg | ||
1406 | |||
1407 | @item | ||
1408 | python-gpgme | ||
1409 | @end itemize | ||
1410 | |||
1411 | |||
1412 | Checkout gnunet-update:@ | ||
1413 | @code{@ | ||
1414 | $ svn checkout -r24905 https://gnunet.org/svn/gnunet-update@ | ||
1415 | } | ||
1416 | |||
1417 | For security reasons, all packages released for gnunet-update from us are | ||
1418 | signed with the key at https://gnunet.org/install/key.txt You would need to | ||
1419 | import this key into your gpg key ring. gnunet-update uses this key to verify | ||
1420 | the integrity of the packages it installs@ | ||
1421 | @code{@ | ||
1422 | $ gpg --recv-keys 7C613D78@ | ||
1423 | } | ||
1424 | |||
1425 | Download the packages relevant to your architecture (currently I have access to | ||
1426 | GNU/Linux machines on x86_64 and i686, so only two for now, hopefully more | ||
1427 | later) from https://gnunet.org/install/. | ||
1428 | |||
1429 | To install the downloaded package into the directory /foo: | ||
1430 | |||
1431 | @code{@ | ||
1432 | gnunet-update/bin/gnunet-update install downloaded/package /foo@ | ||
1433 | } | ||
1434 | |||
1435 | The installer reports the directories into which shared libraries and | ||
1436 | dependencies have been installed. You may need to add the reported shared | ||
1437 | library installation paths to LD_LIBRARY_PATH before you start running any | ||
1438 | installed binaries. | ||
1439 | |||
1440 | Please 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 | |||
1446 | This document is a DEPRECATED installation guide for gnunet on windows. It will | ||
1447 | not work for recent gnunet versions, but maybe it will be of some use if | ||
1448 | problems 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 | ||
1475 | Pentium II or equivalent processor, 350 MHz or better | ||
1476 | |||
1477 | @item | ||
1478 | 128 MB RAM | ||
1479 | |||
1480 | @item | ||
1481 | 600 MB free disk space | ||
1482 | |||
1483 | @item | ||
1484 | Windows 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 | @ | ||
1502 | The MinGW project provides the compiler toolchain that is used to build | ||
1503 | GNUnet.@ Get the following packages from | ||
1504 | @uref{http://sourceforge.net/projects/mingw/files/, the MinGW project}: | ||
1505 | @itemize @bullet | ||
1506 | |||
1507 | |||
1508 | @item | ||
1509 | GCC core | ||
1510 | |||
1511 | @item | ||
1512 | GCC g++ | ||
1513 | |||
1514 | @item | ||
1515 | MSYS | ||
1516 | |||
1517 | @item | ||
1518 | MSYS Developer Tool Kit (msysDTK) | ||
1519 | |||
1520 | @item | ||
1521 | MSYS Developer Tool Kit - msys-autoconf (bin) | ||
1522 | |||
1523 | @item | ||
1524 | MSYS Developer Tool Kit - msys-automake (bin) | ||
1525 | |||
1526 | @item | ||
1527 | MinGW Runtime | ||
1528 | |||
1529 | @item | ||
1530 | MinGW Utilities | ||
1531 | |||
1532 | @item | ||
1533 | Windows API | ||
1534 | |||
1535 | @item | ||
1536 | Binutils | ||
1537 | |||
1538 | @item | ||
1539 | make | ||
1540 | |||
1541 | @item | ||
1542 | pdcurses | ||
1543 | |||
1544 | @item | ||
1545 | GDB (snapshot) | ||
1546 | @end itemize | ||
1547 | |||
1548 | @itemize @bullet | ||
1549 | |||
1550 | |||
1551 | @item | ||
1552 | Install MSYS (to c:\mingw, for example.)@ | ||
1553 | Do @strong{not} use spaces in the pathname (c:\program files\mingw). | ||
1554 | |||
1555 | @item | ||
1556 | Install MinGW runtime, utilities and GCC to a subdirectory (to c:\mingw\mingw, | ||
1557 | for example) | ||
1558 | |||
1559 | @item | ||
1560 | Install the Development Kit to the MSYS directory (c:\mingw) | ||
1561 | |||
1562 | @item | ||
1563 | Create a batch file bash.bat in your MSYS directory with the files:@ | ||
1564 | |||
1565 | @example | ||
1566 | bin\sh.exe --login | ||
1567 | @end example | ||
1568 | |||
1569 | |||
1570 | This batch file opens a shell which is used to invoke the build processes..@ | ||
1571 | MinGW's standard shell (msys.bat) is not suitable because it opens a separate | ||
1572 | console window@ On Vista, bash.bat needs to be run as administrator. | ||
1573 | |||
1574 | @item | ||
1575 | Start bash.sh and rename (c:\mingw\mingw\)lib\libstdc++.la to avoid problems:@ | ||
1576 | |||
1577 | @example | ||
1578 | mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken | ||
1579 | @end example | ||
1580 | |||
1581 | |||
1582 | @item | ||
1583 | Unpack the Windows API to the MinGW directory (c:\mingw\mingw\) and remove the | ||
1584 | declaration of DATADIR from (c:\mingw\mingw\)include\objidl.h (lines 55-58) | ||
1585 | |||
1586 | @item | ||
1587 | Unpack autoconf, automake to the MSYS directory (c:\mingw) | ||
1588 | |||
1589 | @item | ||
1590 | Install all other packages to the MinGW directory (c:\mingw\mingw\) | ||
1591 | @end itemize | ||
1592 | |||
1593 | |||
1594 | @item | ||
1595 | @strong{GNU Libtool}@ | ||
1596 | @ | ||
1597 | GNU Libtool is required to use shared libraries.@ | ||
1598 | @ | ||
1599 | Get the prebuilt package from here and unpack it to the MinGW directory | ||
1600 | (c:\mingw) | ||
1601 | |||
1602 | @item | ||
1603 | @strong{Pthreads}@ | ||
1604 | @ | ||
1605 | GNUnet uses the portable POSIX thread library for multi-threading..@ | ||
1606 | |||
1607 | @itemize @bullet | ||
1608 | |||
1609 | |||
1610 | @item | ||
1611 | Save @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 | ||
1614 | Save @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 | ||
1617 | Download 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 | @ | ||
1625 | GNUnet uses the GNU Multiple Precision library for special cryptographic operations.@ | ||
1626 | @ | ||
1627 | Get 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 | ||
1670 | patch -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 | ||
1681 | dlltool --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 | |||
1767 | Before you compile libextractor or GNUnet, be sure to set@ | ||
1768 | PKG_CONFIG_PATH: | ||
1769 | @example | ||
1770 | export 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 | ||
1779 | export 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 | |||
1792 | The sources of all dependencies are available here. | ||
1793 | |||
1794 | @node Portable GNUnet | ||
1795 | @section Portable GNUnet | ||
1796 | |||
1797 | Quick instructions on how to use the most recent GNUnet on most GNU/Linux | ||
1798 | distributions | ||
1799 | |||
1800 | Currently this has only been tested on Ubuntu 12.04, 12.10, 13.04, Debian and | ||
1801 | CentOS 6, but it should work on almost any GNU/Linux distribution. More | ||
1802 | in-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 | |||
1815 | Open a terminal and paste this line into it to install all required tools | ||
1816 | needed:@ | ||
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 | |||
1822 | The following command will download a working version of gnunet-update with the | ||
1823 | subversion tool and import the public key which is needed for authentication:@ | ||
1824 | |||
1825 | @example | ||
1826 | svn checkout -r24905 https://gnunet.org/svn/gnunet-update ~/gnunet-update && | ||
1827 | cd ~/gnunet-update | ||
1828 | gpg --keyserver "hkp://keys.gnupg.net" --recv-keys 7C613D78 | ||
1829 | @end example | ||
1830 | |||
1831 | @node Install GNUnet | ||
1832 | @subsection Install GNUnet | ||
1833 | |||
1834 | Download and install GNUnet binaries which can be found here and set library | ||
1835 | paths:@ | ||
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 | |||
1844 | You may need to re-login once after executing these last commands | ||
1845 | |||
1846 | That's it, GNUnet is installed in your home directory now. GNUnet can be | ||
1847 | configured and afterwards started by executing@ | ||
1848 | @code{gnunet-arm -s} | ||
1849 | |||
1850 | @node The graphical configuration interface | ||
1851 | @section The graphical configuration interface | ||
1852 | |||
1853 | If you also would like to use gnunet-gtk and gnunet-setup (highly recommended | ||
1854 | for beginners), do: | ||
1855 | |||
1856 | @example | ||
1857 | wget -P /tmp https://gnunet.org/install/packs/gnunet-0.9.4-gtk-0.9.4-`uname -m`.tgz@ | ||
1858 | sh ~/gnunet-update/bin/gnunet-update install /tmp/gnunet-*gtk*.tgz ~@ | ||
1859 | sudo ldconfig | ||
1860 | @end example | ||
1861 | Now 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 | |||
1901 | This chapter will describe the various configuration options in GNUnet. | ||
1902 | |||
1903 | The easiest way to configure your peer is to use the gnunet-setup tool. | ||
1904 | gnunet-setup is part of the gnunet-gtk download. You might have to install it | ||
1905 | separately. | ||
1906 | |||
1907 | Many of the specific sections from this chapter actually are linked from within | ||
1908 | gnunet-setup to help you while using the setup tool. | ||
1909 | |||
1910 | While you can also configure your peer by editing the configuration file by | ||
1911 | hand, 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 | |||
1920 | GNUnet knows three basic modes of operation. In standard "peer-to-peer" mode, | ||
1921 | your peer will connect to any peer. In the pure "friend-to-friend" mode, your | ||
1922 | peer will ONLY connect to peers from a list of friends specified in the | ||
1923 | configuration. Finally, in mixed mode, GNUnet will only connect to arbitrary | ||
1924 | peers if it has at least a specified number of connections to friends. | ||
1925 | |||
1926 | When configuring any of the F2F modes, you first need to create a file with the | ||
1927 | peer identities of your friends. Ask your friends to run | ||
1928 | |||
1929 | $ gnunet-peerinfo -sq | ||
1930 | |||
1931 | The output of this command needs to be added to your friends file, which is | ||
1932 | simply a plain text file with one line per friend with the output from the | ||
1933 | above command. | ||
1934 | |||
1935 | You then specify the location of your friends file in the "FRIENDS" option of | ||
1936 | the "topology" section. | ||
1937 | |||
1938 | Once you have created the friends file, you can tell GNUnet to only connect to | ||
1939 | your friends by setting the "FRIENDS-ONLY" option (again in the "topology" | ||
1940 | section) to YES. | ||
1941 | |||
1942 | If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a | ||
1943 | minimum number of friends to have (before connecting to arbitrary peers) under | ||
1944 | the "MINIMUM-FRIENDS" option. | ||
1945 | |||
1946 | If you want to operate in normal P2P-only mode, simply set "MINIMUM-FRIENDS" to | ||
1947 | zero 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 | |||
1952 | After installing the software you need to get connected to the GNUnet network. | ||
1953 | The configuration file included in your download is already configured to | ||
1954 | connect you to the GNUnet network. In this section the relevant configuration | ||
1955 | settings are explained. | ||
1956 | |||
1957 | To get an initial connection to the GNUnet network and to get to know peers | ||
1958 | already connected to the network you can use the so called bootstrap servers. | ||
1959 | These servers can give you a list of peers connected to the network. To use | ||
1960 | these bootstrap servers you have to configure the hostlist daemon to activate | ||
1961 | bootstrapping. | ||
1962 | |||
1963 | To activate bootstrapping edit your configuration file and edit the | ||
1964 | @code{[hostlist]}-section. You have to set the argument "-b" in the options | ||
1965 | line: | ||
1966 | @example | ||
1967 | [hostlist] | ||
1968 | OPTIONS = -b | ||
1969 | @end example | ||
1970 | |||
1971 | Additionally you have to specify which server you want to use. The default | ||
1972 | bootstrapping server is "@uref{http://v10.gnunet.org/hostlist, | ||
1973 | http://v10.gnunet.org/hostlist}". [^] To set the server you have to edit the | ||
1974 | line "SERVERS" in the hostlist section. To use the default server you should | ||
1975 | set the lines to | ||
1976 | @example | ||
1977 | SERVERS = http://v10.gnunet.org/hostlist [^] | ||
1978 | @end example | ||
1979 | |||
1980 | |||
1981 | To use bootstrapping your configuration file should include these lines: | ||
1982 | @example | ||
1983 | [hostlist] | ||
1984 | OPTIONS = -b | ||
1985 | SERVERS = http://v10.gnunet.org/hostlist [^] | ||
1986 | @end example | ||
1987 | |||
1988 | |||
1989 | Besides using bootstrap servers you can configure your GNUnet peer to recieve | ||
1990 | hostlist advertisements. Peers offering hostlists to other peers can send | ||
1991 | advertisement messages to peers that connect to them. If you configure your | ||
1992 | peer to receive these messages, your peer can download these lists and connect | ||
1993 | to the peers included. These lists are persistent, which means that they are | ||
1994 | saved to your hard disk regularly and are loaded during startup. | ||
1995 | |||
1996 | To activate hostlist learning you have to add the "-e" switch to the OPTIONS | ||
1997 | line in the hostlist section: | ||
1998 | @example | ||
1999 | [hostlist] | ||
2000 | OPTIONS = -b -e | ||
2001 | @end example | ||
2002 | |||
2003 | |||
2004 | Furthermore you can specify in which file the lists are saved. To save the | ||
2005 | lists in the file "hostlists.file" just add the line: | ||
2006 | @example | ||
2007 | HOSTLISTFILE = hostlists.file | ||
2008 | @end example | ||
2009 | |||
2010 | |||
2011 | Best practice is to activate both bootstrapping and hostlist learning. So your | ||
2012 | configuration file should include these lines: | ||
2013 | @example | ||
2014 | [hostlist] | ||
2015 | OPTIONS = -b -e | ||
2016 | HTTPPORT = 8080 | ||
2017 | SERVERS = http://v10.gnunet.org/hostlist [^] | ||
2018 | HOSTLISTFILE = $SERVICEHOME/hostlists.file | ||
2019 | @end example | ||
2020 | |||
2021 | @node Configuration of the HOSTLIST proxy settings | ||
2022 | @subsection Configuration of the HOSTLIST proxy settings | ||
2023 | |||
2024 | The hostlist client can be configured to use a proxy to connect to the hostlist | ||
2025 | server. This functionality can be configured in the configuration file directly | ||
2026 | or using the gnunet-setup tool. | ||
2027 | |||
2028 | The hostlist client supports the following proxy types at the moment: | ||
2029 | @itemize @bullet | ||
2030 | |||
2031 | |||
2032 | @item | ||
2033 | HTTP and HTTP 1.0 only proxy | ||
2034 | |||
2035 | @item | ||
2036 | SOCKS 4/4a/5/5 with hostname | ||
2037 | @end itemize | ||
2038 | |||
2039 | |||
2040 | In addition authentication at the proxy with username and password can be | ||
2041 | configured. | ||
2042 | |||
2043 | To configure proxy support for the hostlist client in the gnunet-setup tool, | ||
2044 | select the "hostlist" tab and select the appropriate proxy type. The hostname | ||
2045 | or IP address (including port if required) has to be entered in the "Proxy | ||
2046 | hostname" textbox. If required, enter username and password in the "Proxy | ||
2047 | username" and "Proxy password" boxes. Be aware that these information will be | ||
2048 | stored in the configuration in plain text. | ||
2049 | |||
2050 | To configure these options directly in the configuration, you can configure the | ||
2051 | following 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 | |||
2069 | If you operate a peer permanently connected to GNUnet you can configure your | ||
2070 | peer to act as a hostlist server, providing other peers the list of peers known | ||
2071 | to him. | ||
2072 | |||
2073 | Yor server can act as a bootstrap server and peers needing to obtain a list of | ||
2074 | peers can contact him to download this list. To download this hostlist the peer | ||
2075 | uses HTTP. For this reason you have to build your peer with libcurl and | ||
2076 | microhttpd support. How you build your peer with this options can be found | ||
2077 | here: https://gnunet.org/generic_installation | ||
2078 | |||
2079 | To configure your peer to act as a bootstrap server you have to add the "-p" | ||
2080 | option to OPTIONS in the [hostlist] section of your configuration file. Besides | ||
2081 | that you have to specify a port number for the http server. In conclusion you | ||
2082 | have to add the following lines: | ||
2083 | |||
2084 | @example | ||
2085 | [hostlist] | ||
2086 | HTTPPORT = 12980 | ||
2087 | OPTIONS = -p | ||
2088 | @end example | ||
2089 | |||
2090 | |||
2091 | If your peer acts as a bootstrap server other peers should know about that. You | ||
2092 | can advertise the hostlist your are providing to other peers. Peers connecting | ||
2093 | to your peer will get a message containing an advertisement for your hostlist | ||
2094 | and the URL where it can be downloaded. If this peer is in learning mode, it | ||
2095 | will test the hostlist and, in the case it can obtain the list successfully, it | ||
2096 | will save it for bootstrapping. | ||
2097 | |||
2098 | To activate hostlist advertisement on your peer, you have to set the following | ||
2099 | lines in your configuration file: | ||
2100 | @example | ||
2101 | [hostlist] | ||
2102 | EXTERNAL_DNS_NAME = example.org | ||
2103 | HTTPPORT = 12981 | ||
2104 | OPTIONS = -p -a | ||
2105 | @end example | ||
2106 | |||
2107 | |||
2108 | With this configuration your peer will a act as a bootstrap server and | ||
2109 | advertise this hostlist to other peers connecting to him. The URL used to | ||
2110 | download the list will be @code{@uref{http://example.org:12981/, | ||
2111 | http://example.org:12981/}}. | ||
2112 | |||
2113 | Please notice: | ||
2114 | @itemize @bullet | ||
2115 | |||
2116 | |||
2117 | @item | ||
2118 | The hostlist is not human readable, so you should not try to download it using | ||
2119 | your webbrowser. Just point your GNUnet peer to the address! | ||
2120 | |||
2121 | @item | ||
2122 | Advertising 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 | |||
2128 | The datastore is what GNUnet uses to for long-term storage of file-sharing | ||
2129 | data. Note that long-term does not mean 'forever' since content does have an | ||
2130 | expiration date, and of course storage space is finite (and hence sometimes | ||
2131 | content may have to be discarded). | ||
2132 | |||
2133 | Use the "QUOTA" option to specify how many bytes of storage space you are | ||
2134 | willing to dedicate to GNUnet. | ||
2135 | |||
2136 | In addition to specifying the maximum space GNUnet is allowed to use for the | ||
2137 | datastore, you need to specify which database GNUnet should use to do so. | ||
2138 | Currently, you have the choice between sqLite, MySQL and Postgres. | ||
2139 | |||
2140 | @node Configuring the MySQL database | ||
2141 | @subsection Configuring the MySQL database | ||
2142 | |||
2143 | This section describes how to setup the MySQL database for GNUnet. | ||
2144 | |||
2145 | Note that the mysql plugin does NOT work with mysql before 4.1 since we need | ||
2146 | prepared statements. We are generally testing the code against MySQL 5.1 at | ||
2147 | this point. | ||
2148 | |||
2149 | @node Reasons for using MySQL | ||
2150 | @subsection Reasons for using MySQL | ||
2151 | |||
2152 | @itemize @bullet | ||
2153 | |||
2154 | @item | ||
2155 | On up-to-date hardware where mysql can be used comfortably, this module will | ||
2156 | have better performance than the other database choices (according to our | ||
2157 | tests). | ||
2158 | |||
2159 | @item Its often possible to recover the mysql database from internal | ||
2160 | inconsistencies. 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 | ||
2169 | Memory usage (likely not an issue if you have more than 1 GB) | ||
2170 | |||
2171 | @item | ||
2172 | Complex manual setup | ||
2173 | @end itemize | ||
2174 | |||
2175 | @node Setup Instructions | ||
2176 | @subsection Setup Instructions | ||
2177 | |||
2178 | @itemize @bullet | ||
2179 | |||
2180 | @item | ||
2181 | In @code{gnunet.conf} set in section "DATASTORE" the value for "DATABASE" to | ||
2182 | "mysql". | ||
2183 | |||
2184 | @item | ||
2185 | Access mysql as root:@ | ||
2186 | |||
2187 | @example | ||
2188 | $ mysql -u root -p | ||
2189 | @end example | ||
2190 | |||
2191 | |||
2192 | and issue the following commands, replacing $USER with the username@ | ||
2193 | that will be running gnunet-arm (so typically "gnunet"): | ||
2194 | @example | ||
2195 | CREATE DATABASE gnunet; | ||
2196 | GRANT select,insert,update,delete,create,alter,drop,create temporary tables | ||
2197 | ON gnunet.* TO $USER@@localhost; | ||
2198 | SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like'); | ||
2199 | FLUSH PRIVILEGES; | ||
2200 | @end example | ||
2201 | |||
2202 | |||
2203 | @item | ||
2204 | In the $HOME directory of $USER, create a ".my.cnf" file with the following lines@ | ||
2205 | |||
2206 | @example | ||
2207 | [client] | ||
2208 | user=$USER | ||
2209 | password=$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 | |||
2222 | You should briefly try if the database connection works. First, login as $USER. | ||
2223 | Then use: | ||
2224 | @example | ||
2225 | $ mysql -u $USER | ||
2226 | mysql> use gnunet; | ||
2227 | @end example | ||
2228 | |||
2229 | |||
2230 | If you get the message "Database changed" it probably works. | ||
2231 | |||
2232 | If 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 | |||
2239 | For GNUnet, you probably want to set the option | ||
2240 | @example | ||
2241 | innodb_flush_log_at_trx_commit = 0 | ||
2242 | @end example | ||
2243 | |||
2244 | for a rather dramatic boost in MySQL performance. However, this reduces the | ||
2245 | "safety" of your database as with this options you may loose transactions | ||
2246 | during a power outage. While this is totally harmless for GNUnet, the option | ||
2247 | applies to all applications using MySQL. So you should set it if (and only if) | ||
2248 | GNUnet is the only application on your system using MySQL. | ||
2249 | |||
2250 | @node Setup for running Testcases | ||
2251 | @subsection Setup for running Testcases | ||
2252 | |||
2253 | If 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 | ||
2255 | used for testing ("make check"). | ||
2256 | |||
2257 | @node Configuring the Postgres database | ||
2258 | @subsection Configuring the Postgres database | ||
2259 | |||
2260 | This text describes how to setup the Postgres database for GNUnet. | ||
2261 | |||
2262 | This Postgres plugin was developed for Postgres 8.3 but might work for earlier | ||
2263 | versions as well. | ||
2264 | |||
2265 | @node Reasons to use Postgres | ||
2266 | @subsection Reasons to use Postgres | ||
2267 | |||
2268 | @itemize @bullet | ||
2269 | @item | ||
2270 | Easier to setup than MySQL | ||
2271 | @item | ||
2272 | Real 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 | ||
2280 | Quite slow | ||
2281 | @item | ||
2282 | Still 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 | ||
2291 | In @code{gnunet.conf} set in section "DATASTORE" the value for@ | ||
2292 | "DATABASE" to "postgres". | ||
2293 | @item | ||
2294 | Access 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 | |||
2305 | and enter the name of the user running GNUnet for the role interactively. | ||
2306 | Then, when prompted, do not set it to superuser, allow the creation of | ||
2307 | databases, 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 | |||
2317 | where $GNUNET_USER is the name of the user running GNUnet.@ | ||
2318 | |||
2319 | @end table | ||
2320 | |||
2321 | |||
2322 | @item | ||
2323 | As 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 | |||
2333 | Now you should be able to start @code{gnunet-arm}. | ||
2334 | |||
2335 | @node Testing the setup manually | ||
2336 | @subsection Testing the setup manually | ||
2337 | |||
2338 | You may want to try if the database connection works. First, again login as | ||
2339 | the user who will run gnunet-arm. Then use, | ||
2340 | @example | ||
2341 | $ psql gnunet # or gnunetcheck | ||
2342 | gnunet=> \dt | ||
2343 | @end example | ||
2344 | |||
2345 | |||
2346 | If, after you have started gnunet-arm at least once, you get a @code{gn090} | ||
2347 | table here, it probably works. | ||
2348 | |||
2349 | @node Configuring the datacache | ||
2350 | @subsection Configuring the datacache | ||
2351 | @c %**end of header | ||
2352 | |||
2353 | The datacache is what GNUnet uses for storing temporary data. This data is | ||
2354 | expected to be wiped completely each time GNUnet is restarted (or the system | ||
2355 | is rebooted). | ||
2356 | |||
2357 | You need to specify how many bytes GNUnet is allowed to use for the datacache | ||
2358 | using the "QUOTA" option in the section "dhtcache". Furthermore, you need to | ||
2359 | specify which database backend should be used to store the data. Currently, | ||
2360 | you have the choice between sqLite, MySQL and Postgres. | ||
2361 | |||
2362 | @node Configuring the file-sharing service | ||
2363 | @subsection Configuring the file-sharing service | ||
2364 | |||
2365 | In order to use GNUnet for file-sharing, you first need to make sure that the | ||
2366 | file-sharing service is loaded. This is done by setting the AUTOSTART option in | ||
2367 | section "fs" to "YES". Alternatively, you can run | ||
2368 | @example | ||
2369 | $ gnunet-arm -i fs | ||
2370 | @end example | ||
2371 | |||
2372 | to start the file-sharing service by hand. | ||
2373 | |||
2374 | Except for configuring the database and the datacache the only important option | ||
2375 | for file-sharing is content migration. | ||
2376 | |||
2377 | Content migration allows your peer to cache content from other peers as well as | ||
2378 | send out content stored on your system without explicit requests. This content | ||
2379 | replication has positive and negative impacts on both system performance an | ||
2380 | privacy. | ||
2381 | |||
2382 | FIXME: discuss the trade-offs. Here is some older text about it... | ||
2383 | |||
2384 | Setting this option to YES allows gnunetd to migrate data to the local machine. | ||
2385 | Setting this option to YES is highly recommended for efficiency. Its also the | ||
2386 | default. If you set this value to YES, GNUnet will store content on your | ||
2387 | machine that you cannot decrypt. While this may protect you from liability if | ||
2388 | the judge is sane, it may not (IANAL). If you put illegal content on your | ||
2389 | machine yourself, setting this option to YES will probably increase your chances | ||
2390 | to get away with it since you can plausibly deny that you inserted the content. | ||
2391 | Note that in either case, your anonymity would have to be broken first (which | ||
2392 | may be possible depending on the size of the GNUnet network and the strength of | ||
2393 | the adversary). | ||
2394 | |||
2395 | @node Configuring logging | ||
2396 | @subsection Configuring logging | ||
2397 | |||
2398 | Logging in GNUnet 0.9.0 is controlled via the "-L" and "-l" options. | ||
2399 | Using "-L", a log level can be specified. With log level "ERROR" only serious | ||
2400 | errors are logged. The default log level is "WARNING" which causes anything of | ||
2401 | concern to be logged. Log level "INFO" can be used to log anything that might | ||
2402 | be interesting information whereas "DEBUG" can be used by developers to log | ||
2403 | debugging messages (but you need to run configure with | ||
2404 | @code{--enable-logging=verbose} to get them compiled). The "-l" option is used | ||
2405 | to specify the log file. | ||
2406 | |||
2407 | Since 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 | ||
2410 | service. In order to enable logging globally without editing the "OPTIONS" | ||
2411 | values for each service, @code{gnunet-arm} supports a "GLOBAL_POSTFIX" option. | ||
2412 | The value specified here is given as an extra option to all services for which | ||
2413 | the configuration does contain a service-specific "OPTIONS" field. | ||
2414 | |||
2415 | "GLOBAL_POSTFIX" can contain the special sequence "@{@}" which is replaced by | ||
2416 | the name of the service that is being started. Furthermore, | ||
2417 | @code{GLOBAL_POSTFIX} is special in that sequences starting with "$" anywhere | ||
2418 | in the string are expanded (according to options in "PATHS"); this expansion | ||
2419 | otherwise is only happening for filenames and then the "$" must be the first | ||
2420 | character in the option. Both of these restrictions do not apply to | ||
2421 | "GLOBAL_POSTFIX". Note that specifying @code{%} anywhere in the "GLOBAL_POSTFIX" | ||
2422 | disables both of these features. | ||
2423 | |||
2424 | In summary, in order to get all services to log at level "INFO" to log-files | ||
2425 | called @code{SERVICENAME-logs}, the following global prefix should be used: | ||
2426 | @example | ||
2427 | GLOBAL_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 | |||
2433 | The transport service in GNUnet is responsible to maintain basic connectivity | ||
2434 | to other peers. Besides initiating and keeping connections alive it is also | ||
2435 | responsible for address validation. | ||
2436 | |||
2437 | The GNUnet transport supports more than one transport protocol. These protocols | ||
2438 | are configured together with the transport service. | ||
2439 | |||
2440 | The configuration section for the transport service itself is quite similar to | ||
2441 | all 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 | |||
2458 | Different are the settings for the plugins to load @code{PLUGINS}. The first | ||
2459 | setting specifies which transport plugins to load. | ||
2460 | @itemize @bullet | ||
2461 | |||
2462 | |||
2463 | @item | ||
2464 | transport-unix | ||
2465 | |||
2466 | A plugin for local only communication with UNIX domain sockets. Used for | ||
2467 | testing 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 | ||
2476 | transport-tcp | ||
2477 | |||
2478 | A plugin for communication with TCP. Set port to 0 for client mode with | ||
2479 | outbound 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 | ||
2492 | transport-udp | ||
2493 | |||
2494 | A 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 | ||
2505 | transport-http | ||
2506 | |||
2507 | HTTP and HTTPS support is split in two part: a client plugin initiating | ||
2508 | outbound connections and a server part accepting connections from the client. | ||
2509 | The 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 | |||
2521 | The 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 | |||
2524 | The server plugin supports reverse proxies, so a external hostname can be set | ||
2525 | using@ | ||
2526 | the @code{EXTERNAL_HOSTNAME} setting. The webserver under this address should | ||
2527 | forward 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 | ||
2547 | transport-wlan | ||
2548 | |||
2549 | There is a special article how to setup the WLAN plugin, so here only the | ||
2550 | settings. 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 | |||
2565 | The wlan transport plugin enables GNUnet to send and to receive data on a wlan | ||
2566 | interface. It has not to be connected to a wlan network as long as sender and | ||
2567 | receiver are on the same channel. This enables you to get connection to the | ||
2568 | GNUnet where no internet access is possible, for example while catastrophes or | ||
2569 | when 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 | ||
2586 | wlan network card with monitor support and packet injection | ||
2587 | (see @uref{http://www.aircrack-ng.org/, aircrack-ng.org}) | ||
2588 | |||
2589 | @item | ||
2590 | Linux kernel with mac80211 stack, introduced in 2.6.22, tested with 2.6.35 | ||
2591 | and 2.6.38 | ||
2592 | |||
2593 | @item | ||
2594 | Wlantools to create the a monitor interface, tested with airmon-ng of the | ||
2595 | aircrack-ng package | ||
2596 | @end itemize | ||
2597 | |||
2598 | @node Configuration | ||
2599 | @subsubsection Configuration | ||
2600 | |||
2601 | There are the following options for the wlan plugin (they should be like this | ||
2602 | in your default config file, you only need to adjust them if the values are | ||
2603 | incorrect 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. | ||
2609 | INTERFACE = mon0@ | ||
2610 | # testmode for developers:@ | ||
2611 | # 0 use wlan interface,@ | ||
2612 | #1 or 2 use loopback driver for tests 1 = server, 2 = client@ | ||
2613 | TESTMODE = 0@ | ||
2614 | } | ||
2615 | |||
2616 | @node Before starting GNUnet | ||
2617 | @subsubsection Before starting GNUnet | ||
2618 | |||
2619 | Before starting GNUnet, you have to make sure that your wlan interface is in | ||
2620 | monitor mode. One way to put the wlan interface into monitor mode (if your | ||
2621 | interface name is wlan0) is by executing:@ | ||
2622 | @code{@ | ||
2623 | sudo airmon-ng start wlan0@ | ||
2624 | } | ||
2625 | |||
2626 | Here 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 | }@ | ||
2632 | The monitor interface is mon0 is the one that you have to put into the | ||
2633 | configuration file. | ||
2634 | |||
2635 | @node Limitations and known bugs | ||
2636 | @subsubsection Limitations and known bugs | ||
2637 | |||
2638 | Wlan speed is at the maximum of 1 Mbit/s because support for choosing the wlan | ||
2639 | speed with packet injection was removed in newer kernels. Please pester the | ||
2640 | kernel developers about fixing this. | ||
2641 | |||
2642 | The interface channel depends on the wlan network that the card is connected | ||
2643 | to. If no connection has been made since the start of the computer, it is | ||
2644 | usually the first channel of the card. Peers will only find each other and | ||
2645 | communicate 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 | |||
2652 | The HTTP plugin supports data transfer using reverse proxies. A reverse proxy | ||
2653 | forwards the HTTP request he receives with a certain URL to another webserver, | ||
2654 | here a GNUnet peer. | ||
2655 | |||
2656 | So if you have a running Apache or nginx webserver you can configure it to be a | ||
2657 | GNUnet reverse proxy. Especially if you have a well-known webiste this improves | ||
2658 | censorship resistance since it looks as normal surfing behaviour. | ||
2659 | |||
2660 | To do so, you have to do two things: | ||
2661 | |||
2662 | @itemize @bullet | ||
2663 | |||
2664 | @item | ||
2665 | Configure your webserver to forward the GNUnet HTTP traffic | ||
2666 | |||
2667 | @item | ||
2668 | Configure your GNUnet peer to announce the respective address | ||
2669 | @end itemize | ||
2670 | |||
2671 | As an example we want to use GNUnet peer running: | ||
2672 | |||
2673 | @itemize @bullet | ||
2674 | |||
2675 | @item | ||
2676 | HTTP server plugin on @code{gnunet.foo.org:1080} | ||
2677 | |||
2678 | @item | ||
2679 | HTTPS server plugin on @code{gnunet.foo.org:4433} | ||
2680 | |||
2681 | @item | ||
2682 | A apache or nginx webserver on @uref{http://www.foo.org/, http://www.foo.org:80/} | ||
2683 | |||
2684 | @item | ||
2685 | A apache or nginx webserver on https://www.foo.org:443/ | ||
2686 | @end itemize | ||
2687 | |||
2688 | And 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 | |||
2693 | First of all you need mod_proxy installed. | ||
2694 | |||
2695 | Edit your webserver configuration. Edit @code{/etc/apache2/apache2.conf} or | ||
2696 | the site-specific configuration file. | ||
2697 | |||
2698 | In 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 | |||
2711 | We assume that you already have an HTTPS server running, if not please check | ||
2712 | how to configure a HTTPS host. An easy to use example is the | ||
2713 | @file{apache2/sites-available/default-ssl} example configuration file. | ||
2714 | |||
2715 | In 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 | |||
2727 | More 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 | |||
2732 | Since nginx does not support chunked encoding, you first of all have to | ||
2733 | install @code{chunkin}:@ | ||
2734 | @uref{http://wiki.nginx.org/HttpChunkinModule, http://wiki.nginx.org/HttpChunkinModule} | ||
2735 | |||
2736 | To 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 | |||
2745 | Edit your webserver configuration. Edit @code{/etc/nginx/nginx.conf} or the | ||
2746 | site-specific configuration file. | ||
2747 | |||
2748 | In 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 | |||
2763 | Edit your webserver configuration. Edit @code{/etc/nginx/nginx.conf} or the | ||
2764 | site-specific configuration file. | ||
2765 | |||
2766 | In 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 | |||
2782 | To 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 | |||
2796 | Now restart your webserver and your peer... | ||
2797 | |||
2798 | @node Blacklisting peers | ||
2799 | @subsection Blacklisting peers | ||
2800 | |||
2801 | Transport service supports to deny connecting to a specific peer of to a | ||
2802 | specific peer with a specific transport plugin using te blacklisting component | ||
2803 | of transport service. With@ blacklisting it is possible to deny connections to | ||
2804 | specific peers of@ to use a specific plugin to a specific peer. Peers can be | ||
2805 | blacklisted using@ the configuration or a blacklist client can be asked. | ||
2806 | |||
2807 | To blacklist peers using the configuration you have to add a section to your@ | ||
2808 | configuration containing the peer id of the peer to blacklist and the plugin@ | ||
2809 | if required. | ||
2810 | |||
2811 | Example:@ | ||
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 | |||
2823 | You can also add a blacklist client usign the blacklist api. On a blacklist@ | ||
2824 | check, blacklisting first checks internally if the peer is blacklisted and@ | ||
2825 | if not, it asks the blacklisting clients. Clients are asked if it is OK to@ | ||
2826 | connect to a peer ID, the plugin is omitted. | ||
2827 | |||
2828 | On 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 | |||
2841 | The client part of the http and https transport plugins can be configured to | ||
2842 | use a proxy to connect to the hostlist server. This functionality can be | ||
2843 | configured in the configuration file directly or using the gnunet-setup tool. | ||
2844 | |||
2845 | The both the HTTP and HTTPS clients support the following proxy types at the | ||
2846 | moment: | ||
2847 | |||
2848 | @itemize @bullet | ||
2849 | @item HTTP 1.1 proxy | ||
2850 | @item SOCKS 4/4a/5/5 with hostname | ||
2851 | @end itemize | ||
2852 | |||
2853 | In addition authentication at the proxy with username and password can be | ||
2854 | configured. | ||
2855 | |||
2856 | To 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 | ||
2858 | appropriate proxy type. The hostname or IP address (including port if required) | ||
2859 | has to be entered in the "Proxy hostname" textbox. If required, enter username | ||
2860 | and password in the "Proxy username" and "Proxy password" boxes. Be aware that | ||
2861 | these information will be stored in the configuration in plain text. | ||
2862 | |||
2863 | To configure these options directly in the configuration, you can configure the | ||
2864 | following settings in the [transport-http_client] and [transport-https_client] | ||
2865 | section 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 | |||
2898 | Before you install GNUnet, make sure you have a user and group 'gnunet' as well | ||
2899 | as an empty group 'gnunetdns'. | ||
2900 | |||
2901 | When using GNUnet with system-wide DNS interception, it is absolutely necessary | ||
2902 | for all GNUnet service processes to be started by @code{gnunet-service-arm} as | ||
2903 | user and group 'gnunet'. You also need to be sure to run @code{make install} as | ||
2904 | root (or use the @code{sudo} option to configure) to grant GNUnet sufficient | ||
2905 | privileges. | ||
2906 | |||
2907 | With this setup, all that is required for enabling system-wide DNS interception | ||
2908 | is 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 | ||
2910 | necessary changes to your firewall (@code{iptables}) rules. | ||
2911 | |||
2912 | Note that this will NOT work if your system sends out DNS traffic to a | ||
2913 | link-local IPv6 address, as in this case GNUnet can intercept the traffic, but | ||
2914 | not inject the responses from the link-local IPv6 address. Hence you cannot use | ||
2915 | system-wide DNS interception in conjunction with link-local IPv6-based DNS | ||
2916 | servers. If such a DNS server is used, it will bypass GNUnet's DNS traffic | ||
2917 | interception. | ||
2918 | |||
2919 | |||
2920 | |||
2921 | Using the GNU Name System (GNS) requires two different configuration steps. | ||
2922 | First of all, GNS needs to be integrated with the operating system. Most of | ||
2923 | this section is about the operating system level integration. | ||
2924 | |||
2925 | Additionally, each individual user who wants to use the system must also | ||
2926 | initialize his GNS zones. This can be done by running (after starting GNUnet)@ | ||
2927 | @code{@ | ||
2928 | $ gnunet-gns-import.sh@ | ||
2929 | }@ | ||
2930 | after the local GNUnet peer has been started. Note that the namestore (in | ||
2931 | particular the namestore database backend) should not be reconfigured | ||
2932 | afterwards (as records are not automatically migrated between backends). | ||
2933 | |||
2934 | The remainder of this chapter will detail the various methods for configuring | ||
2935 | the use of GNS with your operating system. | ||
2936 | |||
2937 | At 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 | ||
2941 | and is likely the easiest. However, it enables GNS only for browsers, not for | ||
2942 | other applications that might be using DNS, such as SSH. Still, using the proxy | ||
2943 | is required for using HTTP with GNS and is thus recommended for all users. To | ||
2944 | do this, you simply have to run the @code{gnunet-gns-proxy-setup-ca} script as | ||
2945 | the 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 | ||
2950 | nsswitch plugin (recommended on GNU systems) This approach has the advantage of | ||
2951 | offering fully personalized resolution even on multi-user systems. A potential | ||
2952 | disadvantage is that some applications might be able to bypass GNS. | ||
2953 | @item Use | ||
2954 | a W32 resolver plugin (recommended on W32) This is currently the only option on | ||
2955 | W32 systems. | ||
2956 | @item Use system-wide DNS packet interception This approach is | ||
2957 | recommended for the GNUnet VPN. It can be used to handle GNS at the same time; | ||
2958 | however, if you only use this method, you will only get one root zone per | ||
2959 | machine (not so great for multi-user systems). | ||
2960 | @end table | ||
2961 | |||
2962 | |||
2963 | You can combine system-wide DNS packet interception with the nsswitch plugin.@ | ||
2964 | The setup of the system-wide DNS interception is described here. All of the | ||
2965 | other 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 | |||
2970 | The Name Service Switch (NSS) is a facility in Unix-like operating systems that | ||
2971 | provides a variety of sources for common configuration databases and name | ||
2972 | resolution mechanisms. A system administrator usually configures the operating | ||
2973 | system's name services using the file /etc/nsswitch.conf. | ||
2974 | |||
2975 | GNS provides a NSS plugin to integrate GNS name resolution with the operating | ||
2976 | system's name resolution process. To use the GNS NSS plugin you have to either | ||
2977 | |||
2978 | @itemize @bullet | ||
2979 | |||
2980 | @item | ||
2981 | install GNUnet as root or | ||
2982 | |||
2983 | @item | ||
2984 | compile GNUnet with the @code{--with-sudo=yes} switch. | ||
2985 | @end itemize | ||
2986 | |||
2987 | Name resolution is controlled by the @emph{hosts} section in the NSS | ||
2988 | configuration. 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 | ||
2990 | similar to:@ | ||
2991 | @code{@ | ||
2992 | hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4@ | ||
2993 | } | ||
2994 | |||
2995 | Here the GNS NSS plugin can be added to perform a GNS lookup before performing | ||
2996 | a 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 | |||
3004 | The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not found | ||
3005 | in GNS it will not be queried in DNS. | ||
3006 | |||
3007 | @node Configuring GNS on W32 | ||
3008 | @subsubsection Configuring GNS on W32 | ||
3009 | |||
3010 | This document is a guide to configuring GNU Name System on W32-compatible | ||
3011 | platforms. | ||
3012 | |||
3013 | After GNUnet is installed, run the w32nsp-install tool: | ||
3014 | @example | ||
3015 | w32nsp-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 | |||
3022 | This will install GNS namespace provider into the system and allow other | ||
3023 | applications to resolve names that end in '@strong{gnu}' and '@strong{zkey}'. | ||
3024 | Note that namespace provider requires gnunet-gns-helper-service-w32 to be | ||
3025 | running, as well as gns service itself (and its usual dependencies). | ||
3026 | |||
3027 | Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353}, and this | ||
3028 | is where gnunet-gns-helper-service-w32 should be listening to (and is | ||
3029 | configured to listen to by default). | ||
3030 | |||
3031 | To uninstall the provider, run: | ||
3032 | @example | ||
3033 | w32nsp-uninstall.exe | ||
3034 | @end example | ||
3035 | |||
3036 | |||
3037 | (uses provider GUID to uninstall it, does not need a dll name). | ||
3038 | |||
3039 | Note that while MSDN claims that other applications will only be able to use | ||
3040 | the new namespace provider after re-starting, in reality they might stat to use | ||
3041 | it without that. Conversely, they might stop using the provider after it's been | ||
3042 | uninstalled, even if they were not re-started. W32 will not permit namespace | ||
3043 | provider library to be deleted or overwritten while the provider is installed, | ||
3044 | and while there is at least one process still using it (even after it was | ||
3045 | uninstalled). | ||
3046 | |||
3047 | @node GNS Proxy Setup | ||
3048 | @subsubsection GNS Proxy Setup | ||
3049 | |||
3050 | When using the GNU Name System (GNS) to browse the WWW, there are several | ||
3051 | issues 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 | ||
3056 | operating under some name in the legacy DNS system (such as example.com). It | ||
3057 | may then attempt to set cookies for that domain, and the web server might | ||
3058 | expect a @code{Host: example.com} header in the request from your browser. | ||
3059 | However, your browser might be using @code{example.gnu} for the @code{Host} | ||
3060 | header and might only accept (and send) cookies for @code{example.gnu}. The GNS | ||
3061 | Proxy will perform the necessary translations of the hostnames for cookies and | ||
3062 | HTTP headers (using the LEHO record for the target domain as the desired | ||
3063 | substitute). | ||
3064 | |||
3065 | @item If using HTTPS, the target site might include an SSL certificate which is | ||
3066 | either only valid for the LEHO domain or might match a TLSA record in GNS. | ||
3067 | However, your browser would expect a valid certificate for @code{example.gnu}, | ||
3068 | not 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 | ||
3070 | for the exchange, signed by your own CA. Assuming you installed the CA of your | ||
3071 | proxy in your browser's certificate authority list, your browser will then | ||
3072 | trust the HTTPS/SSL/TLS connection, as the hostname mismatch is hidden by the | ||
3073 | proxy. | ||
3074 | |||
3075 | @item Finally, the proxy will in the future indicate to the server that it | ||
3076 | speaks GNS, which will enable server operators to deliver GNS-enabled web sites | ||
3077 | to 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 | |||
3083 | First you need to create a CA certificate that the proxy can use. To do so use | ||
3084 | the provided script gnunet-gns-proxy-ca:@ | ||
3085 | @code{@ | ||
3086 | $ gnunet-gns-proxy-setup-ca@ | ||
3087 | } | ||
3088 | |||
3089 | This will create a personal certification authority for you and add this | ||
3090 | authority to the firefox and chrome database. The proxy will use the this CA | ||
3091 | certificate to generate @code{*.gnu} client certificates on the fly. | ||
3092 | |||
3093 | Note that the proxy uses libcurl. Make sure your version of libcurl uses GnuTLS | ||
3094 | and NOT OpenSSL. The proxy will not work with libcurl compiled against | ||
3095 | OpenSSL. | ||
3096 | |||
3097 | @node Testing the GNS setup | ||
3098 | @subsubsection Testing the GNS setup | ||
3099 | |||
3100 | Now for testing purposes we can create some records in our zone to test the SSL | ||
3101 | functionality 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 | |||
3107 | At this point we can start the proxy. Simply execute@ | ||
3108 | @code{@ | ||
3109 | $ gnunet-gns-proxy@ | ||
3110 | } | ||
3111 | |||
3112 | Configure your browser to use this SOCKSv5 proxy on port 7777 and visit this | ||
3113 | link.@ 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 | |||
3116 | When you visit @code{https://homepage.gnu/}, you should get to the | ||
3117 | @code{https://gnunet.org/} frontpage and the browser (with the correctly | ||
3118 | configured 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 | ||
3125 | Size | ||
3126 | @item gnunethpgns.png | ||
3127 | 64.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 | |||
3133 | This page describes a possible option for 'automatic name shortening', which | ||
3134 | you can choose to enable with the GNU Name System. | ||
3135 | |||
3136 | When GNS encounters a name for the first time, it can use the 'NICK' record of | ||
3137 | the originating zone to automatically generate a name for the zone. If | ||
3138 | automatic shortening is enabled, those auto-generated names will be placed (as | ||
3139 | private records) into your personal 'shorten' zone (to prevent confusion with | ||
3140 | manually selected names). Then, in the future, if the same name is encountered | ||
3141 | again, GNS will display the shortened name instead (the first time, the long | ||
3142 | name will still be used as shortening typically happens asynchronously as | ||
3143 | looking up the 'NICK' record takes some time). Using this feature can be a | ||
3144 | convenient way to avoid very long @code{.gnu} names; however, note that names | ||
3145 | from the shorten-zone are assigned on a first-come-first-serve basis and should | ||
3146 | not be trusted. Furthermore, if you enable this feature, you will no longer see | ||
3147 | the 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 | |||
3162 | Before configuring the GNUnet VPN, please make sure that system-wide DNS | ||
3163 | interception is configured properly as described in the section on the GNUnet | ||
3164 | DNS setup. | ||
3165 | |||
3166 | The default-options for the GNUnet VPN are usually sufficient to use GNUnet as | ||
3167 | a Layer 2 for your Internet connection. However, what you always have to | ||
3168 | specify is which IP protocol you want to tunnel: IPv4, IPv6 or both. | ||
3169 | Furthermore, if you tunnel both, you most likely should also tunnel all of your | ||
3170 | DNS requests. You theoretically can tunnel "only" your DNS traffic, but that | ||
3171 | usually makes little sense. | ||
3172 | |||
3173 | The other options as shown on the gnunet-setup tool are: | ||
3174 | |||
3175 | @node IPv4 address for interface | ||
3176 | @subsubsection IPv4 address for interface | ||
3177 | |||
3178 | This 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 | ||
3180 | you use 10.0.0.1/255.255.0.0 already, you might use 10.1.0.1/255.255.0.0. If | ||
3181 | you use 10.0.0.1/255.0.0.0 already, then you might use 192.168.0.1/255.255.0.0. | ||
3182 | If your system is not in a private IP-network, using any of the above will work | ||
3183 | fine.@ You should try to make the mask of the address big enough (255.255.0.0 | ||
3184 | or, even better, 255.0.0.0) to allow more mappings of remote IP Addresses into | ||
3185 | this 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 | |||
3190 | The IPv6 address the VPN interface will get. Here you can specify any | ||
3191 | non-link-local address (the address should not begin with "fe80:"). A subnet | ||
3192 | Unique Local Unicast (fd00::/8-prefix) that you are currently not using would | ||
3193 | be a good choice. | ||
3194 | |||
3195 | @node Configuring the GNUnet VPN DNS | ||
3196 | @subsubsection Configuring the GNUnet VPN DNS | ||
3197 | |||
3198 | To 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 | |||
3203 | If you want to allow other users to share your Internet connection (yes, this | ||
3204 | may be dangerous, just as running a Tor exit node) or want to provide access to | ||
3205 | services on your host (this should be less dangerous, as long as those services | ||
3206 | are secure), you have to enable the GNUnet exit daemon. | ||
3207 | |||
3208 | You then get to specify which exit functions you want to provide. By enabling | ||
3209 | the exit daemon, you will always automatically provide exit functions for | ||
3210 | manually configured local services (this component of the system is under | ||
3211 | development and not documented further at this time). As for those services you | ||
3212 | explicitly specify the target IP address and port, there is no significant | ||
3213 | security risk in doing so. | ||
3214 | |||
3215 | Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet. Being a | ||
3216 | DNS exit is usually pretty harmless. However, enabling IPv4 or IPv6-exit | ||
3217 | without further precautions may enable adversaries to access your local | ||
3218 | network, send spam, attack other systems from your Internet connection and to | ||
3219 | other mischief that will appear to come from your machine. This may or may not | ||
3220 | get you into legal trouble. If you want to allow IPv4 or IPv6-exit | ||
3221 | functionality, you should strongly consider adding additional firewall rules | ||
3222 | manually 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 | ||
3224 | exit-filtering in the future, you're currently on your own here. Essentially, | ||
3225 | be 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 | |||
3228 | Additional configuration options of the exit as shown by the gnunet-setup tool | ||
3229 | are: | ||
3230 | |||
3231 | @node IP Address of external DNS resolver | ||
3232 | @subsubsection IP Address of external DNS resolver | ||
3233 | |||
3234 | If DNS traffic is to exit your machine, it will be send to this DNS resolver. | ||
3235 | You can specify an IPv4 or IPv6 address. | ||
3236 | |||
3237 | @node IPv4 address for Exit interface | ||
3238 | @subsubsection IPv4 address for Exit interface | ||
3239 | |||
3240 | This is the IPv4 address the Interface will get. Make the mask of the address | ||
3241 | big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more mappings of | ||
3242 | IP addresses into this range. As for the VPN interface, any unused, private | ||
3243 | IPv4 address range will do. | ||
3244 | |||
3245 | @node IPv6 address for Exit interface | ||
3246 | @subsubsection IPv6 address for Exit interface | ||
3247 | |||
3248 | The public IPv6 address the interface will get. If your kernel is not a very | ||
3249 | recent kernel and you are willing to manually enable IPv6-NAT, the IPv6 address | ||
3250 | you specify here must be a globally routed IPv6 address of your host. | ||
3251 | |||
3252 | Suppose 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 | ||
3254 | least one bit in the range before the bitmask, in the example above we changed | ||
3255 | bit 111 from 0 to 1). | ||
3256 | |||
3257 | You may also have to configure your router to route traffic for the entire | ||
3258 | subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this | ||
3259 | should be automatic with IPv6, but obviously anything can be | ||
3260 | disabled). | ||
3261 | |||
3262 | @node Bandwidth Configuration | ||
3263 | @subsection Bandwidth Configuration | ||
3264 | |||
3265 | You can specify how many bandwidth GNUnet is allowed to use to receive and send | ||
3266 | data. This is important for users with limited bandwidth or traffic volume. | ||
3267 | |||
3268 | @node Configuring NAT | ||
3269 | @subsection Configuring NAT | ||
3270 | |||
3271 | Most hosts today do not have a normal global IP address but instead are behind | ||
3272 | a router performing Network Address Translation (NAT) which assigns each host | ||
3273 | in the local network a private IP address. As a result, these machines cannot | ||
3274 | trivially receive inbound connections from the Internet. GNUnet supports NAT | ||
3275 | traversal to enable these machines to receive incoming connections from other | ||
3276 | peers despite their limitations. | ||
3277 | |||
3278 | In an ideal world, you can press the "Attempt automatic configuration" button | ||
3279 | in gnunet-setup to automatically configure your peer correctly. Alternatively, | ||
3280 | your distribution might have already triggered this automatic configuration | ||
3281 | during the installation process. However, automatic configuration can fail to | ||
3282 | determine the optimal settings, resulting in your peer either not receiving as | ||
3283 | many connections as possible, or in the worst case it not connecting to the | ||
3284 | network at all. | ||
3285 | |||
3286 | To manually configure the peer, you need to know a few things about your | ||
3287 | network setup. First, determine if you are behind a NAT in the first place. | ||
3288 | This is always the case if your IP address starts with "10.*" or "192.168.*". | ||
3289 | Next, if you have control over your NAT router, you may choose to manually | ||
3290 | configure it to allow GNUnet traffic to your host. If you have configured your | ||
3291 | NAT to forward traffic on ports 2086 (and possibly 1080) to your host, you can | ||
3292 | check the "NAT ports have been opened manually" option, which corresponds to | ||
3293 | the "PUNCHED_NAT" option in the configuration file. If you did not punch your | ||
3294 | NAT box, it may still be configured to support UPnP, which allows GNUnet to | ||
3295 | automatically configure it. In that case, you need to install the "upnpc" | ||
3296 | command, enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal | ||
3297 | via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the configuration | ||
3298 | file). | ||
3299 | |||
3300 | Some NAT boxes can be traversed using the autonomous NAT traversal method. This | ||
3301 | requires certain GNUnet components to be installed with "SUID" prividledges on | ||
3302 | your system (so if you're installing on a system you do not have administrative | ||
3303 | rights to, this will not work). If you installed as 'root', you can enable | ||
3304 | autonomous NAT traversal by checking the "Enable NAT traversal using ICMP | ||
3305 | method". 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 | ||
3307 | configuration. If you have a DynDNS name or know your external IP address, you | ||
3308 | should enter that name under "External (public) IPv4 address" (which | ||
3309 | corresponds to the "EXTERNAL_ADDRESS" option in the configuration file). If you | ||
3310 | leave the option empty, GNUnet will try to determine your external IP address | ||
3311 | automatically (which may fail, in which case autonomous NAT traversal will then | ||
3312 | not work). | ||
3313 | |||
3314 | Finally, if you yourself are not behind NAT but want to be able to connect to | ||
3315 | NATed peers using autonomous NAT traversal, you need to check the "Enable | ||
3316 | connecting to NATed peers using ICMP method" box. | ||
3317 | |||
3318 | |||
3319 | @node Peer configuration for distributions | ||
3320 | @subsection Peer configuration for distributions | ||
3321 | |||
3322 | The "GNUNET_DATA_HOME" in "[path]" in @file{/etc/gnunet.conf} should be manually set | ||
3323 | to "/var/lib/gnunet/data/" as the default "~/.local/share/gnunet/" is probably | ||
3324 | not that appropriate in this case. Similarly, distributions may consider | ||
3325 | pointing "GNUNET_RUNTIME_DIR" to "/var/run/gnunet/" and "GNUNET_HOME" to | ||
3326 | "/var/lib/gnunet/". Also, should a distribution decide to override system | ||
3327 | defaults, all of these changes should be done in a custom @file{/etc/gnunet.conf} | ||
3328 | and not in the files in the @file{config.d/} directory. | ||
3329 | |||
3330 | Given the proposed access permissions, the "gnunet-setup" tool must be run as | ||
3331 | use "gnunet" (and with option "-c /etc/gnunet.conf" so that it modifies the | ||
3332 | system configuration). As always, gnunet-setup should be run after the GNUnet | ||
3333 | peer was stopped using "gnunet-arm -e". Distributions might want to include a | ||
3334 | wrapper for gnunet-setup that allows the desktop-user to "sudo" (i.e. using | ||
3335 | gtksudo) 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 | |||
3343 | This section describes how to start a GNUnet peer. It assumes that you have | ||
3344 | already compiled and installed GNUnet and its' dependencies. Before you start a | ||
3345 | GNUnet 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 | ||
3348 | simply start without any configuration. If you want to configure your peer | ||
3349 | later, you need to stop it before invoking the @code{gnunet-setup} tool to | ||
3350 | customize further and to test your configuration (@code{gnunet-setup} has | ||
3351 | build-in test functions). | ||
3352 | |||
3353 | The most important option you might have to still set by hand is in [PATHS]. | ||
3354 | Here, you use the option "GNUNET_HOME" to specify the path where GNUnet should | ||
3355 | store its data. It defaults to @code{$HOME/}, which again should work for most | ||
3356 | users. Make sure that the directory specified as GNUNET_HOME is writable to | ||
3357 | the user that you will use to run GNUnet (note that you can run frontends | ||
3358 | using other users, GNUNET_HOME must only be accessible to the user used to run | ||
3359 | the background processes). | ||
3360 | |||
3361 | You will also need to make one central decision: should all of GNUnet be run | ||
3362 | under your normal UID, or do you want distinguish between system-wide | ||
3363 | (user-independent) GNUnet services and personal GNUnet services. The multi-user | ||
3364 | setup is slightly more complicated, but also more secure and generally | ||
3365 | recommended. | ||
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 | |||
3377 | For the single-user setup, you do not need to do anything special and can just | ||
3378 | start the GNUnet background processes using @code{gnunet-arm}. By default, | ||
3379 | GNUnet 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 | ||
3381 | configuration lives elsewhere, you need to pass the @code{-c FILENAME} option | ||
3382 | to all GNUnet commands. | ||
3383 | |||
3384 | Assuming the configuration file is called @file{~/.config/gnunet.conf}, you | ||
3385 | start your peer using the @code{gnunet-arm} command (say as user | ||
3386 | @code{gnunet}) using: | ||
3387 | @example | ||
3388 | gnunet-arm -c ~/.config/gnunet.conf -s | ||
3389 | @end example | ||
3390 | |||
3391 | The "-s" option here is for "start". The command should return almost | ||
3392 | instantly. If you want to stop GNUnet, you can use: | ||
3393 | @example | ||
3394 | gnunet-arm -c ~/.config/gnunet.conf -e | ||
3395 | @end example | ||
3396 | |||
3397 | The "-e" option here is for "end". | ||
3398 | |||
3399 | Note that this will only start the basic peer, no actual applications will be | ||
3400 | available. If you want to start the file-sharing service, use (after starting | ||
3401 | GNUnet): | ||
3402 | @example | ||
3403 | gnunet-arm -c ~/.config/gnunet.conf -i fs | ||
3404 | @end example | ||
3405 | |||
3406 | The "-i fs" option here is for "initialize" the "fs" (file-sharing) | ||
3407 | application. You can also selectively kill only file-sharing support using | ||
3408 | @example | ||
3409 | gnunet-arm -c ~/.config/gnunet.conf -k fs | ||
3410 | @end example | ||
3411 | |||
3412 | Assuming that you want certain services (like file-sharing) to be always | ||
3413 | automatically started whenever you start GNUnet, you can activate them by | ||
3414 | setting "FORCESTART=YES" in the respective section of the configuration file | ||
3415 | (for example, "[fs]"). Then GNUnet with file-sharing support would be started | ||
3416 | whenever you@ enter: | ||
3417 | @example | ||
3418 | gnunet-arm -c ~/.config/gnunet.conf -s | ||
3419 | @end example | ||
3420 | |||
3421 | Alternatively, you can combine the two options: | ||
3422 | @example | ||
3423 | gnunet-arm -c ~/.config/gnunet.conf -s -i fs | ||
3424 | @end example | ||
3425 | |||
3426 | |||
3427 | Using @code{gnunet-arm} is also the preferred method for initializing GNUnet | ||
3428 | from @code{init}. | ||
3429 | |||
3430 | Finally, you should edit your @code{crontab} (using the @code{crontab} command) | ||
3431 | and insert a line@ | ||
3432 | @code{@ | ||
3433 | @@reboot gnunet-arm -c ~/.config/gnunet.conf -s@ | ||
3434 | }@ | ||
3435 | to automatically start your peer whenever your system boots. | ||
3436 | |||
3437 | @node The Multi-User Setup | ||
3438 | @subsection The Multi-User Setup | ||
3439 | |||
3440 | This requires you to create a user @code{gnunet} and an additional group | ||
3441 | @code{gnunetdns}, prior to running @code{make install} during installation. | ||
3442 | Then, you create a configuration file @file{/etc/gnunet.conf} which should | ||
3443 | contain 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 | |||
3457 | Afterwards, you need to perform another setup step for each normal user account | ||
3458 | from 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 | }@ | ||
3463 | Then, create a configuration file in @file{~/.config/gnunet.conf} for the $USER | ||
3464 | with 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 | |||
3476 | Again, each user should then start the peer using @code{gnunet-arm -s} --- and | ||
3477 | strongly consider adding logic to start the peer automatically to their | ||
3478 | crontab. | ||
3479 | |||
3480 | Afterwards, 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 | |||
3486 | It is not necessary to stop GNUnet services explicitly when shutting down your | ||
3487 | computer. | ||
3488 | |||
3489 | It should be noted that manually killing "most" of the @code{gnunet-service} | ||
3490 | processes is generally not a successful method for stopping a peer (since | ||
3491 | @code{gnunet-service-arm} will instantly restart them). The best way to | ||
3492 | explicitly stop a peer is using @code{gnunet-arm -e}; note that the per-user | ||
3493 | services may need to be terminated before the system-wide services will | ||
3494 | terminate normally. | ||
3495 | |||
3496 | @node Access Control for GNUnet | ||
3497 | @subsection Access Control for GNUnet | ||
3498 | |||
3499 | This chapter documents how we plan to make access control work within the | ||
3500 | GNUnet system for a typical peer. It should be read as a best-practice | ||
3501 | installation guide for advanced users and builders of binary distributions. The | ||
3502 | recommendations in this guide apply to POSIX-systems with full support for UNIX | ||
3503 | domain sockets only. | ||
3504 | |||
3505 | Note that this is an advanced topic. The discussion presumes a very good | ||
3506 | understanding of users, groups and file permissions. Normal users on hosts with | ||
3507 | just a single user can just install GNUnet under their own account (and | ||
3508 | possibly allow the installer to use SUDO to grant additional permissions for | ||
3509 | special GNUnet tools that need additional rights). The discussion below largely | ||
3510 | applies to installations where multiple users share a system and to | ||
3511 | installations where the best possible security is paramount. | ||
3512 | |||
3513 | A typical GNUnet system consists of components that fall into four categories: | ||
3514 | |||
3515 | @table @asis | ||
3516 | |||
3517 | @item User interfaces | ||
3518 | User interfaces are not security sensitive and are supposed to be run and used | ||
3519 | by normal system users. The GTK GUIs and most command-line programs fall into | ||
3520 | this category. Some command-line tools (like gnunet-transport) should be | ||
3521 | excluded as they offer low-level access that normal users should not need. | ||
3522 | @item System services and support tools | ||
3523 | System services should always run and offer services that can then be accessed | ||
3524 | by the normal users. System services do not require special permissions, but as | ||
3525 | they are not specific to a particular user, they probably should not run as a | ||
3526 | particular user. Also, there should typically only be one GNUnet peer per host. | ||
3527 | System services include the gnunet-service and gnunet-daemon programs; support | ||
3528 | tools include command-line programs such as gnunet-arm. | ||
3529 | @item Priviledged helpers | ||
3530 | Some GNUnet components require root rights to open raw sockets or perform other | ||
3531 | special operations. These gnunet-helper binaries are typically installed SUID | ||
3532 | and run from services or daemons. | ||
3533 | @item Critical services | ||
3534 | Some GNUnet services (such as the DNS service) can manipulate the service in | ||
3535 | deep and possibly highly security sensitive ways. For example, the DNS service | ||
3536 | can be used to intercept and alter any DNS query originating from the local | ||
3537 | machine. Access to the APIs of these critical services and their priviledged | ||
3538 | helpers 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 | |||
3553 | GNUnet services allow two types of access: via TCP socket or via UNIX domain | ||
3554 | socket. If the service is available via TCP, access control can only be | ||
3555 | implemented by restricting connections to a particular range of IP addresses. | ||
3556 | This is acceptable for non-critical services that are supposed to be available | ||
3557 | to all users on the local system or local network. However, as TCP is generally | ||
3558 | less efficient and it is rarely the case that a single GNUnet peer is supposed | ||
3559 | to serve an entire local network, the default configuration should disable TCP | ||
3560 | access to all GNUnet services on systems with support for UNIX domain sockets. | ||
3561 | As of GNUnet 0.9.2, configuration files with TCP access disabled should be | ||
3562 | generated by default. Users can re-enable TCP access to particular services | ||
3563 | simply by specifying a non-zero port number in the section of the respective | ||
3564 | service. | ||
3565 | |||
3566 | |||
3567 | @node Recommendation - Run most services as system user "gnunet" | ||
3568 | @subsubsection Recommendation - Run most services as system user "gnunet" | ||
3569 | |||
3570 | GNUnet's main services should be run as a separate user "gnunet" in a special | ||
3571 | group "gnunet". The user "gnunet" should start the peer using "gnunet-arm -s" | ||
3572 | during 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}. | ||
3574 | Only 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 | |||
3580 | Users that should be allowed to use the GNUnet peer should be added to the | ||
3581 | group "gnunet". Using GNUnet's access control mechanism for UNIX domain | ||
3582 | sockets, those services that are considered useful to ordinary users should be | ||
3583 | made available by setting "UNIX_MATCH_GID=YES" for those services. Again, as | ||
3584 | shipped, GNUnet provides reasonable defaults. Permissions to access the | ||
3585 | transport and core subsystems might additionally be granted without necessarily | ||
3586 | causing security concerns. Some services, such as DNS, must NOT be made | ||
3587 | accessible 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 | |||
3593 | Most of GNUnet's SUID binaries should be safe even if executed by normal users. | ||
3594 | However, it is possible to reduce the risk a little bit more by making these | ||
3595 | binaries owned by the group "gnunet" and restricting their execution to user of | ||
3596 | the 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 | |||
3601 | A 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 | ||
3604 | that 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 | ||
3606 | gnunet-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" | ||
3608 | can change its group to "gnunetdns" and execute the helper, and the helper can | ||
3609 | then 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 | ||
3611 | group!), which means that only "benign" services can manipulate DNS queries | ||
3612 | using "gnunet-service-dns". | ||
3613 | |||
3614 | @node Differences between "make install" and these recommendations | ||
3615 | @subsubsection Differences between "make install" and these recommendations | ||
3616 | |||
3617 | The current build system does not set all permissions automatically based on | ||
3618 | the recommendations above. In particular, it does not use the group "gnunet" at | ||
3619 | all (so setting gnunet-helpers other than the gnunet-helper-dns to be owned by | ||
3620 | group "gnunet" must be done manually). Furthermore, 'make install' will | ||
3621 | silently fail to set the DNS binaries to be owned by group "gnunetdns" unless | ||
3622 | that group already exists (!). An alternative name for the "gnunetdns" group | ||
3623 | can be specified using the "--with-gnunetdns=GRPNAME" configure | ||
3624 | option. | ||
3625 | |||