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