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