From fbf7f994ac4a5a509857c9bd267909d1cffc600c Mon Sep 17 00:00:00 2001 From: lurchi Date: Thu, 28 Jun 2018 01:22:01 +0200 Subject: add Installation chapter --- doc/documentation/Makefile.am | 1 + doc/documentation/chapters/installation.texi | 158 +++++++++++++++++++++++++++ doc/documentation/gnunet.texi | 7 ++ 3 files changed, 166 insertions(+) create mode 100644 doc/documentation/chapters/installation.texi (limited to 'doc/documentation') diff --git a/doc/documentation/Makefile.am b/doc/documentation/Makefile.am index 12f40f147..0ee81304e 100644 --- a/doc/documentation/Makefile.am +++ b/doc/documentation/Makefile.am @@ -114,6 +114,7 @@ gnunet_TEXINFOS = \ chapters/developer.texi \ chapters/preface.texi \ chapters/philosophy.texi \ + chapters/installation.texi \ chapters/user.texi \ chapters/vocabulary.texi \ chapters/configuration.texi \ diff --git a/doc/documentation/chapters/installation.texi b/doc/documentation/chapters/installation.texi new file mode 100644 index 000000000..d66d72ae5 --- /dev/null +++ b/doc/documentation/chapters/installation.texi @@ -0,0 +1,158 @@ +@node Installing GNUnet +@chapter Installing GNUnet + +This guide is intended for those who want to install Gnunet from source. For instructions on how to install GNUnet as a binary package please refer to the official documentation of your operating system or package manager. + +@node Getting the Source Code +@section Installing dependencies +GNUnet needs few libraries and applications for being able to run and another few optional ones for using certain features. Preferably they should be installed with a package manager. Just in case we include a link to the project websites. + +The mandatory libraries and applications are +@itemize @bullet +@item libtool +@item autoconf >= version 2.59 +@item automake >= version 1.11.1 +@item pkg-config +@item libgcrypt >= version 1.6 +@item libextractor +@item libidn +@item libmicrohttpd >= version 0.9.52 +@item libnss +@item libunistring +@item gettext +@item glibc +@item libgmp +@item gnutls +@item libcurl (has to be linked to GnuTLS) or libgnurl +@item zlib +@end itemize + +In addition GNUnet needs one of of these three databases +@itemize @bullet +@item sqlite + libsqlite (the default, requires no further configuration) +@item postgres + libpq +@item mysql + libmysqlclient +@end itemize + +These are the dependencies only required for certain features +@itemize @bullet +@item Texinfo (for building the documentation) +@item Texlive (for building the documentation) +@item miniupnpc (for traversing NAT boxes more reliably) +@item libopus (for running the GNUnet conversation telephony application) +@item libpulse (for running the GNUnet conversation telephony application) +@item libogg (for running the GNUnet conversation telephony application) +@item bluez (for bluetooth support) +@item libpbc (for attribute-based encryption and the identity provider subsystem) +@item libgabe (for attribute-based encryption and the identity provider subsystem) +@end itemize + + +@section Getting the Source Code +You can either download the source code using git (you obviously need git installed) or as an archive. + +Using git type +@example +git clone https://gnunet.org/git/gnunet.git +@end example + +The archive can be found at @uref{https://gnunet.org/downloads}. Extract it using a graphical archive tool or @code{tar}: +@example +tar xzvf gnunet-0.11.0pre66.tar.gz +@end example + +In the next chapter we will assume that the source code is available in the home directory at @code{~/gnunet}. + +@section Create @code{gnunet} user and group +The GNUnet services should be run as a dedicated user called @code{gnunet}. For using them a user should be in the same group as this system user. + +Create user @code{gnunet} who is member of the group @code{gnunet} and specify a home directory where the GNUnet services will store persistant data such as information about peers. +@example +$ sudo useradd --system --groups gnunet --home-dir /var/lib/gnunet +@end example + +Now add your own user to the @code{gnunet} group. +@example +$ sudo adduser alice gnunet +@end example + +@section Preparing and Compiling the Source Code +For preparing the source code for compilation a bootstrap script and @code{configure} has to be run from the source code directory. When running @code{configure} the following options can be specified to customize the compilation and installation process: + +@itemize @bullet +@item @code{--disable-documentation} - don't build the configuration documents +@item @code{--enable-looging=[LOGLEVEL]} - choose a loglevel (@code{debug}, @code{info}, @code{warning} or @code{error}) +@item @code{--prefix=[PATH]} - the directory where the GNUnet libraries and binaries will be installed +@item @code{--with-extractor=[PATH]} - the path to libextractor +@item @code{--with-libidn=[PATH]} - the path to libidn +@item @code{--with-microhttpd=[PATH]} - the path to libmicrohttpd +@item @code{--with-sqlite=[PATH]} - the path to libsqlite +@item @code{--with-zlib=[PATH]} - the path to zlib +@item @code{--with-sudo=[PATH]} - path to the sudo binary (no need to run @code{make install} as root if specified) +@end itemize + +The following example configures the installation prefix @code{/usr/lib} and disables building the documentation +@example +$ cd ~/gnunet +$ ./bootstrap +$ configure --prefix=/usr/lib --disable-configuration +@end example + +After running the bootstrap script and @code{configure} successfully the source code can be compiled with make. Here @code{-j5} specifies that 5 threads should be used. +@example +$ make -j5 +@end example + + +@section Installation +The compiled binaries can be installed using @code{make install}. It needs to be run as root (or with sudo) because some binaries need the @code{suid} bit set. Without that some GNUnet subsystems (such as VPN) will not work. + +@example +$ sudo make install +@end example + +One important library is the GNS plugin for NSS (the name services switch) which allows using GNS (the GNU name system) in the normal DNS resolution process. Unfortunately NSS expects it in a specific location (probably @code{/lib}) which may differ from the installation prefix (see @code{--prefix} option in the previous section). This is why the pugin has to be installed manually. + +Find the directory where nss plugins are installed on your system, e.g. + +@example +$ ls -l /lib/libnss_* +/lib/libnss_mymachines.so.2 +/lib/libnss_resolve.so.2 +/lib/libnss_myhostname.so.2 +/lib/libnss_systemd.so.2 +@end example + +Copy the GNS NSS plugin to that directory: + +@example +cp ~/gnunet/src/gns/nss/libnss_gns.so.2 /lib +@end example + +Now, to activate the plugin, you need to edit your @code{/etc/nsswitch.conf} where you should find a line like this: + +@example +hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 +@end example + +The exact details may differ a bit, which is fine. Add the text @code{"gns [NOTFOUND=return]"} after @code{"files"}. + +@example +hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4 +@end example + +Optionally, if GNS shall be used with a browser, execute the GNS CA-setup script. It will isetup the GNS Certificate Authority with the user's browser. +@example +$ gnunet-gns-proxy-setup-ca +@end example + +Finally install a configuration file in @code{~/.gnunet/gnunet.conf}. Below you find an example config which allows you to start GNUnet. + +@example +[arm] +SYSTEM_ONLY = NO +USER_ONLY = NO + +[transport] +PLUGINS = tcp +@end example diff --git a/doc/documentation/gnunet.texi b/doc/documentation/gnunet.texi index cd2f04399..0d539a9d7 100644 --- a/doc/documentation/gnunet.texi +++ b/doc/documentation/gnunet.texi @@ -83,6 +83,7 @@ This document is the Reference Manual for GNUnet version @value{VERSION}. * Preface:: Chapter 0 * Philosophy:: About GNUnet @c * Vocabulary:: Vocabulary +* Installing GNUnet:: Installing GNUnet * Using GNUnet:: Using GNUnet @c * Configuration Handbook:: Configuring GNUnet * GNUnet Contributors Handbook:: Contributing to GNUnet @@ -120,6 +121,8 @@ Philosophy * Backup of Identities and Egos:: * Revocation:: +Installing GNUnet + Using GNUnet * Checking the Installation:: @@ -192,6 +195,10 @@ GNUnet Developer Handbook @include chapters/philosophy.texi @c ********************************************************************* +@c ********************************************************************* +@include chapters/installation.texi +@c ********************************************************************* + @c ********************************************************************* @include chapters/user.texi @c ********************************************************************* -- cgit v1.2.3