Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / README
1                        Welcome to GNUnet
2
3 ToC
4 ===
5
6 * ToC
7 * What is GNUnet?
8 * Dependencies
9   o direct dependencies
10   o test suite dependencies
11   o optional dependencies
12   o autotools
13 * Notes on setuid
14 * Scope of Operating System support
15 * How to install
16   o binary packages
17   o Building GNUnet from source
18   o Notes on compiling from Git
19 * Configuration
20 * Usage
21 * Hacking GNUnet
22 * Running HTTP on port 80 and HTTPS on port 443
23 * Further Reading
24 * Stay tuned
25
26 What is GNUnet?
27 ===============
28
29 GNUnet is peer-to-peer framework providing a network abstractions and
30 applications focusing on security and privacy.  So far, we have
31 created applications for anonymous file-sharing, decentralized naming
32 and identity management, decentralized and confidential telephony and
33 tunneling IP traffic over GNUnet.  GNUnet is currently developed by a
34 worldwide group of independent free software developers.  GNUnet is a
35 GNU package (http://www.gnu.org/).
36
37 This is an ALPHA release.  There are known and significant bugs as
38 well as many missing features in this release.
39
40 GNUnet is free software released under the GNU Affero General Public
41 License (v3 or later). For details see the COPYING file in this
42 directory.  If you fork this software, you MUST adjust GNUNET_AGPL_URL
43 in src/include/gnunet_util_lib.h to point to the source code of your
44 fork!
45
46 Additional documentation about GNUnet can be found at
47 https://gnunet.org/ and in the 'doc/' folder.
48 Online documentation is provided at
49 'https://docs.gnunet.org' and 'https://tutorial.gnunet.org'.
50
51
52 Dependencies:
53 =============
54
55 The dependencies for building GNUnet will require around 0.74 GiB
56 diskspace. GNUnet itself will require 8 - 9.2 MiB depending on
57 configuration.
58
59 These are the direct dependencies for running GNUnet:
60 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
62 - Bash                              (for some scripts)
63 - gettext
64 - gnutls             >= 3.2.12      (highly recommended a gnutls
65                                      linked against libunbound)
66 - curl (ideally built against gnutls) or gnurl:
67   * libgnurl         >= 7.35.0      (recommended, available from
68                                      https://gnunet.org/en/gnurl.html)
69   or
70   * libcurl          >= 7.35.0      (alternative to libgnurl)
71 - libgcrypt          >= 1.6
72 - libunistring       >= 0.9.2
73 - libidn:
74   * libidn2 (prefered)
75   or
76   * libidn           >= 1.0
77 - libmicrohttpd      >= 0.9.63
78 - libjansson
79 - makeinfo           >= 4.8
80 - make[*3]
81 - nss                               (certutil binary, for
82                                      gnunet-gns-proxy-setup-ca)
83 - openssl            >= 1.0         (binary, used to generate
84                                      X.509 certificate
85                                      for gnunet-gns-proxy-setup-ca)
86 - pkgconf or pkg-config
87 - A Posix shell                       (for some scripts)
88 - Texinfo            >= 5.2         [*1]
89 - libltdl            >= 2.2         (part of GNU libtool)
90 - 1 or more databases:
91   * sqlite           >= 3.8         (default database, required)
92   and/or
93   * mysql            >= 5.1         (alternative to sqlite)
94   and/or
95   * postgres         >= 9.5         (alternative to sqlite)
96 - which                             (contrib/apparmor(?), gnunet-bugreport,
97                                      and possibly more)
98 - zlib
99 - argon2             >= 20190702    (for proof-of-work calculations in
100                                      revocation)
101 - libsodium          >= 1.0.11      (for elliptic curve cryptography)
102
103 These are the dependencies for GNUnet's testsuite:
104 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105
106 - Bash                              (for some tests[*4])
107 - A Posix Shell                     (for some tests)
108 - python             >= 3.4         (3.4 and higher technically supported,
109                                      at least python 3.7 tested to work)
110 - base tools
111   - mostly:
112     - bc,
113     - curl,
114     - sed,
115     - awk,
116     - which
117
118
119 These are the optional dependencies:
120 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
122 - awk                               (for linting tests)
123 - Bash                              (for Docker and Vagrant)
124 - bluez                             (for bluetooth support)
125 - grof                              (for linting of man pages)
126 - libextractor       >= 0.6.1       (highly recommended[*5])
127 - libopus            >= 1.0.1       (for conversation tool)
128 - libpulse           >= 2.0         (for conversation tool)
129 - libogg             >= 1.3.0       (for conversation tool)
130 - libnss                            (certtool binary (for convenient
131                                      installation of GNS proxy))
132 - libzbar            >= 0.10        (for gnunet-qr)
133 - libpbc             >= 0.5.14      (for Attribute-Based Encryption and
134                                      Identity Provider functionality)
135 - libgabe                           (for Attribute-Based Encryption and
136                                      Identity Provider functionality, from
137                                      https://github.com/schanzen/libgabe)
138 - mandoc                            (for linting of man pages, generation of
139                                      html output of man pages (not part of
140                                      the regular build))
141 - miniupnpc
142 - perl5                             (for some utilities)
143 - TeX Live           >= 2012        (for gnunet-bcd[*])
144 - texi2mdoc                         (for automatic mdoc generation [*2], not
145                                      the texi2mdoc script distributed with
146                                      autogen but the texi2mdoc C application)
147
148 Recommended autotools for compiling the Git version are:
149 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150
151 - autoconf           >= 2.59
152 - automake           >= 1.11.1
153 - libtool            >= 2.2
154
155
156 [*] Mandatory for compiling the info output of the documentation,
157     a limited subset ('texlive-tiny' in Guix) is enough.
158
159 [*1] The default configuration is to build the info output of the
160      documentation, and therefore require texinfo.  You can pass
161      '--disable-documentation' to the configure script to change this.
162
163 [*2] If you still prefer to have documentation, you can pass
164      '--enable-texi2mdoc-generation' to build the mdocml ("mandoc")
165      documentation (experimental stages in gnunet).
166      If this proves to be reliable, we will
167      include the mdocml output in the release tarballs.
168      Contrary to the name, texi2mdoc does not require Texinfo,
169      It is a standalone ISO C utility.
170
171 [*3] GNU make introduced the != operator in version 4.0.
172      GNU make was released in october 2013, reasonable to
173      be widespread by now. If this is not working out for
174      you, open a bug so that we can get a more portable
175      fix in.
176
177 [*4] We are commited  to portable tools and solutions
178      where possible. New scripts should be Posix sh
179      compatible, current and older scripts are
180      in the process of being rewritten to comply
181      with this requirement.
182
183 [*5] While libextractor ("LE") is optional, it is recommended to
184      build gnunet against it. If you install it later,
185      you won't benefit from libextractor.
186      If you are a distributor, we recommend to split
187      LE into basis + plugins rather than making LE
188      an option as an afterthought by the user.
189      LE itself is very small, but its dependency chain
190      on first, second, third etc level can be big.
191      There is a small effect on privacy if your LE build
192      differs from one which includes all
193      plugins (plugins are build as shared objects):
194      if users publish a directory with a mixture of file
195      types (for example mpeg, jpeg, png, gif) the
196      configuration of LE could leak which plugins are
197      installed for which filetypes are not providing
198      more details.
199      However, this leak is just a minor concern.
200
201 Notes on setuid
202 ===============
203
204 For a correct functionality depending on the host OS, you need
205 to run the equivalent of these steps after installation.
206 Replace $(DESTDIR)$(libexecdir) with the appropriate paths,
207 for example /usr/local/lib/gnunet/libexec/. Note that this
208 obviously must be run as priviledged user.
209
210 chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-vpn
211 chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-vpn
212 chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-transport-wlan
213 chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-transport-wlan
214 chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-transport-bluetooth
215 chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-transport-bluetooth
216 chown root $(DESTDIR)$(libexecdir)/gnunet-helper-dns
217 chgrp $(GNUNETDNS_GROUP) $(DESTDIR)$(libexecdir)/gnunet-helper-dns
218 chmod 4750 $(DESTDIR)$(libexecdir)/gnunet-helper-dns
219 chgrp $(GNUNETDNS_GROUP) $(DESTDIR)$(libexecdir)/gnunet-helper-dns
220 chown gnunet:$(GNUNETDNS_GROUP) $(DESTDIR)$(libexecdir)/gnunet-helper-dns
221 chmod 2750 $(DESTDIR)$(libexecdir)/gnunet-helper-dns
222 chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-exit
223 chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-exit
224 chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-nat-server
225 chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-nat-client
226 chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-nat-server
227 chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-nat-client
228
229
230 Scope of Operating System support
231 =================================
232
233 We actively support GNUnet on a broad range of Free Software Operating
234 Systems.
235
236 For proprietary Operating Systems, like for example Microsoft Windows
237 or Apple OS X, we accept patches if they don't break anything for
238 other Operating Systems.
239 If you are implementing support for a proprietary Operating System,
240 you should be aware that progress in our codebase could break
241 functionality on your OS and cause unpredicted behavior we can
242 not test. However, we do not break support on Operating Systems
243 with malicious intent.
244 Regressions which do occur on these Operating Systems are 3rd
245 class issues and we expect users and developers of these
246 Operating Systems to send proposed patches to fix regressions.
247
248 For more information about our stand on some of the motivating
249 points here, read the 'Philosophy' Chapter of our handbook.
250
251
252 How to install?
253 ===============
254
255 binary packages
256 ~~~~~~~~~~~~~~~
257
258 We recommend to use binary packages provided by the package manager integrated
259 within your Operating System. GNUnet is reportedly available for at least:
260
261 ALT Linux, Archlinux, Debian, Deepin, Devuan, GNU Guix, Hyperbola,
262 Kali Linux, LEDE/OpenWRT, Manjaro, Nix, Parabola, Pardus, Parrot,
263 PureOS, Raspbian, Rosa, Trisquel, and Ubuntu.
264
265 If GNUnet is available for your Operating System and it is missing,
266 send us feedback so that we can add it to this list. Furthermore, if
267 you are interested in packaging GNUnet for your Operating System,
268 get in touch with us at gnunet-developers@gnu.org if you require
269 help with this job.
270
271 If you were using an Operating System with the apt package manager,
272 GNUnet could be installed as simple as:
273
274 $ apt-get install gnunet
275
276 Generic installation instructions are in the INSTALL file in this
277 directory.
278
279 Building GNUnet from source
280 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
281
282 IMPORTANT: You can read further notes about compilation from source in
283 the handbook under doc/handbook/, which includes notes about specific
284 requirements for operating systems aswell. If you are a package
285 mantainer for an Operating System we invite you to add your notes if
286 you feel it is necessary and can not be covered in your Operating
287 System's documentation.
288
289 Two prominent examples which currently lack cross-compilation
290 support in GNUnet (and native binaries) are MS Windows and Apple macOS.
291 For macOS we recommend you to do the build process via Homebrew and a
292 recent XCode installation. We don't recommend using GNUnet with any
293 recent MS Windows system as it officially spies on its users (according
294 to its T&C), defying some of the purposes of GNUnet.
295
296 Note that some functions of GNUnet require "root" access.  GNUnet will
297 install (tiny) SUID binaries for those functions is you run "make
298 install" as root.  If you do not, GNUnet will still work, but some
299 functionality will not be available (including certain forms of NAT
300 traversal).
301
302 GNUnet requires the GNU MP library (https://www.gnu.org/software/gmp/)
303 and libgcrypt (https://www.gnupg.org/).  You can specify the path to
304 libgcrypt by passing "--with-gcrypt=PATH" to configure.  You will also
305 need either sqlite (http://www.sqlite.org/), MySQL
306 (http://www.mysql.org/) or PostGres (http://www.postgres.org/).
307
308 If you install from source, you need to install GNU libextractor first
309 (download from https://www.gnu.org/software/libextractor/).  We also
310 recommend installing GNU libmicrohttpd (download from
311 https://www.gnu.org/software/libmicrohttpd/). Furthermore we recommend
312 libgnurl (from https://gnunet.org/en/gnurl.html).
313 Then you can start the actual GNUnet compilation process with:
314
315
316 $ export GNUNET_PREFIX=/usr/local/lib # or other directory of your choice
317 # addgroup gnunetdns
318 # adduser --system --home "/var/lib/gnunet" --group gnunet --shell /bin/sh
319 # ./configure --prefix=$GNUNET_PREFIX/.. --with-extractor=$LE_PREFIX
320 $ make
321
322 And finally install GNUnet with:
323
324 # make install
325
326 Complete the process by either adjusting one of our example service files
327 in 'contrib/services' or by running:
328
329 # sudo -u gnunet gnunet-arm -s
330
331
332 Note that you must read paragraph "Notes on setuid", which documents steps you
333 have to follow after the installation, as a priviledged user. We require some
334 binaries to be setuid. The most portable approach across all supported
335 platforms and targets is to let this be handled manually.
336 The installation will work if you do not run these steps as root, but some
337 components may not be installed in the perfect place or with the right
338 permissions and thus won't work.
339
340 This will create the users and groups needed for running GNUnet
341 securely and then compile and install GNUnet to $GNUNET_PREFIX/../bin/,
342 $GNUNET_PREFIX/ and $GNUNET_PREFIX/../share/ and start the system
343 with the default configuration.  It is strongly recommended that you
344 add a user "gnunet" to run "gnunet-arm".  You can then still run the
345 end-user applications as another user.
346
347 If you create a system user "gnunet", it is recommended that you edit
348 the configuration file slightly so that data can be stored in the
349 system user home directory at "/var/lib/gnunet".  Depending on what
350 the $HOME-directory of your "gnunet" user is, you might need to set
351 the SERVICEHOME option in section "[PATHS]" to "/var/lib/gnunet" to
352 do this.  Depending on your personal preferences, you may also want to
353 use "/etc/gnunet.conf" for the location of the configuration file in
354 this case (instead of ~gnunet/.config/gnunet.conf").  In this case,
355 you need to start GNUnet using "gnunet-arm -s -c /etc/gnunet.conf" or
356 set "XDG_CONFIG_HOME=/etc/".
357
358 You can avoid running 'make install' as root if you have extensive sudo rights
359 (can run "chmod +s" and "chown" via 'sudo').  If you run 'make install' as a
360 normal user without sudo rights (or the configure option), certain binaries
361 that require additional privileges will not be installed properly (and
362 autonomous NAT traversal, WLAN, DNS/GNS and the VPN will then not work).
363
364 If you run 'configure' and 'make install' as root, GNUnet's build system will
365 install "libnss_gns*" libraries to "/lib/" regardless (!) of the
366 $GNUNET_PREFIX you might have specified, as those libraries must be in
367 "/lib/".  If you are packaging GNUnet for binary distribution, this may cause
368 your packaging script to miss those plugins, so you might need to do some
369 additional manual work to include those libraries in your binary package(s).
370 Similarly, if you want to use the GNUnet Name System and did NOT run
371 GNUnet's 'make install' process with priviledged rights, the libraries will be
372 installed to "$GNUNET_PREFIX" and you will have to move them to "/lib/"
373 manually.
374
375 Notes on compiling from Git
376 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
377
378 Finally, if you are compiling the code from git, you have to
379 run "sh ./bootstrap" before running "./configure".  If you receive an error during
380 the running of "sh ./bootstrap" that looks like "macro `AM_PATH_GTK'
381 not found in library", you may need to run aclocal by hand with the -I
382 option, pointing to your aclocal m4 macros, i.e.
383
384 $ aclocal -I /usr/local/share/aclocal
385
386
387 Configuration
388 =============
389
390 Note that additional, per-user configuration files can be created by
391 each user.  However, this is usually not necessary as there are few
392 per-user options that normal users would want to modify.  The defaults
393 that are shipped with the installation are usually just fine.
394
395 The gnunet-setup tool is particularly useful to generate the master
396 configuration for the peer.  gnunet-setup can be used to configure and
397 test (!) the network settings, choose which applications should be run
398 and configure databases.  Other options you might want to control
399 include system limitations (such as disk space consumption, bandwidth,
400 etc).  The resulting configuration files are human-readable and can
401 theoretically be created or edited by hand.
402
403 gnunet-setup is a separate download and requires somewhat recent
404 versions of GTK+ and Glade. You can also create the configuration file
405 by hand, but this is not recommended.  For more general information
406 about the GNU build process read the INSTALL file.
407
408 GNUnet uses two types of configuration files, one that specifies the
409 system-wide defaults (typically located in
410 $GNUNET_PREFIX/../share/gnunet/config.d/) and a second one that overrides
411 default values with user-specific preferences.  The user-specific
412 configuration file should be located in "~/.config/gnunet.conf" or its
413 location can be specified by giving the "-c" option to the respective
414 GNUnet application.
415
416 For more information about the configuration (as well as usage) refer
417 to the 'GNUnet User Handbook' chapter of the documentation, included
418 in this software distribution.
419
420
421 Usage
422 =====
423
424 For detailed usage notes, instructions and examples, refer to the
425 included 'GNUnet Handbook'.
426
427 First, you must obtain an initial list of GNUnet hosts.  Knowing a
428 single peer is sufficient since after that GNUnet propagates
429 information about other peers.  Note that the default configuration
430 contains URLs from where GNUnet downloads an initial hostlist
431 whenever it is started.  If you want to create an alternative URL for
432 others to use, the file can be generated on any machine running
433 GNUnet by periodically executing
434
435 $ cat $SERVICEHOME/data/hosts/* > the_file
436
437 and offering 'the_file' via your web server.  Alternatively, you can
438 run the build-in web server by adding '-p' to the OPTIONS value
439 in the "hostlist" section of gnunet.conf and opening the respective
440 HTTPPORT to the public.
441
442 If the solution with the hostlist URL is not feasible for your
443 situation, you can also add hosts manually.  Simply copy the hostkeys
444 to "$SERVICEHOME/data/hosts/" (where $SERVICEHOME is the directory
445 specified in the gnunet.conf configuration file).  You can also use
446 "gnunet-peerinfo -g" to GET a URI for a peer and "gnunet-peerinfo -p
447 URI" to add a URI from another peer.  Finally, GNUnet peers that use
448 UDP or WLAN will discover each other automatically (if they are in the
449 vicinity of each other) using broadcasts (IPv4/WLAN) or multicasts
450 (IPv6).
451
452 The local node is started using "gnunet-arm -s".  We recommend to run
453 GNUnet 24/7 if you want to maximize your anonymity, as this makes
454 partitioning attacks harder.
455
456 Once your peer is running, you should then be able to access GNUnet
457 using the shell:
458
459 $ gnunet-search KEYWORD
460
461 This will display a list of results to the console.  You can abort
462 the command using "CTRL-C".  Then use
463
464 $ gnunet-download -o FILENAME GNUNET_URI
465
466 to retrieve a file.  The GNUNET_URI is printed by gnunet-search
467 together with a description.  To publish files on GNUnet, use the
468 "gnunet-publish" command.
469
470
471 The GTK user interface is shipped separately.
472 After installing gnunet-gtk, you can invoke the setup tool and
473 the file-sharing GUI with:
474
475 $ gnunet-setup
476 $ gnunet-fs-gtk
477
478 For further documentation, see our webpage or the 'GNUnet User Handbook',
479 included in this software distribution.
480
481
482 Hacking GNUnet
483 ==============
484
485 Contributions are welcome. Please submit bugs you find to
486 https://bugs.gnunet.org/ or our bugs mailinglist.
487 Please make sure to run the script "contrib/scripts/gnunet-bugreport"
488 and include the output with your bug reports.  More about how to
489 report bugs can be found in the GNUnet FAQ on the webpage.  Submit
490 patches via E-Mail to gnunet-developers@gnu.org, formated with
491 `git format-patch`.
492
493 In order to run the unit tests by hand (instead of using "make check"),
494 you need to set the environment variable "GNUNET_PREFIX" to the
495 directory where GNUnet's libraries are installed.
496 Before running any testcases, you must complete the installation.
497
498 Quick summary:
499
500 $ ./configure --prefix=$SOMEWHERE
501 $ make
502 $ make install
503 $ export $GNUNET_PREFIX=$SOMEWHERE
504 $ make check
505
506 Some of the testcases require python >= 3.4, and the python module
507 "pexpect" to be installed.
508 If any testcases fail to pass on your system, run
509 "contrib/scripts/gnunet-bugreport" (in the repository) or "gnunet-bugreport"
510 when you already have GNUnet installed and report its output together with
511 information about the failing testcase(s) to the Mantis bugtracking
512 system at https://bugs.gnunet.org/.
513
514
515 Running HTTP on port 80 and HTTPS on port 443
516 =============================================
517
518 In order to hide GNUnet's HTTP/HTTPS traffic perfectly, you might
519 consider running GNUnet's HTTP/HTTPS transport on port 80/443.
520 However, we do not recommend running GNUnet as root.  Instead, forward
521 port 80 to say 1080 with this command (as root, in your startup
522 scripts):
523
524 # iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 1080
525
526 or for HTTPS
527
528 # iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 4433
529
530 Then set in the HTTP section of gnunet.conf the "ADVERTISED_PORT" to
531 "80" and "PORT" to 1080 and similarly in the HTTPS section the
532 "ADVERTISED_PORT" to "443" and "PORT" to 4433.
533
534 You can do the same trick for the TCP and UDP transports if you want
535 to map them to a priviledged port (from the point of view of the
536 network).  However, we are not aware of this providing any advantages
537 at this point.
538
539 If you are already running an HTTP or HTTPS server on port 80 (or 443),
540 you may be able to configure it as a "ReverseProxy".  Here, you tell
541 GNUnet that the externally visible URI is some sub-page on your website,
542 and GNUnet can then tunnel its traffic via your existing HTTP server.
543 This is particularly powerful if your existing server uses HTTPS, as
544 it makes it harder for an adversary to distinguish normal traffic to
545 your server from GNUnet traffic.  Finally, even if you just use HTTP,
546 you might benefit (!) from ISP's traffic shaping as opposed to being
547 throttled by ISPs that dislike P2P.  Details for configuring the
548 reverse proxy are documented on our website.
549
550
551 Further Reading
552 ===============
553
554 * Documentation
555
556   An HTML version of the GNUnet manual is deployed at
557
558     https://docs.gnunet.org
559
560   which currently displays just GNUnet documentation. In the future
561   we will add more reading material.
562
563 * Academia / papers
564
565   In almost 20 years various people in our community have written and
566   collected a good number of papers which have been implemented in
567   GNUnet or projects around GNUnet.
568   There are currently 2 ways to get them:
569
570   * Using git (NOTE: 1.1 GiB as of 2019-03-09):
571     git clone https://git.gnunet.org/bibliography.git
572   * Using the webbrowser:
573     https://bib.gnunet.org/
574
575
576 Stay tuned
577 ==========
578
579 * https://gnunet.org/
580 * https://bugs.gnunet.org
581 * https://git.gnunet.org
582 * http://www.gnu.org/software/gnunet/
583 * http://mail.gnu.org/mailman/listinfo/gnunet-developers
584 * http://mail.gnu.org/mailman/listinfo/help-gnunet
585 * http://mail.gnu.org/mailman/listinfo/info-gnunet
586 * http://mail.gnu.org/mailman/listinfo/gnunet-svn