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