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