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