README 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. Welcome to GNUnet
  2. What is GNUnet?
  3. ===============
  4. GNUnet is peer-to-peer framework providing a network abstractions and
  5. applications focusing on security and privacy. So far, we have
  6. created applications for anonymous file-sharing, decentralized naming
  7. and identity management, decentralized and confidential telephony and
  8. tunneling IP traffic over GNUnet. GNUnet is currently developed by a
  9. worldwide group of independent free software developers. GNUnet is a
  10. GNU package (http://www.gnu.org/).
  11. This is an ALPHA release. There are known and significant bugs as
  12. well as many missing features in this release.
  13. GNUnet is free software released under the GNU Affero General Public
  14. License (v3 or later). For details see the COPYING file in this
  15. directory. If you fork this software, you MUST adjust GNUNET_AGPL_URL
  16. in src/include/gnunet_util_lib.h to point to the source code of your
  17. fork!
  18. Additional documentation about GNUnet can be found at
  19. https://gnunet.org/ and in the 'doc/' folder.
  20. Online documentation is provided at
  21. 'https://docs.gnunet.org' and 'https://tutorial.gnunet.org'.
  22. Dependencies:
  23. =============
  24. These are the direct dependencies for running GNUnet:
  25. - libmicrohttpd >= 0.9.42
  26. - libgcrypt >= 1.6
  27. - libgnurl >= 7.35.0 (recommended, available from https://gnunet.org/en/gnurl.html)
  28. - libcurl >= 7.35.0 (alternative to libgnurl)
  29. - libunistring >= 0.9.2
  30. - gnutls >= 3.2.12 (highly recommended a gnutls linked against libunbound)
  31. - libidn:
  32. - libidn2 (prefered)
  33. or
  34. - libidn >= 1.0
  35. - libextractor >= 0.6.1 (highly recommended)
  36. - openssl >= 1.0 (binary, used to generate X.509 certificate
  37. for gnunet-gns-proxy-setup-ca)
  38. - nss (certutil binary, for
  39. gnunet-gns-proxy-setup-ca)
  40. - libltdl >= 2.2 (part of GNU libtool)
  41. - sqlite >= 3.8 (default database, required)
  42. - mysql >= 5.1 (alternative to sqlite)
  43. - postgres >= 9.5 (alternative to sqlite)
  44. - Texinfo >= 5.2 [*1]
  45. - makeinfo >= 4.8
  46. - make[*3]
  47. - which (contrib/apparmor(?), gnunet-bugreport,
  48. tests (dns, gns, namestore,
  49. scalarproduct) and possibly more)
  50. - gettext
  51. - zlib
  52. These are the dependencies for GNUnet's testsuite:
  53. - Bash (optional (?[*4]), for some tests)
  54. - python >= 3.7 (only python 3.7 is supported)
  55. - python-future >= 3.7 (only python 3.7 is supported)
  56. These are the optional dependencies:
  57. - libopus >= 1.0.1 (for experimental conversation tool)
  58. - libpulse >= 2.0 (for experimental conversation tool)
  59. - libogg >= 1.3.0 (for experimental conversation tool)
  60. - libnss (certtool binary (for convenient installation of GNS proxy))
  61. - python2.7 = 2.7 (for gnunet-qr, only python 2.7 supported)
  62. - python-zbar >= 0.10 (for gnunet-qr, not optional)
  63. - TeX Live >= 2012 (for gnunet-bcd[*])
  64. - texi2mdoc (for automatic mdoc generation [*2])
  65. - libglpk >= 4.45 (for experimental code)
  66. - perl5 (for some utilities)
  67. - guile 1.6.4 (or later up to 1.8?, for gnunet-download-manager)
  68. - bluez (for bluetooth support)
  69. - miniupnpc
  70. - libpbc >= 0.5.14 (for Attribute-Based Encryption and Identity Provider functionality)
  71. - libgabe (for Attribute-Based Encryption and Identity Provider functionality,
  72. from https://github.com/schanzen/libgabe)
  73. Recommended autotools for compiling the Git version are:
  74. - autoconf >= 2.59
  75. - automake >= 1.11.1
  76. - libtool >= 2.2
  77. [*] Mandatory for compiling the info output of the documentation,
  78. a limited subset ('texlive-tiny' in Guix) is enough.
  79. [*1] The default configuration is to build the info output of the
  80. documentation, and therefore require texinfo. You can pass
  81. '--disable-documentation' to the configure script to change this.
  82. [*2] If you still prefer to have documentation, you can pass
  83. '--with-section7' to build mdoc documentation (experimental
  84. stages in gnunet). If this proves to be reliable, we will
  85. include the mdoc output in the release tarballs.
  86. Contrary to the name, texi2mdoc does not require texinfo,
  87. It is a standalone ISO C utility.
  88. [*3] GNU make introduced the != operator in version 4.0.
  89. GNU make was released in october 2013, reasonable to
  90. be widespread by now. If this is not working out for
  91. you, open a bug so that we can get a more portable
  92. fix in.
  93. [*4] We are commited to portable tools and solutions
  94. where possible. While the shellscripts work with
  95. NetBSD's sh, there's no warranty some bashisms
  96. are leftover.
  97. Requirements
  98. ============
  99. GNUnet's directed acyclic graph (DAG) will require around 0.74 GiB
  100. Diskspace, with GNUNet itself taking around 9.2 MiB reported by the
  101. build on GNU Guix.
  102. How to install?
  103. ===============
  104. binary packages
  105. ~~~~~~~~~~~~~~~
  106. We recommend to use binary packages provided by your Operating System's
  107. package manager. GNUnet is reportedly available for at least:
  108. GNU Guix, Nix, Debian, ALT Linux, Archlinux, Deepin, Devuan, Hyperbola,
  109. Kali Linux, LEDE/OpenWRT, Manjaro, Parabola, Pardus, Parrot, PureOS,
  110. Raspbian, Rosa, Trisquel, and Ubuntu.
  111. If GNUnet is available for your Operating System and it is missing,
  112. send us feedback so that we can add it to this list. Furthermore, if
  113. you are interested in packaging GNUnet for your Operating System,
  114. get in touch with us at gnunet-developers@gnu.org if you require
  115. help with this job.
  116. If you were using an Operating System with the apt package manager,
  117. GNUnet could be installed as simple as:
  118. $ apt-get install gnunet
  119. Generic installation instructions are in the INSTALL file in this
  120. directory.
  121. Scope of Operating System support
  122. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. We actively support GNUnet on a broad range of Free Software Operating
  124. Systems.
  125. For proprietary Operating Systems, like for example Microsoft Windows
  126. or Apple OS X, we accept patches if they don't break anything for
  127. other Operating Systems.
  128. If you are implementing support for a proprietary Operating System,
  129. you should be aware that progress in our codebase could break
  130. functionality on your OS and cause unpredicted behavior we can
  131. not test. However, we do not break support on Operating Systems
  132. with malicious intent.
  133. Regressions which do occur on these Operating Systems are 3rd
  134. class issues and we expect users and developers of these
  135. Operating Systems to send proposed patches to fix regressions.
  136. For more information about our stand on some of the motivating
  137. points here, read the 'Philosophy' Chapter of our handbook.
  138. Building GNUnet from source
  139. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140. IMPORTANT: You can read further notes about compilation from source in
  141. the handbook under doc/handbook/, which includes notes about specific
  142. requirements for operating systems aswell. If you are a package
  143. mantainer for an Operating System we invite you to add your notes if
  144. you feel it is necessary and can not be covered in your Operating
  145. System's documentation.
  146. Two prominent examples which currently lack cross-compilation
  147. support in GNUnet (and native binaries) are MS Windows and Apple macOS.
  148. For macOS we recommend you to do the build process via Homebrew and a
  149. recent XCode installation. We don't recommend using GNUnet with any
  150. recent MS Windows system as it officially spies on its users (according
  151. to its T&C), defying some of the purposes of GNUnet.
  152. Note that some functions of GNUnet require "root" access. GNUnet will
  153. install (tiny) SUID binaries for those functions is you run "make
  154. install" as root. If you do not, GNUnet will still work, but some
  155. functionality will not be available (including certain forms of NAT
  156. traversal).
  157. GNUnet requires the GNU MP library (https://www.gnu.org/software/gmp/)
  158. and libgcrypt (https://www.gnupg.org/). You can specify the path to
  159. libgcrypt by passing "--with-gcrypt=PATH" to configure. You will also
  160. need either sqlite (http://www.sqlite.org/), MySQL
  161. (http://www.mysql.org/) or PostGres (http://www.postgres.org/).
  162. If you install from source, you need to install GNU libextractor first
  163. (download from https://www.gnu.org/software/libextractor/). We also
  164. recommend installing GNU libmicrohttpd (download from
  165. https://www.gnu.org/software/libmicrohttpd/). Furthermore we recommend
  166. libgnurl (from https://gnunet.org/en/gnurl.html).
  167. Then you can start the actual GNUnet compilation process with:
  168. $ export GNUNET_PREFIX=/usr/local/lib # or other directory of your choice
  169. # addgroup gnunetdns
  170. # adduser --system --home "/var/lib/gnunet" --group gnunet --shell /bin/sh
  171. # ./configure --prefix=$GNUNET_PREFIX/.. --with-extractor=$LE_PREFIX
  172. $ make
  173. And finally install GNUnet with:
  174. # make install
  175. Complete the process by either adjusting one of our example service files
  176. in 'contrib/services' or by running:
  177. # sudo -u gnunet gnunet-arm -s
  178. Note that running the 'configure' and 'make install' steps as
  179. root (or with sudo) is required as some parts of the installation
  180. require the creation of SUID binaries. The installation will
  181. work if you do not run these steps as root, but some components
  182. may not be installed in the perfect place or with the right
  183. permissions and thus won't work.
  184. This will create the users and groups needed for running GNUnet
  185. securely and then compile and install GNUnet to $GNUNET_PREFIX/../bin/,
  186. $GNUNET_PREFIX/ and $GNUNET_PREFIX/../share/ and start the system
  187. with the default configuration. It is strongly recommended that you
  188. add a user "gnunet" to run "gnunet-arm". You can then still run the
  189. end-user applications as another user.
  190. If you create a system user "gnunet", it is recommended that you edit
  191. the configuration file slightly so that data can be stored in the
  192. system user home directory at "/var/lib/gnunet". Depending on what
  193. the $HOME-directory of your "gnunet" user is, you might need to set
  194. the SERVICEHOME option in section "[PATHS]" to "/var/lib/gnunet" to
  195. do this. Depending on your personal preferences, you may also want to
  196. use "/etc/gnunet.conf" for the location of the configuration file in
  197. this case (instead of ~gnunet/.config/gnunet.conf"). In this case,
  198. you need to start GNUnet using "gnunet-arm -s -c /etc/gnunet.conf" or
  199. set "XDG_CONFIG_HOME=/etc/".
  200. You can avoid running 'make install' as root if you run configure
  201. with the "--with-sudo=yes" option and have extensive sudo rights
  202. (can run "chmod +s" and "chown" via 'sudo'). If you run 'make install'
  203. as a normal user without sudo rights (or the configure option),
  204. certain binaries that require additional priviledges will not be
  205. installed properly (and autonomous NAT traversal, WLAN, DNS/GNS and
  206. the VPN will then not work).
  207. If you run 'configure' and 'make install' as root or use the '--with-sudo'
  208. option, GNUnet's build system will install "libnss_gns*" libraries to
  209. "/lib/" regardless (!) of the $GNUNET_PREFIX you might have specified,
  210. as those libraries must be in "/lib/". If you are packaging GNUnet
  211. for binary distribution, this may cause your packaging script to miss
  212. those plugins, so you might need to do some additional manual work to
  213. include those libraries in your binary package(s). Similarly, if you
  214. want to use the GNUnet naming system and did NOT run GNUnet's 'make
  215. install' process with sudo rights, the libraries will be installed to
  216. "$GNUNET_PREFIX" and you will have to move them to "/lib/"
  217. manually.
  218. Finally, if you are compiling the code from git, you have to
  219. run "sh ./bootstrap" before running "./configure". If you receive an error during
  220. the running of "sh ./bootstrap" that looks like "macro `AM_PATH_GTK'
  221. not found in library", you may need to run aclocal by hand with the -I
  222. option, pointing to your aclocal m4 macros, i.e.
  223. $ aclocal -I /usr/local/share/aclocal
  224. Configuration
  225. =============
  226. Note that additional, per-user configuration files can be created by
  227. each user. However, this is usually not necessary as there are few
  228. per-user options that normal users would want to modify. The defaults
  229. that are shipped with the installation are usually just fine.
  230. The gnunet-setup tool is particularly useful to generate the master
  231. configuration for the peer. gnunet-setup can be used to configure and
  232. test (!) the network settings, choose which applications should be run
  233. and configure databases. Other options you might want to control
  234. include system limitations (such as disk space consumption, bandwidth,
  235. etc). The resulting configuration files are human-readable and can
  236. theoretically be created or edited by hand.
  237. gnunet-setup is a separate download and requires somewhat recent
  238. versions of GTK+ and Glade. You can also create the configuration file
  239. by hand, but this is not recommended. For more general information
  240. about the GNU build process read the INSTALL file.
  241. GNUnet uses two types of configuration files, one that specifies the
  242. system-wide defaults (typically located in
  243. $GNUNET_PREFIX/../share/gnunet/config.d/) and a second one that overrides
  244. default values with user-specific preferences. The user-specific
  245. configuration file should be located in "~/.config/gnunet.conf" or its
  246. location can be specified by giving the "-c" option to the respective
  247. GNUnet application.
  248. For more information about the configuration (as well as usage) refer
  249. to the 'GNUnet User Handbook' chapter of the documentation, included
  250. in this software distribution.
  251. Usage
  252. =====
  253. For detailed usage notes, instructions and examples, refer to the
  254. included 'GNUnet Handbook'.
  255. First, you must obtain an initial list of GNUnet hosts. Knowing a
  256. single peer is sufficient since after that GNUnet propagates
  257. information about other peers. Note that the default configuration
  258. contains URLs from where GNUnet downloads an initial hostlist
  259. whenever it is started. If you want to create an alternative URL for
  260. others to use, the file can be generated on any machine running
  261. GNUnet by periodically executing
  262. $ cat $SERVICEHOME/data/hosts/* > the_file
  263. and offering 'the_file' via your web server. Alternatively, you can
  264. run the build-in web server by adding '-p' to the OPTIONS value
  265. in the "hostlist" section of gnunet.conf and opening the respective
  266. HTTPPORT to the public.
  267. If the solution with the hostlist URL is not feasible for your
  268. situation, you can also add hosts manually. Simply copy the hostkeys
  269. to "$SERVICEHOME/data/hosts/" (where $SERVICEHOME is the directory
  270. specified in the gnunet.conf configuration file). You can also use
  271. "gnunet-peerinfo -g" to GET a URI for a peer and "gnunet-peerinfo -p
  272. URI" to add a URI from another peer. Finally, GNUnet peers that use
  273. UDP or WLAN will discover each other automatically (if they are in the
  274. vicinity of each other) using broadcasts (IPv4/WLAN) or multicasts
  275. (IPv6).
  276. The local node is started using "gnunet-arm -s". We recommend to run
  277. GNUnet 24/7 if you want to maximize your anonymity, as this makes
  278. partitioning attacks harder.
  279. Once your peer is running, you should then be able to access GNUnet
  280. using the shell:
  281. $ gnunet-search KEYWORD
  282. This will display a list of results to the console. You can abort
  283. the command using "CTRL-C". Then use
  284. $ gnunet-download -o FILENAME GNUNET_URI
  285. to retrieve a file. The GNUNET_URI is printed by gnunet-search
  286. together with a description. To publish files on GNUnet, use the
  287. "gnunet-publish" command.
  288. The GTK+ (or: Gimp Toolkit) user interface is shipped separately.
  289. After installing gnunet-gtk, you can invoke the setup tool and
  290. the file-sharing GUI with:
  291. $ gnunet-setup
  292. $ gnunet-fs-gtk
  293. For further documentation, see our webpage or the 'GNUnet User Handbook',
  294. included in this software distribution.
  295. Hacking GNUnet
  296. ==============
  297. Contributions are welcome. Please submit bugs you find to
  298. https://bugs.gnunet.org/ or our bugs mailinglist.
  299. Please make sure to run the script "contrib/scripts/gnunet-bugreport"
  300. and include the output with your bug reports. More about how to
  301. report bugs can be found in the GNUnet FAQ on the webpage. Submit
  302. patches via E-Mail to gnunet-developers@gnu.org, formated with
  303. `git format-patch`.
  304. In order to run the unit tests by hand (instead of using "make check"),
  305. you need to set the environment variable "GNUNET_PREFIX" to the
  306. directory where GNUnet's libraries are installed.
  307. Before running any testcases, you must complete the installation.
  308. Quick summary:
  309. $ ./configure --prefix=$SOMEWHERE
  310. $ make
  311. $ make install
  312. $ export $GNUNET_PREFIX=$SOMEWHERE
  313. $ make check
  314. Some of the testcases require python >= 3.7, and the python modules
  315. "python-future" (http://python-future.org/) and "pexpect" to be installed.
  316. If any testcases fail to pass on your system, run
  317. "contrib/scripts/gnunet-bugreport" (in the repository) or "gnunet-bugreport"
  318. when you already have GNUnet installed and report its output together with
  319. information about the failing testcase(s) to the Mantis bugtracking
  320. system at https://gnunet.org/bugs/.
  321. Running HTTP on port 80 and HTTPS on port 443
  322. =============================================
  323. In order to hide GNUnet's HTTP/HTTPS traffic perfectly, you might
  324. consider running GNUnet's HTTP/HTTPS transport on port 80/443.
  325. However, we do not recommend running GNUnet as root. Instead, forward
  326. port 80 to say 1080 with this command (as root, in your startup
  327. scripts):
  328. # iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 1080
  329. or for HTTPS
  330. # iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 4433
  331. Then set in the HTTP section of gnunet.conf the "ADVERTISED_PORT" to
  332. "80" and "PORT" to 1080 and similarly in the HTTPS section the
  333. "ADVERTISED_PORT" to "443" and "PORT" to 4433.
  334. You can do the same trick for the TCP and UDP transports if you want
  335. to map them to a priviledged port (from the point of view of the
  336. network). However, we are not aware of this providing any advantages
  337. at this point.
  338. If you are already running an HTTP or HTTPS server on port 80 (or 443),
  339. you may be able to configure it as a "ReverseProxy". Here, you tell
  340. GNUnet that the externally visible URI is some sub-page on your website,
  341. and GNUnet can then tunnel its traffic via your existing HTTP server.
  342. This is particularly powerful if your existing server uses HTTPS, as
  343. it makes it harder for an adversary to distinguish normal traffic to
  344. your server from GNUnet traffic. Finally, even if you just use HTTP,
  345. you might benefit (!) from ISP's traffic shaping as opposed to being
  346. throttled by ISPs that dislike P2P. Details for configuring the
  347. reverse proxy are documented on our website.
  348. Further Reading
  349. ===============
  350. * Documentation
  351. A HTML version of the new GNUnet manual is deployed at
  352. https://docs.gnunet.org
  353. which currently displays just GNUnet documentation. Until 2019
  354. we will add more reading material.
  355. * Academia / papers
  356. In almost 20 years various people in our community have written and
  357. collected a good number of papers which have been implemented in
  358. GNUnet or projects around GNUnet.
  359. There are currently 2 ways to get them:
  360. * Using git:
  361. git clone https://git.gnunet.org/bibliography.git
  362. * Using Drupal:
  363. https://old.gnunet.org/bibliography
  364. The Drupal access will be replaced by a new interface to our
  365. bibliography in 2019.
  366. Stay tuned
  367. ==========
  368. * https://gnunet.org/
  369. * https://bugs.gnunet.org
  370. * https://git.gnunet.org
  371. * http://www.gnu.org/software/gnunet/
  372. * http://mail.gnu.org/mailman/listinfo/gnunet-developers
  373. * http://mail.gnu.org/mailman/listinfo/help-gnunet
  374. * http://mail.gnu.org/mailman/listinfo/info-gnunet
  375. * http://mail.gnu.org/mailman/listinfo/gnunet-svn