From 6decfbd4ca86b2465d01406de586fcd5a5005c00 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Mon, 4 Jun 2018 20:50:28 +0000 Subject: contrib: rename scripts/report.sh to scripts/gnunet-bugreport and install it. Signed-off-by: Nils Gillmann --- contrib/Makefile.am | 4 +- contrib/scripts/gnunet-bugreport | 252 +++++++++++++++++++++++++++++++++++++++ contrib/scripts/report.sh | 252 --------------------------------------- 3 files changed, 255 insertions(+), 253 deletions(-) create mode 100755 contrib/scripts/gnunet-bugreport delete mode 100755 contrib/scripts/report.sh diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 8e07a5d8c..81528a90e 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -32,9 +32,11 @@ dist_pkgdata_DATA = \ gns/gns-form.xslt \ branding/logo/gnunet-logo.pdf \ branding/logo/gnunet-logo-color.png \ - scripts/report.sh \ testing_hostkeys.ecc +bin_PROGRAMS = \ + scripts/gnunet-bugreport + if MINGW tap32_DATA = \ 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys \ diff --git a/contrib/scripts/gnunet-bugreport b/contrib/scripts/gnunet-bugreport new file mode 100755 index 000000000..7fbb2f46c --- /dev/null +++ b/contrib/scripts/gnunet-bugreport @@ -0,0 +1,252 @@ +#!/bin/sh + +TEST=`type type|grep not` +if test -n "$TEST"; then + WHICH=which +else + WHICH=type +fi + +echo "Please submit the following information with your bug report: " +echo "--------------------------------------------------------------" +OS=`uname -s 2>/dev/null` +echo "OS : $OS" +REL=`uname -r 2>/dev/null` +echo "OS RELEASE : $REL" +HW=`uname -m 2>/dev/null` +echo "HARDWARE : $HW" + +TEST=`$WHICH gcc 2>/dev/null` +if test -n "$TEST"; then + VERS=`gcc --version 2>/dev/null | head -n 1` + echo "gcc : $VERS" +else + echo "gcc : Not Found"; +fi + +TEST=`$WHICH gmake 2>/dev/null` +if test -n "$TEST" ; then + gmake --version 2>/dev/null |\ + awk -F, '{print $1}' |\ + awk '/GNU Make/{print "GNU gmake :",$NF}' +else + TEST=`make --version 2>/dev/null` + if test -n "$TEST"; then + make --version 2>/dev/null |\ + awk -F, '{print $1}' |\ + awk '/GNU Make/{print "make :",$NF}' + else + echo "make : Not Found" + fi +fi + +TEST=`$WHICH autoconf 2>/dev/null` +if test -n "$TEST"; then + autoconf --version |\ + head -n 1 |\ + awk '{\ + if (length($4) == 0) {\ + print "autoconf : "$3\ + } else {\ + print "autoconf : "$4\ + }}' +else + echo "autoconf : Not Found" +fi + +TEST=`$WHICH automake 2>/dev/null` +if test -n "$TEST"; then + automake --version 2>/dev/null |\ + head -n 1 |\ + awk '{print "automake : "$4}' +else + echo "automake : Not Found" +fi + +TEST=`$WHICH libtool 2>/dev/null` +if test -n "$TEST"; then + libtool --version 2>/dev/null |\ + head -n 1 |\ + awk '{print "libtool : "$4}' +else + echo "libtool : Not Found" +fi + +TEST=`$WHICH extract 2>/dev/null` +if test -n "$TEST"; then + extract -v 2>/dev/null |\ + head -n 1 |\ + awk '{print "libextractor : "$2}' +else + echo "libextractor : Not Found" +fi + +if test -x gnunetd; then + gnunetd -v | sed -e "s/v//" 2>/dev/null |\ + awk '{print "GNUnet 0.8 : "$2 (may conflict!)}' +else + echo "GNUnet 0.8 : Not Found (good)" +fi + +TEST=`$WHICH gnunet-arm 2>/dev/null` +if test -n "$TEST"; then + gnunet-arm -v | sed -e "s/v//" 2>/dev/null |\ + awk '{print "GNUnet 0.9 : "$2}' +else + echo "GNUnet 0.9 : Not Found" +fi + +TEST=`$WHICH libgcrypt-config 2> /dev/null` +if test -n "$TEST"; then + libgcrypt-config --version 2> /dev/null | \ + awk '{print "libgcrypt : "$1}' +else + echo "libgcrypt : Not Found" +fi + +TEST=`$WHICH mysql_config 2> /dev/null` +if test -n "$TEST"; then + mysql_config --version 2> /dev/null | \ + awk '{print "mysql : "$1}' +else + echo "mysql : Not Found" +fi + +TEST=`$WHICH pkg-config 2> /dev/null` +if test -n "$TEST"; then + pkg-config --version 2> /dev/null | \ + awk '{print "pkg-config : "$1}' +else + echo "pkg-config : Not Found" +fi + +TEST=`$WHICH pkg-config 2> /dev/null` +if test -n "$TEST"; then + pkg-config --modversion glib-2.0 2> /dev/null | \ + awk '{print "glib2 : "$1}' +else + echo "glib2 : Not Found" +fi + +TEST=`$WHICH pkg-config 2> /dev/null` +if test -n "$TEST"; then + pkg-config --modversion gtk+-2.0 2> /dev/null | \ + awk '{print "gtk2+ : "$1}' +else + echo "gtk2+ : Not Found" +fi + +TEST=`$WHICH dpkg 2> /dev/null` +if test -n "$TEST"; then + LINES=`dpkg -s libgmp-dev | grep Version | wc -l 2> /dev/null` + if test "$LINES" = "1" + then + VERSION=`dpkg -s libgmp-dev | grep Version | awk '{print $2}'` + echo "GMP : libgmp-dev-$VERSION.deb" + else + echo "GMP : dpkg: libgmp-dev not installed" + fi +else + TEST=`$WHICH rpm 2> /dev/null` + if test -n "$TEST"; then + rpm -q gmp | sed -e "s/gmp-//" 2> /dev/null | \ + awk '{print "GMP : "$1.rpm}' + else + echo "GMP : Test not available" + fi +fi + +TEST=`$WHICH dpkg 2> /dev/null` +if test -n "$TEST"; then + LINES=`dpkg -s libunistring-dev | grep Version | wc -l` + if test "$LINES" = "1" + then + VERSION=`dpkg -s libunistring-dev | grep Version | awk '{print $2}'` + echo "libunistring : libunistring3-dev-$VERSION.deb" + else + echo "libunistring : dpkg: libunistring3-dev not installed" + fi +else + TEST=`$WHICH rpm 2> /dev/null` + if test -n "$TEST"; then + rpm -q unistring | sed -e "s/unistring-//" 2> /dev/null | \ + awk '{print "libunistring : "$1.rpm}' + else + echo "libunistring : Test not available" + fi +fi + +TEST=`$WHICH gettext 2> /dev/null` +if test -n "$TEST"; then + gettext --version | head -n1 2> /dev/null | \ + awk '{print "GNU gettext : "$4}' +else + echo "GNU gettext : Not found" +fi + + +TEST=`$WHICH curl-config 2> /dev/null` +if test -n "$TEST"; then + curl-config --version | head -n1 2> /dev/null | \ + awk '{print "libcurl : "$2}' +else + echo "libcurl : Not found" +fi + +TEST=`$WHICH gnurl-config 2> /dev/null` +if test -n "$TEST"; then + gnurl-config --version | head -n1 2> /dev/null | \ + awk '{print "libgnurl : "$2}' +else + echo "libgnurl : Not found" +fi + +echo -n "libmicrohttpd : " +TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX` +cat - >$TMPFILE.c < +#include +int main() +{ + fprintf (stdout, "%X\n", MHD_VERSION); + return 0; +} +EOF + +gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" +rm -f $TMPFILE $TMPFILE.bin + + +echo -n "GNU GLPK : " +TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX` +cat - >$TMPFILE.c < +#include +int main() +{ + fprintf (stdout, "%u.%u\n", GLP_MAJOR_VERSION, GLP_MINOR_VERSION); + return 0; +} +EOF + +gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" +rm -f $TMPFILE $TMPFILE.bin + + +echo -n "GNUtls : " +TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX` +cat - >$TMPFILE.c < +#include +int main() +{ + fprintf (stdout, "%s\n", GNUTLS_VERSION); + return 0; +} +EOF + +gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" +rm -f $TMPFILE $TMPFILE.bin + + +echo "--------------------------------------------------------------" diff --git a/contrib/scripts/report.sh b/contrib/scripts/report.sh deleted file mode 100755 index 7fbb2f46c..000000000 --- a/contrib/scripts/report.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh - -TEST=`type type|grep not` -if test -n "$TEST"; then - WHICH=which -else - WHICH=type -fi - -echo "Please submit the following information with your bug report: " -echo "--------------------------------------------------------------" -OS=`uname -s 2>/dev/null` -echo "OS : $OS" -REL=`uname -r 2>/dev/null` -echo "OS RELEASE : $REL" -HW=`uname -m 2>/dev/null` -echo "HARDWARE : $HW" - -TEST=`$WHICH gcc 2>/dev/null` -if test -n "$TEST"; then - VERS=`gcc --version 2>/dev/null | head -n 1` - echo "gcc : $VERS" -else - echo "gcc : Not Found"; -fi - -TEST=`$WHICH gmake 2>/dev/null` -if test -n "$TEST" ; then - gmake --version 2>/dev/null |\ - awk -F, '{print $1}' |\ - awk '/GNU Make/{print "GNU gmake :",$NF}' -else - TEST=`make --version 2>/dev/null` - if test -n "$TEST"; then - make --version 2>/dev/null |\ - awk -F, '{print $1}' |\ - awk '/GNU Make/{print "make :",$NF}' - else - echo "make : Not Found" - fi -fi - -TEST=`$WHICH autoconf 2>/dev/null` -if test -n "$TEST"; then - autoconf --version |\ - head -n 1 |\ - awk '{\ - if (length($4) == 0) {\ - print "autoconf : "$3\ - } else {\ - print "autoconf : "$4\ - }}' -else - echo "autoconf : Not Found" -fi - -TEST=`$WHICH automake 2>/dev/null` -if test -n "$TEST"; then - automake --version 2>/dev/null |\ - head -n 1 |\ - awk '{print "automake : "$4}' -else - echo "automake : Not Found" -fi - -TEST=`$WHICH libtool 2>/dev/null` -if test -n "$TEST"; then - libtool --version 2>/dev/null |\ - head -n 1 |\ - awk '{print "libtool : "$4}' -else - echo "libtool : Not Found" -fi - -TEST=`$WHICH extract 2>/dev/null` -if test -n "$TEST"; then - extract -v 2>/dev/null |\ - head -n 1 |\ - awk '{print "libextractor : "$2}' -else - echo "libextractor : Not Found" -fi - -if test -x gnunetd; then - gnunetd -v | sed -e "s/v//" 2>/dev/null |\ - awk '{print "GNUnet 0.8 : "$2 (may conflict!)}' -else - echo "GNUnet 0.8 : Not Found (good)" -fi - -TEST=`$WHICH gnunet-arm 2>/dev/null` -if test -n "$TEST"; then - gnunet-arm -v | sed -e "s/v//" 2>/dev/null |\ - awk '{print "GNUnet 0.9 : "$2}' -else - echo "GNUnet 0.9 : Not Found" -fi - -TEST=`$WHICH libgcrypt-config 2> /dev/null` -if test -n "$TEST"; then - libgcrypt-config --version 2> /dev/null | \ - awk '{print "libgcrypt : "$1}' -else - echo "libgcrypt : Not Found" -fi - -TEST=`$WHICH mysql_config 2> /dev/null` -if test -n "$TEST"; then - mysql_config --version 2> /dev/null | \ - awk '{print "mysql : "$1}' -else - echo "mysql : Not Found" -fi - -TEST=`$WHICH pkg-config 2> /dev/null` -if test -n "$TEST"; then - pkg-config --version 2> /dev/null | \ - awk '{print "pkg-config : "$1}' -else - echo "pkg-config : Not Found" -fi - -TEST=`$WHICH pkg-config 2> /dev/null` -if test -n "$TEST"; then - pkg-config --modversion glib-2.0 2> /dev/null | \ - awk '{print "glib2 : "$1}' -else - echo "glib2 : Not Found" -fi - -TEST=`$WHICH pkg-config 2> /dev/null` -if test -n "$TEST"; then - pkg-config --modversion gtk+-2.0 2> /dev/null | \ - awk '{print "gtk2+ : "$1}' -else - echo "gtk2+ : Not Found" -fi - -TEST=`$WHICH dpkg 2> /dev/null` -if test -n "$TEST"; then - LINES=`dpkg -s libgmp-dev | grep Version | wc -l 2> /dev/null` - if test "$LINES" = "1" - then - VERSION=`dpkg -s libgmp-dev | grep Version | awk '{print $2}'` - echo "GMP : libgmp-dev-$VERSION.deb" - else - echo "GMP : dpkg: libgmp-dev not installed" - fi -else - TEST=`$WHICH rpm 2> /dev/null` - if test -n "$TEST"; then - rpm -q gmp | sed -e "s/gmp-//" 2> /dev/null | \ - awk '{print "GMP : "$1.rpm}' - else - echo "GMP : Test not available" - fi -fi - -TEST=`$WHICH dpkg 2> /dev/null` -if test -n "$TEST"; then - LINES=`dpkg -s libunistring-dev | grep Version | wc -l` - if test "$LINES" = "1" - then - VERSION=`dpkg -s libunistring-dev | grep Version | awk '{print $2}'` - echo "libunistring : libunistring3-dev-$VERSION.deb" - else - echo "libunistring : dpkg: libunistring3-dev not installed" - fi -else - TEST=`$WHICH rpm 2> /dev/null` - if test -n "$TEST"; then - rpm -q unistring | sed -e "s/unistring-//" 2> /dev/null | \ - awk '{print "libunistring : "$1.rpm}' - else - echo "libunistring : Test not available" - fi -fi - -TEST=`$WHICH gettext 2> /dev/null` -if test -n "$TEST"; then - gettext --version | head -n1 2> /dev/null | \ - awk '{print "GNU gettext : "$4}' -else - echo "GNU gettext : Not found" -fi - - -TEST=`$WHICH curl-config 2> /dev/null` -if test -n "$TEST"; then - curl-config --version | head -n1 2> /dev/null | \ - awk '{print "libcurl : "$2}' -else - echo "libcurl : Not found" -fi - -TEST=`$WHICH gnurl-config 2> /dev/null` -if test -n "$TEST"; then - gnurl-config --version | head -n1 2> /dev/null | \ - awk '{print "libgnurl : "$2}' -else - echo "libgnurl : Not found" -fi - -echo -n "libmicrohttpd : " -TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX` -cat - >$TMPFILE.c < -#include -int main() -{ - fprintf (stdout, "%X\n", MHD_VERSION); - return 0; -} -EOF - -gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" -rm -f $TMPFILE $TMPFILE.bin - - -echo -n "GNU GLPK : " -TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX` -cat - >$TMPFILE.c < -#include -int main() -{ - fprintf (stdout, "%u.%u\n", GLP_MAJOR_VERSION, GLP_MINOR_VERSION); - return 0; -} -EOF - -gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" -rm -f $TMPFILE $TMPFILE.bin - - -echo -n "GNUtls : " -TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX` -cat - >$TMPFILE.c < -#include -int main() -{ - fprintf (stdout, "%s\n", GNUTLS_VERSION); - return 0; -} -EOF - -gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" -rm -f $TMPFILE $TMPFILE.bin - - -echo "--------------------------------------------------------------" -- cgit v1.2.3 From a37d06cb367b57636b11c9224c2e28458614aca6 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Mon, 4 Jun 2018 22:05:13 +0000 Subject: extend the list of known package maintainers Signed-off-by: Nils Gillmann --- AUTHORS | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index ef7e2eb9d..718038ab8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -113,12 +113,17 @@ GNU with Net : Christian Muellner AFS Face : Alex Jones new GNU in Net: Nicklas Larsson -Maintainers: +Package Maintainers (current and previous): FreeBSD : Kirill Ponomarew -Debian GNU/Linux: Daniel Baumann +Debian GNU/Linux: Bertrand Marc + Daniel Baumann + Arnaud Kyheng + Glenn McGrath +Nix: : viric, rahul OpenWrt/LEDE : Daniel Golle OS X : Jussi Eloranta Gentoo : Carlo von lynX + Nils Gillmann If you have contributed and are not listed here, please notify one of the maintainers in order to be added. -- cgit v1.2.3 From 52de9c044b048de3f1ba4d6d4d59dc62a6fab5f9 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Tue, 5 Jun 2018 08:54:29 +0000 Subject: Add GPL2 licensed openrc service file Signed-off-by: Nils Gillmann --- contrib/services/openrc/gnunet.initd | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 contrib/services/openrc/gnunet.initd diff --git a/contrib/services/openrc/gnunet.initd b/contrib/services/openrc/gnunet.initd new file mode 100644 index 000000000..c042e3de1 --- /dev/null +++ b/contrib/services/openrc/gnunet.initd @@ -0,0 +1,82 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +if [ -d /run ] ; then + PIDFILE=${PIDFILE:-/run/gnunet/arm-service.pid} +else + PIDFILE=${PIDFILE:-/var/run/gnunet/arm-service.pid} +fi + +depend() { + # FIXME: refine? + need net +} + +GNUNET_PATH="/usr" +GNUNET_HOME="/var/lib/gnunet" +SUID_ROOT_HELPERS="exit nat-server nat-client transport-bluetooth transport-wlan vpn" + +chmodown_execbin() { + if [ -x $1 ]; then + if [ "$3" ]; then + chown $3 $1 2>/dev/null && chmod $2 $1 + else + chmod $2 $1 + fi + fi +} + +checkconfig() { + if [ -n "$(find ${GNUNET_HOME}/.local/share/gnunet -maxdepth 1 -name gnunet.conf -perm +0044)" ] ; then + eerror "${conf} must not be world or group readable. Try:" + eerror " chmod 600 ${conf}" + eerror " chown gnunet:gnunet ${conf}" + return 1 + fi + mkdir -p ${GNUNET_HOME}/.cache/gnunet + + # taken from dangole's lede config.. thx! + local libexec="${GNUNET_PATH}/lib/gnunet/libexec" # why not /usr/libexec/gnunet ? + # not reliable enough: + #[ -e ${libexec}/.permfix ] && return + for helper in $SUID_ROOT_HELPERS; do + chmodown_execbin ${libexec}/gnunet-helper-$helper u+s + done + chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns + chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns + #touch ${libexec}/.permfix +} + +start() { + checkconfig || return 1 + + local piddir=$(dirname ${PIDFILE}) + if [ ! -d ${piddir} ] ; then + ebegin "Making ${piddir}" + mkdir -p ${piddir} + eend $? + ebegin "Changing permissions of ${piddir}" + chown gnunet:gnunet ${piddir} + eend $? + fi + + ebegin "Starting ${SVCNAME}" + # shouldn't be necessary... but + start-stop-daemon --start --user gnunet --name gnunet --pidfile ${PIDFILE} \ + --exec ${GNUNET_PATH}/lib/gnunet/libexec/gnunet-service-arm -- -d + # flags to be passed to the process appear after the double-dash + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --signal QUIT --pidfile ${PIDFILE} + sleep 1 + killall -u gnunet + sleep 1 + rm -rf /tmp/gnunet-gnunet-runtime >/dev/null 2>&1 + rm -rf /tmp/gnunet-system-runtime >/dev/null 2>&1 + eend $? +} + -- cgit v1.2.3 From c99d62c683ec641b81b92efeef913189648b7d61 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Tue, 5 Jun 2018 10:17:44 +0000 Subject: gnunet-bugreport: GNUtls->GnuTLS Signed-off-by: Nils Gillmann --- contrib/scripts/gnunet-bugreport | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/scripts/gnunet-bugreport b/contrib/scripts/gnunet-bugreport index 7fbb2f46c..f17cb7636 100755 --- a/contrib/scripts/gnunet-bugreport +++ b/contrib/scripts/gnunet-bugreport @@ -233,7 +233,7 @@ gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" rm -f $TMPFILE $TMPFILE.bin -echo -n "GNUtls : " +echo -n "GnuTLS : " TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX` cat - >$TMPFILE.c < -- cgit v1.2.3 From afbd424f7410ad5134913a46b4a3f75112d573a3 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 6 Jun 2018 12:17:10 +0000 Subject: README rework part 1 Signed-off-by: Nils Gillmann --- README | 245 ++++++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 182 insertions(+), 63 deletions(-) diff --git a/README b/README index 80a87d274..572d6ca84 100644 --- a/README +++ b/README @@ -19,7 +19,7 @@ GNUnet is free software released under the GNU General Public License (v3 or later). For details see the COPYING file in this directory. Additional documentation about GNUnet can be found at -https://gnunet.org/ and in the doc/ folder. +https://gnunet.org/ and in the 'doc/' folder. Dependencies: @@ -30,78 +30,185 @@ recent versions of the libraries which are often NOT to be found in stable distributions in 2014. While using older packages may in some cases on some operating systems may seem to work in some limited fashion, we are in many cases aware of serious problems with older -packages. Hence please make sure to use the versions listed below. +packages. Hence please make sure to use the versions listed below. These are the direct dependencies for running GNUnet: -- libmicrohttpd >= 0.9.42 -- libgcrypt >= 1.6 -- libgnurl >= 7.35.0 (available from https://gnunet.org/gnurl) -- libunistring >= 0.9.2 -- gnutls >= 3.2.12 -- libidn >= 1.0 -- libextractor >= 0.6.1 (highly recommended) -- openssl >= 1.0 (binary, used to generate X.509 certificate) -- libltdl >= 2.2 (part of GNU libtool) -- sqlite >= 3.8 (default database, required) -- mysql >= 5.1 (alternative to sqlite) -- postgres >= 9.5 (alternative to sqlite) -- libopus >= 1.0.1 (optional for experimental conversation tool) -- libpulse >= 2.0 (optional for experimental conversation tool) -- libogg >= 1.3.0 (optional for experimental conversation tool) -- python-zbar >= 0.10 (optional for gnunet-qr) -- TeX Live >= 2012 (optional for gnunet-bcd[*]) -- Texinfo >= 5.2 [*1] -- libglpk >= 4.45 (optional for experimental code) +- libmicrohttpd >= 0.9.42 +- libgcrypt >= 1.6 +- libgnurl >= 7.35.0 (recommended, available from https://gnunet.org/gnurl) +- libcurl >= 7.35.0 (alternative to libgnurl) +- libunistring >= 0.9.2 +- gnutls >= 3.2.12 (highly recommended a gnutls linked against libunbound) +- libidn >= 1.0 +- libextractor >= 0.6.1 (highly recommended) +- openssl >= 1.0 (binary, used to generate X.509 certificate) +- libltdl >= 2.2 (part of GNU libtool) +- sqlite >= 3.8 (default database, required) +- mysql >= 5.1 (alternative to sqlite) +- postgres >= 9.5 (alternative to sqlite) +- Texinfo >= 5.2 [*1] +- which (for the bootstrap script) +- gettext +- zlib +- pkg-config + + +These are the dependencies for GNUnet's testsuite: + +- Bash (optional (?), for some tests) +- python >= 2.7 (optional, only python 2.7 is supported) +- python-future >= 2.7 (optional, only python 2.7 is supported) + + +These are the optional dependencies: + +- libopus >= 1.0.1 (optional, for experimental conversation tool) +- libpulse >= 2.0 (optional, for experimental conversation tool) +- libogg >= 1.3.0 (optional, for experimental conversation tool) +- libnss (optional, certtool binary (for convenient installation of GNS proxy)) +- python-future (optional, for some testcases and utilities) +- python-zbar >= 0.10 (optional, for gnunet-qr) +- TeX Live >= 2012 (optional, for gnunet-bcd[*]) +- libglpk >= 4.45 (optional, for experimental code) +- perl5 (optional, for some utilities) +- python >= 2.7 (optional, for gnunet-qr, only python 2.7 is supported) +- bluez (optional, for bluetooth support) +- miniupnpc +- libpbc >= 0.5.14 (optional, for Attribute-Based Encryption and Identity Provider functionality) +- libgabe (optional, for Attribute-Based Encryption and Identity Provider functionality, + from https://github.com/schanzen/libgabe) + Recommended autotools for compiling the git version are: -- autoconf >= 2.59 -- automake >= 1.11.1 -- libtool >= 2.2 + +- autoconf >= 2.59 +- automake >= 1.11.1 +- libtool >= 2.2 [*] Mandatory for compiling the info output of the documentation, -a limited subset ('texlive-tiny' in Guix) is enough. + a limited subset ('texlive-tiny' in Guix) is enough. + +[*1] The default configuration is to build the info output of the + documentation, and therefore require texinfo. You can pass + '--disable-documentation' to the configure script to change this. -[*1] The default configuration is to build the info output of the documentation, -and therefore require texinfo. You can pass --disable-documentation to -the configure script to change this. +Requirements +============ + +GNUnet's directed acyclic graph (DAG) will require around 0.74 GiB +Diskspace, with GNUNet itself taking around 9.2 MiB reported by the +build on GNU Guix. How to install? =============== -The fastest way is to use a binary package if it is available for your -system. For a more detailed description, read the installation -instructions on the webpage at https://gnunet.org/installation. + +binary packages +~~~~~~~~~~~~~~~ + +We recommend to use binary packages provided by your Operating System's +package manager. GNUnet is reportedly available for at least: + +Gentoo (via the 'youbroketheinternet' overlay), GNU Guix, Nix, +Debian, ALT Linux, Archlinux, Deepin, Devuan, Hyperbola, Kali Linux, +LEDE/OpenWRT, Manjaro, Parabola, Pardus, Parrot, PureOS, Raspbian, +Rosa, Trisquel, and Ubuntu. + +If GNUnet is available for your Operating System and it is missing, +send us feedback so that we can add it to this list. Furthermore, if +you are interested in packaging GNUnet for your Operating System, +get in touch with us at gnunet-developers@gnu.org if you require +help with this job. + +If you were using an Operating System with the apt package manager, +GNUnet could be installed as simple as: + +$ apt-get install gnunet + Generic installation instructions are in the INSTALL file in this directory. +Scope of Operating System support +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We actively support GNUnet on a broad range of Free Software Operating +Systems. + +For proprietary Operating Systems, like for example Microsoft Windows +or Apple OS X, we accept patches if they don't break anything for +other Operating Systems. +If you are implementing support for a proprietary Operating System, +you should be aware that progress in our codebase could break +functionality on your OS and cause unpredicted behavior we can +not test. However, we do not break support on Operating Systems +with malicious intent. +Regressions which do occur on these Operating Systems are 3rd +class issues and we expect users and developers of these +Operating Systems to send proposed patches to fix regressions. + +For more information about our stand on some of the motivating +points here, read the 'Philosophy' Chapter of our handbook. + +Building GNUnet from source +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +IMPORTANT: You can read further notes about compilation from source in +the 'doc/FILENAME' document, which includes notes about specific +requirements for operating systems aswell. If you are a package +mantainer for an Operating System we invite you to add your notes if +you feel it is necessary and can not be covered in your Operating +System's documentation. + + +Some Operating Systems currently require you to build GNUnet from +source. +If you are building GNUnet from source you are either interested +in furthering its development (we have further notes for developer +builds in our 'GNUnet Developer Handbook') or your Operating System +simply lacks support for a binary package at the moment. +Two prominent examples which currently lack cross-compilation +support in GNUnet (and native binaries) are MS Windows and Apple macOS. +For macOS we recommend you to do the build process via Homebrew and a +recent XCode installation. +Compilation for MS Windows can ... + Note that some functions of GNUnet require "root" access. GNUnet will install (tiny) SUID binaries for those functions is you run "make install" as root. If you do not, GNUnet will still work, but some functionality will not be available (including certain forms of NAT traversal). -GNUnet requires the GNU MP library (http://www.gnu.org/software/gmp/) -and libgcrypt (http://www.gnupg.org/). You can specify the path to +GNUnet requires the GNU MP library (https://www.gnu.org/software/gmp/) +and libgcrypt (https://www.gnupg.org/). You can specify the path to libgcrypt by passing "--with-gcrypt=PATH" to configure. You will also need either sqlite (http://www.sqlite.org/), MySQL (http://www.mysql.org/) or PostGres (http://www.postgres.org/). If you install from source, you need to install GNU libextractor first -(download from http://www.gnu.org/software/libextractor/). We also +(download from https://www.gnu.org/software/libextractor/). We also recommend installing GNU libmicrohttpd (download from -http://www.gnu.org/software/libmicrohttpd/). Then you can start the -actual GNUnet compilation and installation process with: +https://www.gnu.org/software/libmicrohttpd/). Furthermore we recommend +libgnurl (from https://gnunet.org/gnurl). +Then you can start the actual GNUnet compilation process with: + $ export GNUNET_PREFIX=/usr/local/lib # or other directory of your choice # addgroup gnunetdns # adduser --system --home "/var/lib/gnunet" --group gnunet --shell /bin/sh # ./configure --prefix=$GNUNET_PREFIX/.. --with-extractor=$LE_PREFIX $ make + +And finally install GNUnet with: + # make install + +Complete the process by either adjusting one of our example service files +in 'contrib/services' or by running: + # sudo -u gnunet gnunet-arm -s + Note that running the 'configure' and 'make install' steps as root (or with sudo) is required as some parts of the installation require the creation of SUID binaries. The installation will @@ -135,7 +242,7 @@ certain binaries that require additional priviledges will not be installed properly (and autonomous NAT traversal, WLAN, DNS/GNS and the VPN will then not work). -If you run 'configure' and 'make install' as root or use the SUDO +If you run 'configure' and 'make install' as root or use the '--with-sudo' option, GNUnet's build system will install "libnss_gns*" libraries to "/lib/" regardless (!) of the $GNUNET_PREFIX you might have specified, as those libraries must be in "/lib/". If you are packaging GNUnet @@ -143,14 +250,14 @@ for binary distribution, this may cause your packaging script to miss those plugins, so you might need to do some additional manual work to include those libraries in your binary package(s). Similarly, if you want to use the GNUnet naming system and did NOT run GNUnet's 'make -install' process with SUDO rights, the libraries will be installed to +install' process with sudo rights, the libraries will be installed to "$GNUNET_PREFIX" and you will have to move them to "/lib/" manually. Finally, if you are compiling the code from git, you have to -run ". bootstrap" before ./configure. If you receive an error during -the running of ". bootstrap" that looks like "macro `AM_PATH_GTK' not -found in library", you may need to run aclocal by hand with the -I +run "sh ./bootstrap" before running "./configure". If you receive an error during +the running of "sh ./bootstrap" that looks like "macro `AM_PATH_GTK' +not found in library", you may need to run aclocal by hand with the -I option, pointing to your aclocal m4 macros, i.e. $ aclocal -I /usr/local/share/aclocal @@ -169,7 +276,7 @@ configuration for the peer. gnunet-setup can be used to configure and test (!) the network settings, choose which applications should be run and configure databases. Other options you might want to control include system limitations (such as disk space consumption, bandwidth, -etc.). The resulting configuration files are human-readable and can +etc). The resulting configuration files are human-readable and can theoretically be created or edited by hand. gnunet-setup is a separate download and requires somewhat recent @@ -185,10 +292,17 @@ configuration file should be located in "~/.config/gnunet.conf" or its location can be specified by giving the "-c" option to the respective GNUnet application. +For more information about the configuration (as well as usage) refer +to the 'GNUnet User Handbook' chapter of the documentation, included +in this software distribution. + Usage ===== +For detailed usage notes, instructions and examples, refer to the +included 'GNUnet User Handbook'. + First, you must obtain an initial list of GNUnet hosts. Knowing a single peer is sufficient since after that GNUnet propagates information about other peers. Note that the default configuration @@ -214,9 +328,9 @@ UDP or WLAN will discover each other automatically (if they are in the vicinity of each other) using broadcasts (IPv4/WLAN) or multicasts (IPv6). -The local node is started using "gnunet-arm -s". GNUnet should run -24/7 if you want to maximize your anonymity, as this makes partitioning -attacks harder. +The local node is started using "gnunet-arm -s". We recommend to run +GNUnet 24/7 if you want to maximize your anonymity, as this makes +partitioning attacks harder. Once your peer is running, you should then be able to access GNUnet using the shell: @@ -233,42 +347,47 @@ together with a description. To publish files on GNUnet, use the "gnunet-publish" command. -The GTK user interface is shipped separately. After downloading and -installing gnunet-gtk, you can invoke the setup tool and the -file-sharing GUI with: +The GTK+ (or: Gimp Toolkit) user interface is shipped separately. +After installing gnunet-gtk, you can invoke the setup tool and +the file-sharing GUI with: $ gnunet-setup $ gnunet-fs-gtk -For further documentation, see our webpage. +For further documentation, see our webpage or the 'GNUnet User Handbook', +included in this software distribution. Hacking GNUnet ============== -Contributions are welcome, please submit bugs to -https://gnunet.org/bugs/. Please make sure to run contrib/report.sh +Contributions are welcome. Please submit bugs you find to +https://gnunet.org/bugs/. +Please make sure to run the script "contrib/scripts/gnunet-bugreport" and include the output with your bug reports. More about how to report bugs can be found in the GNUnet FAQ on the webpage. Submit -patches via E-Mail to gnunet-developers@gnu.org. +patches via E-Mail to gnunet-developers@gnu.org, formated with +`git format-patch`. + +In order to run the unit tests by hand (instead of using "make check"), +you need to set the environment variable "GNUNET_PREFIX" to the +directory where GNUnet's libraries are installed. +Before running any testcases, you must complete the installation. -In order to run the unit tests with by hand (instead of using -"make check"), you need to -set an environment variable ("GNUNET_PREFIX") to the directory -where GNUnet's libraries are installed. -Also, before running any testcases, you must -complete the installation first. Quick summary: +Quick summary: $ ./configure --prefix=$SOMEWHERE $ make $ make install +$ export $GNUNET_PREFIX=$SOMEWHERE $ make check -Some of the testcases require python >= 2.6 (+ the python module "futures") -and pexpect to be installed. If any testcases fail to pass on your system, run -"contrib/scripts/report.sh" (in the repository) or "gnunet-bugreport" -when you already have GNUnet installed and report the output together with -information about the failing testcase to the Mantis bugtracking +Some of the testcases require python >= 2.7, and the python modules +"python-future" (http://python-future.org/) and "pexpect" to be installed. +If any testcases fail to pass on your system, run +"contrib/scripts/gnunet-bugreport" (in the repository) or "gnunet-bugreport" +when you already have GNUnet installed and report its output together with +information about the failing testcase(s) to the Mantis bugtracking system at https://gnunet.org/bugs/. -- cgit v1.2.3 From a4f268904b7e0a29136376a4d5e95d0cf8faedc3 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 6 Jun 2018 12:18:30 +0000 Subject: documentation: Remove installation Signed-off-by: Nils Gillmann --- doc/documentation/Makefile.am | 1 - doc/documentation/chapters/installation.texi | 4149 -------------------------- doc/documentation/gnunet.texi | 20 +- 3 files changed, 2 insertions(+), 4168 deletions(-) delete mode 100644 doc/documentation/chapters/installation.texi diff --git a/doc/documentation/Makefile.am b/doc/documentation/Makefile.am index 0781b2fbb..12f40f147 100644 --- a/doc/documentation/Makefile.am +++ b/doc/documentation/Makefile.am @@ -113,7 +113,6 @@ info_TEXINFOS = \ gnunet_TEXINFOS = \ chapters/developer.texi \ chapters/preface.texi \ - chapters/installation.texi \ chapters/philosophy.texi \ chapters/user.texi \ chapters/vocabulary.texi \ diff --git a/doc/documentation/chapters/installation.texi b/doc/documentation/chapters/installation.texi deleted file mode 100644 index 665f980be..000000000 --- a/doc/documentation/chapters/installation.texi +++ /dev/null @@ -1,4149 +0,0 @@ -@node GNUnet Installation Handbook -@chapter GNUnet Installation Handbook - -This handbook describes how to install (build, setup, compile) and -setup (configure, start) GNUnet @value{VERSION}. After following these -instructions you should be able to install and then start user-interfaces -to interact with the network. - -Note: This manual is far from complete, and we welcome contributions, be -it in the form of new chapters or insightful comments. - -@menu -* Dependencies:: -* Pre-installation notes:: -* Generic installation instructions:: -* Build instructions for Ubuntu 12.04 using Git:: -* Build instructions for software builds from source:: -* Build Instructions for Microsoft Windows Platforms:: -* Build instructions for Debian 7.5:: -* Installing GNUnet from Git on Ubuntu 14.4:: -* Build instructions for Debian 8:: -* Build instructions for macOS:: -@c * Build instructions for OpenBSD 6.2:: -* Outdated build instructions for previous revisions:: -@c * Portable GNUnet:: -* The graphical configuration interface:: -* How to start and stop a GNUnet peer:: -@end menu - -@node Dependencies -@section Dependencies -@c %**end of header - -This section lists the various known dependencies for -GNUnet @value{EDITION}. -Suggestions for missing dependencies or wrong version numbers are welcome. - -@menu -* External dependencies:: -* Optional dependencies:: -* Internal dependencies:: -@end menu - -@node External dependencies -@subsection External dependencies -@c %**end of header - -These packages must be installed before a typical GNUnet installation -can be performed: - -@itemize @bullet -@item autoconf -@item automake -@item pkg-config -@item libltdl -@item gstreamer -@item gst-plugins-base -@item perl -@item python (only 2.7 supported)@footnote{tests and gnunet-qr} -@item jansson -@item nss -@item glib -@item gmp -@item bluez -@item miniupnpc -@item gettext -@item which -@item texinfo @geq{} 5.2 -@item GNU libmicrohttpd @geq{} 0.9.30 @footnote{We recommend to build it -with a GnuTLS version that was configured with libunbound} -@item GNU libextractor @geq{} 1.0 -@item GNU libtool @geq{} 2.2 -@item GNU libunistring @geq{} 0.9.1.1 -@item GNU libidn @geq{} 1.0.0 -@item @uref{https://gnupg.org/software/libgcrypt/, GNU libgcrypt} @geq{} -@uref{https://gnupg.org/ftp/gcrypt/libgcrypt/, 1.6.0} -@item @uref{https://gnutls.org/, GnuTLS} @geq{} 3.2.7 -@footnote{We recommend to compile with libunbound for DANE support; -GnuTLS also requires GNU nettle 2.7 (update: GnuTLS 3.2.7 appears NOT -to work against GNU nettle > 2.7, due to some API updatings done by -nettle. Thus it should be compiled against nettle 2.7 -and, in case you get some error on the reference to `rpl_strerror' being -undefined, follow the instructions on -@uref{http://lists.gnupg.org/pipermail/gnutls-devel/2013-November/006588.html, this} -post (and the link inside it)).} -@item @uref{https://gnunet.org/gnurl, gnURL} libgnurl @geq{} 7.34.0 -@footnote{must be compiled after @code{GnuTLS}} -@item libglpk @geq{} 4.45 -@item @uref{http://www.openssl.org/, OpenSSL} @geq{} 1.0 -@item TeX Live @geq{} 2012, optional (for gnunet-bcd) -@item Texinfo @geq{} 5.2 (for documentation) -@item libsqlite @geq{} 3.8.0 @footnote{(note that the code will -compile and often work with lower version numbers, but you may get subtle -bugs with respect to quota management in certain rare cases); -alternatively, MySQL or Postgres can also be installed, but those -databases will require more complex configurations (not -recommended for first-time users)} -@item zlib -@end itemize - -@node Optional dependencies -@subsection Optional dependencies - -These applications must be installed for various experimental or otherwise -optional features such as @command{gnunet-conversation}, -and @command{gnunet-conversation-gtk} (most of these features are only build if you -configure GNUnet with @command{--enable-experimental}): - -@itemize @bullet -@item libpulse @geq{} 2.0, -optional (for @command{gnunet-conversation}) -@item libopus @geq{} 1.0.1, -optional (for @command{gnunet-conversation}) -@item libogg @geq{} 1.3.0, -optional (for @command{gnunet-conversation}) -@item libnss contained @command{certool} binary, -optional for convenient installation of -the GNS proxy. -@item python-zbar @geq{} 0.10, -optional (for @command{gnunet-qr}) -@item Gtk+ @geq{} 3.0, -optional (for @command{gnunet-gtk}) -@item libgladeui (must match Gtk+ version), -optional (for @command{gnunet-gtk}) -@item libqrencode @geq{} 3.0, -optional (for @command{gnunet-namestore-gtk}) -@item libpbc @geq{} 0.5.14, optional for Attribute-Based Encryption and Identity Provider functionality -@item libgabe (https://github.com/schanzen/libgabe), optional for Attribute-Based Encryption and Identity Provider functionality -@end itemize - -@node Internal dependencies -@subsection Internal dependencies - -This section tries to give an overview of what processes a typical GNUnet -peer running a particular application would consist of. All of the -processes listed here should be automatically started by -@command{gnunet-arm -s}. -The list is given as a rough first guide to users for failure diagnostics. -Ideally, end-users should never have to worry about these internal -dependencies. - -In terms of internal dependencies, a minimum file-sharing system consists -of the following GNUnet processes (in order of dependency): - -@itemize @bullet -@item gnunet-service-arm -@item gnunet-service-resolver (required by all) -@item gnunet-service-statistics (required by all) -@item gnunet-service-peerinfo -@item gnunet-service-transport (requires peerinfo) -@item gnunet-service-core (requires transport) -@item gnunet-daemon-hostlist (requires core) -@item gnunet-daemon-topology (requires hostlist, peerinfo) -@item gnunet-service-datastore -@item gnunet-service-dht (requires core) -@item gnunet-service-identity -@item gnunet-service-fs (requires identity, mesh, dht, datastore, core) -@end itemize - -@noindent -A minimum VPN system consists of the following GNUnet processes (in -order of dependency): - -@itemize @bullet -@item gnunet-service-arm -@item gnunet-service-resolver (required by all) -@item gnunet-service-statistics (required by all) -@item gnunet-service-peerinfo -@item gnunet-service-transport (requires peerinfo) -@item gnunet-service-core (requires transport) -@item gnunet-daemon-hostlist (requires core) -@item gnunet-service-dht (requires core) -@item gnunet-service-mesh (requires dht, core) -@item gnunet-service-dns (requires dht) -@item gnunet-service-regex (requires dht) -@item gnunet-service-vpn (requires regex, dns, mesh, dht) -@end itemize - -@noindent -A minimum GNS system consists of the following GNUnet processes (in -order of dependency): - -@itemize @bullet -@item gnunet-service-arm -@item gnunet-service-resolver (required by all) -@item gnunet-service-statistics (required by all) -@item gnunet-service-peerinfo -@item gnunet-service-transport (requires peerinfo) -@item gnunet-service-core (requires transport) -@item gnunet-daemon-hostlist (requires core) -@item gnunet-service-dht (requires core) -@item gnunet-service-mesh (requires dht, core) -@item gnunet-service-dns (requires dht) -@item gnunet-service-regex (requires dht) -@item gnunet-service-vpn (requires regex, dns, mesh, dht) -@item gnunet-service-identity -@item gnunet-service-namestore (requires identity) -@item gnunet-service-gns (requires vpn, dns, dht, namestore, identity) -@end itemize - -@node Pre-installation notes -@section Pre-installation notes - -Please note that in the code instructions for the installation, -@emph{#} indicates commands run as privileged root user and -@emph{$} shows commands run as unprivileged ("normal") system user. - - -@node Generic installation instructions -@section Generic installation instructions - -First, in addition to the GNUnet sources you might require downloading the -latest version of various dependencies, depending on how recent the -software versions in your distribution of GNU/Linux are. -Most distributions do not include sufficiently recent versions of these -dependencies. -Thus, a typically installation on a "modern" GNU/Linux distribution -requires you to install the following dependencies (ideally in this -order): - -@itemize @bullet -@item libgpgerror and libgcrypt -@item libnettle and libunbound (possibly from distribution), GnuTLS -@item libgnurl (read the README) -@item GNU libmicrohttpd -@item GNU libextractor -@end itemize - -Make sure to first install the various mandatory and optional -dependencies including development headers from your distribution. - -Other dependencies that you should strongly consider to install is a -database (MySQL, sqlite or Postgres). -The following instructions will assume that you installed at least sqlite. -For most distributions you should be able to find pre-build packages for -the database. Again, make sure to install the client libraries @b{and} the -respective development headers (if they are packaged separately) as well. - -You can find specific, detailed instructions for installing of the -dependencies (and possibly the rest of the GNUnet installation) in the -platform-specific descriptions, which can be found in the Index. -Please consult them now. -If your distribution is not listed, please study -@ref{Build instructions for Debian 8}, the build instructions for -Debian stable, carefully as you try to install the dependencies for your -own distribution. -Contributing additional instructions for further platforms is always -appreciated. -Please take in mind that operating system development tends to move at -a rather fast speed. Due to this you should be aware that some of -the instructions could be outdated by the time you are reading this. -If you find a mistake, please tell us about it (or even better: send -a patch to the documentation to fix it!). - -Before proceeding further, please double-check the dependency list. -Note that in addition to satisfying the dependencies, you might have to -make sure that development headers for the various libraries are also -installed. -There maybe files for other distributions, or you might be able to find -equivalent packages for your distribution. - -While it is possible to build and install GNUnet without having root -access, we will assume that you have full control over your system in -these instructions. -First, you should create a system user @emph{gnunet} and an additional -group @emph{gnunetdns}. On the GNU/Linux distributions Debian and Ubuntu, -type: - -@example -# adduser --system --home /var/lib/gnunet --group \ ---disabled-password gnunet -# addgroup --system gnunetdns -@end example - -@noindent -On other Unixes and GNU systems, this should have the same effect: - -@example -# useradd --system --groups gnunet --home-dir /var/lib/gnunet -# addgroup --system gnunetdns -@end example - -Now compile and install GNUnet using: - -@example -$ tar xvf gnunet-@value{VERSION}.tar.gz -$ cd gnunet-@value{VERSION} -$ ./configure --with-sudo=sudo --with-nssdir=/lib -$ make -$ sudo make install -@end example - -If you want to be able to enable DEBUG-level log messages, add -@code{--enable-logging=verbose} to the end of the -@command{./configure} command. -@code{DEBUG}-level log messages are in English only and -should only be useful for developers (or for filing -really detailed bug reports). - -Finally, you probably want to compile @command{gnunet-gtk}, which -includes @command{gnunet-setup} (a graphical tool for -GNUnet configuration) and @command{gnunet-fs-gtk} (a graphical tool for -GNUnet file-sharing): - -@example -$ tar xvf gnunet-gtk-@value{VERSION}.tar.gz -$ cd gnunet-gtk-@value{VERSION} -$ ./configure --with-gnunet=/usr/local/ -$ make -$ sudo make install -$ cd .. -# just to be safe run this: -$ sudo ldconfig -@end example - -@noindent -Next, edit the file @file{/etc/gnunet.conf} to contain the following: - -@example -[arm] -SYSTEM_ONLY = YES -USER_ONLY = NO -@end example - -@noindent -You may need to update your @code{ld.so} cache to include -files installed in @file{/usr/local/lib}: - -@example -# ldconfig -@end example - -@noindent -Then, switch from user @code{root} to user @code{gnunet} to start -the peer: - -@example -# su -s /bin/sh - gnunet -$ gnunet-arm -c /etc/gnunet.conf -s -@end example - -You may also want to add the last line in the gnunet user's @file{crontab} -prefixed with @code{@@reboot} so that it is executed whenever the system -is booted: - -@example -@@reboot /usr/local/bin/gnunet-arm -c /etc/gnunet.conf -s -@end example - -@noindent -This will only start the system-wide GNUnet services. -Type exit to get back your root shell. -Now, you need to configure the per-user part. For each -$USER that should get access to GNUnet on the system, run: - -@example -# adduser $USER gnunet -@end example - -@noindent -to allow them to access the system-wide GNUnet services. Then, each -user should create a configuration file @file{~/.config/gnunet.conf} -with the lines: - -@example -[arm] -SYSTEM_ONLY = NO -USER_ONLY = YES -DEFAULTSERVICES = gns -@end example - -@noindent -and start the per-user services using - -@example -$ gnunet-arm -c ~/.config/gnunet.conf -s -@end example - -@noindent -Again, adding a @code{crontab} entry to autostart the peer is advised: - -@example -@@reboot /usr/local/bin/gnunet-arm -c $HOME/.config/gnunet.conf -s -@end example - -@noindent -Note that some GNUnet services (such as SOCKS5 proxies) may need a -system-wide TCP port for each user. -For those services, systems with more than one user may require each user -to specify a different port number in their personal configuration file. - -Finally, the user should perform the basic initial setup for the GNU Name -System (GNS) certificate authority. This is done by running: - -@example -$ gnunet-gns-proxy-setup-ca -@end example - -@noindent -The first generates the default zones, wheras the second setups the GNS -Certificate Authority with the user's browser. Now, to activate GNS in the -normal DNS resolution process, you need to edit your -@file{/etc/nsswitch.conf} where you should find a line like this: - -@example -hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 -@end example - -@noindent -The exact details may differ a bit, which is fine. Add the text -@emph{"gns [NOTFOUND=return]"} after @emph{"files"}. -Keep in mind that we included a backslash ("\") here just for -markup reasons. You should write the text below on @b{one line} -and @b{without} the "\": - -@example -hosts: files gns [NOTFOUND=return] mdns4_minimal \ -[NOTFOUND=return] dns mdns4 -@end example - -@c FIXME: Document new behavior. -You might want to make sure that @file{/lib/libnss_gns.so.2} exists on -your system, it should have been created during the installation. - -@node Build instructions for Ubuntu 12.04 using Git -@section Build instructions for Ubuntu 12.04 using Git - -@menu -* Install the required build tools:: -* Install libgcrypt 1.6 and libgpg-error:: -* Install gnutls with DANE support:: -* Install libgnurl:: -* Install libmicrohttpd from Git:: -* Install libextractor from Git:: -* Install GNUnet dependencies:: -* Build GNUnet:: -* Install the GNUnet-gtk user interface from Git:: -@end menu - -@node Install the required build tools -@subsection Install the required build tools - -First, make sure Git is installed on your system: - -@example -$ sudo apt-get install git -@end example - -Install the essential buildtools: - -@example -$ sudo apt-get install automake autopoint autoconf libtool -@end example - -@node Install libgcrypt 1.6 and libgpg-error -@subsection Install libgcrypt 1.6 and libgpg-error - -@ref{generic source installation - libgpg-error} - -@node Install gnutls with DANE support -@subsection Install gnutls with DANE support - -@itemize @bullet -@item @ref{generic source installation - nettle} -@item @ref{generic source installation - ldns} -@item @ref{generic source installation - libunbound/unbound} -@item @ref{generic source installation - gnutls} -@item @ref{generic source installation - libgcrypt} -@end itemize - -@node Install libgnurl -@subsection Install libgnurl - -Follow the @ref{generic source installation - libgnurl}. - -@node Install libmicrohttpd from Git -@subsection Install libmicrohttpd from Git - -@example -$ git clone https://gnunet.org/git/libmicrohttpd -$ cd libmicrohttpd/ -$ ./bootstrap -$ ./configure -$ sudo make install ; cd .. -@end example - -@node Install libextractor from Git -@subsection Install libextractor from Git - -Install libextractor dependencies: - -@example -$ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \ - libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \ - libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \ - g++ -@end example - -Build libextractor: - -@example -$ git clone https://gnunet.org/git/libextractor -$ cd libextractor -$ ./bootstrap -$ ./configure -$ sudo make install ; cd .. -@end example - -@node Install GNUnet dependencies -@subsection Install GNUnet dependencies - -@example -$ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \ - libpulse-dev libbluetooth-dev libsqlite-dev -@end example - -Install libopus: - -@example -$ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz -$ tar xf opus-1.1.tar.gz -$ cd opus-1.1/ -$ ./configure -$ sudo make install ; cd .. -@end example - -Choose one or more database backends: - -SQLite3: -@example -$ sudo apt-get install libsqlite3-dev -@end example -MySQL: -@example -$ sudo apt-get install libmysqlclient-dev -@end example -PostgreSQL: -@example -$ sudo apt-get install libpq-dev postgresql -@end example - - - -@node Build GNUnet -@subsection Build GNUnet - - - -@menu -* Configuring the installation path:: -* Configuring the system:: -* Installing components requiring sudo permission:: -* Build:: -@end menu - -@node Configuring the installation path -@subsubsection Configuring the installation path - -You can specify the location of the GNUnet installation by setting the -prefix when calling the configure script with @code{--prefix=DIRECTORY} - -@example -$ export PATH=$PATH:DIRECTORY/bin -@end example - -@node Configuring the system -@subsubsection Configuring the system - -Please make sure NOW that you have created a user and group 'gnunet' -and additionally a group 'gnunetdns': - -@example -$ sudo addgroup gnunet -$ sudo addgroup gnunetdns -$ sudo adduser gnunet -@end example - -Each GNUnet user should be added to the 'gnunet' group (may -require fresh login to come into effect): - -@example -$ sudo useradd -G gnunet -@end example - -@node Installing components requiring sudo permission -@subsubsection Installing components requiring sudo permission - -Some components, like the nss plugin required for GNS, may require root -permissions. To allow these few components to be installed use: - -@example -$ ./configure --with-sudo -@end example - -@node Build -@subsubsection Build - -@example -$ git clone https://gnunet.org/git/gnunet/ -$ cd gnunet/ -$ ./bootstrap -@end example - -Use the required configure call including the optional installation prefix -@code{PREFIX} or the sudo permissions: - -@example -$ ./configure [ --with-sudo | --with-prefix=PREFIX ] -@end example - -@example -$ make; sudo make install -@end example - -After installing it, you need to create an empty configuration file: - -@example -mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf -@end example - -And finally you can start GNUnet with: - -@example -$ gnunet-arm -s -@end example - -@node Install the GNUnet-gtk user interface from Git -@subsection Install the GNUnet-gtk user interface from Git - - -Install depencies: - -@example -$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \ - libqrencode-dev -@end example - -Build GNUnet (with an optional prefix) and execute: - -@example -$ git clone https://gnunet.org/git/gnunet-gtk/ -$ cd gnunet-gtk/ -$ ./bootstrap -$ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY -$ make; sudo make install -@end example - -@node Build instructions for software builds from source -@section Build instructions for software builds from source - -This section describes software builds in case your operating -system lacks binary substitutes / binary builds for some dependencies -of GNUnet. -It is assumed that you have installed common build dependencies -and that these instructions are treated as generic without any -debugging help. -It is furthermore assumed that you use the release tarballs of -the software, installation from the respective version control -sources might differ in ways that are only minimal different -(for example a dependency on autotools etc). - -@menu -* generic source installation - nettle:: -* generic source installation - ldns:: -* generic source installation - libunbound/unbound:: -* generic source installation - libav:: -* generic source installation - libextractor:: -* generic source installation - libgpg-error:: -* generic source installation - libgcrypt:: -* generic source installation - gnutls:: -* generic source installation - libmicrohttpd:: -* generic source installation - libgnurl:: -@end menu - -@node generic source installation - nettle -@subsection generic source installation - nettle - -@example -$ wget http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz -$ tar xf nettle-2.7.1.tar.gz -$ cd nettle-2.7.1 -$ ./configure -$ sudo make install ; cd .. -@end example - -@node generic source installation - ldns -@subsection generic source installation - ldns - -@example -$ wget https://www.nlnetlabs.nl/downloads/ldns/ldns-1.6.16.tar.gz -$ tar xf ldns-1.6.16.tar.gz -$ cd ldns-1.6.16 -$ ./configure -$ sudo make install ; cd .. -@end example - -@node generic source installation - libunbound/unbound -@subsection generic source installation - libunbound/unbound - -@example -$ wget https://unbound.net/downloads/unbound-1.4.21.tar.gz -$ tar xf unbound-1.4.21.tar.gz -$ cd unbound-1.4.21 -$ ./configure -$ sudo make install ; cd .. -@end example - -@node generic source installation - libav -@subsection generic source installation - libav - -@example -$ wget https://libav.org/releases/libav-9.10.tar.xz -$ cd libav-0.9 ; ./configure --enable-shared; -$ make; sudo make install; cd .. -@end example - -@node generic source installation - libextractor -@subsection generic source installation - libextractor - -@example -$ wget https://ftp.gnu.org/gnu/libextractor/libextractor-1.3.tar.gz -$ tar xvf libextractor-1.3.tar.gz -$ cd libextractor-1.3 ; ./configure; -$ make ; sudo make install; cd .. -@end example - -@node generic source installation - libgpg-error -@subsection generic source installation - libgpg-error - -@example -$ wget https://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.bz2 -$ tar xvf libgpg-error-1.12.tar.bz2 -$ cd libgpg-error-1.12; ./configure; -$ make ; sudo make install; cd .. -@end example - -@node generic source installation - libgcrypt -@subsection generic source installation - libgcrypt -@example -$ wget https://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.0.tar.bz2 -$ tar xvf libgcrypt-1.6.0.tar.bz2 -$ cd libgcrypt-1.6.0; ./configure --with-gpg-error-prefix=/usr/local; -$ make ; sudo make install ; cd .. -@end example - -@node generic source installation - gnutls -@subsection generic source installation - gnutls - -@example -$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz -$ tar xvf gnutls-3.2.7.tar.xz -$ cd gnutls-3.2.7 -@end example - -@noindent -If you want a GnuTLS with DANE functionality (recommended for GNUnet), -you have to compile it against libunbound. Assuming that libunbound -is installed on your system: - -@example -$ ./configure --enable-libdane -@end example - -@noindent -Note that the build system of GnuTLS should pick up libunbound without -the explicit mention of @code{--enable-libdane}. -If you don't want libdane support you should pass @code{--disable-libdane} -instead. - -@example -$ ./configure -$ make ; sudo make install ; cd .. -@end example - -@node generic source installation - libmicrohttpd -@subsection generic source installation - libmicrohttpd - -@example -$ wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.33.tar.gz -$ tar xvf libmicrohttpd-0.9.33.tar.gz -$ cd libmicrohttpd-0.9.33; ./configure; -$ make ; sudo make install ; cd .. -@end example - -@node generic source installation - libgnurl -@subsection generic source installation - libgnurl - -Example installation of libgnurl version 7.57.0 from source. - -@example -$ wget https://ftp.gnu.org/gnu/gnunet/gnurl-7.57.0.tar.xz -$ wget https://ftp.gnu.org/gnu/gnunet/gnurl-7.57.0.tar.xz.sig -$ gpg --verify gnurl-7.57.0.tar.xz.sig -@end example - -@noindent -If that command fails because you do not have the required public key, -then run this command to import it: - -@example -$ gpg --keyserver pgp.mit.edu --recv-keys A88C8ADD129828D7EAC02E52E22F9BBFEE348588 -@end example - -@noindent -and rerun the gpg --verify command. - -@example -$ tar xvf gnurl-7.57.0.tar.xz -$ cd gnurl-7.57.0 -$ ./configure --disable-ntlm-wb -$ make ; sudo make install; cd .. -@end example - -You have now build and installed libgnurl from source. - -@menu -* Fixing libgnurl build issues:: -@end menu - -@node Fixing libgnurl build issues -@subsubsection Fixing libgnurl build issues - -@c FIXME: Obviously this subsection should be evaluated and -@c if still necessary moved into gnURL itself (README) or -@c into a separate section which deals with gnURL. -If you have to compile libgnurl from source (for example if the version -included in your distribution is too old or it's not included at all) -you perhaps might get an error message while running the -@command{configure} script: - -@example -$ configure -... -checking for 64-bit curl_off_t data type... unknown -checking for 32-bit curl_off_t data type... unknown -checking for 16-bit curl_off_t data type... unknown -configure: error: cannot find data type for curl_off_t. -@end example - -@noindent -Solution: - -Before running the @command{configure} script, set: - -@example -CFLAGS="-I. -I$BUILD_ROOT/include" -@end example - -@node Build Instructions for Microsoft Windows Platforms -@section Build Instructions for Microsoft Windows Platforms - -@menu -* Introduction to building on MS Windows:: -* Requirements:: -* Dependencies & Initial Setup:: -* GNUnet Installation:: -* Adjusting Windows for running and testing GNUnet:: -* Building the GNUnet Installer:: -* Using GNUnet with Netbeans on Windows:: -@end menu - -@node Introduction to building on MS Windows -@subsection Introduction to building on MS Windows - - -This document is a guide to building GNUnet and its dependencies on -Windows platforms. GNUnet development is mostly done under GNU/Linux and -especially git checkouts may not build out of the box. -We regret any inconvenience, and if you have problems, please report -them. - -@node Requirements -@subsection Requirements - -The Howto is based upon a @strong{Windows Server 2008 32bit} -@strong{Installation}, @strong{sbuild} and thus a -@uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW} -(W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild -is a convenient set of scripts which creates a working msys/mingw -installation and installs most dependencies required for GNUnet. - -As of the point of the creation of these instructions, -GNUnet @strong{requires} a Windows @strong{Server} 2003 or -newer for full feature support. -Windows Vista and later will also work, but -@strong{non-server version can not run a VPN-Exit-Node} as the NAT -features have been removed as of Windows Vista. - -@c TODO: We should document Windows 10! -@c It seems like the situation hasn't changed with W10 - -@node Dependencies & Initial Setup -@subsection Dependencies & Initial Setup - - -@itemize @bullet - -@item -Install a fresh version of @strong{Python 2.x}, even if you are using a -x64-OS, install a 32-bit version for use with sbuild. -Python 3.0 is currently incompatible. - -@item -Install your favorite @uref{http://code.google.com/p/tortoisegit/, git} & -@uref{http://tortoisesvn.net/, subversion}-clients. - -@item -You will also need some archive-manager like -@uref{http://www.7-zip.org/, 7zip}. - -@item -Pull a copy of sbuild to a directory of your choice, which will be used -in the remainder of this guide. For now, we will use -@file{c:\gnunet\sbuild\} - -@item -in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages -@strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild -to compile/install those for us. - -@item -Follow LRN's sbuild installation instructions.- -@end itemize - -Please note that sbuild may (or will most likely) fail during -installation, thus you really HAVE to @strong{check the logfiles} created -during the installation process. -Certain packages may fail to build initially due to missing dependencies, -thus you may have to -@strong{substitute those with binary-versions initially}. Later on once -dependencies are satisfied you can re-build the newer package versions. - -@strong{It is normal that you may have to repeat this step multiple times -and there is no uniform way to fix all compile-time issues, as the -build-process of many of the dependencies installed are rather unstable -on win32 and certain releases may not even compile at all.} - -Most dependencies for GNUnet have been set up by sbuild, thus we now -should add the @file{bin/} directories in your new msys and mingw -installations to PATH. You will want to create a backup of your finished -msys-environment by now. - -@node GNUnet Installation -@subsection GNUnet Installation - -First, we need to launch our msys-shell, you can do this via - -@file{C:\gnunet\sbuild\msys\msys.bat} - -You might wish to take a look at this file and adjust some -login-parameters to your msys environment. - -Also, sbuild added two pointpoints to your msys-environment, though those -might remain invisible: - -@itemize @bullet - -@item -/mingw, which will mount your mingw-directory from sbuild/mingw and the -other one is - -@item -/src which contains all the installation sources sbuild just compiled. -@end itemize - -Check out the current GNUnet sources (git HEAD) from the -GNUnet repository "gnunet.git", we will do this in your home directory: - -@code{git clone https://gnunet.org/git/gnunet/ ~/gnunet} - -Now, we will first need to bootstrap the checked out installation and then -configure it accordingly. - -@example -cd ~/gnunet -./bootstrap -STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \ -./configure --prefix=/ --docdir=/share/doc/gnunet \ ---with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \ ---with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \ ---with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \ ---enable-expensivetests --enable-experimental --with-qrencode=/mingw \ ---enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log -@end example - -The parameters above will configure for a reasonable GNUnet installation -to the your msys-root directory. -Depending on which features your would like to build or you may need to -specify additional dependencies. Sbuild installed most libs into -the /mingw subdirectory, so remember to prefix library locations with -this path. - -Like on a unixoid system, you might want to use your home directory as -prefix for your own GNUnet installation for development, without tainting -the buildenvironment. Just change the "prefix" parameter to point towards -~/ in this case. - -Now it's time to compile GNUnet as usual. Though this will take some time, -so you may fetch yourself a coffee or some Mate now... - -@example -make ; make install -@end example - -@node Adjusting Windows for running and testing GNUnet -@subsection Adjusting Windows for running and testing GNUnet - -Assuming the build succeeded and you -@strong{added the bin directory of your GNUnet to PATH}, you can now use -your gnunet-installation as usual. -Remember that UAC or the windows firewall may popup initially, blocking -further execution of gnunet until you acknowledge them. - -You will also have to take the usual steps to get peer-to-peer (p2p) -software running properly (port forwarding, ...), -and GNUnet will require administrative permissions as it may even -install a device-driver (in case you are using gnunet-vpn and/or -gnunet-exit). - -@node Building the GNUnet Installer -@subsection Building the GNUnet Installer - -The GNUnet installer is made with -@uref{http://nsis.sourceforge.net/, NSIS}. -The installer script is located in @file{contrib\win} in the -GNUnet source tree. - -@node Using GNUnet with Netbeans on Windows -@subsection Using GNUnet with Netbeans on Windows - -TODO - -@node Build instructions for Debian 7.5 -@section Build instructions for Debian 7.5 - - -These are the installation instructions for Debian 7.5. They were tested -using a minimal, fresh Debian 7.5 AMD64 installation without non-free -software (no contrib or non-free). -By "minimal", we mean that during installation, we did not select any -desktop environment, servers or system utilities during the "tasksel" -step. Note that the packages and the dependencies that we will install -during this chapter take about 1.5 GB of disk space. -Combined with GNUnet and space for objects during compilation, you should -not even attempt this unless you have about 2.5 GB free after the minimal -Debian installation. -Using these instructions to build a VM image is likely to require a -minimum of 4-5 GB for the VM (as you will likely also want a desktop -manager). - -GNUnet's security model assumes that your @file{/home} directory is -encrypted. Thus, if possible, you should encrypt your home partition -(or per-user home directory). - -Naturally, the exact details of the starting state for your installation -should not matter much. For example, if you selected any of those -installation groups you might simply already have some of the necessary -packages installed. -We did this for testing, as this way we are less likely to forget to -mention a required package. -Note that we will not install a desktop environment, but of course you -will need to install one to use GNUnet's graphical user interfaces. -Thus, it is suggested that you simply install the desktop environment of -your choice before beginning with the instructions. - - - -@menu -* Update:: -* Stable? Hah!:: -* Update again:: -* Installing packages:: -* Installing dependencies from source:: -* Installing GNUnet from source:: -* But wait there is more!:: -@end menu - -@node Update -@subsection Update - -After any installation, you should begin by running - -@example -# apt-get update ; apt-get upgrade -@end example - -to ensure that all of your packages are up-to-date. Note that the "#" is -used to indicate that you need to type in this command as "root" -(or prefix with "sudo"), whereas "$" is used to indicate typing in a -command as a normal user. - -@node Stable? Hah! -@subsection Stable? Hah! - -Yes, we said we start with a Debian 7.5 "stable" system. However, to -reduce the amount of compilation by hand, we will begin by allowing the -installation of packages from the testing and unstable distributions as -well. -We will stick to "stable" packages where possible, but some packages will -be taken from the other distributions. -Start by modifying @file{/etc/apt/sources.list} to contain the -following (possibly adjusted to point to your mirror of choice): - -@example -# These were there before: -deb http://ftp.de.debian.org/debian/ wheezy main -deb-src http://ftp.de.debian.org/debian/ wheezy main -deb http://security.debian.org/ wheezy/updates main -deb-src http://security.debian.org/ wheezy/updates main -deb http://ftp.de.debian.org/debian/ wheezy-updates main -deb-src http://ftp.de.debian.org/debian/ wheezy-updates main - -# Add these lines (feel free to adjust the mirror): -deb http://ftp.de.debian.org/debian/ testing main -deb http://ftp.de.debian.org/debian/ unstable main -@end example - -The next step is to create/edit your @file{/etc/apt/preferences} -file to look like this: - -@example -Package: * -Pin: release a=stable,n=wheezy -Pin-Priority: 700 - -Package: * -Pin: release o=Debian,a=testing -Pin-Priority: 650 - -Package: * -Pin: release o=Debian,a=unstable -Pin-Priority: 600 -@end example - -You can read more about Apt Preferences here and here. -Note that other pinnings are likely to also work for GNUnet, the key -thing is that you need some packages from unstable (as shown below). -However, as unstable is unlikely to be comprehensive (missing packages) -or might be problematic (crashing packages), you probably want others -from stable and/or testing. - -@node Update again -@subsection Update again - -Now, run again@ - -@example -# apt-get update@ -# apt-get upgrade@ -@end example - -to ensure that all your new distribution indices are downloaded, and -that your pinning is correct: the upgrade step should cause no changes -at all. - -@node Installing packages -@subsection Installing packages - -We begin by installing a few Debian packages from stable:@ - -@example -# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ - libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \ - texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \ - libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \ - libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \ - librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \ - libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \ - libqrencode-dev libgladeui-dev nasm texlive-latex-extra \ - libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev -@end example - -After that, we install a few more packages from unstable:@ - -@example -# apt-get install -t unstable nettle-dev libgstreamer1.0-dev \ - gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ - libgstreamer-plugins-base1.0-dev -@end example - -@node Installing dependencies from source -@subsection Installing dependencies from source - -Next, we need to install a few dependencies from source. -You might want to do this as a "normal" user and only run the -@code{make install} steps as root (hence the @code{sudo} in the -commands below). Also, you do this from any -directory. We begin by downloading all dependencies, then extracting the -sources, and finally compiling and installing the libraries. - -For these steps, follow the instructions given in the -installation from source instruction in this order: - -@itemize @bullet -@item @ref{generic source installation - libav} -@item @ref{generic source installation - libextractor} -@item @ref{generic source installation - libgpg-error} -@item @ref{generic source installation - libgcrypt} -@item @ref{generic source installation - gnutls} -@item @ref{generic source installation - libmicrohttpd} -@item @ref{generic source installation - libgnurl} -@end itemize - -@node Installing GNUnet from source -@subsection Installing GNUnet from source - - -For this, simply follow the generic installation instructions from -here. - -@node But wait there is more! -@subsection But wait there is more! - -So far, we installed all of the packages and dependencies required to -ensure that all of GNUnet would be built. -However, while for example the plugins to interact with the MySQL or -Postgres databases have been created, we did not actually install or -configure those databases. Thus, you will need to install -and configure those databases or stick with the default Sqlite database. -Sqlite is usually fine for most applications, but MySQL can offer better -performance and Postgres better resillience. - - -@node Installing GNUnet from Git on Ubuntu 14.4 -@section Installing GNUnet from Git on Ubuntu 14.4 - -@strong{Install the required build tools:} - -@example -$ sudo apt-get install git automake autopoint autoconf -@end example - -@strong{Install the required dependencies} - -@example -$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ - libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ - libmicrohttpd-dev libgnutls28-dev -@end example - -@strong{Choose one or more database backends} - -@itemize @bullet - -@item SQLite3: - -@example -$ sudo apt-get install libsqlite3-dev -@end example - -@item MySQL: - -@example -$ sudo apt-get install libmysqlclient-dev -@end example - -@item PostgreSQL: - -@example -$ sudo apt-get install libpq-dev postgresql -@end example - -@end itemize - -@strong{Install the optional dependencies for gnunet-conversation:} - -@example -$ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev -@end example - -@strong{Install the libgrypt 1.6.1:} - -@itemize @bullet - -@item For Ubuntu 14.04: - -@example -$ sudo apt-get install libgcrypt20-dev -@end example - -@item For Ubuntu older 14.04: - -@example -$ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 -$ tar xf libgcrypt-1.6.1.tar.bz2 -$ cd libgcrypt-1.6.1 -$ ./configure -$ sudo make install -$ cd .. -@end example - -@end itemize - -@strong{Install libgnurl} - -@example -$ wget https://gnunet.org/sites/default/files/gnurl-7.35.0.tar.bz2 -$ tar xf gnurl-7.35.0.tar.bz2 -$ cd gnurl-7.35.0 -$ ./configure --enable-ipv6 --with-gnutls --without-libssh2 \ - --without-libmetalink --without-winidn --without-librtmp \ - --without-nghttp2 --without-nss --without-cyassl --without-polarssl \ - --without-ssl --without-winssl --without-darwinssl --disable-sspi \ - --disable-ntlm-wb --disable-ldap --disable-rtsp --disable-dict \ - --disable-telnet --disable-tftp --disable-pop3 --disable-imap \ - --disable-smtp --disable-gopher --disable-file --disable-ftp -$ sudo make install -$ cd .. -@end example - -@strong{Install GNUnet} - -@example -$ git clone https://gnunet.org/git/gnunet/ -$ cd gnunet/ -$ ./bootstrap -@end example - -If you want to: - -@itemize @bullet - -@item Install to a different directory: - -@example ---prefix=PREFIX -@end example - -@item -Have sudo permission, but do not want to compile as root: - -@example ---with-sudo -@end example - -@item -Want debug message enabled: - -@example ---enable-logging=verbose -@end example - -@end itemize - - -@example -$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] -$ make; sudo make install -@end example - -After installing it, you need to create an empty configuration file: - -@example -touch ~/.config/gnunet.conf -@end example - -And finally you can start GNUnet with - -@example -$ gnunet-arm -s -@end example - -@node Build instructions for Debian 8 -@section Build instructions for Debian 8 -@c FIXME: I -> we - -These are the installation instructions for Debian 8. They were tested -sing a fresh Debian 8 AMD64 installation without non-free software (no -contrib or non-free). During installation, I only selected "lxde" for the -desktop environment. -Note that the packages and the dependencies that we will install during -this chapter take about 1.5 GB of disk space. Combined with GNUnet and -space for objects during compilation, you should not even attempt this -unless you have about 2.5 GB free after the Debian installation. -Using these instructions to build a VM image is likely to require a -minimum of 4-5 GB for the VM (as you will likely also want a desktop -manager). - -GNUnet's security model assumes that your @code{/home} directory is -encrypted. -Thus, if possible, you should encrypt your entire disk, or at least just -your home partition (or per-user home directory). - -Naturally, the exact details of the starting state for your installation -should not matter much. -For example, if you selected any of those installation groups you might -simply already have some of the necessary packages installed. Thus, it is -suggested that you simply install the desktop environment of your choice -before beginning with the instructions. - - -@menu -* Update Debian:: -* Installing Debian Packages:: -* Installing Dependencies from Source2:: -* Installing GNUnet from Source2:: -* But wait (again) there is more!:: -@end menu - -@node Update Debian -@subsection Update Debian - -After any installation, you should begin by running - -@example -# apt-get update -# apt-get upgrade -@end example - -to ensure that all of your packages are up-to-date. Note that the "#" is -used to indicate that you need to type in this command as "root" (or -prefix with "sudo"), whereas "$" is used to indicate typing in a command -as a normal user. - -@node Installing Debian Packages -@subsection Installing Debian Packages - -We begin by installing a few Debian packages from stable: - -@example -# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ -libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \ -libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \ -libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \ -libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \ -libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \ -texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \ -libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ -libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \ -libgcrypt20-dev libmicrohttpd-dev -@end example - -@node Installing Dependencies from Source2 -@subsection Installing Dependencies from Source2 - -Yes, we said we start with a Debian 8 "stable" system, but because Debian -linked GnuTLS without support for DANE, we need to compile a few things, -in addition to GNUnet, still by hand. Yes, you can run GNUnet using the -respective Debian packages, but then you will not get DANE support. - -Next, we need to install a few dependencies from source. You might want -to do this as a "normal" user and only run the @code{make install} steps -as root (hence the @code{sudo} in the commands below). Also, you do this -from any directory. We begin by downloading all dependencies, then -extracting the sources, and finally compiling and installing the -libraries: - -@example -$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz -$ tar xvf gnutls-3.3.12.tar.xz -$ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd .. -@end example - -For the installation and compilation of libgnurl/gnURL refer to -the generic installation section, -@xref{generic source installation - libgnurl}. - -@node Installing GNUnet from Source2 -@subsection Installing GNUnet from Source2 - -For this, simply follow the generic installation instructions from@ -here. - -@node But wait (again) there is more! -@subsection But wait (again) there is more! - -So far, we installed all of the packages and dependencies required to -ensure that all of GNUnet would be built. However, while for example the -plugins to interact with the MySQL or Postgres databases have been -created, we did not actually install or configure those databases. -Thus, you will need to install and configure those databases or stick -with the default Sqlite database. Sqlite is usually fine for most -applications, but MySQL can offer better performance and Postgres better -resillience. - -@node Build instructions for macOS -@section Build instructions for macOS -@c FIXME: I -> we - -These are the installation guidelines for macOS. -They were tested on macOS High Sierra. - -@menu -* Installing dependencies:: -* Compile from Source:: -@end menu - -@node Installing dependencies -@subsection Installing dependencies - -First, install XCode in the newest version. -See https://developer.apple.com/xcode/. - -Install Homebrew (https://brew.sh) and then install the dependencies listed above. -If a dependency does not exists in brew, you need to compile it from source. - -@example -# brew install -@end example - -@node Compile from Source -@subsection Compile from Source - -Before you start building GNUnet, you need to setup your environment. -This means that you have to make sure the proper tools are used in the build process. -For example, after installing texinfo you need to make sure the new texinfo is actually used: - -@example -# echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.bash_profile -@end example - -Note: brew tells you the appropriate command when executing - -@example -# brew info texinfo -@end example - -This may also be necessary for the gettext package. - -Before you start compiling, you need to make sure gcc is used and not the clang compile of your macOS system. -On my system, gcc was actually ``gcc-7'' and gcc pointed to the clang compiler. - -@example -# export CC=gcc-7 -@end example - -After this the standard compile instructions apply. - -@c @node Build instructions for OpenBSD 6.2 -@c @section Build instructions for OpenBSD 6.2 - -@node Outdated build instructions for previous revisions -@section Outdated build instructions for previous revisions - -This chapter contains a collection of outdated, older installation guides. -They are mostly intended to serve as a starting point for writing -up-to-date instructions and should not be expected to work for -GNUnet 0.10.x. -A set of older installation instructions can also be found in the -file @file{doc/outdated-and-old-installation-instructions.txt} in the -source tree of GNUnet. - -This file covers old instructions which no longer receive security -updates or any kind of support. - -@menu -* Installing GNUnet 0.10.1 on Ubuntu 14.04:: -* Building GLPK for MinGW:: -* GUI build instructions for Ubuntu 12.04 using Subversion:: -@c * Installation with gnunet-update:: -* Instructions for Microsoft Windows Platforms (Old):: -@end menu - - -@node Installing GNUnet 0.10.1 on Ubuntu 14.04 -@subsection Installing GNUnet 0.10.1 on Ubuntu 14.04 - -Install the required dependencies: - -@example -$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ - libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ - libmicrohttpd-dev libgnutls28-dev -@end example - -Choose one or more database backends: - -@itemize @bullet - -@item SQLite3 - -@example - $ sudo apt-get install libsqlite3-dev@ -@end example - -@item MySQL - -@example -$ sudo apt-get install libmysqlclient-dev@ -@end example - -@item PostgreSQL - -@example - $ sudo apt-get install libpq-dev postgresql@ -@end example - -@end itemize - -Install the optional dependencies for gnunet-conversation: - -@example - $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev -@end example - -Install libgcrypt 1.6: - -@itemize @bullet - -@item For Ubuntu 14.04: - -@example -$ sudo apt-get install libgcrypt20-dev -@end example - -@item For Ubuntu older than 14.04: - -@example -wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 -$ tar xf libgcrypt-1.6.1.tar.bz2 -$ cd libgcrypt-1.6.1 -$ ./configure -$ sudo make install -$ cd .. -@end example -@end itemize - -Install libgnurl: - -@pxref{generic source installation - libgnurl}. - -Install GNUnet: - -@example -$ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz -$ tar xf gnunet-0.10.1.tar.gz -$ cd gnunet-0.10.1 -@end example - -If you want to: - -@itemize @bullet - -@item -Install to a different directory: - -@example ---prefix=PREFIX -@end example - -@item -Have sudo permission, but do not want to compile as root: - -@example ---with-sudo -@end example - -@item -Want debug message enabled: - -@example ---enable-logging=verbose -@end example - -@end itemize - -@example -$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] -$ make; sudo make install -@end example - -After installing it, you need to create an empty configuration file: - -@example -touch ~/.config/gnunet.conf -@end example - -And finally you can start GNUnet with - -@example -$ gnunet-arm -s -@end example - -@node Building GLPK for MinGW -@subsection Building GLPK for MinGW - -GNUnet now requires the GNU Linear Programming Kit (GLPK). -Since there's is no package you can install with @code{mingw-get} you -have to compile it from source: - -@itemize @bullet - -@item Download the latest version from -@uref{http://ftp.gnu.org/gnu/glpk/} - -@item Unzip the downloaded source tarball using your favourite -unzipper application In the MSYS shell - -@item change to the respective directory - -@item Configure glpk for "i686-pc-mingw32": - -@example -./configure '--build=i686-pc-mingw32' -@end example - -@item run - -@example -make install check -@end example - -@end itemize - -MinGW does not automatically detect the correct buildtype so you have to -specify it manually. - - -@node GUI build instructions for Ubuntu 12.04 using Subversion -@subsection GUI build instructions for Ubuntu 12.04 using Subversion - -After installing GNUnet you can continue installing the GNUnet GUI tools: - -First, install the required dependencies: - -@example -$ sudo apt-get install libgladeui-dev libqrencode-dev -@end example - -Please ensure that the GNUnet shared libraries can be found by the linker. -If you installed GNUnet libraries in a non standard path -(say GNUNET_PREFIX=/usr/local/lib/), you can - -@itemize @bullet - -@item set the environmental variable permanently to: - -@example -LD_LIBRARY_PATH=$GNUNET_PREFIX -@end example - -@item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf} - -@end itemize - -Now you can checkout and compile the GNUnet GUI tools: - -@example -$ git clone https://gnunet.org/git/gnunet-gtk -$ cd gnunet-gtk -$ ./bootstrap -$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/.. -$ make install -@end example - -@c @node Installation with gnunet-update -@c @subsection Installation with gnunet-update - -@c gnunet-update project is an effort to introduce updates to GNUnet -@c installations. An interesting to-be-implemented-feature of gnunet-update -@c is that these updates are propagated through GNUnet's peer-to-peer -@c network. More information about gnunet-update can be found at -@c @c FIXME: Use correct cgit URL -@c @uref{https://gnunet.org/git/gnunet-update.git/tree/plain/README}. - -@c While the project is still under development, we have implemented the -@c following features which we believe may be helpful for users and we -@c would like them to be tested: - -@c @itemize @bullet - -@c @item -@c Packaging GNUnet installation along with its run-time dependencies into -@c update packages - -@c @item -@c Installing update packages into compatible hosts - -@c @item -@c Updating an existing installation (which had been installed by -@c gnunet-update) to a newer one - -@c @end itemize - -@c The above said features of gnunet-update are currently available for -@c testing on GNU/Linux systems. - -@c The following is a guide to help you get started with gnunet-update. -@c It shows you how to install the testing binary packages of GNUnet -@c 0.9.1 we have at @uref{https://gnunet.org/install/}. - -@c gnunet-update needs the following dependencies: - -@c @itemize @bullet -@c @item -@c python @geq{} 2.6 - -@c @item -@c gnupg - -@c @item -@c python-gpgme -@c @end itemize - - -@c Checkout gnunet-update: - -@c @c FIXME: git! -@c @example -@c $ svn checkout -r24905 https://gnunet.org/svn/gnunet-update@ -@c @end example - -@c For security reasons, all packages released for gnunet-update from us are -@c signed with the key at @uref{https://gnunet.org/install/key.txt}. -@c You would need to import this key into your gpg key ring. -@c gnunet-update uses this key to verify the integrity of the packages it -@c installs: - -@c @example -@c $ gpg --recv-keys 7C613D78@ -@c @end example - -@c Download the packages relevant to your architecture (currently I have -@c access to GNU/Linux machines on x86_64 and i686, so only two for now, -@c hopefully more later) from https://gnunet.org/install/. - -@c To install the downloaded package into the directory /foo: - -@c @example -@c gnunet-update/bin/gnunet-update install downloaded/package /foo -@c @end example - -@c The installer reports the directories into which shared libraries and -@c dependencies have been installed. You may need to add the reported shared -@c library installation paths to LD_LIBRARY_PATH before you start running any -@c installed binaries. - -@c Please report bugs at https://gnunet.org/bugs/ under the project -@c 'gnunet-update'. - -@node Instructions for Microsoft Windows Platforms (Old) -@subsection Instructions for Microsoft Windows Platforms (Old) - -This document is a @b{DEPRECATED} installation guide for GNUnet on -Windows. -It will not work for recent GNUnet versions, but maybe it will be of -some use if problems arise. - -The Windows build uses a UNIX emulator for Windows, -@uref{http://www.mingw.org/, MinGW}, to build the executable modules. -These modules run natively on Windows and do not require additional -emulation software besides the usual dependencies. - -GNUnet development is mostly done under GNU/Linux and especially git -checkouts may not build out of the box. -We regret any inconvenience, and if you have problems, please report them. - -@menu -* Hardware and OS requirements:: -* Software installation:: -* Building libextractor and GNUnet:: -* Installer:: -* Source:: -@end menu - -@node Hardware and OS requirements -@subsubsection Hardware and OS requirements - -@itemize @bullet - -@item Pentium II or equivalent processor, @geq{} 350 MHz - -@item 128 MB RAM - -@item 600 MB free disk space - -@item Windows 2000 or Windows XP are recommended - -@end itemize - -@node Software installation -@subsubsection Software installation - -@itemize @bullet - -@item -@strong{Compression software}@ - -The software packages GNUnet depends on are usually compressed using UNIX -tools like @command{tar}, @command{gzip}, @command{xzip} and -@command{bzip2}. -If you do not already have an utility that is able to extract such -archives, get @uref{http://www.7-zip.org/, 7-Zip}. - -@item -@strong{UNIX environment}@ - -The MinGW project provides the compiler toolchain that is used to build -GNUnet. -Get the following packages from the -@uref{http://sourceforge.net/projects/mingw/files/, MinGW} project: - -@itemize @bullet - -@item GCC core -@item GCC g++ -@item MSYS -@item MSYS Developer Tool Kit (msysDTK) -@item MSYS Developer Tool Kit - msys-autoconf (bin) -@item MSYS Developer Tool Kit - msys-automake (bin) -@item MinGW Runtime -@item MinGW Utilities -@item Windows API -@item Binutils -@item make -@item pdcurses -@item GDB (snapshot) -@end itemize - -@itemize @bullet - - -@item Install MSYS (to c:\mingw, for example.)@ -Do @strong{not} use spaces in the pathname. -For example, avoid a location such as @file{c:\program files\mingw}. - -@item Install MinGW runtime, utilities and GCC to a subdirectory -(to @file{c:\mingw\mingw}, for example) - -@item Install the Development Kit to the MSYS directory -(@file{c:\mingw}) - -@item Create a batch file bash.bat in your MSYS directory with -the files: - -@example -bin\sh.exe --login -@end example - -This batch file opens a shell which is used to invoke the build -processes. -MinGW's standard shell (@command{msys.bat}) is not suitable -because it opens a separate console window. -On Vista, @command{bash.bat} needs to be run as Administrator. - -@item -Start @command{bash.sh} and rename -@file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems: - -@example -mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken -@end example - -@item -Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and -remove the declaration of DATADIR from -(@file{c:\mingw\mingw\include\objidl.h} (lines 55-58) - -@item -Unpack autoconf, automake to the MSYS directory (@file{c:\mingw}) - -@item -Install all other packages to the MinGW directory (@file{c:\mingw\mingw\}) -@end itemize - - -@item @strong{GNU Libtool}@ -GNU Libtool is required to use shared libraries. -Get the prebuilt package from here and unpack it to the -MinGW directory (@file{c:\mingw}) - -@item @strong{Pthreads}@ -GNUnet uses the portable POSIX thread library for multi-threading: - -@itemize @bullet - -@item Save -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a} -(x86) or -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a} -(x64) as libpthread.a into the @file{lib} -directory (@file{c:\mingw\mingw\lib\libpthread.a}). - -@item Save -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll} -(x86) or -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a} -(x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}). - -@item Download all header files from -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/} -to the @file{include} directory (@file{c:\mingw\mingw\include}). -@end itemize - - -@item @strong{GNU MP}@ -GNUnet uses the GNU Multiple Precision library for special cryptographic -operations. Get the GMP binary package from the -@uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and -unpack it to the MinGW directory (@file{c:\mingw\mingw}) - -@item @strong{GNU Gettext}@ -GNU gettext is used to provide national language support. -Get the prebuilt package from hereand unpack it to the MinGW -directory (@file{c:\mingw\mingw}) - -@item @strong{GNU iconv}@ -GNU Libiconv is used for character encoding conversion. -Get the prebuilt package from here and unpack it to the MinGW -directory (@file{c:\mingw\mingw}). - -@item @strong{SQLite}@ -GNUnet uses the SQLite database to store data. -Get the prebuilt binary from here and unpack it to your MinGW directory. - -@item @strong{MySQL}@ -As an alternative to SQLite, GNUnet also supports MySQL. - -@itemize @bullet - -@item Get the binary installer from the -@uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project} -(version 4.1), install it and follow the instructions in -@file{README.mysql}. - -@item Create a temporary build directory (@file{c:\mysql}) - -@item Copy the directories @file{include\} and @file{lib\} from the -MySQL directory to the new directory - -@item Get the patches from -@uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and -@uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the -latter is only required for MySQL - -@example -patch -p 0 -@end example - -@item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll} - -@item Change to @file{lib\} and create an import library: - -@example -dlltool --input-def ../include/libmySQL.def \ ---dllname libmysql.dll \ ---output-lib libmysqlclient.a -k -@end example - -@item Copy include\* to include\mysql\ - -@item Pass @code{--with-mysql=/c/mysql} to -@command{./configure} and copy @file{libmysql.dll} -to your PATH or GNUnet's @file{bin} directory -@end itemize - - -@item @strong{GTK+}@ -@command{gnunet-fs-gtk} and @command{libextractor} depend on GTK. -Get the the binary and developer packages of @command{atk}, -@command{glib}, @command{gtk}, @command{iconv}, -@command{gettext-runtime}, @command{pango} from -@uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them -to the MinGW directory (@file{c:\mingw\mingw}). -@c FIXME: The URL below for pkg-config seems wrong. -Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and -@command{libpng} and unpack them to the MinGW directory -(@file{c:\mingw\mingw}). -Here is an all-in-one package for the -@uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies} -. Do not overwrite any existing files! - -@item @strong{Glade}@ -@command{gnunet-*-gtk} and @command{gnunet-setup} were created using -this interface builder - -@itemize @bullet - -@item Get the Glade and libglade (-bin and -devel) packages -(without GTK!) from -@uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to -the MinGW directory (@file{c:\mingw\mingw}). - -@item Get @command{libxml} from here and unpack it to the MinGW -directory (@file{c:\mingw\mingw}). -@end itemize - -@c FIXME: URLs -@item @strong{zLib}@ -@command{libextractor} requires @command{zLib} to decompress some file -formats. GNUnet uses it to (de)compress meta-data. -Get zLib from here (Signature) and unpack it to the MinGW directory -(@file{c:\mingw\mingw}). - -@item @strong{Bzip2}@ -@command{libextractor} also requires @command{Bzip2} to -decompress some file formats. -Get the Bzip2 (binary and developer package) from -@uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and -unpack it to the MinGW directory (@file{c:\mingw\mingw}). - -@item @strong{Libgcrypt}@ -@command{Libgcrypt} provides the cryptographic functions used by GNUnet. -Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here}, -compile and place it in the MinGW directory -(@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to -compile GNUnet. - -@item @strong{PlibC}@ -PlibC emulates Unix functions under Windows. Get PlibC from here and -unpack it to the MinGW directory (c:\mingw\mingw) - -@item @strong{OGG Vorbis}@ -@command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files. -Get the packages -@uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg} -and -@uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis} -from the -@uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build} -and unpack them to the MinGW directory (c:\mingw\mingw). - -@item @strong{Exiv2}@ -(lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data. -Download -@uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2} -and unpack it to the MSYS directory (c:\mingw). -@end itemize - -@node Building libextractor and GNUnet -@subsubsection Building libextractor and GNUnet - -Before you compile @command{libextractor} or @command{GNUnet}, -be sure to set @code{PKG_CONFIG_PATH}: - -@example -export PKG_CONFIG_PATH=/mingw/lib/pkgconfig -@end example - -@noindent -@xref{GNUnet Installation Handbook}, for basic instructions on building -@command{libextractor} and @command{GNUnet}. -By default, all modules that are created in this way contain -debug information and are quite large. To compile release versions -(small and fast) set the variable @code{CFLAGS}: - -@example -export CFLAGS='-O2 -march=pentium -fomit-frame-pointer' -./configure --prefix=$HOME --with-extractor=$HOME -@end example - -@node Installer -@subsubsection Installer - -The GNUnet installer is made with -@uref{http://nsis.sourceforge.net/, NSIS}. The installer script is -located in @file{contrib\win} in the GNUnet source tree. - -@node Source -@subsubsection Source - -@c FIXME: URL -The sources of all dependencies are available here. - -@c @node Portable GNUnet -@c @section Portable GNUnet - -@c Quick instructions on how to use the most recent GNUnet on most GNU/Linux -@c distributions - -@c Currently this has only been tested on Ubuntu 12.04, 12.10, 13.04, Debian -@c and CentOS 6, but it should work on almost any GNU/Linux distribution. -@c More in-detail information can be found in the handbook. - -@c Note 2017-10: Currently this section assumes the old SVN repo of GNUnet -@c which no longer exists. - -@c @menu -@c * Prerequisites:: -@c * Download & set up gnunet-update:: -@c * Install GNUnet:: -@c @end menu - -@c @node Prerequisites -@c @subsection Prerequisites - -@c Open a terminal and paste this line into it to install all required tools -@c needed: - -@c @example -@c sudo apt-get install python-gpgme subversion -@c @end example - -@c @node Download & set up gnunet-update -@c @subsection Download & set up gnunet-update - -@c The following command will download a working version of gnunet-update -@c with the subversion tool and import the public key which is needed for -@c authentication: - -@c @example -@c svn checkout -r24905 https://gnunet.org/svn/gnunet-update ~/gnunet-update -@c cd ~/gnunet-update -@c gpg --keyserver "hkp://keys.gnupg.net" --recv-keys 7C613D78 -@c @end example - -@c @node Install GNUnet -@c @subsection Install GNUnet - -@c Download and install GNUnet binaries which can be found here and set -@c library paths: - -@c @example -@c wget -P /tmp https://gnunet.org/install/packs/gnunet-0.9.4-`uname -m`.tgz -@c ./bin/gnunet-update install /tmp/gnunet-0.9*.tgz ~ -@c echo "PATH DEFAULT=$@{PATH@}:$HOME/bin" >> ~/.pam_environment -@c echo -e "$@{HOME@}/lib\n$@{HOME@}/lib/gnunet-deps" | sudo tee \ -@c /etc/ld.so.conf.d/gnunet.conf > /dev/null -@c sudo ldconfig -@c @end example - -@c You may need to re-login once after executing these last commands - -@c That's it, GNUnet is installed in your home directory now. GNUnet can be -@c configured and afterwards started by executing: - -@c @example -@c gnunet-arm -s -@c @end example - -@node The graphical configuration interface -@section The graphical configuration interface - -If you also would like to use @command{gnunet-gtk} and -@command{gnunet-setup} (highly recommended for beginners), do: - -@example -wget -P /tmp \ -https://gnunet.org/install/packs/gnunet-0.9.4-gtk-0.9.4-`uname -m`.tgz -sh ~/gnunet-update/bin/gnunet-update install /tmp/gnunet-*gtk*.tgz ~ -sudo ldconfig -@end example - -Now you can run @command{gnunet-setup} for easy configuration of your -GNUnet peer. - -@menu -* Configuring your peer:: -* Configuring the Friend-to-Friend (F2F) mode:: -* Configuring the hostlist to bootstrap:: -* Configuration of the HOSTLIST proxy settings:: -* Configuring your peer to provide a hostlist :: -* Configuring the datastore:: -* Configuring the MySQL database:: -* Reasons for using MySQL:: -* Reasons for not using MySQL:: -* Setup Instructions:: -* Testing:: -* Performance Tuning:: -* Setup for running Testcases:: -* Configuring the Postgres database:: -* Reasons to use Postgres:: -* Reasons not to use Postgres:: -* Manual setup instructions:: -* Testing the setup manually:: -* Configuring the datacache:: -* Configuring the file-sharing service:: -* Configuring logging:: -* Configuring the transport service and plugins:: -* Configuring the wlan transport plugin:: -* Configuring HTTP(S) reverse proxy functionality using Apache or nginx:: -* Blacklisting peers:: -* Configuration of the HTTP and HTTPS transport plugins:: -* Configuring the GNU Name System:: -* Configuring the GNUnet VPN:: -* Bandwidth Configuration:: -* Configuring NAT:: -* Peer configuration for distributions:: -@end menu - -@node Configuring your peer -@subsection Configuring your peer - -This chapter will describe the various configuration options in GNUnet. - -The easiest way to configure your peer is to use the -@command{gnunet-setup} tool. -@command{gnunet-setup} is part of the @command{gnunet-gtk} -application. You might have to install it separately. - -Many of the specific sections from this chapter actually are linked from -within @command{gnunet-setup} to help you while using the setup tool. - -While you can also configure your peer by editing the configuration -file by hand, this is not recommended for anyone except for developers -as it requires a more in-depth understanding of the configuration files -and internal dependencies of GNUnet. - -@node Configuring the Friend-to-Friend (F2F) mode -@subsection Configuring the Friend-to-Friend (F2F) mode - -GNUnet knows three basic modes of operation: -@itemize @bullet -@item In standard "peer-to-peer" mode, -your peer will connect to any peer. -@item In the pure "friend-to-friend" -mode, your peer will ONLY connect to peers from a list of friends -specified in the configuration. -@item Finally, in mixed mode, -GNUnet will only connect to arbitrary peers if it -has at least a specified number of connections to friends. -@end itemize - -When configuring any of the F2F ("friend-to-friend") modes, -you first need to create a file with the peer identities -of your friends. Ask your friends to run - -@example -$ gnunet-peerinfo -sq -@end example - -@noindent -The resulting output of this command needs to be added to your -@file{friends} file, which is simply a plain text file with one line -per friend with the output from the above command. - -You then specify the location of your @file{friends} file in the -@code{FRIENDS} option of the "topology" section. - -Once you have created the @file{friends} file, you can tell GNUnet to only -connect to your friends by setting the @code{FRIENDS-ONLY} option -(again in the "topology" section) to YES. - -If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a -minimum number of friends to have (before connecting to arbitrary peers) -under the "MINIMUM-FRIENDS" option. - -If you want to operate in normal P2P-only mode, simply set -@code{MINIMUM-FRIENDS} to zero and @code{FRIENDS_ONLY} to NO. -This is the default. - -@node Configuring the hostlist to bootstrap -@subsection Configuring the hostlist to bootstrap - -After installing the software you need to get connected to the GNUnet -network. The configuration file included in your download is already -configured to connect you to the GNUnet network. -In this section the relevant configuration settings are explained. - -To get an initial connection to the GNUnet network and to get to know -peers already connected to the network you can use the so called -"bootstrap servers". -These servers can give you a list of peers connected to the network. -To use these bootstrap servers you have to configure the hostlist daemon -to activate bootstrapping. - -To activate bootstrapping, edit the @code{[hostlist]}-section in your -configuration file. You have to set the argument @command{-b} in the -options line: - -@example -[hostlist] -OPTIONS = -b -@end example - -Additionally you have to specify which server you want to use. -The default bootstrapping server is -"@uref{http://v10.gnunet.org/hostlist, http://v10.gnunet.org/hostlist}". -[^] To set the server you have to edit the line "SERVERS" in the hostlist -section. To use the default server you should set the lines to - -@example -SERVERS = http://v10.gnunet.org/hostlist [^] -@end example - -@noindent -To use bootstrapping your configuration file should include these lines: - -@example -[hostlist] -OPTIONS = -b -SERVERS = http://v10.gnunet.org/hostlist [^] -@end example - -@noindent -Besides using bootstrap servers you can configure your GNUnet peer to -recieve hostlist advertisements. -Peers offering hostlists to other peers can send advertisement messages -to peers that connect to them. If you configure your peer to receive these -messages, your peer can download these lists and connect to the peers -included. These lists are persistent, which means that they are saved to -your hard disk regularly and are loaded during startup. - -To activate hostlist learning you have to add the @command{-e} -switch to the @code{OPTIONS} line in the hostlist section: - -@example -[hostlist] -OPTIONS = -b -e -@end example - -@noindent -Furthermore you can specify in which file the lists are saved. -To save the lists in the file @file{hostlists.file} just add the line: - -@example -HOSTLISTFILE = hostlists.file -@end example - -@noindent -Best practice is to activate both bootstrapping and hostlist learning. -So your configuration file should include these lines: - -@example -[hostlist] -OPTIONS = -b -e -HTTPPORT = 8080 -SERVERS = http://v10.gnunet.org/hostlist [^] -HOSTLISTFILE = $SERVICEHOME/hostlists.file -@end example - -@node Configuration of the HOSTLIST proxy settings -@subsection Configuration of the HOSTLIST proxy settings - -The hostlist client can be configured to use a proxy to connect to the -hostlist server. -This functionality can be configured in the configuration file directly -or using the @command{gnunet-setup} tool. - -The hostlist client supports the following proxy types at the moment: - -@itemize @bullet -@item HTTP and HTTP 1.0 only proxy -@item SOCKS 4/4a/5/5 with hostname -@end itemize - -In addition authentication at the proxy with username and password can be -configured. - -To configure proxy support for the hostlist client in the -@command{gnunet-setup} tool, select the "hostlist" tab and select -the appropriate proxy type. -The hostname or IP address (including port if required) has to be entered -in the "Proxy hostname" textbox. If required, enter username and password -in the "Proxy username" and "Proxy password" boxes. -Be aware that this information will be stored in the configuration in -plain text (TODO: Add explanation and generalize the part in Chapter 3.6 -about the encrypted home). - -To provide these options directly in the configuration, you can -enter the following settings in the @code{[hostlist]} section of -the configuration: - -@example -# Type of proxy server, -# Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME -# Default: HTTP -# PROXY_TYPE = HTTP - -# Hostname or IP of proxy server -# PROXY = -# User name for proxy server -# PROXY_USERNAME = -# User password for proxy server -# PROXY_PASSWORD = -@end example - -@node Configuring your peer to provide a hostlist -@subsection Configuring your peer to provide a hostlist - -If you operate a peer permanently connected to GNUnet you can configure -your peer to act as a hostlist server, providing other peers the list of -peers known to him. - -Your server can act as a bootstrap server and peers needing to obtain a -list of peers can contact it to download this list. -To download this hostlist the peer uses HTTP. -For this reason you have to build your peer with libgnurl (or libcurl) -and microhttpd support. -How you build your peer with these options can be found here: -@xref{Generic installation instructions}. - -To configure your peer to act as a bootstrap server you have to add the -@command{-p} option to @code{OPTIONS} in the @code{[hostlist]} section -of your configuration file. -Besides that you have to specify a port number for the http server. -In conclusion you have to add the following lines: - -@example -[hostlist] -HTTPPORT = 12980 -OPTIONS = -p -@end example - -@noindent -If your peer acts as a bootstrap server other peers should know about -that. You can advertise the hostlist your are providing to other peers. -Peers connecting to your peer will get a message containing an -advertisement for your hostlist and the URL where it can be downloaded. -If this peer is in learning mode, it will test the hostlist and, in the -case it can obtain the list successfully, it will save it for -bootstrapping. - -To activate hostlist advertisement on your peer, you have to set the -following lines in your configuration file: - -@example -[hostlist] -EXTERNAL_DNS_NAME = example.org -HTTPPORT = 12981 -OPTIONS = -p -a -@end example - -@noindent -With this configuration your peer will a act as a bootstrap server and -advertise this hostlist to other peers connecting to it. -The URL used to download the list will be -@code{@uref{http://example.org:12981/, http://example.org:12981/}}. - -Please notice: - -@itemize @bullet -@item The hostlist is @b{not} human readable, so you should not try to -download it using your webbrowser. Just point your GNUnet peer to the -address! -@item Advertising without providing a hostlist does not make sense and -will not work. -@end itemize - -@node Configuring the datastore -@subsection Configuring the datastore - -The datastore is what GNUnet uses for long-term storage of file-sharing -data. Note that long-term does not mean 'forever' since content does have -an expiration date, and of course storage space is finite (and hence -sometimes content may have to be discarded). - -Use the @code{QUOTA} option to specify how many bytes of storage space -you are willing to dedicate to GNUnet. - -In addition to specifying the maximum space GNUnet is allowed to use for -the datastore, you need to specify which database GNUnet should use to do -so. Currently, you have the choice between sqLite, MySQL and Postgres. - -@node Configuring the MySQL database -@subsection Configuring the MySQL database - -This section describes how to setup the MySQL database for GNUnet. - -Note that the mysql plugin does NOT work with mysql before 4.1 since we -need prepared statements. -We are generally testing the code against MySQL 5.1 at this point. - -@node Reasons for using MySQL -@subsection Reasons for using MySQL - -@itemize @bullet - -@item On up-to-date hardware wher -mysql can be used comfortably, this module -will have better performance than the other database choices (according -to our tests). - -@item Its often possible to recover the mysql database from internal -inconsistencies. Some of the other databases do not support repair. -@end itemize - -@node Reasons for not using MySQL -@subsection Reasons for not using MySQL - -@itemize @bullet -@item Memory usage (likely not an issue if you have more than 1 GB) -@item Complex manual setup -@end itemize - -@node Setup Instructions -@subsection Setup Instructions - -@itemize @bullet - -@item In @file{gnunet.conf} set in section @code{DATASTORE} the value for -@code{DATABASE} to @code{mysql}. - -@item Access mysql as root: - -@example -$ mysql -u root -p -@end example - -@noindent -and issue the following commands, replacing $USER with the username -that will be running @command{gnunet-arm} (so typically "gnunet"): - -@example -CREATE DATABASE gnunet; -GRANT select,insert,update,delete,create,alter,drop,create \ -temporary tables ON gnunet.* TO $USER@@localhost; -SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like'); -FLUSH PRIVILEGES; -@end example - -@item -In the $HOME directory of $USER, create a @file{.my.cnf} file with the -following lines - -@example -[client] -user=$USER -password=$the_password_you_like -@end example - -@end itemize - -Thats it. Note that @file{.my.cnf} file is a slight security risk unless -its on a safe partition. The @file{$HOME/.my.cnf} can of course be -a symbolic link. -Luckily $USER has only priviledges to mess up GNUnet's tables, -which should be pretty harmless. - -@node Testing -@subsection Testing - -You should briefly try if the database connection works. First, login -as $USER. Then use: - -@example -$ mysql -u $USER -mysql> use gnunet; -@end example - -@noindent -If you get the message - -@example -Database changed -@end example - -@noindent -it probably works. - -If you get - -@example -ERROR 2002: Can't connect to local MySQL server -through socket '/tmp/mysql.sock' (2) -@end example - -@noindent -it may be resolvable by - -@example -ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock -@end example - -@noindent -so there may be some additional trouble depending on your mysql setup. - -@node Performance Tuning -@subsection Performance Tuning - -For GNUnet, you probably want to set the option - -@example -innodb_flush_log_at_trx_commit = 0 -@end example - -@noindent -for a rather dramatic boost in MySQL performance. However, this reduces -the "safety" of your database as with this options you may loose -transactions during a power outage. -While this is totally harmless for GNUnet, the option applies to all -applications using MySQL. So you should set it if (and only if) GNUnet is -the only application on your system using MySQL. - -@node Setup for running Testcases -@subsection Setup for running Testcases - -If you want to run the testcases, you must create a second database -"gnunetcheck" with the same username and password. This database will -then be used for testing (@command{make check}). - -@node Configuring the Postgres database -@subsection Configuring the Postgres database - -This text describes how to setup the Postgres database for GNUnet. - -This Postgres plugin was developed for Postgres 8.3 but might work for -earlier versions as well. - -@node Reasons to use Postgres -@subsection Reasons to use Postgres - -@itemize @bullet -@item Easier to setup than MySQL -@item Real database -@end itemize - -@node Reasons not to use Postgres -@subsection Reasons not to use Postgres - -@itemize @bullet -@item Quite slow -@item Still some manual setup required -@end itemize - -@node Manual setup instructions -@subsection Manual setup instructions - -@itemize @bullet -@item In @file{gnunet.conf} set in section @code{DATASTORE} the value for -@code{DATABASE} to @code{postgres}. -@item Access Postgres to create a user: - -@table @asis -@item with Postgres 8.x, use: - -@example -# su - postgres -$ createuser -@end example - -@noindent -and enter the name of the user running GNUnet for the role interactively. -Then, when prompted, do not set it to superuser, allow the creation of -databases, and do not allow the creation of new roles. - -@item with Postgres 9.x, use: - -@example -# su - postgres -$ createuser -d $GNUNET_USER -@end example - -@noindent -where $GNUNET_USER is the name of the user running GNUnet. - -@end table - - -@item -As that user (so typically as user "gnunet"), create a database (or two): - -@example -$ createdb gnunet -# this way you can run "make check" -$ createdb gnunetcheck -@end example - -@end itemize - -Now you should be able to start @code{gnunet-arm}. - -@node Testing the setup manually -@subsection Testing the setup manually - -You may want to try if the database connection works. First, again login -as the user who will run @command{gnunet-arm}. Then use: - -@example -$ psql gnunet # or gnunetcheck -gnunet=> \dt -@end example - -@noindent -If, after you have started @command{gnunet-arm} at least once, you get -a @code{gn090} table here, it probably works. - -@node Configuring the datacache -@subsection Configuring the datacache -@c %**end of header - -The datacache is what GNUnet uses for storing temporary data. This data is -expected to be wiped completely each time GNUnet is restarted (or the -system is rebooted). - -You need to specify how many bytes GNUnet is allowed to use for the -datacache using the @code{QUOTA} option in the section @code{[dhtcache]}. -Furthermore, you need to specify which database backend should be used to -store the data. Currently, you have the choice between -sqLite, MySQL and Postgres. - -@node Configuring the file-sharing service -@subsection Configuring the file-sharing service - -In order to use GNUnet for file-sharing, you first need to make sure -that the file-sharing service is loaded. -This is done by setting the @code{AUTOSTART} option in -section @code{[fs]} to "YES". Alternatively, you can run - -@example -$ gnunet-arm -i fs -@end example - -@noindent -to start the file-sharing service by hand. - -Except for configuring the database and the datacache the only important -option for file-sharing is content migration. - -Content migration allows your peer to cache content from other peers as -well as send out content stored on your system without explicit requests. -This content replication has positive and negative impacts on both system -performance and privacy. - -FIXME: discuss the trade-offs. Here is some older text about it... - -Setting this option to YES allows gnunetd to migrate data to the local -machine. Setting this option to YES is highly recommended for efficiency. -Its also the default. If you set this value to YES, GNUnet will store -content on your machine that you cannot decrypt. -While this may protect you from liability if the judge is sane, it may -not (IANAL). If you put illegal content on your machine yourself, setting -this option to YES will probably increase your chances to get away with it -since you can plausibly deny that you inserted the content. -Note that in either case, your anonymity would have to be broken first -(which may be possible depending on the size of the GNUnet network and the -strength of the adversary). - -@node Configuring logging -@subsection Configuring logging - -Logging in GNUnet 0.9.0 is controlled via the "-L" and "-l" options. -Using @code{-L}, a log level can be specified. With log level -@code{ERROR} only serious errors are logged. -The default log level is @code{WARNING} which causes anything of -concern to be logged. -Log level @code{INFO} can be used to log anything that might be -interesting information whereas -@code{DEBUG} can be used by developers to log debugging messages -(but you need to run @code{./configure} with -@code{--enable-logging=verbose} to get them compiled). -The @code{-l} option is used to specify the log file. - -Since most GNUnet services are managed by @code{gnunet-arm}, using the -@code{-l} or @code{-L} options directly is not possible. -Instead, they can be specified using the @code{OPTIONS} configuration -value in the respective section for the respective service. -In order to enable logging globally without editing the @code{OPTIONS} -values for each service, @command{gnunet-arm} supports a -@code{GLOBAL_POSTFIX} option. -The value specified here is given as an extra option to all services for -which the configuration does contain a service-specific @code{OPTIONS} -field. - -@code{GLOBAL_POSTFIX} can contain the special sequence "@{@}" which -is replaced by the name of the service that is being started. -Furthermore, @code{GLOBAL_POSTFIX} is special in that sequences -starting with "$" anywhere in the string are expanded (according -to options in @code{PATHS}); this expansion otherwise is -only happening for filenames and then the "$" must be the -first character in the option. Both of these restrictions do -not apply to @code{GLOBAL_POSTFIX}. -Note that specifying @code{%} anywhere in the @code{GLOBAL_POSTFIX} -disables both of these features. - -In summary, in order to get all services to log at level -@code{INFO} to log-files called @code{SERVICENAME-logs}, the -following global prefix should be used: - -@example -GLOBAL_POSTFIX = -l $SERVICEHOME/@{@}-logs -L INFO -@end example - -@node Configuring the transport service and plugins -@subsection Configuring the transport service and plugins - -The transport service in GNUnet is responsible to maintain basic -connectivity to other peers. -Besides initiating and keeping connections alive it is also responsible -for address validation. - -The GNUnet transport supports more than one transport protocol. -These protocols are configured together with the transport service. - -The configuration section for the transport service itself is quite -similar to all the other services - -@example -AUTOSTART = YES -@@UNIXONLY@@ PORT = 2091 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-transport -#PREFIX = valgrind -NEIGHBOUR_LIMIT = 50 -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -PLUGINS = tcp udp -UNIXPATH = /tmp/gnunet-service-transport.sock -@end example - -Different are the settings for the plugins to load @code{PLUGINS}. -The first setting specifies which transport plugins to load. - -@itemize @bullet -@item transport-unix -A plugin for local only communication with UNIX domain sockets. Used for -testing and available on unix systems only. Just set the port - -@example -[transport-unix] -PORT = 22086 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example - -@item transport-tcp -A plugin for communication with TCP. Set port to 0 for client mode with -outbound only connections - -@example -[transport-tcp] -# Use 0 to ONLY advertise as a peer behind NAT (no port binding) -PORT = 2086 -ADVERTISED_PORT = 2086 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -# Maximum number of open TCP connections allowed -MAX_CONNECTIONS = 128 -@end example - -@item transport-udp -A plugin for communication with UDP. Supports peer discovery using -broadcasts. - -@example -[transport-udp] -PORT = 2086 -BROADCAST = YES -BROADCAST_INTERVAL = 30 s -MAX_BPS = 1000000 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example - -@item transport-http -HTTP and HTTPS support is split in two part: a client plugin initiating -outbound connections and a server part accepting connections from the -client. The client plugin just takes the maximum number of connections as -an argument. - -@example -[transport-http_client] -MAX_CONNECTIONS = 128 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example - -@example -[transport-https_client] -MAX_CONNECTIONS = 128 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example - -@noindent -The server has a port configured and the maximum nunber of connections. -The HTTPS part has two files with the certificate key and the certificate -file. - -The server plugin supports reverse proxies, so a external hostname can be -set using the @code{EXTERNAL_HOSTNAME} setting. -The webserver under this address should forward the request to the peer -and the configure port. - -@example -[transport-http_server] -EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet -PORT = 1080 -MAX_CONNECTIONS = 128 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example - -@example -[transport-https_server] -PORT = 4433 -CRYPTO_INIT = NORMAL -KEY_FILE = https.key -CERT_FILE = https.cert -MAX_CONNECTIONS = 128 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example - -@item transport-wlan - -The next section describes how to setup the WLAN plugin, -so here only the settings. Just specify the interface to use: - -@example -[transport-wlan] -# Name of the interface in monitor mode (typically monX) -INTERFACE = mon0 -# Real hardware, no testing -TESTMODE = 0 -TESTING_IGNORE_KEYS = ACCEPT_FROM; -@end example -@end itemize - -@node Configuring the wlan transport plugin -@subsection Configuring the wlan transport plugin - -The wlan transport plugin enables GNUnet to send and to receive data on a -wlan interface. -It has not to be connected to a wlan network as long as sender and -receiver are on the same channel. This enables you to get connection to -GNUnet where no internet access is possible, for example during -catastrophes or when censorship cuts you off from the internet. - - -@menu -* Requirements for the WLAN plugin:: -* Configuration:: -* Before starting GNUnet:: -* Limitations and known bugs:: -@end menu - - -@node Requirements for the WLAN plugin -@subsubsection Requirements for the WLAN plugin - -@itemize @bullet - -@item wlan network card with monitor support and packet injection -(see @uref{http://www.aircrack-ng.org/, aircrack-ng.org}) - -@item Linux kernel with mac80211 stack, introduced in 2.6.22, tested with -2.6.35 and 2.6.38 - -@item Wlantools to create the a monitor interface, tested with airmon-ng -of the aircrack-ng package -@end itemize - -@node Configuration -@subsubsection Configuration - -There are the following options for the wlan plugin (they should be like -this in your default config file, you only need to adjust them if the -values are incorrect for your system) - -@example -# section for the wlan transport plugin -[transport-wlan] -# interface to use, more information in the -# "Before starting GNUnet" section of the handbook. -INTERFACE = mon0 -# testmode for developers: -# 0 use wlan interface, -#1 or 2 use loopback driver for tests 1 = server, 2 = client -TESTMODE = 0 -@end example - -@node Before starting GNUnet -@subsubsection Before starting GNUnet - -Before starting GNUnet, you have to make sure that your wlan interface is -in monitor mode. -One way to put the wlan interface into monitor mode (if your interface -name is wlan0) is by executing: - -@example -sudo airmon-ng start wlan0 -@end example - -@noindent -Here is an example what the result should look like: - -@example -Interface Chipset Driver -wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0] -(monitor mode enabled on mon0) -@end example - -@noindent -The monitor interface is mon0 is the one that you have to put into the -configuration file. - -@node Limitations and known bugs -@subsubsection Limitations and known bugs - -Wlan speed is at the maximum of 1 Mbit/s because support for choosing the -wlan speed with packet injection was removed in newer kernels. -Please pester the kernel developers about fixing this. - -The interface channel depends on the wlan network that the card is -connected to. If no connection has been made since the start of the -computer, it is usually the first channel of the card. -Peers will only find each other and communicate if they are on the same -channel. Channels must be set manually, i.e. using: - -@example -iwconfig wlan0 channel 1 -@end example - -@node Configuring HTTP(S) reverse proxy functionality using Apache or nginx -@subsection Configuring HTTP(S) reverse proxy functionality using Apache or nginx - -The HTTP plugin supports data transfer using reverse proxies. A reverse -proxy forwards the HTTP request he receives with a certain URL to another -webserver, here a GNUnet peer. - -So if you have a running Apache or nginx webserver you can configure it to -be a GNUnet reverse proxy. Especially if you have a well-known webiste -this improves censorship resistance since it looks as normal surfing -behaviour. - -To do so, you have to do two things: - -@itemize @bullet -@item Configure your webserver to forward the GNUnet HTTP traffic -@item Configure your GNUnet peer to announce the respective address -@end itemize - -As an example we want to use GNUnet peer running: - -@itemize @bullet - -@item HTTP server plugin on @code{gnunet.foo.org:1080} - -@item HTTPS server plugin on @code{gnunet.foo.org:4433} - -@item A apache or nginx webserver on -@uref{http://www.foo.org/, http://www.foo.org:80/} - -@item A apache or nginx webserver on https://www.foo.org:443/ -@end itemize - -And we want the webserver to accept GNUnet traffic under -@code{http://www.foo.org/bar/}. The required steps are described here: - -@menu -* Reverse Proxy - Configure your Apache2 HTTP webserver:: -* Reverse Proxy - Configure your Apache2 HTTPS webserver:: -* Reverse Proxy - Configure your nginx HTTPS webserver:: -* Reverse Proxy - Configure your nginx HTTP webserver:: -* Reverse Proxy - Configure your GNUnet peer:: -@end menu - -@node Reverse Proxy - Configure your Apache2 HTTP webserver -@subsubsection Reverse Proxy - Configure your Apache2 HTTP webserver - -First of all you need mod_proxy installed. - -Edit your webserver configuration. Edit -@code{/etc/apache2/apache2.conf} or the site-specific configuration file. - -In the respective @code{server config},@code{virtual host} or -@code{directory} section add the following lines: - -@example -ProxyTimeout 300 -ProxyRequests Off - -ProxyPass http://gnunet.foo.org:1080/ -ProxyPassReverse http://gnunet.foo.org:1080/ - -@end example - -@node Reverse Proxy - Configure your Apache2 HTTPS webserver -@subsubsection Reverse Proxy - Configure your Apache2 HTTPS webserver - -We assume that you already have an HTTPS server running, if not please -check how to configure a HTTPS host. An uncomplicated to use example -is the example configuration file for Apache2/HTTPD provided in -@file{apache2/sites-available/default-ssl}. - -In the respective HTTPS @code{server config},@code{virtual host} or -@code{directory} section add the following lines: - -@example -SSLProxyEngine On -ProxyTimeout 300 -ProxyRequests Off - -ProxyPass https://gnunet.foo.org:4433/ -ProxyPassReverse https://gnunet.foo.org:4433/ - -@end example - -@noindent -More information about the apache mod_proxy configuration can be found -in the Apache documentation@footnote{@uref{http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass, http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass}} - -@node Reverse Proxy - Configure your nginx HTTPS webserver -@subsubsection Reverse Proxy - Configure your nginx HTTPS webserver - -Since nginx does not support chunked encoding, you first of all have to -install the @code{chunkin} module@footnote{@uref{http://wiki.nginx.org/HttpChunkinModule, http://wiki.nginx.org/HttpChunkinModule}} - -To enable chunkin add: - -@example -chunkin on; -error_page 411 = @@my_411_error; -location @@my_411_error @{ -chunkin_resume; -@} -@end example - -@noindent -Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or -the site-specific configuration file. - -In the @code{server} section add: - -@example -location /bar/ @{ -proxy_pass http://gnunet.foo.org:1080/; -proxy_buffering off; -proxy_connect_timeout 5; # more than http_server -proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout -proxy_http_version 1.1; # 1.0 default -proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504; -@} -@end example - -@node Reverse Proxy - Configure your nginx HTTP webserver -@subsubsection Reverse Proxy - Configure your nginx HTTP webserver - -Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or -the site-specific configuration file. - -In the @code{server} section add: - -@example -ssl_session_timeout 6m; -location /bar/ -@{ -proxy_pass https://gnunet.foo.org:4433/; -proxy_buffering off; -proxy_connect_timeout 5; # more than http_server -proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout -proxy_http_version 1.1; # 1.0 default -proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504; -@} -@end example - -@node Reverse Proxy - Configure your GNUnet peer -@subsubsection Reverse Proxy - Configure your GNUnet peer - -To have your GNUnet peer announce the address, you have to specify the -@code{EXTERNAL_HOSTNAME} option in the @code{[transport-http_server]} -section: - -@example -[transport-http_server] -EXTERNAL_HOSTNAME = http://www.foo.org/bar/ -@end example - -@noindent -and/or @code{[transport-https_server]} section: - -@example -[transport-https_server] -EXTERNAL_HOSTNAME = https://www.foo.org/bar/ -@end example - -@noindent -Now restart your webserver and your peer... - -@node Blacklisting peers -@subsection Blacklisting peers - -Transport service supports to deny connecting to a specific peer of to a -specific peer with a specific transport plugin using te blacklisting -component of transport service. With@ blacklisting it is possible to deny -connections to specific peers of@ to use a specific plugin to a specific -peer. Peers can be blacklisted using@ the configuration or a blacklist -client can be asked. - -To blacklist peers using the configuration you have to add a section to -your configuration containing the peer id of the peer to blacklist and -the plugin@ if required. - -Examples: - -To blacklist connections to P565... on peer AG2P... using tcp add: - -@c FIXME: This is too long and produces errors in the pdf. -@example -[transport-blacklist AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520] -P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp -@end example - -To blacklist connections to P565... on peer AG2P... using all plugins add: - -@example -[transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520] -P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = -@end example - -You can also add a blacklist client usign the blacklist API. On a -blacklist check, blacklisting first checks internally if the peer is -blacklisted and if not, it asks the blacklisting clients. Clients are -asked if it is OK to connect to a peer ID, the plugin is omitted. - -On blacklist check for (peer, plugin) -@itemize @bullet -@item Do we have a local blacklist entry for this peer and this plugin?@ -@item YES: disallow connection@ -@item Do we have a local blacklist entry for this peer and all plugins?@ -@item YES: disallow connection@ -@item Does one of the clients disallow?@ -@item YES: disallow connection -@end itemize - -@node Configuration of the HTTP and HTTPS transport plugins -@subsection Configuration of the HTTP and HTTPS transport plugins - -The client parts of the http and https transport plugins can be configured -to use a proxy to connect to the hostlist server. This functionality can -be configured in the configuration file directly or using the -gnunet-setup tool. - -Both the HTTP and HTTPS clients support the following proxy types at -the moment: - -@itemize @bullet -@item HTTP 1.1 proxy -@item SOCKS 4/4a/5/5 with hostname -@end itemize - -In addition authentication at the proxy with username and password can be -configured. - -To configure proxy support for the clients in the gnunet-setup tool, -select the "transport" tab and activate the respective plugin. Now you -can select the appropriate proxy type. The hostname or IP address -(including port if required) has to be entered in the "Proxy hostname" -textbox. If required, enter username and password in the "Proxy username" -and "Proxy password" boxes. Be aware that these information will be stored -in the configuration in plain text. - -To configure these options directly in the configuration, you can -configure the following settings in the @code{[transport-http_client]} -and @code{[transport-https_client]} section of the configuration: - -@example -# Type of proxy server, -# Valid values: HTTP, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME -# Default: HTTP -# PROXY_TYPE = HTTP - -# Hostname or IP of proxy server -# PROXY = -# User name for proxy server -# PROXY_USERNAME = -# User password for proxy server -# PROXY_PASSWORD = -@end example - -@node Configuring the GNU Name System -@subsection Configuring the GNU Name System - -@menu -* Configuring system-wide DNS interception:: -* Configuring the GNS nsswitch plugin:: -* Configuring GNS on W32:: -* GNS Proxy Setup:: -* Setup of the GNS CA:: -* Testing the GNS setup:: -@end menu - - -@node Configuring system-wide DNS interception -@subsubsection Configuring system-wide DNS interception - -Before you install GNUnet, make sure you have a user and group 'gnunet' -as well as an empty group 'gnunetdns'. - -When using GNUnet with system-wide DNS interception, it is absolutely -necessary for all GNUnet service processes to be started by -@code{gnunet-service-arm} as user and group 'gnunet'. You also need to be -sure to run @code{make install} as root (or use the @code{sudo} option to -configure) to grant GNUnet sufficient privileges. - -With this setup, all that is required for enabling system-wide DNS -interception is for some GNUnet component (VPN or GNS) to request it. -The @code{gnunet-service-dns} will then start helper programs that will -make the necessary changes to your firewall (@code{iptables}) rules. - -Note that this will NOT work if your system sends out DNS traffic to a -link-local IPv6 address, as in this case GNUnet can intercept the traffic, -but not inject the responses from the link-local IPv6 address. Hence you -cannot use system-wide DNS interception in conjunction with link-local -IPv6-based DNS servers. If such a DNS server is used, it will bypass -GNUnet's DNS traffic interception. - -Using the GNU Name System (GNS) requires two different configuration -steps. -First of all, GNS needs to be integrated with the operating system. Most -of this section is about the operating system level integration. - -The remainder of this chapter will detail the various methods for -configuring the use of GNS with your operating system. - -At this point in time you have different options depending on your OS: - -@table @asis - -@item Use the gnunet-gns-proxy This approach works for all operating -systems and is likely the easiest. However, it enables GNS only for -browsers, not for other applications that might be using DNS, such as SSH. -Still, using the proxy is required for using HTTP with GNS and is thus -recommended for all users. To do this, you simply have to run the -@code{gnunet-gns-proxy-setup-ca} script as the user who will run the -browser (this will create a GNS certificate authority (CA) on your system -and import its key into your browser), then start @code{gnunet-gns-proxy} -and inform your browser to use the Socks5 proxy which -@code{gnunet-gns-proxy} makes available by default on port 7777. -@item Use a nsswitch plugin (recommended on GNU systems) -This approach has the advantage of offering fully personalized resolution -even on multi-user systems. A potential disadvantage is that some -applications might be able to bypass GNS. -@item Use a W32 resolver plugin (recommended on W32) -This is currently the only option on W32 systems. -@item Use system-wide DNS packet interception -This approach is recommended for the GNUnet VPN. It can be used to handle -GNS at the same time; however, if you only use this method, you will only -get one root zone per machine (not so great for multi-user systems). -@end table - -You can combine system-wide DNS packet interception with the nsswitch -plugin. -The setup of the system-wide DNS interception is described here. All of -the other GNS-specific configuration steps are described in the following -sections. - -@node Configuring the GNS nsswitch plugin -@subsubsection Configuring the GNS nsswitch plugin - -The Name Service Switch (NSS) is a facility in Unix-like operating systems -@footnote{More accurate: NSS is a functionality of the GNU C Library} -that provides a variety of sources for common configuration databases and -name resolution mechanisms. -A superuser (system administrator) usually configures the -operating system's name services using the file -@file{/etc/nsswitch.conf}. - -GNS provides a NSS plugin to integrate GNS name resolution with the -operating system's name resolution process. -To use the GNS NSS plugin you have to either - -@itemize @bullet -@item install GNUnet as root or -@item compile GNUnet with the @code{--with-sudo=yes} switch. -@end itemize - -Name resolution is controlled by the @emph{hosts} section in the NSS -configuration. By default this section first performs a lookup in the -@file{/etc/hosts} file and then in DNS. -The nsswitch file should contain a line similar to: - -@example -hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4 -@end example - -@noindent -Here the GNS NSS plugin can be added to perform a GNS lookup before -performing a DNS lookup. -The GNS NSS plugin has to be added to the "hosts" section in -@file{/etc/nsswitch.conf} file before DNS related plugins: - -@example -... -hosts: files gns [NOTFOUND=return] dns mdns4_minimal mdns4 -... -@end example - -@noindent -The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not -found in GNS it will not be queried in DNS. - -@node Configuring GNS on W32 -@subsubsection Configuring GNS on W32 - -This document is a guide to configuring GNU Name System on W32-compatible -platforms. - -After GNUnet is installed, run the w32nsp-install tool: - -@example -w32nsp-install.exe libw32nsp-0.dll -@end example - -@noindent -('0' is the library version of W32 NSP; it might increase in the future, -change the invocation accordingly). - -This will install GNS namespace provider into the system and allow other -applications to resolve names that end in '@strong{gnu}' -and '@strong{zkey}'. Note that namespace provider requires -gnunet-gns-helper-service-w32 to be running, as well as gns service -itself (and its usual dependencies). - -Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353}, -and this is where gnunet-gns-helper-service-w32 should be listening to -(and is configured to listen to by default). - -To uninstall the provider, run: - -@example -w32nsp-uninstall.exe -@end example - -@noindent -(uses provider GUID to uninstall it, does not need a dll name). - -Note that while MSDN claims that other applications will only be able to -use the new namespace provider after re-starting, in reality they might -stat to use it without that. Conversely, they might stop using the -provider after it's been uninstalled, even if they were not re-started. -W32 will not permit namespace provider library to be deleted or -overwritten while the provider is installed, and while there is at least -one process still using it (even after it was uninstalled). - -@node GNS Proxy Setup -@subsubsection GNS Proxy Setup - -When using the GNU Name System (GNS) to browse the WWW, there are several -issues that can be solved by adding the GNS Proxy to your setup: - -@itemize @bullet - -@item If the target website does not support GNS, it might assume that it -is operating under some name in the legacy DNS system (such as -example.com). It may then attempt to set cookies for that domain, and the -web server might expect a @code{Host: example.com} header in the request -from your browser. -However, your browser might be using @code{example.gnu} for the -@code{Host} header and might only accept (and send) cookies for -@code{example.gnu}. The GNS Proxy will perform the necessary translations -of the hostnames for cookies and HTTP headers (using the LEHO record for -the target domain as the desired substitute). - -@item If using HTTPS, the target site might include an SSL certificate -which is either only valid for the LEHO domain or might match a TLSA -record in GNS. However, your browser would expect a valid certificate for -@code{example.gnu}, not for some legacy domain name. The proxy will -validate the certificate (either against LEHO or TLSA) and then -on-the-fly produce a valid certificate for the exchange, signed by your -own CA. Assuming you installed the CA of your proxy in your browser's -certificate authority list, your browser will then trust the -HTTPS/SSL/TLS connection, as the hostname mismatch is hidden by the proxy. - -@item Finally, the proxy will in the future indicate to the server that it -speaks GNS, which will enable server operators to deliver GNS-enabled web -sites to your browser (and continue to deliver legacy links to legacy -browsers) -@end itemize - -@node Setup of the GNS CA -@subsubsection Setup of the GNS CA - -First you need to create a CA certificate that the proxy can use. -To do so use the provided script gnunet-gns-proxy-ca: - -@example -$ gnunet-gns-proxy-setup-ca -@end example - -@noindent -This will create a personal certification authority for you and add this -authority to the firefox and chrome database. The proxy will use the this -CA certificate to generate @code{*.gnu} client certificates on the fly. - -Note that the proxy uses libcurl. Make sure your version of libcurl uses -GnuTLS and NOT OpenSSL. The proxy will @b{not} work with libcurl compiled -against OpenSSL. - -You can check the configuration your libcurl was build with by -running: - -@example -curl --version -@end example - -the output will look like this (without the linebreaks): - -@example -gnurl --version -curl 7.56.0 (x86_64-unknown-linux-gnu) libcurl/7.56.0 \ -GnuTLS/3.5.13 zlib/1.2.11 libidn2/2.0.4 -Release-Date: 2017-10-08 -Protocols: http https -Features: AsynchDNS IDN IPv6 Largefile NTLM SSL libz \ -TLS-SRP UnixSockets HTTPS-proxy -@end example - -@node Testing the GNS setup -@subsubsection Testing the GNS setup - -Now for testing purposes we can create some records in our zone to test -the SSL functionality of the proxy: - -@example -$ gnunet-identity -C test -$ gnunet-namestore -a -e "1 d" -n "homepage" \ - -t A -V 131.159.74.67 -z test -$ gnunet-namestore -a -e "1 d" -n "homepage" \ - -t LEHO -V "gnunet.org" -z test -@end example - -@noindent -At this point we can start the proxy. Simply execute - -@example -$ gnunet-gns-proxy -@end example - -@noindent -Configure your browser to use this SOCKSv5 proxy on port 7777 and visit -this link. -If you use @command{Firefox} (or one of its deriviates/forks such as -Icecat) you also have to go to @code{about:config} and set the key -@code{network.proxy.socks_remote_dns} to @code{true}. - -When you visit @code{https://homepage.test/}, you should get to the -@code{https://gnunet.org/} frontpage and the browser (with the correctly -configured proxy) should give you a valid SSL certificate for -@code{homepage.gnu} and no warnings. It should look like this: - -@c FIXME: Image does not exist, create it or save it from Drupal? -@c @image{images/gnunethpgns.png,5in,, picture of homepage.gnu in Webbrowser} - - -@node Configuring the GNUnet VPN -@subsection Configuring the GNUnet VPN - -@menu -* IPv4 address for interface:: -* IPv6 address for interface:: -* Configuring the GNUnet VPN DNS:: -* Configuring the GNUnet VPN Exit Service:: -* IP Address of external DNS resolver:: -* IPv4 address for Exit interface:: -* IPv6 address for Exit interface:: -@end menu - -Before configuring the GNUnet VPN, please make sure that system-wide DNS -interception is configured properly as described in the section on the -GNUnet DNS setup. @pxref{Configuring the GNU Name System}, -if you haven't done so already. - -The default options for the GNUnet VPN are usually sufficient to use -GNUnet as a Layer 2 for your Internet connection. -However, what you always have to specify is which IP protocol you want -to tunnel: IPv4, IPv6 or both. -Furthermore, if you tunnel both, you most likely should also tunnel -all of your DNS requests. -You theoretically can tunnel "only" your DNS traffic, but that usually -makes little sense. - -The other options as shown on the gnunet-setup tool are: - -@node IPv4 address for interface -@subsubsection IPv4 address for interface - -This is the IPv4 address the VPN interface will get. You should pick an -'private' IPv4 network that is not yet in use for you system. For example, -if you use @code{10.0.0.1/255.255.0.0} already, you might use -@code{10.1.0.1/255.255.0.0}. -If you use @code{10.0.0.1/255.0.0.0} already, then you might use -@code{192.168.0.1/255.255.0.0}. -If your system is not in a private IP-network, using any of the above will -work fine. -You should try to make the mask of the address big enough -(@code{255.255.0.0} or, even better, @code{255.0.0.0}) to allow more -mappings of remote IP Addresses into this range. -However, even a @code{255.255.255.0} mask will suffice for most users. - -@node IPv6 address for interface -@subsubsection IPv6 address for interface - -The IPv6 address the VPN interface will get. Here you can specify any -non-link-local address (the address should not begin with @code{fe80:}). -A subnet Unique Local Unicast (@code{fd00::/8} prefix) that you are -currently not using would be a good choice. - -@node Configuring the GNUnet VPN DNS -@subsubsection Configuring the GNUnet VPN DNS - -To resolve names for remote nodes, activate the DNS exit option. - -@node Configuring the GNUnet VPN Exit Service -@subsubsection Configuring the GNUnet VPN Exit Service - -If you want to allow other users to share your Internet connection (yes, -this may be dangerous, just as running a Tor exit node) or want to -provide access to services on your host (this should be less dangerous, -as long as those services are secure), you have to enable the GNUnet exit -daemon. - -You then get to specify which exit functions you want to provide. By -enabling the exit daemon, you will always automatically provide exit -functions for manually configured local services (this component of the -system is under -development and not documented further at this time). As for those -services you explicitly specify the target IP address and port, there is -no significant security risk in doing so. - -Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet. -Being a DNS exit is usually pretty harmless. However, enabling IPv4 or -IPv6-exit without further precautions may enable adversaries to access -your local network, send spam, attack other systems from your Internet -connection and to other mischief that will appear to come from your -machine. This may or may not get you into legal trouble. -If you want to allow IPv4 or IPv6-exit functionality, you should strongly -consider adding additional firewall rules manually to protect your local -network and to restrict outgoing TCP traffic (i.e. by not allowing access -to port 25). While we plan to improve exit-filtering in the future, -you're currently on your own here. -Essentially, be prepared for any kind of IP-traffic to exit the respective -TUN interface (and GNUnet will enable IP-forwarding and NAT for the -interface automatically). - -Additional configuration options of the exit as shown by the gnunet-setup -tool are: - -@node IP Address of external DNS resolver -@subsubsection IP Address of external DNS resolver - -If DNS traffic is to exit your machine, it will be send to this DNS -resolver. You can specify an IPv4 or IPv6 address. - -@node IPv4 address for Exit interface -@subsubsection IPv4 address for Exit interface - -This is the IPv4 address the Interface will get. Make the mask of the -address big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more -mappings of IP addresses into this range. As for the VPN interface, any -unused, private IPv4 address range will do. - -@node IPv6 address for Exit interface -@subsubsection IPv6 address for Exit interface - -The public IPv6 address the interface will get. If your kernel is not a -very recent kernel and you are willing to manually enable IPv6-NAT, the -IPv6 address you specify here must be a globally routed IPv6 address of -your host. - -Suppose your host has the address @code{2001:4ca0::1234/64}, then -using @code{2001:4ca0::1:0/112} would be fine (keep the first 64 bits, -then change at least one bit in the range before the bitmask, in the -example above we changed bit 111 from 0 to 1). - -You may also have to configure your router to route traffic for the entire -subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this -should be automatic with IPv6, but obviously anything can be -disabled). - -@node Bandwidth Configuration -@subsection Bandwidth Configuration - -You can specify how many bandwidth GNUnet is allowed to use to receive -and send data. This is important for users with limited bandwidth or -traffic volume. - -@node Configuring NAT -@subsection Configuring NAT - -Most hosts today do not have a normal global IP address but instead are -behind a router performing Network Address Translation (NAT) which assigns -each host in the local network a private IP address. -As a result, these machines cannot trivially receive inbound connections -from the Internet. GNUnet supports NAT traversal to enable these machines -to receive incoming connections from other peers despite their -limitations. - -In an ideal world, you can press the "Attempt automatic configuration" -button in gnunet-setup to automatically configure your peer correctly. -Alternatively, your distribution might have already triggered this -automatic configuration during the installation process. -However, automatic configuration can fail to determine the optimal -settings, resulting in your peer either not receiving as many connections -as possible, or in the worst case it not connecting to the network at all. - -To manually configure the peer, you need to know a few things about your -network setup. First, determine if you are behind a NAT in the first -place. -This is always the case if your IP address starts with "10.*" or -"192.168.*". Next, if you have control over your NAT router, you may -choose to manually configure it to allow GNUnet traffic to your host. -If you have configured your NAT to forward traffic on ports 2086 (and -possibly 1080) to your host, you can check the "NAT ports have been opened -manually" option, which corresponds to the "PUNCHED_NAT" option in the -configuration file. If you did not punch your NAT box, it may still be -configured to support UPnP, which allows GNUnet to automatically -configure it. In that case, you need to install the "upnpc" command, -enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal -via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the -configuration file). - -Some NAT boxes can be traversed using the autonomous NAT traversal method. -This requires certain GNUnet components to be installed with "SUID" -prividledges on your system (so if you're installing on a system you do -not have administrative rights to, this will not work). -If you installed as 'root', you can enable autonomous NAT traversal by -checking the "Enable NAT traversal using ICMP method". -The ICMP method requires a way to determine your NAT's external (global) -IP address. This can be done using either UPnP, DynDNS, or by manual -configuration. If you have a DynDNS name or know your external IP address, -you should enter that name under "External (public) IPv4 address" (which -corresponds to the "EXTERNAL_ADDRESS" option in the configuration file). -If you leave the option empty, GNUnet will try to determine your external -IP address automatically (which may fail, in which case autonomous -NAT traversal will then not work). - -Finally, if you yourself are not behind NAT but want to be able to -connect to NATed peers using autonomous NAT traversal, you need to check -the "Enable connecting to NATed peers using ICMP method" box. - - -@node Peer configuration for distributions -@subsection Peer configuration for distributions - -The "GNUNET_DATA_HOME" in "[path]" in @file{/etc/gnunet.conf} should be -manually set to "/var/lib/gnunet/data/" as the default -"~/.local/share/gnunet/" is probably not that appropriate in this case. -Similarly, distributions may consider pointing "GNUNET_RUNTIME_DIR" to -"/var/run/gnunet/" and "GNUNET_HOME" to "/var/lib/gnunet/". Also, should a -distribution decide to override system defaults, all of these changes -should be done in a custom @file{/etc/gnunet.conf} and not in the files -in the @file{config.d/} directory. - -Given the proposed access permissions, the "gnunet-setup" tool must be -run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it -modifies the system configuration). As always, gnunet-setup should be run -after the GNUnet peer was stopped using "gnunet-arm -e". Distributions -might want to include a wrapper for gnunet-setup that allows the -desktop-user to "sudo" (i.e. using gtksudo) to the "gnunet" user account -and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in -sequence. - -@node How to start and stop a GNUnet peer -@section How to start and stop a GNUnet peer - -This section describes how to start a GNUnet peer. It assumes that you -have already compiled and installed GNUnet and its' dependencies. -Before you start a GNUnet peer, you may want to create a configuration -file using gnunet-setup (but you do not have to). -Sane defaults should exist in your -@file{$GNUNET_PREFIX/share/gnunet/config.d/} directory, so in practice -you could simply start without any configuration. If you want to -configure your peer later, you need to stop it before invoking the -@code{gnunet-setup} tool to customize further and to test your -configuration (@code{gnunet-setup} has build-in test functions). - -The most important option you might have to still set by hand is in -[PATHS]. Here, you use the option "GNUNET_HOME" to specify the path where -GNUnet should store its data. -It defaults to @code{$HOME/}, which again should work for most users. -Make sure that the directory specified as GNUNET_HOME is writable to -the user that you will use to run GNUnet (note that you can run frontends -using other users, GNUNET_HOME must only be accessible to the user used to -run the background processes). - -You will also need to make one central decision: should all of GNUnet be -run under your normal UID, or do you want distinguish between system-wide -(user-independent) GNUnet services and personal GNUnet services. The -multi-user setup is slightly more complicated, but also more secure and -generally recommended. - -@menu -* The Single-User Setup:: -* The Multi-User Setup:: -* Killing GNUnet services:: -* Access Control for GNUnet:: -@end menu - -@node The Single-User Setup -@subsection The Single-User Setup - -For the single-user setup, you do not need to do anything special and can -just start the GNUnet background processes using @code{gnunet-arm}. -By default, GNUnet looks in @file{~/.config/gnunet.conf} for a -configuration (or @code{$XDG_CONFIG_HOME/gnunet.conf} if@ -@code{$XDG_CONFIG_HOME} is defined). If your configuration lives -elsewhere, you need to pass the @code{-c FILENAME} option to all GNUnet -commands. - -Assuming the configuration file is called @file{~/.config/gnunet.conf}, -you start your peer using the @code{gnunet-arm} command (say as user -@code{gnunet}) using: - -@example -gnunet-arm -c ~/.config/gnunet.conf -s -@end example - -@noindent -The "-s" option here is for "start". The command should return almost -instantly. If you want to stop GNUnet, you can use: - -@example -gnunet-arm -c ~/.config/gnunet.conf -e -@end example - -@noindent -The "-e" option here is for "end". - -Note that this will only start the basic peer, no actual applications -will be available. -If you want to start the file-sharing service, use (after starting -GNUnet): - -@example -gnunet-arm -c ~/.config/gnunet.conf -i fs -@end example - -@noindent -The "-i fs" option here is for "initialize" the "fs" (file-sharing) -application. You can also selectively kill only file-sharing support using - -@example -gnunet-arm -c ~/.config/gnunet.conf -k fs -@end example - -@noindent -Assuming that you want certain services (like file-sharing) to be always -automatically started whenever you start GNUnet, you can activate them by -setting "FORCESTART=YES" in the respective section of the configuration -file (for example, "[fs]"). Then GNUnet with file-sharing support would -be started whenever you@ enter: - -@example -gnunet-arm -c ~/.config/gnunet.conf -s -@end example - -@noindent -Alternatively, you can combine the two options: - -@example -gnunet-arm -c ~/.config/gnunet.conf -s -i fs -@end example - -@noindent -Using @code{gnunet-arm} is also the preferred method for initializing -GNUnet from @code{init}. - -Finally, you should edit your @code{crontab} (using the @code{crontab} -command) and insert a line@ - -@example -@@reboot gnunet-arm -c ~/.config/gnunet.conf -s -@end example - -to automatically start your peer whenever your system boots. - -@node The Multi-User Setup -@subsection The Multi-User Setup - -This requires you to create a user @code{gnunet} and an additional group -@code{gnunetdns}, prior to running @code{make install} during -installation. -Then, you create a configuration file @file{/etc/gnunet.conf} which should -contain the lines:@ - -@example -[arm] -SYSTEM_ONLY = YES -USER_ONLY = NO -@end example - -@noindent -Then, perform the same steps to run GNUnet as in the per-user -configuration, except as user @code{gnunet} (including the -@code{crontab} installation). -You may also want to run @code{gnunet-setup} to configure your peer -(databases, etc.). -Make sure to pass @code{-c /etc/gnunet.conf} to all commands. If you -run @code{gnunet-setup} as user @code{gnunet}, you might need to change -permissions on @file{/etc/gnunet.conf} so that the @code{gnunet} user can -write to the file (during setup). - -Afterwards, you need to perform another setup step for each normal user -account from which you want to access GNUnet. First, grant the normal user -(@code{$USER}) permission to the group gnunet: - -@example -# adduser $USER gnunet -@end example - -@noindent -Then, create a configuration file in @file{~/.config/gnunet.conf} for the -$USER with the lines: - -@example -[arm] -SYSTEM_ONLY = NO -USER_ONLY = YES -@end example - -@noindent -This will ensure that @code{gnunet-arm} when started by the normal user -will only run services that are per-user, and otherwise rely on the -system-wide services. -Note that the normal user may run gnunet-setup, but the -configuration would be ineffective as the system-wide services will use -@file{/etc/gnunet.conf} and ignore options set by individual users. - -Again, each user should then start the peer using -@file{gnunet-arm -s} --- and strongly consider adding logic to start -the peer automatically to their crontab. - -Afterwards, you should see two (or more, if you have more than one USER) -@code{gnunet-service-arm} processes running in your system. - -@node Killing GNUnet services -@subsection Killing GNUnet services - -It is not necessary to stop GNUnet services explicitly when shutting -down your computer. - -It should be noted that manually killing "most" of the -@code{gnunet-service} processes is generally not a successful method for -stopping a peer (since @code{gnunet-service-arm} will instantly restart -them). The best way to explicitly stop a peer is using -@code{gnunet-arm -e}; note that the per-user services may need to be -terminated before the system-wide services will terminate normally. - -@node Access Control for GNUnet -@subsection Access Control for GNUnet - -This chapter documents how we plan to make access control work within the -GNUnet system for a typical peer. It should be read as a best-practice -installation guide for advanced users and builders of binary -distributions. The recommendations in this guide apply to POSIX-systems -with full support for UNIX domain sockets only. - -Note that this is an advanced topic. The discussion presumes a very good -understanding of users, groups and file permissions. Normal users on -hosts with just a single user can just install GNUnet under their own -account (and possibly allow the installer to use SUDO to grant additional -permissions for special GNUnet tools that need additional rights). -The discussion below largely applies to installations where multiple users -share a system and to installations where the best possible security is -paramount. - -A typical GNUnet system consists of components that fall into four -categories: - -@table @asis - -@item User interfaces -User interfaces are not security sensitive and are supposed to be run and -used by normal system users. -The GTK GUIs and most command-line programs fall into this category. -Some command-line tools (like gnunet-transport) should be excluded as they -offer low-level access that normal users should not need. -@item System services and support tools -System services should always run and offer services that can then be -accessed by the normal users. -System services do not require special permissions, but as they are not -specific to a particular user, they probably should not run as a -particular user. Also, there should typically only be one GNUnet peer per -host. System services include the gnunet-service and gnunet-daemon -programs; support tools include command-line programs such as gnunet-arm. -@item Priviledged helpers -Some GNUnet components require root rights to open raw sockets or perform -other special operations. These gnunet-helper binaries are typically -installed SUID and run from services or daemons. -@item Critical services -Some GNUnet services (such as the DNS service) can manipulate the service -in deep and possibly highly security sensitive ways. For example, the DNS -service can be used to intercept and alter any DNS query originating from -the local machine. Access to the APIs of these critical services and their -priviledged helpers must be tightly controlled. -@end table - -@c FIXME: The titles of these chapters are too long in the index. - -@menu -* Recommendation - Disable access to services via TCP:: -* Recommendation - Run most services as system user "gnunet":: -* Recommendation - Control access to services using group "gnunet":: -* Recommendation - Limit access to certain SUID binaries by group "gnunet":: -* Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns":: -* Differences between "make install" and these recommendations:: -@end menu - -@node Recommendation - Disable access to services via TCP -@subsubsection Recommendation - Disable access to services via TCP - -GNUnet services allow two types of access: via TCP socket or via UNIX -domain socket. -If the service is available via TCP, access control can only be -implemented by restricting connections to a particular range of IP -addresses. -This is acceptable for non-critical services that are supposed to be -available to all users on the local system or local network. -However, as TCP is generally less efficient and it is rarely the case -that a single GNUnet peer is supposed to serve an entire local network, -the default configuration should disable TCP access to all GNUnet -services on systems with support for UNIX domain sockets. -As of GNUnet 0.9.2, configuration files with TCP access disabled should be -generated by default. Users can re-enable TCP access to particular -services simply by specifying a non-zero port number in the section of -the respective service. - - -@node Recommendation - Run most services as system user "gnunet" -@subsubsection Recommendation - Run most services as system user "gnunet" - -GNUnet's main services should be run as a separate user "gnunet" in a -special group "gnunet". -The user "gnunet" should start the peer using "gnunet-arm -s" during -system startup. The home directory for this user should be -@file{/var/lib/gnunet} and the configuration file should be -@file{/etc/gnunet.conf}. -Only the @code{gnunet} user should have the right to access -@file{/var/lib/gnunet} (@emph{mode: 700}). - -@node Recommendation - Control access to services using group "gnunet" -@subsubsection Recommendation - Control access to services using group "gnunet" - -Users that should be allowed to use the GNUnet peer should be added to the -group "gnunet". Using GNUnet's access control mechanism for UNIX domain -sockets, those services that are considered useful to ordinary users -should be made available by setting "UNIX_MATCH_GID=YES" for those -services. -Again, as shipped, GNUnet provides reasonable defaults. -Permissions to access the transport and core subsystems might additionally -be granted without necessarily causing security concerns. -Some services, such as DNS, must NOT be made accessible to the "gnunet" -group (and should thus only be accessible to the "gnunet" user and -services running with this UID). - -@node Recommendation - Limit access to certain SUID binaries by group "gnunet" -@subsubsection Recommendation - Limit access to certain SUID binaries by group "gnunet" - -Most of GNUnet's SUID binaries should be safe even if executed by normal -users. However, it is possible to reduce the risk a little bit more by -making these binaries owned by the group "gnunet" and restricting their -execution to user of the group "gnunet" as well (4750). - -@node Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns" -@subsubsection Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns" - -A special group "gnunetdns" should be created for controlling access to -the "gnunet-helper-dns". -The binary should then be owned by root and be in group "gnunetdns" and -be installed SUID and only be group-executable (2750). -@b{Note that the group "gnunetdns" should have no users in it at all, -ever.} -The "gnunet-service-dns" program should be executed by user "gnunet" (via -gnunet-service-arm) with the binary owned by the user "root" and the group -"gnunetdns" and be SGID (2700). This way, @strong{only} -"gnunet-service-dns" can change its group to "gnunetdns" and execute the -helper, and the helper can then run as root (as per SUID). -Access to the API offered by "gnunet-service-dns" is in turn restricted -to the user "gnunet" (not the group!), which means that only -"benign" services can manipulate DNS queries using "gnunet-service-dns". - -@node Differences between "make install" and these recommendations -@subsubsection Differences between "make install" and these recommendations - -The current build system does not set all permissions automatically based -on the recommendations above. In particular, it does not use the group -"gnunet" at all (so setting gnunet-helpers other than the -gnunet-helper-dns to be owned by group "gnunet" must be done manually). -Furthermore, 'make install' will silently fail to set the DNS binaries to -be owned by group "gnunetdns" unless that group already exists (!). -An alternative name for the "gnunetdns" group can be specified using the -@code{--with-gnunetdns=GRPNAME} configure option. diff --git a/doc/documentation/gnunet.texi b/doc/documentation/gnunet.texi index 22ee8206a..13c3aa9c8 100644 --- a/doc/documentation/gnunet.texi +++ b/doc/documentation/gnunet.texi @@ -113,22 +113,6 @@ Philosophy * Backup of Identities and Egos:: * Revocation:: -GNUnet Installation Handbook - -* Dependencies:: -* Pre-installation notes:: -* Generic installation instructions:: -* Build instructions for Ubuntu 12.04 using Git:: -* Build instructions for software builds from source:: -* Build Instructions for Microsoft Windows Platforms:: -* Build instructions for Debian 7.5:: -* Installing GNUnet from Git on Ubuntu 14.4:: -* Build instructions for Debian 8:: -* Outdated build instructions for previous revisions:: -@c * Portable GNUnet:: -* The graphical configuration interface:: -* How to start and stop a GNUnet peer:: - Using GNUnet * Checking the Installation:: @@ -140,8 +124,6 @@ Using GNUnet * The GNU Name System:: * Using the Virtual Public Network:: -@c Configuration Handbook - GNUnet Contributors Handbook * Contributing to GNUnet:: @@ -152,6 +134,7 @@ GNUnet Contributors Handbook GNUnet Developer Handbook * Developer Introduction:: +* Internal Dependencies:: * Code overview:: * System Architecture:: * Subsystem stability:: @@ -159,6 +142,7 @@ GNUnet Developer Handbook * Build-system:: * Developing extensions for GNUnet using the gnunet-ext template:: * Writing testcases:: +* Building GNUNet and its dependencies:: * TESTING library:: * Performance regression analysis with Gauger:: * TESTBED Subsystem:: -- cgit v1.2.3 From 63775bc55d68efd8d88e0204da99c3e2f3a4e7a0 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 6 Jun 2018 12:19:00 +0000 Subject: doc: stagging file 'FROM_SOURCE' with old repetive instructions Signed-off-by: Nils Gillmann --- doc/FROM_SOURCE | 1423 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1423 insertions(+) create mode 100644 doc/FROM_SOURCE diff --git a/doc/FROM_SOURCE b/doc/FROM_SOURCE new file mode 100644 index 000000000..074b6a91e --- /dev/null +++ b/doc/FROM_SOURCE @@ -0,0 +1,1423 @@ +@node Build instructions for Ubuntu 12.04 using Git +@section Build instructions for Ubuntu 12.04 using Git + +@menu +* Install the required build tools:: +* Install libgcrypt 1.6 and libgpg-error:: +* Install gnutls with DANE support:: +* Install libgnurl:: +* Install libmicrohttpd from Git:: +* Install libextractor from Git:: +* Install GNUnet dependencies:: +* Build GNUnet:: +* Install the GNUnet-gtk user interface from Git:: +@end menu + +@node Install the required build tools +@subsection Install the required build tools + +First, make sure Git is installed on your system: + +@example +$ sudo apt-get install git +@end example + +Install the essential buildtools: + +@example +$ sudo apt-get install automake autopoint autoconf libtool +@end example + +@node Install libgcrypt 1.6 and libgpg-error +@subsection Install libgcrypt 1.6 and libgpg-error + +@ref{generic source installation - libgpg-error} + +@node Install gnutls with DANE support +@subsection Install gnutls with DANE support + +@itemize @bullet +@item @ref{generic source installation - nettle} +@item @ref{generic source installation - ldns} +@item @ref{generic source installation - libunbound/unbound} +@item @ref{generic source installation - gnutls} +@item @ref{generic source installation - libgcrypt} +@end itemize + +@node Install libgnurl +@subsection Install libgnurl + +Follow the @ref{generic source installation - libgnurl}. + +@node Install libmicrohttpd from Git +@subsection Install libmicrohttpd from Git + +@example +$ git clone https://gnunet.org/git/libmicrohttpd +$ cd libmicrohttpd/ +$ ./bootstrap +$ ./configure +$ sudo make install ; cd .. +@end example + +@node Install libextractor from Git +@subsection Install libextractor from Git + +Install libextractor dependencies: + +@example +$ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \ + libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \ + libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \ + g++ +@end example + +Build libextractor: + +@example +$ git clone https://gnunet.org/git/libextractor +$ cd libextractor +$ ./bootstrap +$ ./configure +$ sudo make install ; cd .. +@end example + +@node Install GNUnet dependencies +@subsection Install GNUnet dependencies + +@example +$ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \ + libpulse-dev libbluetooth-dev libsqlite-dev +@end example + +Install libopus: + +@example +$ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz +$ tar xf opus-1.1.tar.gz +$ cd opus-1.1/ +$ ./configure +$ sudo make install ; cd .. +@end example + +Choose one or more database backends: + +SQLite3: +@example +$ sudo apt-get install libsqlite3-dev +@end example +MySQL: +@example +$ sudo apt-get install libmysqlclient-dev +@end example +PostgreSQL: +@example +$ sudo apt-get install libpq-dev postgresql +@end example + + + +@node Build GNUnet +@subsection Build GNUnet + + + +@menu +* Configuring the installation path:: +* Configuring the system:: +* Installing components requiring sudo permission:: +* Build:: +@end menu + +@node Configuring the installation path +@subsubsection Configuring the installation path + +You can specify the location of the GNUnet installation by setting the +prefix when calling the configure script with @code{--prefix=DIRECTORY} + +@example +$ export PATH=$PATH:DIRECTORY/bin +@end example + +@node Configuring the system +@subsubsection Configuring the system + +Please make sure NOW that you have created a user and group 'gnunet' +and additionally a group 'gnunetdns': + +@example +$ sudo addgroup gnunet +$ sudo addgroup gnunetdns +$ sudo adduser gnunet +@end example + +Each GNUnet user should be added to the 'gnunet' group (may +require fresh login to come into effect): + +@example +$ sudo useradd -G gnunet +@end example + +@node Installing components requiring sudo permission +@subsubsection Installing components requiring sudo permission + +Some components, like the nss plugin required for GNS, may require root +permissions. To allow these few components to be installed use: + +@example +$ ./configure --with-sudo +@end example + +@node Build +@subsubsection Build + +@example +$ git clone https://gnunet.org/git/gnunet/ +$ cd gnunet/ +$ ./bootstrap +@end example + +Use the required configure call including the optional installation prefix +@code{PREFIX} or the sudo permissions: + +@example +$ ./configure [ --with-sudo | --with-prefix=PREFIX ] +@end example + +@example +$ make; sudo make install +@end example + +After installing it, you need to create an empty configuration file: + +@example +mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf +@end example + +And finally you can start GNUnet with: + +@example +$ gnunet-arm -s +@end example + +@node Install the GNUnet-gtk user interface from Git +@subsection Install the GNUnet-gtk user interface from Git + + +Install depencies: + +@example +$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \ + libqrencode-dev +@end example + +Build GNUnet (with an optional prefix) and execute: + +@example +$ git clone https://gnunet.org/git/gnunet-gtk/ +$ cd gnunet-gtk/ +$ ./bootstrap +$ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY +$ make; sudo make install +@end example + +@node Build Instructions for Microsoft Windows Platforms +@section Build Instructions for Microsoft Windows Platforms + +@menu +* Introduction to building on MS Windows:: +* Requirements:: +* Dependencies & Initial Setup:: +* GNUnet Installation:: +* Adjusting Windows for running and testing GNUnet:: +* Building the GNUnet Installer:: +* Using GNUnet with Netbeans on Windows:: +@end menu + +@node Introduction to building on MS Windows +@subsection Introduction to building on MS Windows + + +This document is a guide to building GNUnet and its dependencies on +Windows platforms. GNUnet development is mostly done under GNU/Linux and +especially git checkouts may not build out of the box. +We regret any inconvenience, and if you have problems, please report +them. + +@node Requirements +@subsection Requirements + +The Howto is based upon a @strong{Windows Server 2008 32bit} +@strong{Installation}, @strong{sbuild} and thus a +@uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW} +(W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild +is a convenient set of scripts which creates a working msys/mingw +installation and installs most dependencies required for GNUnet. + +As of the point of the creation of these instructions, +GNUnet @strong{requires} a Windows @strong{Server} 2003 or +newer for full feature support. +Windows Vista and later will also work, but +@strong{non-server version can not run a VPN-Exit-Node} as the NAT +features have been removed as of Windows Vista. + +@c TODO: We should document Windows 10! +@c It seems like the situation hasn't changed with W10 + +@node Dependencies & Initial Setup +@subsection Dependencies & Initial Setup + + +@itemize @bullet + +@item +Install a fresh version of @strong{Python 2.x}, even if you are using a +x64-OS, install a 32-bit version for use with sbuild. +Python 3.0 is currently incompatible. + +@item +Install your favorite @uref{http://code.google.com/p/tortoisegit/, git} & +@uref{http://tortoisesvn.net/, subversion}-clients. + +@item +You will also need some archive-manager like +@uref{http://www.7-zip.org/, 7zip}. + +@item +Pull a copy of sbuild to a directory of your choice, which will be used +in the remainder of this guide. For now, we will use +@file{c:\gnunet\sbuild\} + +@item +in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages +@strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild +to compile/install those for us. + +@item +Follow LRN's sbuild installation instructions.- +@end itemize + +Please note that sbuild may (or will most likely) fail during +installation, thus you really HAVE to @strong{check the logfiles} created +during the installation process. +Certain packages may fail to build initially due to missing dependencies, +thus you may have to +@strong{substitute those with binary-versions initially}. Later on once +dependencies are satisfied you can re-build the newer package versions. + +@strong{It is normal that you may have to repeat this step multiple times +and there is no uniform way to fix all compile-time issues, as the +build-process of many of the dependencies installed are rather unstable +on win32 and certain releases may not even compile at all.} + +Most dependencies for GNUnet have been set up by sbuild, thus we now +should add the @file{bin/} directories in your new msys and mingw +installations to PATH. You will want to create a backup of your finished +msys-environment by now. + +@node GNUnet Installation +@subsection GNUnet Installation + +First, we need to launch our msys-shell, you can do this via + +@file{C:\gnunet\sbuild\msys\msys.bat} + +You might wish to take a look at this file and adjust some +login-parameters to your msys environment. + +Also, sbuild added two pointpoints to your msys-environment, though those +might remain invisible: + +@itemize @bullet + +@item +/mingw, which will mount your mingw-directory from sbuild/mingw and the +other one is + +@item +/src which contains all the installation sources sbuild just compiled. +@end itemize + +Check out the current GNUnet sources (git HEAD) from the +GNUnet repository "gnunet.git", we will do this in your home directory: + +@code{git clone https://gnunet.org/git/gnunet/ ~/gnunet} + +Now, we will first need to bootstrap the checked out installation and then +configure it accordingly. + +@example +cd ~/gnunet +./bootstrap +STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \ +./configure --prefix=/ --docdir=/share/doc/gnunet \ +--with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \ +--with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \ +--with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \ +--enable-expensivetests --enable-experimental --with-qrencode=/mingw \ +--enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log +@end example + +The parameters above will configure for a reasonable GNUnet installation +to the your msys-root directory. +Depending on which features your would like to build or you may need to +specify additional dependencies. Sbuild installed most libs into +the /mingw subdirectory, so remember to prefix library locations with +this path. + +Like on a unixoid system, you might want to use your home directory as +prefix for your own GNUnet installation for development, without tainting +the buildenvironment. Just change the "prefix" parameter to point towards +~/ in this case. + +Now it's time to compile GNUnet as usual. Though this will take some time, +so you may fetch yourself a coffee or some Mate now... + +@example +make ; make install +@end example + +@node Adjusting Windows for running and testing GNUnet +@subsection Adjusting Windows for running and testing GNUnet + +Assuming the build succeeded and you +@strong{added the bin directory of your GNUnet to PATH}, you can now use +your gnunet-installation as usual. +Remember that UAC or the windows firewall may popup initially, blocking +further execution of gnunet until you acknowledge them. + +You will also have to take the usual steps to get peer-to-peer (p2p) +software running properly (port forwarding, ...), +and GNUnet will require administrative permissions as it may even +install a device-driver (in case you are using gnunet-vpn and/or +gnunet-exit). + +@node Building the GNUnet Installer +@subsection Building the GNUnet Installer + +The GNUnet installer is made with +@uref{http://nsis.sourceforge.net/, NSIS}. +The installer script is located in @file{contrib\win} in the +GNUnet source tree. + +@node Using GNUnet with Netbeans on Windows +@subsection Using GNUnet with Netbeans on Windows + +TODO + +@node Build instructions for Debian 7.5 +@section Build instructions for Debian 7.5 + + +These are the installation instructions for Debian 7.5. They were tested +using a minimal, fresh Debian 7.5 AMD64 installation without non-free +software (no contrib or non-free). +By "minimal", we mean that during installation, we did not select any +desktop environment, servers or system utilities during the "tasksel" +step. Note that the packages and the dependencies that we will install +during this chapter take about 1.5 GB of disk space. +Combined with GNUnet and space for objects during compilation, you should +not even attempt this unless you have about 2.5 GB free after the minimal +Debian installation. +Using these instructions to build a VM image is likely to require a +minimum of 4-5 GB for the VM (as you will likely also want a desktop +manager). + +GNUnet's security model assumes that your @file{/home} directory is +encrypted. Thus, if possible, you should encrypt your home partition +(or per-user home directory). + +Naturally, the exact details of the starting state for your installation +should not matter much. For example, if you selected any of those +installation groups you might simply already have some of the necessary +packages installed. +We did this for testing, as this way we are less likely to forget to +mention a required package. +Note that we will not install a desktop environment, but of course you +will need to install one to use GNUnet's graphical user interfaces. +Thus, it is suggested that you simply install the desktop environment of +your choice before beginning with the instructions. + + + +@menu +* Update:: +* Stable? Hah!:: +* Update again:: +* Installing packages:: +* Installing dependencies from source:: +* Installing GNUnet from source:: +* But wait there is more!:: +@end menu + +@node Update +@subsection Update + +After any installation, you should begin by running + +@example +# apt-get update ; apt-get upgrade +@end example + +to ensure that all of your packages are up-to-date. Note that the "#" is +used to indicate that you need to type in this command as "root" +(or prefix with "sudo"), whereas "$" is used to indicate typing in a +command as a normal user. + +@node Stable? Hah! +@subsection Stable? Hah! + +Yes, we said we start with a Debian 7.5 "stable" system. However, to +reduce the amount of compilation by hand, we will begin by allowing the +installation of packages from the testing and unstable distributions as +well. +We will stick to "stable" packages where possible, but some packages will +be taken from the other distributions. +Start by modifying @file{/etc/apt/sources.list} to contain the +following (possibly adjusted to point to your mirror of choice): + +@example +# These were there before: +deb http://ftp.de.debian.org/debian/ wheezy main +deb-src http://ftp.de.debian.org/debian/ wheezy main +deb http://security.debian.org/ wheezy/updates main +deb-src http://security.debian.org/ wheezy/updates main +deb http://ftp.de.debian.org/debian/ wheezy-updates main +deb-src http://ftp.de.debian.org/debian/ wheezy-updates main + +# Add these lines (feel free to adjust the mirror): +deb http://ftp.de.debian.org/debian/ testing main +deb http://ftp.de.debian.org/debian/ unstable main +@end example + +The next step is to create/edit your @file{/etc/apt/preferences} +file to look like this: + +@example +Package: * +Pin: release a=stable,n=wheezy +Pin-Priority: 700 + +Package: * +Pin: release o=Debian,a=testing +Pin-Priority: 650 + +Package: * +Pin: release o=Debian,a=unstable +Pin-Priority: 600 +@end example + +You can read more about Apt Preferences here and here. +Note that other pinnings are likely to also work for GNUnet, the key +thing is that you need some packages from unstable (as shown below). +However, as unstable is unlikely to be comprehensive (missing packages) +or might be problematic (crashing packages), you probably want others +from stable and/or testing. + +@node Update again +@subsection Update again + +Now, run again@ + +@example +# apt-get update@ +# apt-get upgrade@ +@end example + +to ensure that all your new distribution indices are downloaded, and +that your pinning is correct: the upgrade step should cause no changes +at all. + +@node Installing packages +@subsection Installing packages + +We begin by installing a few Debian packages from stable:@ + +@example +# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ + libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \ + texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \ + libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \ + libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \ + librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \ + libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \ + libqrencode-dev libgladeui-dev nasm texlive-latex-extra \ + libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev +@end example + +After that, we install a few more packages from unstable:@ + +@example +# apt-get install -t unstable nettle-dev libgstreamer1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + libgstreamer-plugins-base1.0-dev +@end example + +@node Installing dependencies from source +@subsection Installing dependencies from source + +Next, we need to install a few dependencies from source. +You might want to do this as a "normal" user and only run the +@code{make install} steps as root (hence the @code{sudo} in the +commands below). Also, you do this from any +directory. We begin by downloading all dependencies, then extracting the +sources, and finally compiling and installing the libraries. + +For these steps, follow the instructions given in the +installation from source instruction in this order: + +@itemize @bullet +@item @ref{generic source installation - libav} +@item @ref{generic source installation - libextractor} +@item @ref{generic source installation - libgpg-error} +@item @ref{generic source installation - libgcrypt} +@item @ref{generic source installation - gnutls} +@item @ref{generic source installation - libmicrohttpd} +@item @ref{generic source installation - libgnurl} +@end itemize + +@node Installing GNUnet from source +@subsection Installing GNUnet from source + + +For this, simply follow the generic installation instructions from +here. + +@node But wait there is more! +@subsection But wait there is more! + +So far, we installed all of the packages and dependencies required to +ensure that all of GNUnet would be built. +However, while for example the plugins to interact with the MySQL or +Postgres databases have been created, we did not actually install or +configure those databases. Thus, you will need to install +and configure those databases or stick with the default Sqlite database. +Sqlite is usually fine for most applications, but MySQL can offer better +performance and Postgres better resillience. + + +@node Installing GNUnet from Git on Ubuntu 14.4 +@section Installing GNUnet from Git on Ubuntu 14.4 + +@strong{Install the required build tools:} + +@example +$ sudo apt-get install git automake autopoint autoconf +@end example + +@strong{Install the required dependencies} + +@example +$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ + libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ + libmicrohttpd-dev libgnutls28-dev +@end example + +@strong{Choose one or more database backends} + +@itemize @bullet + +@item SQLite3: + +@example +$ sudo apt-get install libsqlite3-dev +@end example + +@item MySQL: + +@example +$ sudo apt-get install libmysqlclient-dev +@end example + +@item PostgreSQL: + +@example +$ sudo apt-get install libpq-dev postgresql +@end example + +@end itemize + +@strong{Install the optional dependencies for gnunet-conversation:} + +@example +$ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev +@end example + +@strong{Install the libgrypt 1.6.1:} + +@itemize @bullet + +@item For Ubuntu 14.04: + +@example +$ sudo apt-get install libgcrypt20-dev +@end example + +@item For Ubuntu older 14.04: + +@example +$ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 +$ tar xf libgcrypt-1.6.1.tar.bz2 +$ cd libgcrypt-1.6.1 +$ ./configure +$ sudo make install +$ cd .. +@end example + +@end itemize + +@strong{Install libgnurl} + +@strong{Install GNUnet} + +@example +$ git clone https://gnunet.org/git/gnunet/ +$ cd gnunet/ +$ ./bootstrap +@end example + +If you want to: + +@itemize @bullet + +@item Install to a different directory: + +@example +--prefix=PREFIX +@end example + +@item +Have sudo permission, but do not want to compile as root: + +@example +--with-sudo +@end example + +@item +Want debug message enabled: + +@example +--enable-logging=verbose +@end example + +@end itemize + + +@example +$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] +$ make; sudo make install +@end example + +After installing it, you need to create an empty configuration file: + +@example +touch ~/.config/gnunet.conf +@end example + +And finally you can start GNUnet with + +@example +$ gnunet-arm -s +@end example + +@node Build instructions for Debian 8 +@section Build instructions for Debian 8 +@c FIXME: I -> we + +These are the installation instructions for Debian 8. They were tested +sing a fresh Debian 8 AMD64 installation without non-free software (no +contrib or non-free). During installation, I only selected "lxde" for the +desktop environment. +Note that the packages and the dependencies that we will install during +this chapter take about 1.5 GB of disk space. Combined with GNUnet and +space for objects during compilation, you should not even attempt this +unless you have about 2.5 GB free after the Debian installation. +Using these instructions to build a VM image is likely to require a +minimum of 4-5 GB for the VM (as you will likely also want a desktop +manager). + +GNUnet's security model assumes that your @code{/home} directory is +encrypted. +Thus, if possible, you should encrypt your entire disk, or at least just +your home partition (or per-user home directory). + +Naturally, the exact details of the starting state for your installation +should not matter much. +For example, if you selected any of those installation groups you might +simply already have some of the necessary packages installed. Thus, it is +suggested that you simply install the desktop environment of your choice +before beginning with the instructions. + + +@menu +* Update Debian:: +* Installing Debian Packages:: +* Installing Dependencies from Source2:: +* Installing GNUnet from Source2:: +* But wait (again) there is more!:: +@end menu + +@node Update Debian +@subsection Update Debian + +After any installation, you should begin by running + +@example +# apt-get update +# apt-get upgrade +@end example + +to ensure that all of your packages are up-to-date. Note that the "#" is +used to indicate that you need to type in this command as "root" (or +prefix with "sudo"), whereas "$" is used to indicate typing in a command +as a normal user. + +@node Installing Debian Packages +@subsection Installing Debian Packages + +We begin by installing a few Debian packages from stable: + +@example +# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ +libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \ +libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \ +libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \ +libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \ +libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \ +texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \ +libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ +libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \ +libgcrypt20-dev libmicrohttpd-dev +@end example + +@node Installing Dependencies from Source2 +@subsection Installing Dependencies from Source2 + +Yes, we said we start with a Debian 8 "stable" system, but because Debian +linked GnuTLS without support for DANE, we need to compile a few things, +in addition to GNUnet, still by hand. Yes, you can run GNUnet using the +respective Debian packages, but then you will not get DANE support. + +Next, we need to install a few dependencies from source. You might want +to do this as a "normal" user and only run the @code{make install} steps +as root (hence the @code{sudo} in the commands below). Also, you do this +from any directory. We begin by downloading all dependencies, then +extracting the sources, and finally compiling and installing the +libraries: + +@example +$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz +$ tar xvf gnutls-3.3.12.tar.xz +$ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd .. +@end example + +For the installation and compilation of libgnurl/gnURL refer to +the generic installation section, +@xref{generic source installation - libgnurl}. + +@node Installing GNUnet from Source2 +@subsection Installing GNUnet from Source2 + +For this, simply follow the generic installation instructions from@ +here. + +@node But wait (again) there is more! +@subsection But wait (again) there is more! + +So far, we installed all of the packages and dependencies required to +ensure that all of GNUnet would be built. However, while for example the +plugins to interact with the MySQL or Postgres databases have been +created, we did not actually install or configure those databases. +Thus, you will need to install and configure those databases or stick +with the default Sqlite database. Sqlite is usually fine for most +applications, but MySQL can offer better performance and Postgres better +resillience. + +@node Build instructions for macOS +@section Build instructions for macOS +@c FIXME: I -> we + +These are the installation guidelines for macOS. +They were tested on macOS High Sierra. + +@menu +* Installing dependencies:: +* Compile from Source:: +@end menu + +@node Installing dependencies +@subsection Installing dependencies + +First, install XCode in the newest version. +See https://developer.apple.com/xcode/. + +Install Homebrew (https://brew.sh) and then install the dependencies listed above. +If a dependency does not exists in brew, you need to compile it from source. + +@example +# brew install +@end example + +@node Compile from Source +@subsection Compile from Source + +Before you start building GNUnet, you need to setup your environment. +This means that you have to make sure the proper tools are used in the build process. +For example, after installing texinfo you need to make sure the new texinfo is actually used: + +@example +# echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.bash_profile +@end example + +Note: brew tells you the appropriate command when executing + +@example +# brew info texinfo +@end example + +This may also be necessary for the gettext package. + +Before you start compiling, you need to make sure gcc is used and not the clang compile of your macOS system. +On my system, gcc was actually ``gcc-7'' and gcc pointed to the clang compiler. + +@example +# export CC=gcc-7 +@end example + +After this the standard compile instructions apply. + +@c @node Build instructions for OpenBSD 6.2 +@c @section Build instructions for OpenBSD 6.2 + +@node Outdated build instructions for previous revisions +@section Outdated build instructions for previous revisions + +This chapter contains a collection of outdated, older installation guides. +They are mostly intended to serve as a starting point for writing +up-to-date instructions and should not be expected to work for +GNUnet 0.10.x. +A set of older installation instructions can also be found in the +file @file{doc/outdated-and-old-installation-instructions.txt} in the +source tree of GNUnet. + +This file covers old instructions which no longer receive security +updates or any kind of support. + +@menu +* Installing GNUnet 0.10.1 on Ubuntu 14.04:: +* Building GLPK for MinGW:: +* GUI build instructions for Ubuntu 12.04 using Subversion:: +@c * Installation with gnunet-update:: +* Instructions for Microsoft Windows Platforms (Old):: +@end menu + + +@node Installing GNUnet 0.10.1 on Ubuntu 14.04 +@subsection Installing GNUnet 0.10.1 on Ubuntu 14.04 + +Install the required dependencies: + +@example +$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ + libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ + libmicrohttpd-dev libgnutls28-dev +@end example + +Choose one or more database backends: + +@itemize @bullet + +@item SQLite3 + +@example + $ sudo apt-get install libsqlite3-dev@ +@end example + +@item MySQL + +@example +$ sudo apt-get install libmysqlclient-dev@ +@end example + +@item PostgreSQL + +@example + $ sudo apt-get install libpq-dev postgresql@ +@end example + +@end itemize + +Install the optional dependencies for gnunet-conversation: + +@example + $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev +@end example + +Install libgcrypt 1.6: + +@itemize @bullet + +@item For Ubuntu 14.04: + +@example +$ sudo apt-get install libgcrypt20-dev +@end example + +@item For Ubuntu older than 14.04: + +@example +wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 +$ tar xf libgcrypt-1.6.1.tar.bz2 +$ cd libgcrypt-1.6.1 +$ ./configure +$ sudo make install +$ cd .. +@end example +@end itemize + +Install libgnurl: + +@pxref{generic source installation - libgnurl}. + +Install GNUnet: + +@example +$ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz +$ tar xf gnunet-0.10.1.tar.gz +$ cd gnunet-0.10.1 +@end example + +If you want to: + +@itemize @bullet + +@item +Install to a different directory: + +@example +--prefix=PREFIX +@end example + +@item +Have sudo permission, but do not want to compile as root: + +@example +--with-sudo +@end example + +@item +Want debug message enabled: + +@example +--enable-logging=verbose +@end example + +@end itemize + +@example +$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] +$ make; sudo make install +@end example + +After installing it, you need to create an empty configuration file: + +@example +touch ~/.config/gnunet.conf +@end example + +And finally you can start GNUnet with + +@example +$ gnunet-arm -s +@end example + +@node Building GLPK for MinGW +@subsection Building GLPK for MinGW + +GNUnet now requires the GNU Linear Programming Kit (GLPK). +Since there's is no package you can install with @code{mingw-get} you +have to compile it from source: + +@itemize @bullet + +@item Download the latest version from +@uref{http://ftp.gnu.org/gnu/glpk/} + +@item Unzip the downloaded source tarball using your favourite +unzipper application In the MSYS shell + +@item change to the respective directory + +@item Configure glpk for "i686-pc-mingw32": + +@example +./configure '--build=i686-pc-mingw32' +@end example + +@item run + +@example +make install check +@end example + +@end itemize + +MinGW does not automatically detect the correct buildtype so you have to +specify it manually. + + +@node GUI build instructions for Ubuntu 12.04 using Subversion +@subsection GUI build instructions for Ubuntu 12.04 using Subversion + +After installing GNUnet you can continue installing the GNUnet GUI tools: + +First, install the required dependencies: + +@example +$ sudo apt-get install libgladeui-dev libqrencode-dev +@end example + +Please ensure that the GNUnet shared libraries can be found by the linker. +If you installed GNUnet libraries in a non standard path +(say GNUNET_PREFIX=/usr/local/lib/), you can + +@itemize @bullet + +@item set the environmental variable permanently to: + +@example +LD_LIBRARY_PATH=$GNUNET_PREFIX +@end example + +@item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf} + +@end itemize + +Now you can checkout and compile the GNUnet GUI tools: + +@example +$ git clone https://gnunet.org/git/gnunet-gtk +$ cd gnunet-gtk +$ ./bootstrap +$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/.. +$ make install +@end example + +@node Instructions for Microsoft Windows Platforms (Old) +@subsection Instructions for Microsoft Windows Platforms (Old) + +This document is a @b{DEPRECATED} installation guide for GNUnet on +Windows. +It will not work for recent GNUnet versions, but maybe it will be of +some use if problems arise. + +The Windows build uses a UNIX emulator for Windows, +@uref{http://www.mingw.org/, MinGW}, to build the executable modules. +These modules run natively on Windows and do not require additional +emulation software besides the usual dependencies. + +GNUnet development is mostly done under GNU/Linux and especially git +checkouts may not build out of the box. +We regret any inconvenience, and if you have problems, please report them. + +@menu +* Hardware and OS requirements:: +* Software installation:: +* Building libextractor and GNUnet:: +* Installer:: +* Source:: +@end menu + +@node Hardware and OS requirements +@subsubsection Hardware and OS requirements + +@itemize @bullet +@item Pentium II or equivalent processor, @geq{} 350 MHz +@item 128 MB RAM +@item 600 MB free disk space +@item Windows 2000 or Windows XP are recommended +@end itemize + +@node Software installation +@subsubsection Software installation + +@itemize @bullet + +@item +@strong{Compression software}@ + +The software packages GNUnet depends on are usually compressed using UNIX +tools like @command{tar}, @command{gzip}, @command{xzip} and +@command{bzip2}. +If you do not already have an utility that is able to extract such +archives, get @uref{http://www.7-zip.org/, 7-Zip}. + +@item +@strong{UNIX environment}@ + +The MinGW project provides the compiler toolchain that is used to build +GNUnet. +Get the following packages from the +@uref{http://sourceforge.net/projects/mingw/files/, MinGW} project: + +@itemize @bullet + +@item GCC core +@item GCC g++ +@item MSYS +@item MSYS Developer Tool Kit (msysDTK) +@item MSYS Developer Tool Kit - msys-autoconf (bin) +@item MSYS Developer Tool Kit - msys-automake (bin) +@item MinGW Runtime +@item MinGW Utilities +@item Windows API +@item Binutils +@item make +@item pdcurses +@item GDB (snapshot) +@end itemize + +@itemize @bullet + + +@item Install MSYS (to c:\mingw, for example.)@ +Do @strong{not} use spaces in the pathname. +For example, avoid a location such as @file{c:\program files\mingw}. + +@item Install MinGW runtime, utilities and GCC to a subdirectory +(to @file{c:\mingw\mingw}, for example) + +@item Install the Development Kit to the MSYS directory +(@file{c:\mingw}) + +@item Create a batch file bash.bat in your MSYS directory with +the files: + +@example +bin\sh.exe --login +@end example + +This batch file opens a shell which is used to invoke the build +processes. +MinGW's standard shell (@command{msys.bat}) is not suitable +because it opens a separate console window. +On Vista, @command{bash.bat} needs to be run as Administrator. + +@item +Start @command{bash.sh} and rename +@file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems: + +@example +mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken +@end example + +@item +Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and +remove the declaration of DATADIR from +(@file{c:\mingw\mingw\include\objidl.h} (lines 55-58) + +@item +Unpack autoconf, automake to the MSYS directory (@file{c:\mingw}) + +@item +Install all other packages to the MinGW directory (@file{c:\mingw\mingw\}) +@end itemize + + +@item @strong{GNU Libtool}@ +GNU Libtool is required to use shared libraries. +Get the prebuilt package from here and unpack it to the +MinGW directory (@file{c:\mingw}) + +@item @strong{Pthreads}@ +GNUnet uses the portable POSIX thread library for multi-threading: + +@itemize @bullet + +@item Save +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a} +(x86) or +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a} +(x64) as libpthread.a into the @file{lib} +directory (@file{c:\mingw\mingw\lib\libpthread.a}). + +@item Save +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll} +(x86) or +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a} +(x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}). + +@item Download all header files from +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/} +to the @file{include} directory (@file{c:\mingw\mingw\include}). +@end itemize + + +@item @strong{GNU MP}@ +GNUnet uses the GNU Multiple Precision library for special cryptographic +operations. Get the GMP binary package from the +@uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and +unpack it to the MinGW directory (@file{c:\mingw\mingw}) + +@item @strong{GNU Gettext}@ +GNU gettext is used to provide national language support. +Get the prebuilt package from hereand unpack it to the MinGW +directory (@file{c:\mingw\mingw}) + +@item @strong{GNU iconv}@ +GNU Libiconv is used for character encoding conversion. +Get the prebuilt package from here and unpack it to the MinGW +directory (@file{c:\mingw\mingw}). + +@item @strong{SQLite}@ +GNUnet uses the SQLite database to store data. +Get the prebuilt binary from here and unpack it to your MinGW directory. + +@item @strong{MySQL}@ +As an alternative to SQLite, GNUnet also supports MySQL. + +@itemize @bullet + +@item Get the binary installer from the +@uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project} +(version 4.1), install it and follow the instructions in +@file{README.mysql}. + +@item Create a temporary build directory (@file{c:\mysql}) + +@item Copy the directories @file{include\} and @file{lib\} from the +MySQL directory to the new directory + +@item Get the patches from +@uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and +@uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the +latter is only required for MySQL + +@example +patch -p 0 +@end example + +@item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll} + +@item Change to @file{lib\} and create an import library: + +@example +dlltool --input-def ../include/libmySQL.def \ +--dllname libmysql.dll \ +--output-lib libmysqlclient.a -k +@end example + +@item Copy include\* to include\mysql\ + +@item Pass @code{--with-mysql=/c/mysql} to +@command{./configure} and copy @file{libmysql.dll} +to your PATH or GNUnet's @file{bin} directory +@end itemize + + +@item @strong{GTK+}@ +@command{gnunet-fs-gtk} and @command{libextractor} depend on GTK. +Get the the binary and developer packages of @command{atk}, +@command{glib}, @command{gtk}, @command{iconv}, +@command{gettext-runtime}, @command{pango} from +@uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them +to the MinGW directory (@file{c:\mingw\mingw}). +@c FIXME: The URL below for pkg-config seems wrong. +Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and +@command{libpng} and unpack them to the MinGW directory +(@file{c:\mingw\mingw}). +Here is an all-in-one package for the +@uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies} +. Do not overwrite any existing files! + +@item @strong{Glade}@ +@command{gnunet-*-gtk} and @command{gnunet-setup} were created using +this interface builder + +@itemize @bullet + +@item Get the Glade and libglade (-bin and -devel) packages +(without GTK!) from +@uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to +the MinGW directory (@file{c:\mingw\mingw}). + +@item Get @command{libxml} from here and unpack it to the MinGW +directory (@file{c:\mingw\mingw}). +@end itemize + +@c FIXME: URLs +@item @strong{zLib}@ +@command{libextractor} requires @command{zLib} to decompress some file +formats. GNUnet uses it to (de)compress meta-data. +Get zLib from here (Signature) and unpack it to the MinGW directory +(@file{c:\mingw\mingw}). + +@item @strong{Bzip2}@ +@command{libextractor} also requires @command{Bzip2} to +decompress some file formats. +Get the Bzip2 (binary and developer package) from +@uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and +unpack it to the MinGW directory (@file{c:\mingw\mingw}). + +@item @strong{Libgcrypt}@ +@command{Libgcrypt} provides the cryptographic functions used by GNUnet. +Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here}, +compile and place it in the MinGW directory +(@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to +compile GNUnet. + +@item @strong{PlibC}@ +PlibC emulates Unix functions under Windows. Get PlibC from here and +unpack it to the MinGW directory (c:\mingw\mingw) + +@item @strong{OGG Vorbis}@ +@command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files. +Get the packages +@uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg} +and +@uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis} +from the +@uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build} +and unpack them to the MinGW directory (c:\mingw\mingw). + +@item @strong{Exiv2}@ +(lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data. +Download +@uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2} +and unpack it to the MSYS directory (c:\mingw). +@end itemize + +@node Building libextractor and GNUnet +@subsubsection Building libextractor and GNUnet + +Before you compile @command{libextractor} or @command{GNUnet}, +be sure to set @code{PKG_CONFIG_PATH}: + +@example +export PKG_CONFIG_PATH=/mingw/lib/pkgconfig +@end example + +@noindent +@xref{GNUnet Installation Handbook}, for basic instructions on building +@command{libextractor} and @command{GNUnet}. +By default, all modules that are created in this way contain +debug information and are quite large. To compile release versions +(small and fast) set the variable @code{CFLAGS}: + +@example +export CFLAGS='-O2 -march=pentium -fomit-frame-pointer' +./configure --prefix=$HOME --with-extractor=$HOME +@end example + +@node Installer +@subsubsection Installer + +The GNUnet installer is made with +@uref{http://nsis.sourceforge.net/, NSIS}. The installer script is +located in @file{contrib\win} in the GNUnet source tree. + +@node Source +@subsubsection Source + +@c FIXME: URL... or: WHERE is HERE? +The sources of all dependencies are available here. -- cgit v1.2.3 From 0379239804ef74dd73c7ba3fac24ce86fecb3ac1 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 6 Jun 2018 12:23:59 +0000 Subject: guix-env.scm: Add python2-future. Signed-off-by: Nils Gillmann --- guix-env.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/guix-env.scm b/guix-env.scm index 11e5451e2..6085f96a9 100644 --- a/guix-env.scm +++ b/guix-env.scm @@ -102,6 +102,7 @@ ("zlib" ,zlib) ("perl" ,perl) ("python-2" ,python-2) ; tests and gnunet-qr + ("python2-future" ,python2-future) ("jansson" ,jansson) ("nss" ,nss) ("glib" ,glib "bin") -- cgit v1.2.3 From d8cba9f05dce5fab72d3dcbcf0d1af6de97575ae Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Fri, 8 Jun 2018 06:16:21 +0000 Subject: doc: create system specific folder and move files into it Signed-off-by: Nils Gillmann --- doc/FROM_SOURCE | 1423 -------------------- doc/outdated-and-old-installation-instructions.txt | 672 --------- doc/system_specific/FROM_SOURCE | 1423 ++++++++++++++++++++ .../outdated-and-old-installation-instructions.txt | 672 +++++++++ 4 files changed, 2095 insertions(+), 2095 deletions(-) delete mode 100644 doc/FROM_SOURCE delete mode 100644 doc/outdated-and-old-installation-instructions.txt create mode 100644 doc/system_specific/FROM_SOURCE create mode 100644 doc/system_specific/outdated-and-old-installation-instructions.txt diff --git a/doc/FROM_SOURCE b/doc/FROM_SOURCE deleted file mode 100644 index 074b6a91e..000000000 --- a/doc/FROM_SOURCE +++ /dev/null @@ -1,1423 +0,0 @@ -@node Build instructions for Ubuntu 12.04 using Git -@section Build instructions for Ubuntu 12.04 using Git - -@menu -* Install the required build tools:: -* Install libgcrypt 1.6 and libgpg-error:: -* Install gnutls with DANE support:: -* Install libgnurl:: -* Install libmicrohttpd from Git:: -* Install libextractor from Git:: -* Install GNUnet dependencies:: -* Build GNUnet:: -* Install the GNUnet-gtk user interface from Git:: -@end menu - -@node Install the required build tools -@subsection Install the required build tools - -First, make sure Git is installed on your system: - -@example -$ sudo apt-get install git -@end example - -Install the essential buildtools: - -@example -$ sudo apt-get install automake autopoint autoconf libtool -@end example - -@node Install libgcrypt 1.6 and libgpg-error -@subsection Install libgcrypt 1.6 and libgpg-error - -@ref{generic source installation - libgpg-error} - -@node Install gnutls with DANE support -@subsection Install gnutls with DANE support - -@itemize @bullet -@item @ref{generic source installation - nettle} -@item @ref{generic source installation - ldns} -@item @ref{generic source installation - libunbound/unbound} -@item @ref{generic source installation - gnutls} -@item @ref{generic source installation - libgcrypt} -@end itemize - -@node Install libgnurl -@subsection Install libgnurl - -Follow the @ref{generic source installation - libgnurl}. - -@node Install libmicrohttpd from Git -@subsection Install libmicrohttpd from Git - -@example -$ git clone https://gnunet.org/git/libmicrohttpd -$ cd libmicrohttpd/ -$ ./bootstrap -$ ./configure -$ sudo make install ; cd .. -@end example - -@node Install libextractor from Git -@subsection Install libextractor from Git - -Install libextractor dependencies: - -@example -$ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \ - libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \ - libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \ - g++ -@end example - -Build libextractor: - -@example -$ git clone https://gnunet.org/git/libextractor -$ cd libextractor -$ ./bootstrap -$ ./configure -$ sudo make install ; cd .. -@end example - -@node Install GNUnet dependencies -@subsection Install GNUnet dependencies - -@example -$ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \ - libpulse-dev libbluetooth-dev libsqlite-dev -@end example - -Install libopus: - -@example -$ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz -$ tar xf opus-1.1.tar.gz -$ cd opus-1.1/ -$ ./configure -$ sudo make install ; cd .. -@end example - -Choose one or more database backends: - -SQLite3: -@example -$ sudo apt-get install libsqlite3-dev -@end example -MySQL: -@example -$ sudo apt-get install libmysqlclient-dev -@end example -PostgreSQL: -@example -$ sudo apt-get install libpq-dev postgresql -@end example - - - -@node Build GNUnet -@subsection Build GNUnet - - - -@menu -* Configuring the installation path:: -* Configuring the system:: -* Installing components requiring sudo permission:: -* Build:: -@end menu - -@node Configuring the installation path -@subsubsection Configuring the installation path - -You can specify the location of the GNUnet installation by setting the -prefix when calling the configure script with @code{--prefix=DIRECTORY} - -@example -$ export PATH=$PATH:DIRECTORY/bin -@end example - -@node Configuring the system -@subsubsection Configuring the system - -Please make sure NOW that you have created a user and group 'gnunet' -and additionally a group 'gnunetdns': - -@example -$ sudo addgroup gnunet -$ sudo addgroup gnunetdns -$ sudo adduser gnunet -@end example - -Each GNUnet user should be added to the 'gnunet' group (may -require fresh login to come into effect): - -@example -$ sudo useradd -G gnunet -@end example - -@node Installing components requiring sudo permission -@subsubsection Installing components requiring sudo permission - -Some components, like the nss plugin required for GNS, may require root -permissions. To allow these few components to be installed use: - -@example -$ ./configure --with-sudo -@end example - -@node Build -@subsubsection Build - -@example -$ git clone https://gnunet.org/git/gnunet/ -$ cd gnunet/ -$ ./bootstrap -@end example - -Use the required configure call including the optional installation prefix -@code{PREFIX} or the sudo permissions: - -@example -$ ./configure [ --with-sudo | --with-prefix=PREFIX ] -@end example - -@example -$ make; sudo make install -@end example - -After installing it, you need to create an empty configuration file: - -@example -mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf -@end example - -And finally you can start GNUnet with: - -@example -$ gnunet-arm -s -@end example - -@node Install the GNUnet-gtk user interface from Git -@subsection Install the GNUnet-gtk user interface from Git - - -Install depencies: - -@example -$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \ - libqrencode-dev -@end example - -Build GNUnet (with an optional prefix) and execute: - -@example -$ git clone https://gnunet.org/git/gnunet-gtk/ -$ cd gnunet-gtk/ -$ ./bootstrap -$ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY -$ make; sudo make install -@end example - -@node Build Instructions for Microsoft Windows Platforms -@section Build Instructions for Microsoft Windows Platforms - -@menu -* Introduction to building on MS Windows:: -* Requirements:: -* Dependencies & Initial Setup:: -* GNUnet Installation:: -* Adjusting Windows for running and testing GNUnet:: -* Building the GNUnet Installer:: -* Using GNUnet with Netbeans on Windows:: -@end menu - -@node Introduction to building on MS Windows -@subsection Introduction to building on MS Windows - - -This document is a guide to building GNUnet and its dependencies on -Windows platforms. GNUnet development is mostly done under GNU/Linux and -especially git checkouts may not build out of the box. -We regret any inconvenience, and if you have problems, please report -them. - -@node Requirements -@subsection Requirements - -The Howto is based upon a @strong{Windows Server 2008 32bit} -@strong{Installation}, @strong{sbuild} and thus a -@uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW} -(W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild -is a convenient set of scripts which creates a working msys/mingw -installation and installs most dependencies required for GNUnet. - -As of the point of the creation of these instructions, -GNUnet @strong{requires} a Windows @strong{Server} 2003 or -newer for full feature support. -Windows Vista and later will also work, but -@strong{non-server version can not run a VPN-Exit-Node} as the NAT -features have been removed as of Windows Vista. - -@c TODO: We should document Windows 10! -@c It seems like the situation hasn't changed with W10 - -@node Dependencies & Initial Setup -@subsection Dependencies & Initial Setup - - -@itemize @bullet - -@item -Install a fresh version of @strong{Python 2.x}, even if you are using a -x64-OS, install a 32-bit version for use with sbuild. -Python 3.0 is currently incompatible. - -@item -Install your favorite @uref{http://code.google.com/p/tortoisegit/, git} & -@uref{http://tortoisesvn.net/, subversion}-clients. - -@item -You will also need some archive-manager like -@uref{http://www.7-zip.org/, 7zip}. - -@item -Pull a copy of sbuild to a directory of your choice, which will be used -in the remainder of this guide. For now, we will use -@file{c:\gnunet\sbuild\} - -@item -in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages -@strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild -to compile/install those for us. - -@item -Follow LRN's sbuild installation instructions.- -@end itemize - -Please note that sbuild may (or will most likely) fail during -installation, thus you really HAVE to @strong{check the logfiles} created -during the installation process. -Certain packages may fail to build initially due to missing dependencies, -thus you may have to -@strong{substitute those with binary-versions initially}. Later on once -dependencies are satisfied you can re-build the newer package versions. - -@strong{It is normal that you may have to repeat this step multiple times -and there is no uniform way to fix all compile-time issues, as the -build-process of many of the dependencies installed are rather unstable -on win32 and certain releases may not even compile at all.} - -Most dependencies for GNUnet have been set up by sbuild, thus we now -should add the @file{bin/} directories in your new msys and mingw -installations to PATH. You will want to create a backup of your finished -msys-environment by now. - -@node GNUnet Installation -@subsection GNUnet Installation - -First, we need to launch our msys-shell, you can do this via - -@file{C:\gnunet\sbuild\msys\msys.bat} - -You might wish to take a look at this file and adjust some -login-parameters to your msys environment. - -Also, sbuild added two pointpoints to your msys-environment, though those -might remain invisible: - -@itemize @bullet - -@item -/mingw, which will mount your mingw-directory from sbuild/mingw and the -other one is - -@item -/src which contains all the installation sources sbuild just compiled. -@end itemize - -Check out the current GNUnet sources (git HEAD) from the -GNUnet repository "gnunet.git", we will do this in your home directory: - -@code{git clone https://gnunet.org/git/gnunet/ ~/gnunet} - -Now, we will first need to bootstrap the checked out installation and then -configure it accordingly. - -@example -cd ~/gnunet -./bootstrap -STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \ -./configure --prefix=/ --docdir=/share/doc/gnunet \ ---with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \ ---with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \ ---with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \ ---enable-expensivetests --enable-experimental --with-qrencode=/mingw \ ---enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log -@end example - -The parameters above will configure for a reasonable GNUnet installation -to the your msys-root directory. -Depending on which features your would like to build or you may need to -specify additional dependencies. Sbuild installed most libs into -the /mingw subdirectory, so remember to prefix library locations with -this path. - -Like on a unixoid system, you might want to use your home directory as -prefix for your own GNUnet installation for development, without tainting -the buildenvironment. Just change the "prefix" parameter to point towards -~/ in this case. - -Now it's time to compile GNUnet as usual. Though this will take some time, -so you may fetch yourself a coffee or some Mate now... - -@example -make ; make install -@end example - -@node Adjusting Windows for running and testing GNUnet -@subsection Adjusting Windows for running and testing GNUnet - -Assuming the build succeeded and you -@strong{added the bin directory of your GNUnet to PATH}, you can now use -your gnunet-installation as usual. -Remember that UAC or the windows firewall may popup initially, blocking -further execution of gnunet until you acknowledge them. - -You will also have to take the usual steps to get peer-to-peer (p2p) -software running properly (port forwarding, ...), -and GNUnet will require administrative permissions as it may even -install a device-driver (in case you are using gnunet-vpn and/or -gnunet-exit). - -@node Building the GNUnet Installer -@subsection Building the GNUnet Installer - -The GNUnet installer is made with -@uref{http://nsis.sourceforge.net/, NSIS}. -The installer script is located in @file{contrib\win} in the -GNUnet source tree. - -@node Using GNUnet with Netbeans on Windows -@subsection Using GNUnet with Netbeans on Windows - -TODO - -@node Build instructions for Debian 7.5 -@section Build instructions for Debian 7.5 - - -These are the installation instructions for Debian 7.5. They were tested -using a minimal, fresh Debian 7.5 AMD64 installation without non-free -software (no contrib or non-free). -By "minimal", we mean that during installation, we did not select any -desktop environment, servers or system utilities during the "tasksel" -step. Note that the packages and the dependencies that we will install -during this chapter take about 1.5 GB of disk space. -Combined with GNUnet and space for objects during compilation, you should -not even attempt this unless you have about 2.5 GB free after the minimal -Debian installation. -Using these instructions to build a VM image is likely to require a -minimum of 4-5 GB for the VM (as you will likely also want a desktop -manager). - -GNUnet's security model assumes that your @file{/home} directory is -encrypted. Thus, if possible, you should encrypt your home partition -(or per-user home directory). - -Naturally, the exact details of the starting state for your installation -should not matter much. For example, if you selected any of those -installation groups you might simply already have some of the necessary -packages installed. -We did this for testing, as this way we are less likely to forget to -mention a required package. -Note that we will not install a desktop environment, but of course you -will need to install one to use GNUnet's graphical user interfaces. -Thus, it is suggested that you simply install the desktop environment of -your choice before beginning with the instructions. - - - -@menu -* Update:: -* Stable? Hah!:: -* Update again:: -* Installing packages:: -* Installing dependencies from source:: -* Installing GNUnet from source:: -* But wait there is more!:: -@end menu - -@node Update -@subsection Update - -After any installation, you should begin by running - -@example -# apt-get update ; apt-get upgrade -@end example - -to ensure that all of your packages are up-to-date. Note that the "#" is -used to indicate that you need to type in this command as "root" -(or prefix with "sudo"), whereas "$" is used to indicate typing in a -command as a normal user. - -@node Stable? Hah! -@subsection Stable? Hah! - -Yes, we said we start with a Debian 7.5 "stable" system. However, to -reduce the amount of compilation by hand, we will begin by allowing the -installation of packages from the testing and unstable distributions as -well. -We will stick to "stable" packages where possible, but some packages will -be taken from the other distributions. -Start by modifying @file{/etc/apt/sources.list} to contain the -following (possibly adjusted to point to your mirror of choice): - -@example -# These were there before: -deb http://ftp.de.debian.org/debian/ wheezy main -deb-src http://ftp.de.debian.org/debian/ wheezy main -deb http://security.debian.org/ wheezy/updates main -deb-src http://security.debian.org/ wheezy/updates main -deb http://ftp.de.debian.org/debian/ wheezy-updates main -deb-src http://ftp.de.debian.org/debian/ wheezy-updates main - -# Add these lines (feel free to adjust the mirror): -deb http://ftp.de.debian.org/debian/ testing main -deb http://ftp.de.debian.org/debian/ unstable main -@end example - -The next step is to create/edit your @file{/etc/apt/preferences} -file to look like this: - -@example -Package: * -Pin: release a=stable,n=wheezy -Pin-Priority: 700 - -Package: * -Pin: release o=Debian,a=testing -Pin-Priority: 650 - -Package: * -Pin: release o=Debian,a=unstable -Pin-Priority: 600 -@end example - -You can read more about Apt Preferences here and here. -Note that other pinnings are likely to also work for GNUnet, the key -thing is that you need some packages from unstable (as shown below). -However, as unstable is unlikely to be comprehensive (missing packages) -or might be problematic (crashing packages), you probably want others -from stable and/or testing. - -@node Update again -@subsection Update again - -Now, run again@ - -@example -# apt-get update@ -# apt-get upgrade@ -@end example - -to ensure that all your new distribution indices are downloaded, and -that your pinning is correct: the upgrade step should cause no changes -at all. - -@node Installing packages -@subsection Installing packages - -We begin by installing a few Debian packages from stable:@ - -@example -# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ - libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \ - texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \ - libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \ - libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \ - librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \ - libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \ - libqrencode-dev libgladeui-dev nasm texlive-latex-extra \ - libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev -@end example - -After that, we install a few more packages from unstable:@ - -@example -# apt-get install -t unstable nettle-dev libgstreamer1.0-dev \ - gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ - libgstreamer-plugins-base1.0-dev -@end example - -@node Installing dependencies from source -@subsection Installing dependencies from source - -Next, we need to install a few dependencies from source. -You might want to do this as a "normal" user and only run the -@code{make install} steps as root (hence the @code{sudo} in the -commands below). Also, you do this from any -directory. We begin by downloading all dependencies, then extracting the -sources, and finally compiling and installing the libraries. - -For these steps, follow the instructions given in the -installation from source instruction in this order: - -@itemize @bullet -@item @ref{generic source installation - libav} -@item @ref{generic source installation - libextractor} -@item @ref{generic source installation - libgpg-error} -@item @ref{generic source installation - libgcrypt} -@item @ref{generic source installation - gnutls} -@item @ref{generic source installation - libmicrohttpd} -@item @ref{generic source installation - libgnurl} -@end itemize - -@node Installing GNUnet from source -@subsection Installing GNUnet from source - - -For this, simply follow the generic installation instructions from -here. - -@node But wait there is more! -@subsection But wait there is more! - -So far, we installed all of the packages and dependencies required to -ensure that all of GNUnet would be built. -However, while for example the plugins to interact with the MySQL or -Postgres databases have been created, we did not actually install or -configure those databases. Thus, you will need to install -and configure those databases or stick with the default Sqlite database. -Sqlite is usually fine for most applications, but MySQL can offer better -performance and Postgres better resillience. - - -@node Installing GNUnet from Git on Ubuntu 14.4 -@section Installing GNUnet from Git on Ubuntu 14.4 - -@strong{Install the required build tools:} - -@example -$ sudo apt-get install git automake autopoint autoconf -@end example - -@strong{Install the required dependencies} - -@example -$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ - libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ - libmicrohttpd-dev libgnutls28-dev -@end example - -@strong{Choose one or more database backends} - -@itemize @bullet - -@item SQLite3: - -@example -$ sudo apt-get install libsqlite3-dev -@end example - -@item MySQL: - -@example -$ sudo apt-get install libmysqlclient-dev -@end example - -@item PostgreSQL: - -@example -$ sudo apt-get install libpq-dev postgresql -@end example - -@end itemize - -@strong{Install the optional dependencies for gnunet-conversation:} - -@example -$ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev -@end example - -@strong{Install the libgrypt 1.6.1:} - -@itemize @bullet - -@item For Ubuntu 14.04: - -@example -$ sudo apt-get install libgcrypt20-dev -@end example - -@item For Ubuntu older 14.04: - -@example -$ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 -$ tar xf libgcrypt-1.6.1.tar.bz2 -$ cd libgcrypt-1.6.1 -$ ./configure -$ sudo make install -$ cd .. -@end example - -@end itemize - -@strong{Install libgnurl} - -@strong{Install GNUnet} - -@example -$ git clone https://gnunet.org/git/gnunet/ -$ cd gnunet/ -$ ./bootstrap -@end example - -If you want to: - -@itemize @bullet - -@item Install to a different directory: - -@example ---prefix=PREFIX -@end example - -@item -Have sudo permission, but do not want to compile as root: - -@example ---with-sudo -@end example - -@item -Want debug message enabled: - -@example ---enable-logging=verbose -@end example - -@end itemize - - -@example -$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] -$ make; sudo make install -@end example - -After installing it, you need to create an empty configuration file: - -@example -touch ~/.config/gnunet.conf -@end example - -And finally you can start GNUnet with - -@example -$ gnunet-arm -s -@end example - -@node Build instructions for Debian 8 -@section Build instructions for Debian 8 -@c FIXME: I -> we - -These are the installation instructions for Debian 8. They were tested -sing a fresh Debian 8 AMD64 installation without non-free software (no -contrib or non-free). During installation, I only selected "lxde" for the -desktop environment. -Note that the packages and the dependencies that we will install during -this chapter take about 1.5 GB of disk space. Combined with GNUnet and -space for objects during compilation, you should not even attempt this -unless you have about 2.5 GB free after the Debian installation. -Using these instructions to build a VM image is likely to require a -minimum of 4-5 GB for the VM (as you will likely also want a desktop -manager). - -GNUnet's security model assumes that your @code{/home} directory is -encrypted. -Thus, if possible, you should encrypt your entire disk, or at least just -your home partition (or per-user home directory). - -Naturally, the exact details of the starting state for your installation -should not matter much. -For example, if you selected any of those installation groups you might -simply already have some of the necessary packages installed. Thus, it is -suggested that you simply install the desktop environment of your choice -before beginning with the instructions. - - -@menu -* Update Debian:: -* Installing Debian Packages:: -* Installing Dependencies from Source2:: -* Installing GNUnet from Source2:: -* But wait (again) there is more!:: -@end menu - -@node Update Debian -@subsection Update Debian - -After any installation, you should begin by running - -@example -# apt-get update -# apt-get upgrade -@end example - -to ensure that all of your packages are up-to-date. Note that the "#" is -used to indicate that you need to type in this command as "root" (or -prefix with "sudo"), whereas "$" is used to indicate typing in a command -as a normal user. - -@node Installing Debian Packages -@subsection Installing Debian Packages - -We begin by installing a few Debian packages from stable: - -@example -# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ -libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \ -libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \ -libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \ -libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \ -libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \ -texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \ -libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ -libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \ -libgcrypt20-dev libmicrohttpd-dev -@end example - -@node Installing Dependencies from Source2 -@subsection Installing Dependencies from Source2 - -Yes, we said we start with a Debian 8 "stable" system, but because Debian -linked GnuTLS without support for DANE, we need to compile a few things, -in addition to GNUnet, still by hand. Yes, you can run GNUnet using the -respective Debian packages, but then you will not get DANE support. - -Next, we need to install a few dependencies from source. You might want -to do this as a "normal" user and only run the @code{make install} steps -as root (hence the @code{sudo} in the commands below). Also, you do this -from any directory. We begin by downloading all dependencies, then -extracting the sources, and finally compiling and installing the -libraries: - -@example -$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz -$ tar xvf gnutls-3.3.12.tar.xz -$ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd .. -@end example - -For the installation and compilation of libgnurl/gnURL refer to -the generic installation section, -@xref{generic source installation - libgnurl}. - -@node Installing GNUnet from Source2 -@subsection Installing GNUnet from Source2 - -For this, simply follow the generic installation instructions from@ -here. - -@node But wait (again) there is more! -@subsection But wait (again) there is more! - -So far, we installed all of the packages and dependencies required to -ensure that all of GNUnet would be built. However, while for example the -plugins to interact with the MySQL or Postgres databases have been -created, we did not actually install or configure those databases. -Thus, you will need to install and configure those databases or stick -with the default Sqlite database. Sqlite is usually fine for most -applications, but MySQL can offer better performance and Postgres better -resillience. - -@node Build instructions for macOS -@section Build instructions for macOS -@c FIXME: I -> we - -These are the installation guidelines for macOS. -They were tested on macOS High Sierra. - -@menu -* Installing dependencies:: -* Compile from Source:: -@end menu - -@node Installing dependencies -@subsection Installing dependencies - -First, install XCode in the newest version. -See https://developer.apple.com/xcode/. - -Install Homebrew (https://brew.sh) and then install the dependencies listed above. -If a dependency does not exists in brew, you need to compile it from source. - -@example -# brew install -@end example - -@node Compile from Source -@subsection Compile from Source - -Before you start building GNUnet, you need to setup your environment. -This means that you have to make sure the proper tools are used in the build process. -For example, after installing texinfo you need to make sure the new texinfo is actually used: - -@example -# echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.bash_profile -@end example - -Note: brew tells you the appropriate command when executing - -@example -# brew info texinfo -@end example - -This may also be necessary for the gettext package. - -Before you start compiling, you need to make sure gcc is used and not the clang compile of your macOS system. -On my system, gcc was actually ``gcc-7'' and gcc pointed to the clang compiler. - -@example -# export CC=gcc-7 -@end example - -After this the standard compile instructions apply. - -@c @node Build instructions for OpenBSD 6.2 -@c @section Build instructions for OpenBSD 6.2 - -@node Outdated build instructions for previous revisions -@section Outdated build instructions for previous revisions - -This chapter contains a collection of outdated, older installation guides. -They are mostly intended to serve as a starting point for writing -up-to-date instructions and should not be expected to work for -GNUnet 0.10.x. -A set of older installation instructions can also be found in the -file @file{doc/outdated-and-old-installation-instructions.txt} in the -source tree of GNUnet. - -This file covers old instructions which no longer receive security -updates or any kind of support. - -@menu -* Installing GNUnet 0.10.1 on Ubuntu 14.04:: -* Building GLPK for MinGW:: -* GUI build instructions for Ubuntu 12.04 using Subversion:: -@c * Installation with gnunet-update:: -* Instructions for Microsoft Windows Platforms (Old):: -@end menu - - -@node Installing GNUnet 0.10.1 on Ubuntu 14.04 -@subsection Installing GNUnet 0.10.1 on Ubuntu 14.04 - -Install the required dependencies: - -@example -$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ - libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ - libmicrohttpd-dev libgnutls28-dev -@end example - -Choose one or more database backends: - -@itemize @bullet - -@item SQLite3 - -@example - $ sudo apt-get install libsqlite3-dev@ -@end example - -@item MySQL - -@example -$ sudo apt-get install libmysqlclient-dev@ -@end example - -@item PostgreSQL - -@example - $ sudo apt-get install libpq-dev postgresql@ -@end example - -@end itemize - -Install the optional dependencies for gnunet-conversation: - -@example - $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev -@end example - -Install libgcrypt 1.6: - -@itemize @bullet - -@item For Ubuntu 14.04: - -@example -$ sudo apt-get install libgcrypt20-dev -@end example - -@item For Ubuntu older than 14.04: - -@example -wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 -$ tar xf libgcrypt-1.6.1.tar.bz2 -$ cd libgcrypt-1.6.1 -$ ./configure -$ sudo make install -$ cd .. -@end example -@end itemize - -Install libgnurl: - -@pxref{generic source installation - libgnurl}. - -Install GNUnet: - -@example -$ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz -$ tar xf gnunet-0.10.1.tar.gz -$ cd gnunet-0.10.1 -@end example - -If you want to: - -@itemize @bullet - -@item -Install to a different directory: - -@example ---prefix=PREFIX -@end example - -@item -Have sudo permission, but do not want to compile as root: - -@example ---with-sudo -@end example - -@item -Want debug message enabled: - -@example ---enable-logging=verbose -@end example - -@end itemize - -@example -$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] -$ make; sudo make install -@end example - -After installing it, you need to create an empty configuration file: - -@example -touch ~/.config/gnunet.conf -@end example - -And finally you can start GNUnet with - -@example -$ gnunet-arm -s -@end example - -@node Building GLPK for MinGW -@subsection Building GLPK for MinGW - -GNUnet now requires the GNU Linear Programming Kit (GLPK). -Since there's is no package you can install with @code{mingw-get} you -have to compile it from source: - -@itemize @bullet - -@item Download the latest version from -@uref{http://ftp.gnu.org/gnu/glpk/} - -@item Unzip the downloaded source tarball using your favourite -unzipper application In the MSYS shell - -@item change to the respective directory - -@item Configure glpk for "i686-pc-mingw32": - -@example -./configure '--build=i686-pc-mingw32' -@end example - -@item run - -@example -make install check -@end example - -@end itemize - -MinGW does not automatically detect the correct buildtype so you have to -specify it manually. - - -@node GUI build instructions for Ubuntu 12.04 using Subversion -@subsection GUI build instructions for Ubuntu 12.04 using Subversion - -After installing GNUnet you can continue installing the GNUnet GUI tools: - -First, install the required dependencies: - -@example -$ sudo apt-get install libgladeui-dev libqrencode-dev -@end example - -Please ensure that the GNUnet shared libraries can be found by the linker. -If you installed GNUnet libraries in a non standard path -(say GNUNET_PREFIX=/usr/local/lib/), you can - -@itemize @bullet - -@item set the environmental variable permanently to: - -@example -LD_LIBRARY_PATH=$GNUNET_PREFIX -@end example - -@item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf} - -@end itemize - -Now you can checkout and compile the GNUnet GUI tools: - -@example -$ git clone https://gnunet.org/git/gnunet-gtk -$ cd gnunet-gtk -$ ./bootstrap -$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/.. -$ make install -@end example - -@node Instructions for Microsoft Windows Platforms (Old) -@subsection Instructions for Microsoft Windows Platforms (Old) - -This document is a @b{DEPRECATED} installation guide for GNUnet on -Windows. -It will not work for recent GNUnet versions, but maybe it will be of -some use if problems arise. - -The Windows build uses a UNIX emulator for Windows, -@uref{http://www.mingw.org/, MinGW}, to build the executable modules. -These modules run natively on Windows and do not require additional -emulation software besides the usual dependencies. - -GNUnet development is mostly done under GNU/Linux and especially git -checkouts may not build out of the box. -We regret any inconvenience, and if you have problems, please report them. - -@menu -* Hardware and OS requirements:: -* Software installation:: -* Building libextractor and GNUnet:: -* Installer:: -* Source:: -@end menu - -@node Hardware and OS requirements -@subsubsection Hardware and OS requirements - -@itemize @bullet -@item Pentium II or equivalent processor, @geq{} 350 MHz -@item 128 MB RAM -@item 600 MB free disk space -@item Windows 2000 or Windows XP are recommended -@end itemize - -@node Software installation -@subsubsection Software installation - -@itemize @bullet - -@item -@strong{Compression software}@ - -The software packages GNUnet depends on are usually compressed using UNIX -tools like @command{tar}, @command{gzip}, @command{xzip} and -@command{bzip2}. -If you do not already have an utility that is able to extract such -archives, get @uref{http://www.7-zip.org/, 7-Zip}. - -@item -@strong{UNIX environment}@ - -The MinGW project provides the compiler toolchain that is used to build -GNUnet. -Get the following packages from the -@uref{http://sourceforge.net/projects/mingw/files/, MinGW} project: - -@itemize @bullet - -@item GCC core -@item GCC g++ -@item MSYS -@item MSYS Developer Tool Kit (msysDTK) -@item MSYS Developer Tool Kit - msys-autoconf (bin) -@item MSYS Developer Tool Kit - msys-automake (bin) -@item MinGW Runtime -@item MinGW Utilities -@item Windows API -@item Binutils -@item make -@item pdcurses -@item GDB (snapshot) -@end itemize - -@itemize @bullet - - -@item Install MSYS (to c:\mingw, for example.)@ -Do @strong{not} use spaces in the pathname. -For example, avoid a location such as @file{c:\program files\mingw}. - -@item Install MinGW runtime, utilities and GCC to a subdirectory -(to @file{c:\mingw\mingw}, for example) - -@item Install the Development Kit to the MSYS directory -(@file{c:\mingw}) - -@item Create a batch file bash.bat in your MSYS directory with -the files: - -@example -bin\sh.exe --login -@end example - -This batch file opens a shell which is used to invoke the build -processes. -MinGW's standard shell (@command{msys.bat}) is not suitable -because it opens a separate console window. -On Vista, @command{bash.bat} needs to be run as Administrator. - -@item -Start @command{bash.sh} and rename -@file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems: - -@example -mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken -@end example - -@item -Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and -remove the declaration of DATADIR from -(@file{c:\mingw\mingw\include\objidl.h} (lines 55-58) - -@item -Unpack autoconf, automake to the MSYS directory (@file{c:\mingw}) - -@item -Install all other packages to the MinGW directory (@file{c:\mingw\mingw\}) -@end itemize - - -@item @strong{GNU Libtool}@ -GNU Libtool is required to use shared libraries. -Get the prebuilt package from here and unpack it to the -MinGW directory (@file{c:\mingw}) - -@item @strong{Pthreads}@ -GNUnet uses the portable POSIX thread library for multi-threading: - -@itemize @bullet - -@item Save -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a} -(x86) or -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a} -(x64) as libpthread.a into the @file{lib} -directory (@file{c:\mingw\mingw\lib\libpthread.a}). - -@item Save -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll} -(x86) or -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a} -(x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}). - -@item Download all header files from -@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/} -to the @file{include} directory (@file{c:\mingw\mingw\include}). -@end itemize - - -@item @strong{GNU MP}@ -GNUnet uses the GNU Multiple Precision library for special cryptographic -operations. Get the GMP binary package from the -@uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and -unpack it to the MinGW directory (@file{c:\mingw\mingw}) - -@item @strong{GNU Gettext}@ -GNU gettext is used to provide national language support. -Get the prebuilt package from hereand unpack it to the MinGW -directory (@file{c:\mingw\mingw}) - -@item @strong{GNU iconv}@ -GNU Libiconv is used for character encoding conversion. -Get the prebuilt package from here and unpack it to the MinGW -directory (@file{c:\mingw\mingw}). - -@item @strong{SQLite}@ -GNUnet uses the SQLite database to store data. -Get the prebuilt binary from here and unpack it to your MinGW directory. - -@item @strong{MySQL}@ -As an alternative to SQLite, GNUnet also supports MySQL. - -@itemize @bullet - -@item Get the binary installer from the -@uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project} -(version 4.1), install it and follow the instructions in -@file{README.mysql}. - -@item Create a temporary build directory (@file{c:\mysql}) - -@item Copy the directories @file{include\} and @file{lib\} from the -MySQL directory to the new directory - -@item Get the patches from -@uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and -@uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the -latter is only required for MySQL - -@example -patch -p 0 -@end example - -@item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll} - -@item Change to @file{lib\} and create an import library: - -@example -dlltool --input-def ../include/libmySQL.def \ ---dllname libmysql.dll \ ---output-lib libmysqlclient.a -k -@end example - -@item Copy include\* to include\mysql\ - -@item Pass @code{--with-mysql=/c/mysql} to -@command{./configure} and copy @file{libmysql.dll} -to your PATH or GNUnet's @file{bin} directory -@end itemize - - -@item @strong{GTK+}@ -@command{gnunet-fs-gtk} and @command{libextractor} depend on GTK. -Get the the binary and developer packages of @command{atk}, -@command{glib}, @command{gtk}, @command{iconv}, -@command{gettext-runtime}, @command{pango} from -@uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them -to the MinGW directory (@file{c:\mingw\mingw}). -@c FIXME: The URL below for pkg-config seems wrong. -Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and -@command{libpng} and unpack them to the MinGW directory -(@file{c:\mingw\mingw}). -Here is an all-in-one package for the -@uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies} -. Do not overwrite any existing files! - -@item @strong{Glade}@ -@command{gnunet-*-gtk} and @command{gnunet-setup} were created using -this interface builder - -@itemize @bullet - -@item Get the Glade and libglade (-bin and -devel) packages -(without GTK!) from -@uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to -the MinGW directory (@file{c:\mingw\mingw}). - -@item Get @command{libxml} from here and unpack it to the MinGW -directory (@file{c:\mingw\mingw}). -@end itemize - -@c FIXME: URLs -@item @strong{zLib}@ -@command{libextractor} requires @command{zLib} to decompress some file -formats. GNUnet uses it to (de)compress meta-data. -Get zLib from here (Signature) and unpack it to the MinGW directory -(@file{c:\mingw\mingw}). - -@item @strong{Bzip2}@ -@command{libextractor} also requires @command{Bzip2} to -decompress some file formats. -Get the Bzip2 (binary and developer package) from -@uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and -unpack it to the MinGW directory (@file{c:\mingw\mingw}). - -@item @strong{Libgcrypt}@ -@command{Libgcrypt} provides the cryptographic functions used by GNUnet. -Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here}, -compile and place it in the MinGW directory -(@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to -compile GNUnet. - -@item @strong{PlibC}@ -PlibC emulates Unix functions under Windows. Get PlibC from here and -unpack it to the MinGW directory (c:\mingw\mingw) - -@item @strong{OGG Vorbis}@ -@command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files. -Get the packages -@uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg} -and -@uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis} -from the -@uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build} -and unpack them to the MinGW directory (c:\mingw\mingw). - -@item @strong{Exiv2}@ -(lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data. -Download -@uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2} -and unpack it to the MSYS directory (c:\mingw). -@end itemize - -@node Building libextractor and GNUnet -@subsubsection Building libextractor and GNUnet - -Before you compile @command{libextractor} or @command{GNUnet}, -be sure to set @code{PKG_CONFIG_PATH}: - -@example -export PKG_CONFIG_PATH=/mingw/lib/pkgconfig -@end example - -@noindent -@xref{GNUnet Installation Handbook}, for basic instructions on building -@command{libextractor} and @command{GNUnet}. -By default, all modules that are created in this way contain -debug information and are quite large. To compile release versions -(small and fast) set the variable @code{CFLAGS}: - -@example -export CFLAGS='-O2 -march=pentium -fomit-frame-pointer' -./configure --prefix=$HOME --with-extractor=$HOME -@end example - -@node Installer -@subsubsection Installer - -The GNUnet installer is made with -@uref{http://nsis.sourceforge.net/, NSIS}. The installer script is -located in @file{contrib\win} in the GNUnet source tree. - -@node Source -@subsubsection Source - -@c FIXME: URL... or: WHERE is HERE? -The sources of all dependencies are available here. diff --git a/doc/outdated-and-old-installation-instructions.txt b/doc/outdated-and-old-installation-instructions.txt deleted file mode 100644 index f2cbe1847..000000000 --- a/doc/outdated-and-old-installation-instructions.txt +++ /dev/null @@ -1,672 +0,0 @@ -# This file contains pieces from chapter/installation.texi for systems where the LTS or otherwise support -# ended. They can be useful for people trying to write new installation instructions for those systems. -# In particual this covers: -# - FreeBSD 8 -# - Mac OS X Tiger -# - Fedora 8 -# - Gentoo with GNUnet 0.9 -# -# Sources for LTS and support ranges: -# https://www.freebsd.org/security/security.html#sup -# https://support.microsoft.com/en-us/help/17140/lifecycle-faq-general-policy-questions -# Mac products, OS is supposedly similar (no official statements exist): https://web.archive.org/web/20160706101225/https://support.apple.com/en-us/HT201624 -# https://wiki.debian.org/LTS -# https://www.ubuntu.com/info/release-end-of-life - -@node Build instructions for Gentoo -@subsection Build instructions for Gentoo - - -This page describes how to install GNUnet 0.9 on Gentoo. - -Since the GNUnet 0.9 ebuilds are not in the official portage tree yet, we need -to add them to the local portage overlay. All the commands below should be -executed as root. - -Specify your local portage directory in the /etc/make.conf, for example:@ -@code{$ echo 'PORTDIR_OVERLAY="/usr/local/portage"' >> /etc/make.conf} - -Create directories for the ebuilds:@ -@code{$ mkdir -p /usr/local/portage/media-libs/libextractor /usr/local/portage/net-p2p/gnunet/files} - -Download the latest ebuilds, init and config files from here and put them into -respective directories:@ -@code{$ cp libextractor-0.6.2.ebuild /usr/local/portage/media-libs/libextractor@ - $ cp gnunet-0.9.2.ebuild /usr/local/portage/net-p2p/gnunet@ - $ cp gnunet-0.9.2.conf gnunet-0.9.2.confd gnunet-0.9.2.initd /usr/local/portage/net-p2p/gnunet/files} - -Generate Manifest files for the ebuilds:@ -@code{$ cd /usr/local/portage/net-p2p/gnunet@ - $ ebuild gnunet-0.9.2.ebuild digest@ - $ cd /usr/local/portage/media-libs/libextractor@ - $ ebuild libextractor-0.6.2.ebuild digest} - -Unmask GNUnet and dependencies in the /etc/portage/package.keywords. For -example, if you use x86-64 architecture, add the following lines:@ -@code{net-p2p/gnunet ~amd64@ - media-libs/libextractor ~amd64@ - net-libs/libmicrohttpd ~amd64@ - net-misc/curl ~amd64} - -Add either sqlite or mysql USE-flag in the /etc/portage/package.use:@ -@code{net-p2p/gnunet sqlite} - -Now everything is ready to install GNUnet:@ -@code{$ emerge -av gnunet} - -Use /etc/init.d/gnunet to start/stop GNUnet. - - - - -@node Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . -@subsection Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . -@c %**end of header - -@strong{This documentation is outdated and not valid for GNUnet 0.10.0!}@ - GNUnet installation on Fedora 8/Planetlab nodes can be done as following: - -1. Install the build tools to build GNUnet@ -@example -sudo yum -y -t --nogpgcheck install gcc make automake autoconf gettext-devel \ -texinfo zlib-devel subversion@ -@end example - -2. Install the GNUnet dependencies@ -@example -sudo yum -y -t --nogpgcheck install gnutls-devel gnutls-devel libgcrypt-devel \ -sqlite-devel postgresql-devel mysql-devel libgsf-devel libvorbis-devel \ -libidn-devel -@end example - -3. Install outdated dependencies from source@ - libtool@ -@code{@ - wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ - tar xvfz libtool-2.4.2.tar.gz@ - cd libtool-2.4.2@ - ./configure@ - sudo make install@ -} - -libtool@ -@code{@ - wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ - tar xvfz libtool-2.4.2.tar.gz@ - cd libtool-2.4.2@ - ./configure@ - sudo make install@ -} - -glpk@ -@code{@ - wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz@ - tar xvfz glpk-4.47.tar.gz@ - cd glpk-4.47@ - ./configure@ - sudo make install@ -} - -libgpg-error@ -@code{@ - wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2@ - tar xvfj libgpg-error-1.10.tar.bz2@ - cd libgpg-error-1.10@ - ./configure --prefix=/usr@ - sudo make install@ -} - -libgcrypt@ -@code{@ - wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2@ - tar xvfj libgcrypt-1.5.0.tar.tar.bz2@ - cd libgcrypt-1.5.0@ - ./configure --prefix=/usr@ - sudo make install@ -} - -libcurl@ -@code{@ - wget http://curl.haxx.se/download/curl-7.26.0.tar.gz@ - tar xvfz curl-7.26.0.tar.gz@ - cd curl-7.26.0@ - ./configure@ - sudo make install@ -} - -libunistring@ -@code{@ - wget http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz@ - tar xvfz libunistring-0.9.3.tar.gz@ - cd libunistring-0.9.3@ - ./configure@ - sudo make install@ -} - -4. Remove conflicting packages@ -@code{@ - sudo rpm -e --nodeps libgcrypt libgpg-error@ -} - -4. Install libextractor@ -@code{@ - wget ftp://ftp.gnu.org/gnu/libextractor/libextractor-0.6.3.tar.gz@ - tar xvfz libextractor-0.6.3.tar.gz@ - cd libextractor-0.6.3@ - ./configure@ - sudo make install@ -} - -5. Install libmicrohttpd and dependencies - -nettle@ -@code{@ - wget http://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz@ - tar xvfz nettle-2.5.tar.gz@ - cd nettle-2.5@ - ./configure@ - sudo make install@ -} - -GnuTLS@ -@code{@ - wget http://ftp.gnu.org/gnu/gnutls/gnutls-2.12.20.tar.bz2@ - tar xvfj gnutls-2.12.20.tar.bz2@ - cd gnutls-2.12.20@ - ./configure --without-p11-kit@ - sudo make install@ -} - -libmicrohttpd@ -@code{@ - wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.21.tar.gz@ - tar xvfz libmicrohttpd-0.9.21.tar.gz@ - cd libmicrohttpd-0.9.21@ - ./configure@ - sudo make install@ -} - -6. Set GNUnet prefix and add to PATH@ -@code{@ - export GNUNET_PREFIX=@ - export PATH=$PATH:$GNUNET_PREFIX/bin@ -} - -7. Install GNUnet from svn@ -@example - export LD_LIBRARY_PATH=/usr/local/lib@ - svn co https://gnunet.org/svn/gnunet@ - cd gnunet@ - libtoolize@ - ./bootstrap@ - ./configure --prefix=$GNUNET_PREFIX --with-extractor=/usr/local \ - --with-curl=/usr/local --with-mysql=/usr/lib/mysql --enable-logging=verbose@ - make install@ -@end example - -Done! - - -@node Build instructions for FreeBSD 8 -@subsection Build instructions for FreeBSD 8 - -To get GNUnet 0.9 to compile on FreeBSD (at least FreeBSD 8.0):@ in order to -install the library @code{libiconv}, at first change the directory to your -ports directory, e.g.@ -@code{@ - $ cd /usr/ports/@ -}@ - following that, go to the install file of @code{libiconv} and install it,@ -@code{@ - $ cd converters/libiconv,@ - $ make install@ -} - -after that, change the directory to where you will check out -@code{libextractor} and GNUnet, and install latest @code{libextractor},@ - first of all, checkout @code{libextractor}, e.g.@ -@code{@ - $ svn co https://gnunet.org/svn/Extractor@ -}@ - then change the directory into which it was checked out, e.g.@ -@code{@ - $ cd Extractor@ -}@ - before the installation, you should do following steps,@ - -@example -$ ./bootstrap@ -$ ./configure --with-ltdl-include=/usr/local/include \ - --with-ltdl-lib=/usr/local/lib@ -@end example - -if these steps complete successfully, you can install the library,@ - -@example -$ make install@ -@end example - -to check out the GNUnet, you should do the similar steps as -@code{libextractor}, firstly, change back to starting directory, e.g.@ -@code{@ - $ cd ../@ -}@ - Set the following environmental variables:@ -@code{@ - export CPPFLAGS="-I/usr/local/include"@ - export LDFLAGS="-L/usr/local/lib"@ -}@ - next, checkout GNUnet using@ -@code{@ - $ svn co https://gnunet.org/svn/gnunet@ -}@ - then change directory into newly checked out directory,@ -@code{@ - $ cd gnunet@ -}@ - at last, start to install GNUnet,@ - -@example - $ ./bootstrap@ - $ ./configure --with-ltdl-include=/usr/local/include \ - --with-ltdl-lib=/usr/local/lib --with-extractor=/usr/local - -## NOTE: you may not need the --with-extractor option!@ - -$ make install -@end example - - - -@node Basic installation for Mac OS X -@subsection Basic installation for Mac OS X - -This documentation may be outdated! - -This page is providing guidelines for users trying to install GNUnet on Mac OS -X.@ Mainly users trying to install GNUnet by building source code are the most -welcome readers.@ The steps below are tested on an Intel Architecture running -Mac OS X Tiger (10.4.11). Ideally they should work on other Mac boxes with -different configurations as all the configuration done for it is dependent on -@uref{http://www.macports.org/, MacPorts} - -For having GNUnet installed successfully, some dependencies should be firstly -resolved: - -@itemize @bullet - -@item -Install/Update your @uref{http://developer.apple.com/tools/xcode/, Xcode} -version 3.2.1 or later for Snow Leopard, 3.1.4 or later for Leopard, or 2.5 for -Tiger. - -@item -Download and install @uref{http://www.macports.org/, MacPorts}.@ -Now you are ready for installing GNunet dependencies. - -@item -First, you'd better make sure that: /opt/local/bin and /opt/local/sbin are -available in your PATH. (For doing so, open a terminal and type:@ - -@example -$ echo $PATH -@end example - -and examine the output of it). If the paths are not available in your -environment, you have to add them (You can add them by editing your .profile -file in your home directory, append them to the PATH line). Then type: -@example -$ source ~/.profile -@end example - -and re-examine the echo command output. - -@item -Use MacPorts to download and install the dependencies:@ -The libraries are: - -@itemize @bullet - -@item -@uref{http://trac.macports.org/browser/trunk/dports/www/libmicrohttpd/Portfile, libmicrohttpd.} - -@item -@uref{http://trac.macports.org/browser/trunk/dports/devel/libgcrypt/Portfile, libgcrypt.} - -@item -@uref{http://trac.macports.org/browser/trunk/dports/net/curl/Portfile, libcurl.} - -@item -@uref{http://trac.macports.org/browser/trunk/dports/devel/libtool/Portfile, libltdl.} - -@item -@uref{http://trac.macports.org/browser/trunk/dports/databases/sqlite3/Portfile, SQlite.} - -@item -libunistring - -@item -glpk - -@end itemize - -The port command is as follows:@ -@example -port install libmicrohttpd libgcrypt curl libtool sqlite3 linunistring glpk -@end example -One of the dependencies, the libextractor, should be explicitly installed, -since the version available from macports is outdated to work with GNUnet. To -install the latest libextractor: -@itemize @bullet - - -@item -Install the Subversion Client:@ -For more information about Subversion visit: -@uref{http://subversion.tigris.org/, http://subversion.tigris.org/} - -@example -# port install subversion -@end example - - -@item -Use Subversion to download the latest Extractor: -@example -$ svn checkout https://gnunet.org/svn/Extractor -@end example - - -@item -Go to the installation directory of the Extractor, compile and install it: -@example -$ ./bootstrap -$ export CPPFLAGS="-I/opt/local/include" -$ export LDFLAGS="-L/opt/local/lib" -$ ./configure --prefix=/opt/local -$ make -# make install -@end example - -@end itemize - - -@item -Now, your system is ready to install GNunet. If you downloaded GNUnet by -checking it out from svn, you should start by running the bootstrap script. -Open a terminal pointing to the GNUnet directory and type:@ - -@example -$ ./bootstrap -@end example - - -@item -Run the configure script: -@example -$ export CPPFLAGS="-I/opt/local/include" -$ export LDFLAGS="-L/opt/local/lib" -$ ./configure --prefix=/tmp/gnunet_build -@end example - - -GNUnet will be installed in the directory /tmp/gnunet_build (Of course that -installation path can be changed).@ The CPPFLAGS and LDFLAGS are mentioned in -order to inform the compiler and the linker to lookup headers and libraries in -/opt/local/include and /opt/local/lib. - -@item -Compile@ - -@example -$ make -@end example - - -@item -Install GNUnet -@example -# make install -@end example - -@end itemize - - -@node Basic Installation for Fedora/PlanetLab nodes running Fedora 12 -@subsection Basic Installation for Fedora/PlanetLab nodes running Fedora 12 - - -@strong{This documentation is outdated and not valid for GNUnet 0.10.0!}@ - -GNUnet installation on Fedora 8/Planetlab nodes can be done as following: - -1. Install the build tools to build GNUnet@ -@example -sudo yum -y -t --nogpgcheck install gcc make autoconf gettext-devel \ -texinfo subversion@ -@end example - -2. Install the GNUnet dependencies@ -@example -sudo yum -y -t --nogpgcheck install libunistring-devel libunistring-devel \ -libgcrypt-devel zlib-devel sqlite-devel postgresql-devel mysql-devel \ -libgsf-devel libvorbis-devel@ -@end example - -3. Install outdated dependencies from source@ -libtool@ -@example -wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ -tar xvfz libtool-2.4.2.tar.gz@ -cd libtool-2.4.2@ -./configure@ -sudo make install@ -@end example - -glpk@ -@example -wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz@ -tar xvfz glpk-4.47.tar.gz@ -cd glpk-4.47@ -./configure@ -sudo make install@ -@end example - -libcurl@ -@example -wget http://curl.haxx.se/download/curl-7.26.0.tar.gz@ -tar xvfz curl-7.26.0.tar.gz@ -cd curl-7.26.0@ -./configure@ -sudo make install@ -@end example - -4. Install libextractor@ -@example -svn co https://gnunet.org/svn/libextractor@ -cd libextractor@ -libtoolize@ -./bootstrap@ -./configure@ -sudo make install@ -@end example - -5. Install libmicrohttpd@ -@example -svn co https://gnunet.org/svn/libmicrohttpd@ -cd libmicrohttpd@ -libtoolize@ -./bootstrap@ -./configure@ -sudo make install@ -@end example - -6. Set GNUnet prefix and add to PATH@ -@example -export GNUNET_PREFIX=@ -export PATH=$PATH:$GNUNET_PREFIX/bin@ -@end example - -7. Install GNUnet from svn@ -@example -export LD_LIBRARY_PATH=/usr/local/lib@ -svn co https://gnunet.org/svn/gnunet@ -cd gnunet@ -libtoolize@ -./bootstrap@ -./configure --prefix=$GNUNET_PREFIX --with-extractor=/usr \ - --with-mysql=/usr/lib/mysql --enable-logging=verbose@ -make install@ -@end example - -Done! - - -@node Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . -@subsection Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . -@c %**end of header - -@strong{This documentation is outdated and not valid for GNUnet 0.10.0!}@ - GNUnet installation on Fedora 8/Planetlab nodes can be done as following: - -1. Install the build tools to build GNUnet@ -@example -sudo yum -y -t --nogpgcheck install gcc make automake autoconf gettext-devel \ -texinfo zlib-devel subversion@ -@end example - -2. Install the GNUnet dependencies@ -@example -sudo yum -y -t --nogpgcheck install gnutls-devel gnutls-devel libgcrypt-devel \ -sqlite-devel postgresql-devel mysql-devel libgsf-devel libvorbis-devel \ -libidn-devel -@end example - -3. Install outdated dependencies from source@ - libtool@ -@code{@ - wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ - tar xvfz libtool-2.4.2.tar.gz@ - cd libtool-2.4.2@ - ./configure@ - sudo make install@ -} - -libtool@ -@code{@ - wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ - tar xvfz libtool-2.4.2.tar.gz@ - cd libtool-2.4.2@ - ./configure@ - sudo make install@ -} - -glpk@ -@code{@ - wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz@ - tar xvfz glpk-4.47.tar.gz@ - cd glpk-4.47@ - ./configure@ - sudo make install@ -} - -libgpg-error@ -@code{@ - wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2@ - tar xvfj libgpg-error-1.10.tar.bz2@ - cd libgpg-error-1.10@ - ./configure --prefix=/usr@ - sudo make install@ -} - -libgcrypt@ -@code{@ - wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2@ - tar xvfj libgcrypt-1.5.0.tar.tar.bz2@ - cd libgcrypt-1.5.0@ - ./configure --prefix=/usr@ - sudo make install@ -} - -libcurl@ -@code{@ - wget http://curl.haxx.se/download/curl-7.26.0.tar.gz@ - tar xvfz curl-7.26.0.tar.gz@ - cd curl-7.26.0@ - ./configure@ - sudo make install@ -} - -libunistring@ -@code{@ - wget http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz@ - tar xvfz libunistring-0.9.3.tar.gz@ - cd libunistring-0.9.3@ - ./configure@ - sudo make install@ -} - -4. Remove conflicting packages@ -@code{@ - sudo rpm -e --nodeps libgcrypt libgpg-error@ -} - -4. Install libextractor@ -@code{@ - wget ftp://ftp.gnu.org/gnu/libextractor/libextractor-0.6.3.tar.gz@ - tar xvfz libextractor-0.6.3.tar.gz@ - cd libextractor-0.6.3@ - ./configure@ - sudo make install@ -} - -5. Install libmicrohttpd and dependencies - -nettle@ -@code{@ - wget http://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz@ - tar xvfz nettle-2.5.tar.gz@ - cd nettle-2.5@ - ./configure@ - sudo make install@ -} - -GnuTLS@ -@code{@ - wget http://ftp.gnu.org/gnu/gnutls/gnutls-2.12.20.tar.bz2@ - tar xvfj gnutls-2.12.20.tar.bz2@ - cd gnutls-2.12.20@ - ./configure --without-p11-kit@ - sudo make install@ -} - -libmicrohttpd@ -@code{@ - wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.21.tar.gz@ - tar xvfz libmicrohttpd-0.9.21.tar.gz@ - cd libmicrohttpd-0.9.21@ - ./configure@ - sudo make install@ -} - -6. Set GNUnet prefix and add to PATH@ -@code{@ - export GNUNET_PREFIX=@ - export PATH=$PATH:$GNUNET_PREFIX/bin@ -} - -7. Install GNUnet from svn@ -@example - export LD_LIBRARY_PATH=/usr/local/lib@ - svn co https://gnunet.org/svn/gnunet@ - cd gnunet@ - libtoolize@ - ./bootstrap@ - ./configure --prefix=$GNUNET_PREFIX --with-extractor=/usr/local \ - --with-curl=/usr/local --with-mysql=/usr/lib/mysql --enable-logging=verbose@ - make install@ -@end example - -Done! - - diff --git a/doc/system_specific/FROM_SOURCE b/doc/system_specific/FROM_SOURCE new file mode 100644 index 000000000..074b6a91e --- /dev/null +++ b/doc/system_specific/FROM_SOURCE @@ -0,0 +1,1423 @@ +@node Build instructions for Ubuntu 12.04 using Git +@section Build instructions for Ubuntu 12.04 using Git + +@menu +* Install the required build tools:: +* Install libgcrypt 1.6 and libgpg-error:: +* Install gnutls with DANE support:: +* Install libgnurl:: +* Install libmicrohttpd from Git:: +* Install libextractor from Git:: +* Install GNUnet dependencies:: +* Build GNUnet:: +* Install the GNUnet-gtk user interface from Git:: +@end menu + +@node Install the required build tools +@subsection Install the required build tools + +First, make sure Git is installed on your system: + +@example +$ sudo apt-get install git +@end example + +Install the essential buildtools: + +@example +$ sudo apt-get install automake autopoint autoconf libtool +@end example + +@node Install libgcrypt 1.6 and libgpg-error +@subsection Install libgcrypt 1.6 and libgpg-error + +@ref{generic source installation - libgpg-error} + +@node Install gnutls with DANE support +@subsection Install gnutls with DANE support + +@itemize @bullet +@item @ref{generic source installation - nettle} +@item @ref{generic source installation - ldns} +@item @ref{generic source installation - libunbound/unbound} +@item @ref{generic source installation - gnutls} +@item @ref{generic source installation - libgcrypt} +@end itemize + +@node Install libgnurl +@subsection Install libgnurl + +Follow the @ref{generic source installation - libgnurl}. + +@node Install libmicrohttpd from Git +@subsection Install libmicrohttpd from Git + +@example +$ git clone https://gnunet.org/git/libmicrohttpd +$ cd libmicrohttpd/ +$ ./bootstrap +$ ./configure +$ sudo make install ; cd .. +@end example + +@node Install libextractor from Git +@subsection Install libextractor from Git + +Install libextractor dependencies: + +@example +$ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \ + libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \ + libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \ + g++ +@end example + +Build libextractor: + +@example +$ git clone https://gnunet.org/git/libextractor +$ cd libextractor +$ ./bootstrap +$ ./configure +$ sudo make install ; cd .. +@end example + +@node Install GNUnet dependencies +@subsection Install GNUnet dependencies + +@example +$ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \ + libpulse-dev libbluetooth-dev libsqlite-dev +@end example + +Install libopus: + +@example +$ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz +$ tar xf opus-1.1.tar.gz +$ cd opus-1.1/ +$ ./configure +$ sudo make install ; cd .. +@end example + +Choose one or more database backends: + +SQLite3: +@example +$ sudo apt-get install libsqlite3-dev +@end example +MySQL: +@example +$ sudo apt-get install libmysqlclient-dev +@end example +PostgreSQL: +@example +$ sudo apt-get install libpq-dev postgresql +@end example + + + +@node Build GNUnet +@subsection Build GNUnet + + + +@menu +* Configuring the installation path:: +* Configuring the system:: +* Installing components requiring sudo permission:: +* Build:: +@end menu + +@node Configuring the installation path +@subsubsection Configuring the installation path + +You can specify the location of the GNUnet installation by setting the +prefix when calling the configure script with @code{--prefix=DIRECTORY} + +@example +$ export PATH=$PATH:DIRECTORY/bin +@end example + +@node Configuring the system +@subsubsection Configuring the system + +Please make sure NOW that you have created a user and group 'gnunet' +and additionally a group 'gnunetdns': + +@example +$ sudo addgroup gnunet +$ sudo addgroup gnunetdns +$ sudo adduser gnunet +@end example + +Each GNUnet user should be added to the 'gnunet' group (may +require fresh login to come into effect): + +@example +$ sudo useradd -G gnunet +@end example + +@node Installing components requiring sudo permission +@subsubsection Installing components requiring sudo permission + +Some components, like the nss plugin required for GNS, may require root +permissions. To allow these few components to be installed use: + +@example +$ ./configure --with-sudo +@end example + +@node Build +@subsubsection Build + +@example +$ git clone https://gnunet.org/git/gnunet/ +$ cd gnunet/ +$ ./bootstrap +@end example + +Use the required configure call including the optional installation prefix +@code{PREFIX} or the sudo permissions: + +@example +$ ./configure [ --with-sudo | --with-prefix=PREFIX ] +@end example + +@example +$ make; sudo make install +@end example + +After installing it, you need to create an empty configuration file: + +@example +mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf +@end example + +And finally you can start GNUnet with: + +@example +$ gnunet-arm -s +@end example + +@node Install the GNUnet-gtk user interface from Git +@subsection Install the GNUnet-gtk user interface from Git + + +Install depencies: + +@example +$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \ + libqrencode-dev +@end example + +Build GNUnet (with an optional prefix) and execute: + +@example +$ git clone https://gnunet.org/git/gnunet-gtk/ +$ cd gnunet-gtk/ +$ ./bootstrap +$ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY +$ make; sudo make install +@end example + +@node Build Instructions for Microsoft Windows Platforms +@section Build Instructions for Microsoft Windows Platforms + +@menu +* Introduction to building on MS Windows:: +* Requirements:: +* Dependencies & Initial Setup:: +* GNUnet Installation:: +* Adjusting Windows for running and testing GNUnet:: +* Building the GNUnet Installer:: +* Using GNUnet with Netbeans on Windows:: +@end menu + +@node Introduction to building on MS Windows +@subsection Introduction to building on MS Windows + + +This document is a guide to building GNUnet and its dependencies on +Windows platforms. GNUnet development is mostly done under GNU/Linux and +especially git checkouts may not build out of the box. +We regret any inconvenience, and if you have problems, please report +them. + +@node Requirements +@subsection Requirements + +The Howto is based upon a @strong{Windows Server 2008 32bit} +@strong{Installation}, @strong{sbuild} and thus a +@uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW} +(W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild +is a convenient set of scripts which creates a working msys/mingw +installation and installs most dependencies required for GNUnet. + +As of the point of the creation of these instructions, +GNUnet @strong{requires} a Windows @strong{Server} 2003 or +newer for full feature support. +Windows Vista and later will also work, but +@strong{non-server version can not run a VPN-Exit-Node} as the NAT +features have been removed as of Windows Vista. + +@c TODO: We should document Windows 10! +@c It seems like the situation hasn't changed with W10 + +@node Dependencies & Initial Setup +@subsection Dependencies & Initial Setup + + +@itemize @bullet + +@item +Install a fresh version of @strong{Python 2.x}, even if you are using a +x64-OS, install a 32-bit version for use with sbuild. +Python 3.0 is currently incompatible. + +@item +Install your favorite @uref{http://code.google.com/p/tortoisegit/, git} & +@uref{http://tortoisesvn.net/, subversion}-clients. + +@item +You will also need some archive-manager like +@uref{http://www.7-zip.org/, 7zip}. + +@item +Pull a copy of sbuild to a directory of your choice, which will be used +in the remainder of this guide. For now, we will use +@file{c:\gnunet\sbuild\} + +@item +in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages +@strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild +to compile/install those for us. + +@item +Follow LRN's sbuild installation instructions.- +@end itemize + +Please note that sbuild may (or will most likely) fail during +installation, thus you really HAVE to @strong{check the logfiles} created +during the installation process. +Certain packages may fail to build initially due to missing dependencies, +thus you may have to +@strong{substitute those with binary-versions initially}. Later on once +dependencies are satisfied you can re-build the newer package versions. + +@strong{It is normal that you may have to repeat this step multiple times +and there is no uniform way to fix all compile-time issues, as the +build-process of many of the dependencies installed are rather unstable +on win32 and certain releases may not even compile at all.} + +Most dependencies for GNUnet have been set up by sbuild, thus we now +should add the @file{bin/} directories in your new msys and mingw +installations to PATH. You will want to create a backup of your finished +msys-environment by now. + +@node GNUnet Installation +@subsection GNUnet Installation + +First, we need to launch our msys-shell, you can do this via + +@file{C:\gnunet\sbuild\msys\msys.bat} + +You might wish to take a look at this file and adjust some +login-parameters to your msys environment. + +Also, sbuild added two pointpoints to your msys-environment, though those +might remain invisible: + +@itemize @bullet + +@item +/mingw, which will mount your mingw-directory from sbuild/mingw and the +other one is + +@item +/src which contains all the installation sources sbuild just compiled. +@end itemize + +Check out the current GNUnet sources (git HEAD) from the +GNUnet repository "gnunet.git", we will do this in your home directory: + +@code{git clone https://gnunet.org/git/gnunet/ ~/gnunet} + +Now, we will first need to bootstrap the checked out installation and then +configure it accordingly. + +@example +cd ~/gnunet +./bootstrap +STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \ +./configure --prefix=/ --docdir=/share/doc/gnunet \ +--with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \ +--with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \ +--with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \ +--enable-expensivetests --enable-experimental --with-qrencode=/mingw \ +--enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log +@end example + +The parameters above will configure for a reasonable GNUnet installation +to the your msys-root directory. +Depending on which features your would like to build or you may need to +specify additional dependencies. Sbuild installed most libs into +the /mingw subdirectory, so remember to prefix library locations with +this path. + +Like on a unixoid system, you might want to use your home directory as +prefix for your own GNUnet installation for development, without tainting +the buildenvironment. Just change the "prefix" parameter to point towards +~/ in this case. + +Now it's time to compile GNUnet as usual. Though this will take some time, +so you may fetch yourself a coffee or some Mate now... + +@example +make ; make install +@end example + +@node Adjusting Windows for running and testing GNUnet +@subsection Adjusting Windows for running and testing GNUnet + +Assuming the build succeeded and you +@strong{added the bin directory of your GNUnet to PATH}, you can now use +your gnunet-installation as usual. +Remember that UAC or the windows firewall may popup initially, blocking +further execution of gnunet until you acknowledge them. + +You will also have to take the usual steps to get peer-to-peer (p2p) +software running properly (port forwarding, ...), +and GNUnet will require administrative permissions as it may even +install a device-driver (in case you are using gnunet-vpn and/or +gnunet-exit). + +@node Building the GNUnet Installer +@subsection Building the GNUnet Installer + +The GNUnet installer is made with +@uref{http://nsis.sourceforge.net/, NSIS}. +The installer script is located in @file{contrib\win} in the +GNUnet source tree. + +@node Using GNUnet with Netbeans on Windows +@subsection Using GNUnet with Netbeans on Windows + +TODO + +@node Build instructions for Debian 7.5 +@section Build instructions for Debian 7.5 + + +These are the installation instructions for Debian 7.5. They were tested +using a minimal, fresh Debian 7.5 AMD64 installation without non-free +software (no contrib or non-free). +By "minimal", we mean that during installation, we did not select any +desktop environment, servers or system utilities during the "tasksel" +step. Note that the packages and the dependencies that we will install +during this chapter take about 1.5 GB of disk space. +Combined with GNUnet and space for objects during compilation, you should +not even attempt this unless you have about 2.5 GB free after the minimal +Debian installation. +Using these instructions to build a VM image is likely to require a +minimum of 4-5 GB for the VM (as you will likely also want a desktop +manager). + +GNUnet's security model assumes that your @file{/home} directory is +encrypted. Thus, if possible, you should encrypt your home partition +(or per-user home directory). + +Naturally, the exact details of the starting state for your installation +should not matter much. For example, if you selected any of those +installation groups you might simply already have some of the necessary +packages installed. +We did this for testing, as this way we are less likely to forget to +mention a required package. +Note that we will not install a desktop environment, but of course you +will need to install one to use GNUnet's graphical user interfaces. +Thus, it is suggested that you simply install the desktop environment of +your choice before beginning with the instructions. + + + +@menu +* Update:: +* Stable? Hah!:: +* Update again:: +* Installing packages:: +* Installing dependencies from source:: +* Installing GNUnet from source:: +* But wait there is more!:: +@end menu + +@node Update +@subsection Update + +After any installation, you should begin by running + +@example +# apt-get update ; apt-get upgrade +@end example + +to ensure that all of your packages are up-to-date. Note that the "#" is +used to indicate that you need to type in this command as "root" +(or prefix with "sudo"), whereas "$" is used to indicate typing in a +command as a normal user. + +@node Stable? Hah! +@subsection Stable? Hah! + +Yes, we said we start with a Debian 7.5 "stable" system. However, to +reduce the amount of compilation by hand, we will begin by allowing the +installation of packages from the testing and unstable distributions as +well. +We will stick to "stable" packages where possible, but some packages will +be taken from the other distributions. +Start by modifying @file{/etc/apt/sources.list} to contain the +following (possibly adjusted to point to your mirror of choice): + +@example +# These were there before: +deb http://ftp.de.debian.org/debian/ wheezy main +deb-src http://ftp.de.debian.org/debian/ wheezy main +deb http://security.debian.org/ wheezy/updates main +deb-src http://security.debian.org/ wheezy/updates main +deb http://ftp.de.debian.org/debian/ wheezy-updates main +deb-src http://ftp.de.debian.org/debian/ wheezy-updates main + +# Add these lines (feel free to adjust the mirror): +deb http://ftp.de.debian.org/debian/ testing main +deb http://ftp.de.debian.org/debian/ unstable main +@end example + +The next step is to create/edit your @file{/etc/apt/preferences} +file to look like this: + +@example +Package: * +Pin: release a=stable,n=wheezy +Pin-Priority: 700 + +Package: * +Pin: release o=Debian,a=testing +Pin-Priority: 650 + +Package: * +Pin: release o=Debian,a=unstable +Pin-Priority: 600 +@end example + +You can read more about Apt Preferences here and here. +Note that other pinnings are likely to also work for GNUnet, the key +thing is that you need some packages from unstable (as shown below). +However, as unstable is unlikely to be comprehensive (missing packages) +or might be problematic (crashing packages), you probably want others +from stable and/or testing. + +@node Update again +@subsection Update again + +Now, run again@ + +@example +# apt-get update@ +# apt-get upgrade@ +@end example + +to ensure that all your new distribution indices are downloaded, and +that your pinning is correct: the upgrade step should cause no changes +at all. + +@node Installing packages +@subsection Installing packages + +We begin by installing a few Debian packages from stable:@ + +@example +# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ + libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \ + texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \ + libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \ + libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \ + librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \ + libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \ + libqrencode-dev libgladeui-dev nasm texlive-latex-extra \ + libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev +@end example + +After that, we install a few more packages from unstable:@ + +@example +# apt-get install -t unstable nettle-dev libgstreamer1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + libgstreamer-plugins-base1.0-dev +@end example + +@node Installing dependencies from source +@subsection Installing dependencies from source + +Next, we need to install a few dependencies from source. +You might want to do this as a "normal" user and only run the +@code{make install} steps as root (hence the @code{sudo} in the +commands below). Also, you do this from any +directory. We begin by downloading all dependencies, then extracting the +sources, and finally compiling and installing the libraries. + +For these steps, follow the instructions given in the +installation from source instruction in this order: + +@itemize @bullet +@item @ref{generic source installation - libav} +@item @ref{generic source installation - libextractor} +@item @ref{generic source installation - libgpg-error} +@item @ref{generic source installation - libgcrypt} +@item @ref{generic source installation - gnutls} +@item @ref{generic source installation - libmicrohttpd} +@item @ref{generic source installation - libgnurl} +@end itemize + +@node Installing GNUnet from source +@subsection Installing GNUnet from source + + +For this, simply follow the generic installation instructions from +here. + +@node But wait there is more! +@subsection But wait there is more! + +So far, we installed all of the packages and dependencies required to +ensure that all of GNUnet would be built. +However, while for example the plugins to interact with the MySQL or +Postgres databases have been created, we did not actually install or +configure those databases. Thus, you will need to install +and configure those databases or stick with the default Sqlite database. +Sqlite is usually fine for most applications, but MySQL can offer better +performance and Postgres better resillience. + + +@node Installing GNUnet from Git on Ubuntu 14.4 +@section Installing GNUnet from Git on Ubuntu 14.4 + +@strong{Install the required build tools:} + +@example +$ sudo apt-get install git automake autopoint autoconf +@end example + +@strong{Install the required dependencies} + +@example +$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ + libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ + libmicrohttpd-dev libgnutls28-dev +@end example + +@strong{Choose one or more database backends} + +@itemize @bullet + +@item SQLite3: + +@example +$ sudo apt-get install libsqlite3-dev +@end example + +@item MySQL: + +@example +$ sudo apt-get install libmysqlclient-dev +@end example + +@item PostgreSQL: + +@example +$ sudo apt-get install libpq-dev postgresql +@end example + +@end itemize + +@strong{Install the optional dependencies for gnunet-conversation:} + +@example +$ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev +@end example + +@strong{Install the libgrypt 1.6.1:} + +@itemize @bullet + +@item For Ubuntu 14.04: + +@example +$ sudo apt-get install libgcrypt20-dev +@end example + +@item For Ubuntu older 14.04: + +@example +$ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 +$ tar xf libgcrypt-1.6.1.tar.bz2 +$ cd libgcrypt-1.6.1 +$ ./configure +$ sudo make install +$ cd .. +@end example + +@end itemize + +@strong{Install libgnurl} + +@strong{Install GNUnet} + +@example +$ git clone https://gnunet.org/git/gnunet/ +$ cd gnunet/ +$ ./bootstrap +@end example + +If you want to: + +@itemize @bullet + +@item Install to a different directory: + +@example +--prefix=PREFIX +@end example + +@item +Have sudo permission, but do not want to compile as root: + +@example +--with-sudo +@end example + +@item +Want debug message enabled: + +@example +--enable-logging=verbose +@end example + +@end itemize + + +@example +$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] +$ make; sudo make install +@end example + +After installing it, you need to create an empty configuration file: + +@example +touch ~/.config/gnunet.conf +@end example + +And finally you can start GNUnet with + +@example +$ gnunet-arm -s +@end example + +@node Build instructions for Debian 8 +@section Build instructions for Debian 8 +@c FIXME: I -> we + +These are the installation instructions for Debian 8. They were tested +sing a fresh Debian 8 AMD64 installation without non-free software (no +contrib or non-free). During installation, I only selected "lxde" for the +desktop environment. +Note that the packages and the dependencies that we will install during +this chapter take about 1.5 GB of disk space. Combined with GNUnet and +space for objects during compilation, you should not even attempt this +unless you have about 2.5 GB free after the Debian installation. +Using these instructions to build a VM image is likely to require a +minimum of 4-5 GB for the VM (as you will likely also want a desktop +manager). + +GNUnet's security model assumes that your @code{/home} directory is +encrypted. +Thus, if possible, you should encrypt your entire disk, or at least just +your home partition (or per-user home directory). + +Naturally, the exact details of the starting state for your installation +should not matter much. +For example, if you selected any of those installation groups you might +simply already have some of the necessary packages installed. Thus, it is +suggested that you simply install the desktop environment of your choice +before beginning with the instructions. + + +@menu +* Update Debian:: +* Installing Debian Packages:: +* Installing Dependencies from Source2:: +* Installing GNUnet from Source2:: +* But wait (again) there is more!:: +@end menu + +@node Update Debian +@subsection Update Debian + +After any installation, you should begin by running + +@example +# apt-get update +# apt-get upgrade +@end example + +to ensure that all of your packages are up-to-date. Note that the "#" is +used to indicate that you need to type in this command as "root" (or +prefix with "sudo"), whereas "$" is used to indicate typing in a command +as a normal user. + +@node Installing Debian Packages +@subsection Installing Debian Packages + +We begin by installing a few Debian packages from stable: + +@example +# apt-get install gcc make python-zbar libltdl-dev libsqlite3-dev \ +libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \ +libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \ +libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \ +libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \ +libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \ +texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \ +libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ +libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \ +libgcrypt20-dev libmicrohttpd-dev +@end example + +@node Installing Dependencies from Source2 +@subsection Installing Dependencies from Source2 + +Yes, we said we start with a Debian 8 "stable" system, but because Debian +linked GnuTLS without support for DANE, we need to compile a few things, +in addition to GNUnet, still by hand. Yes, you can run GNUnet using the +respective Debian packages, but then you will not get DANE support. + +Next, we need to install a few dependencies from source. You might want +to do this as a "normal" user and only run the @code{make install} steps +as root (hence the @code{sudo} in the commands below). Also, you do this +from any directory. We begin by downloading all dependencies, then +extracting the sources, and finally compiling and installing the +libraries: + +@example +$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz +$ tar xvf gnutls-3.3.12.tar.xz +$ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd .. +@end example + +For the installation and compilation of libgnurl/gnURL refer to +the generic installation section, +@xref{generic source installation - libgnurl}. + +@node Installing GNUnet from Source2 +@subsection Installing GNUnet from Source2 + +For this, simply follow the generic installation instructions from@ +here. + +@node But wait (again) there is more! +@subsection But wait (again) there is more! + +So far, we installed all of the packages and dependencies required to +ensure that all of GNUnet would be built. However, while for example the +plugins to interact with the MySQL or Postgres databases have been +created, we did not actually install or configure those databases. +Thus, you will need to install and configure those databases or stick +with the default Sqlite database. Sqlite is usually fine for most +applications, but MySQL can offer better performance and Postgres better +resillience. + +@node Build instructions for macOS +@section Build instructions for macOS +@c FIXME: I -> we + +These are the installation guidelines for macOS. +They were tested on macOS High Sierra. + +@menu +* Installing dependencies:: +* Compile from Source:: +@end menu + +@node Installing dependencies +@subsection Installing dependencies + +First, install XCode in the newest version. +See https://developer.apple.com/xcode/. + +Install Homebrew (https://brew.sh) and then install the dependencies listed above. +If a dependency does not exists in brew, you need to compile it from source. + +@example +# brew install +@end example + +@node Compile from Source +@subsection Compile from Source + +Before you start building GNUnet, you need to setup your environment. +This means that you have to make sure the proper tools are used in the build process. +For example, after installing texinfo you need to make sure the new texinfo is actually used: + +@example +# echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.bash_profile +@end example + +Note: brew tells you the appropriate command when executing + +@example +# brew info texinfo +@end example + +This may also be necessary for the gettext package. + +Before you start compiling, you need to make sure gcc is used and not the clang compile of your macOS system. +On my system, gcc was actually ``gcc-7'' and gcc pointed to the clang compiler. + +@example +# export CC=gcc-7 +@end example + +After this the standard compile instructions apply. + +@c @node Build instructions for OpenBSD 6.2 +@c @section Build instructions for OpenBSD 6.2 + +@node Outdated build instructions for previous revisions +@section Outdated build instructions for previous revisions + +This chapter contains a collection of outdated, older installation guides. +They are mostly intended to serve as a starting point for writing +up-to-date instructions and should not be expected to work for +GNUnet 0.10.x. +A set of older installation instructions can also be found in the +file @file{doc/outdated-and-old-installation-instructions.txt} in the +source tree of GNUnet. + +This file covers old instructions which no longer receive security +updates or any kind of support. + +@menu +* Installing GNUnet 0.10.1 on Ubuntu 14.04:: +* Building GLPK for MinGW:: +* GUI build instructions for Ubuntu 12.04 using Subversion:: +@c * Installation with gnunet-update:: +* Instructions for Microsoft Windows Platforms (Old):: +@end menu + + +@node Installing GNUnet 0.10.1 on Ubuntu 14.04 +@subsection Installing GNUnet 0.10.1 on Ubuntu 14.04 + +Install the required dependencies: + +@example +$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \ + libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \ + libmicrohttpd-dev libgnutls28-dev +@end example + +Choose one or more database backends: + +@itemize @bullet + +@item SQLite3 + +@example + $ sudo apt-get install libsqlite3-dev@ +@end example + +@item MySQL + +@example +$ sudo apt-get install libmysqlclient-dev@ +@end example + +@item PostgreSQL + +@example + $ sudo apt-get install libpq-dev postgresql@ +@end example + +@end itemize + +Install the optional dependencies for gnunet-conversation: + +@example + $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev +@end example + +Install libgcrypt 1.6: + +@itemize @bullet + +@item For Ubuntu 14.04: + +@example +$ sudo apt-get install libgcrypt20-dev +@end example + +@item For Ubuntu older than 14.04: + +@example +wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2 +$ tar xf libgcrypt-1.6.1.tar.bz2 +$ cd libgcrypt-1.6.1 +$ ./configure +$ sudo make install +$ cd .. +@end example +@end itemize + +Install libgnurl: + +@pxref{generic source installation - libgnurl}. + +Install GNUnet: + +@example +$ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz +$ tar xf gnunet-0.10.1.tar.gz +$ cd gnunet-0.10.1 +@end example + +If you want to: + +@itemize @bullet + +@item +Install to a different directory: + +@example +--prefix=PREFIX +@end example + +@item +Have sudo permission, but do not want to compile as root: + +@example +--with-sudo +@end example + +@item +Want debug message enabled: + +@example +--enable-logging=verbose +@end example + +@end itemize + +@example +$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose] +$ make; sudo make install +@end example + +After installing it, you need to create an empty configuration file: + +@example +touch ~/.config/gnunet.conf +@end example + +And finally you can start GNUnet with + +@example +$ gnunet-arm -s +@end example + +@node Building GLPK for MinGW +@subsection Building GLPK for MinGW + +GNUnet now requires the GNU Linear Programming Kit (GLPK). +Since there's is no package you can install with @code{mingw-get} you +have to compile it from source: + +@itemize @bullet + +@item Download the latest version from +@uref{http://ftp.gnu.org/gnu/glpk/} + +@item Unzip the downloaded source tarball using your favourite +unzipper application In the MSYS shell + +@item change to the respective directory + +@item Configure glpk for "i686-pc-mingw32": + +@example +./configure '--build=i686-pc-mingw32' +@end example + +@item run + +@example +make install check +@end example + +@end itemize + +MinGW does not automatically detect the correct buildtype so you have to +specify it manually. + + +@node GUI build instructions for Ubuntu 12.04 using Subversion +@subsection GUI build instructions for Ubuntu 12.04 using Subversion + +After installing GNUnet you can continue installing the GNUnet GUI tools: + +First, install the required dependencies: + +@example +$ sudo apt-get install libgladeui-dev libqrencode-dev +@end example + +Please ensure that the GNUnet shared libraries can be found by the linker. +If you installed GNUnet libraries in a non standard path +(say GNUNET_PREFIX=/usr/local/lib/), you can + +@itemize @bullet + +@item set the environmental variable permanently to: + +@example +LD_LIBRARY_PATH=$GNUNET_PREFIX +@end example + +@item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf} + +@end itemize + +Now you can checkout and compile the GNUnet GUI tools: + +@example +$ git clone https://gnunet.org/git/gnunet-gtk +$ cd gnunet-gtk +$ ./bootstrap +$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/.. +$ make install +@end example + +@node Instructions for Microsoft Windows Platforms (Old) +@subsection Instructions for Microsoft Windows Platforms (Old) + +This document is a @b{DEPRECATED} installation guide for GNUnet on +Windows. +It will not work for recent GNUnet versions, but maybe it will be of +some use if problems arise. + +The Windows build uses a UNIX emulator for Windows, +@uref{http://www.mingw.org/, MinGW}, to build the executable modules. +These modules run natively on Windows and do not require additional +emulation software besides the usual dependencies. + +GNUnet development is mostly done under GNU/Linux and especially git +checkouts may not build out of the box. +We regret any inconvenience, and if you have problems, please report them. + +@menu +* Hardware and OS requirements:: +* Software installation:: +* Building libextractor and GNUnet:: +* Installer:: +* Source:: +@end menu + +@node Hardware and OS requirements +@subsubsection Hardware and OS requirements + +@itemize @bullet +@item Pentium II or equivalent processor, @geq{} 350 MHz +@item 128 MB RAM +@item 600 MB free disk space +@item Windows 2000 or Windows XP are recommended +@end itemize + +@node Software installation +@subsubsection Software installation + +@itemize @bullet + +@item +@strong{Compression software}@ + +The software packages GNUnet depends on are usually compressed using UNIX +tools like @command{tar}, @command{gzip}, @command{xzip} and +@command{bzip2}. +If you do not already have an utility that is able to extract such +archives, get @uref{http://www.7-zip.org/, 7-Zip}. + +@item +@strong{UNIX environment}@ + +The MinGW project provides the compiler toolchain that is used to build +GNUnet. +Get the following packages from the +@uref{http://sourceforge.net/projects/mingw/files/, MinGW} project: + +@itemize @bullet + +@item GCC core +@item GCC g++ +@item MSYS +@item MSYS Developer Tool Kit (msysDTK) +@item MSYS Developer Tool Kit - msys-autoconf (bin) +@item MSYS Developer Tool Kit - msys-automake (bin) +@item MinGW Runtime +@item MinGW Utilities +@item Windows API +@item Binutils +@item make +@item pdcurses +@item GDB (snapshot) +@end itemize + +@itemize @bullet + + +@item Install MSYS (to c:\mingw, for example.)@ +Do @strong{not} use spaces in the pathname. +For example, avoid a location such as @file{c:\program files\mingw}. + +@item Install MinGW runtime, utilities and GCC to a subdirectory +(to @file{c:\mingw\mingw}, for example) + +@item Install the Development Kit to the MSYS directory +(@file{c:\mingw}) + +@item Create a batch file bash.bat in your MSYS directory with +the files: + +@example +bin\sh.exe --login +@end example + +This batch file opens a shell which is used to invoke the build +processes. +MinGW's standard shell (@command{msys.bat}) is not suitable +because it opens a separate console window. +On Vista, @command{bash.bat} needs to be run as Administrator. + +@item +Start @command{bash.sh} and rename +@file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems: + +@example +mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken +@end example + +@item +Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and +remove the declaration of DATADIR from +(@file{c:\mingw\mingw\include\objidl.h} (lines 55-58) + +@item +Unpack autoconf, automake to the MSYS directory (@file{c:\mingw}) + +@item +Install all other packages to the MinGW directory (@file{c:\mingw\mingw\}) +@end itemize + + +@item @strong{GNU Libtool}@ +GNU Libtool is required to use shared libraries. +Get the prebuilt package from here and unpack it to the +MinGW directory (@file{c:\mingw}) + +@item @strong{Pthreads}@ +GNUnet uses the portable POSIX thread library for multi-threading: + +@itemize @bullet + +@item Save +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a} +(x86) or +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a} +(x64) as libpthread.a into the @file{lib} +directory (@file{c:\mingw\mingw\lib\libpthread.a}). + +@item Save +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll} +(x86) or +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a} +(x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}). + +@item Download all header files from +@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/} +to the @file{include} directory (@file{c:\mingw\mingw\include}). +@end itemize + + +@item @strong{GNU MP}@ +GNUnet uses the GNU Multiple Precision library for special cryptographic +operations. Get the GMP binary package from the +@uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and +unpack it to the MinGW directory (@file{c:\mingw\mingw}) + +@item @strong{GNU Gettext}@ +GNU gettext is used to provide national language support. +Get the prebuilt package from hereand unpack it to the MinGW +directory (@file{c:\mingw\mingw}) + +@item @strong{GNU iconv}@ +GNU Libiconv is used for character encoding conversion. +Get the prebuilt package from here and unpack it to the MinGW +directory (@file{c:\mingw\mingw}). + +@item @strong{SQLite}@ +GNUnet uses the SQLite database to store data. +Get the prebuilt binary from here and unpack it to your MinGW directory. + +@item @strong{MySQL}@ +As an alternative to SQLite, GNUnet also supports MySQL. + +@itemize @bullet + +@item Get the binary installer from the +@uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project} +(version 4.1), install it and follow the instructions in +@file{README.mysql}. + +@item Create a temporary build directory (@file{c:\mysql}) + +@item Copy the directories @file{include\} and @file{lib\} from the +MySQL directory to the new directory + +@item Get the patches from +@uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and +@uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the +latter is only required for MySQL + +@example +patch -p 0 +@end example + +@item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll} + +@item Change to @file{lib\} and create an import library: + +@example +dlltool --input-def ../include/libmySQL.def \ +--dllname libmysql.dll \ +--output-lib libmysqlclient.a -k +@end example + +@item Copy include\* to include\mysql\ + +@item Pass @code{--with-mysql=/c/mysql} to +@command{./configure} and copy @file{libmysql.dll} +to your PATH or GNUnet's @file{bin} directory +@end itemize + + +@item @strong{GTK+}@ +@command{gnunet-fs-gtk} and @command{libextractor} depend on GTK. +Get the the binary and developer packages of @command{atk}, +@command{glib}, @command{gtk}, @command{iconv}, +@command{gettext-runtime}, @command{pango} from +@uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them +to the MinGW directory (@file{c:\mingw\mingw}). +@c FIXME: The URL below for pkg-config seems wrong. +Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and +@command{libpng} and unpack them to the MinGW directory +(@file{c:\mingw\mingw}). +Here is an all-in-one package for the +@uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies} +. Do not overwrite any existing files! + +@item @strong{Glade}@ +@command{gnunet-*-gtk} and @command{gnunet-setup} were created using +this interface builder + +@itemize @bullet + +@item Get the Glade and libglade (-bin and -devel) packages +(without GTK!) from +@uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to +the MinGW directory (@file{c:\mingw\mingw}). + +@item Get @command{libxml} from here and unpack it to the MinGW +directory (@file{c:\mingw\mingw}). +@end itemize + +@c FIXME: URLs +@item @strong{zLib}@ +@command{libextractor} requires @command{zLib} to decompress some file +formats. GNUnet uses it to (de)compress meta-data. +Get zLib from here (Signature) and unpack it to the MinGW directory +(@file{c:\mingw\mingw}). + +@item @strong{Bzip2}@ +@command{libextractor} also requires @command{Bzip2} to +decompress some file formats. +Get the Bzip2 (binary and developer package) from +@uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and +unpack it to the MinGW directory (@file{c:\mingw\mingw}). + +@item @strong{Libgcrypt}@ +@command{Libgcrypt} provides the cryptographic functions used by GNUnet. +Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here}, +compile and place it in the MinGW directory +(@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to +compile GNUnet. + +@item @strong{PlibC}@ +PlibC emulates Unix functions under Windows. Get PlibC from here and +unpack it to the MinGW directory (c:\mingw\mingw) + +@item @strong{OGG Vorbis}@ +@command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files. +Get the packages +@uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg} +and +@uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis} +from the +@uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build} +and unpack them to the MinGW directory (c:\mingw\mingw). + +@item @strong{Exiv2}@ +(lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data. +Download +@uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2} +and unpack it to the MSYS directory (c:\mingw). +@end itemize + +@node Building libextractor and GNUnet +@subsubsection Building libextractor and GNUnet + +Before you compile @command{libextractor} or @command{GNUnet}, +be sure to set @code{PKG_CONFIG_PATH}: + +@example +export PKG_CONFIG_PATH=/mingw/lib/pkgconfig +@end example + +@noindent +@xref{GNUnet Installation Handbook}, for basic instructions on building +@command{libextractor} and @command{GNUnet}. +By default, all modules that are created in this way contain +debug information and are quite large. To compile release versions +(small and fast) set the variable @code{CFLAGS}: + +@example +export CFLAGS='-O2 -march=pentium -fomit-frame-pointer' +./configure --prefix=$HOME --with-extractor=$HOME +@end example + +@node Installer +@subsubsection Installer + +The GNUnet installer is made with +@uref{http://nsis.sourceforge.net/, NSIS}. The installer script is +located in @file{contrib\win} in the GNUnet source tree. + +@node Source +@subsubsection Source + +@c FIXME: URL... or: WHERE is HERE? +The sources of all dependencies are available here. diff --git a/doc/system_specific/outdated-and-old-installation-instructions.txt b/doc/system_specific/outdated-and-old-installation-instructions.txt new file mode 100644 index 000000000..f2cbe1847 --- /dev/null +++ b/doc/system_specific/outdated-and-old-installation-instructions.txt @@ -0,0 +1,672 @@ +# This file contains pieces from chapter/installation.texi for systems where the LTS or otherwise support +# ended. They can be useful for people trying to write new installation instructions for those systems. +# In particual this covers: +# - FreeBSD 8 +# - Mac OS X Tiger +# - Fedora 8 +# - Gentoo with GNUnet 0.9 +# +# Sources for LTS and support ranges: +# https://www.freebsd.org/security/security.html#sup +# https://support.microsoft.com/en-us/help/17140/lifecycle-faq-general-policy-questions +# Mac products, OS is supposedly similar (no official statements exist): https://web.archive.org/web/20160706101225/https://support.apple.com/en-us/HT201624 +# https://wiki.debian.org/LTS +# https://www.ubuntu.com/info/release-end-of-life + +@node Build instructions for Gentoo +@subsection Build instructions for Gentoo + + +This page describes how to install GNUnet 0.9 on Gentoo. + +Since the GNUnet 0.9 ebuilds are not in the official portage tree yet, we need +to add them to the local portage overlay. All the commands below should be +executed as root. + +Specify your local portage directory in the /etc/make.conf, for example:@ +@code{$ echo 'PORTDIR_OVERLAY="/usr/local/portage"' >> /etc/make.conf} + +Create directories for the ebuilds:@ +@code{$ mkdir -p /usr/local/portage/media-libs/libextractor /usr/local/portage/net-p2p/gnunet/files} + +Download the latest ebuilds, init and config files from here and put them into +respective directories:@ +@code{$ cp libextractor-0.6.2.ebuild /usr/local/portage/media-libs/libextractor@ + $ cp gnunet-0.9.2.ebuild /usr/local/portage/net-p2p/gnunet@ + $ cp gnunet-0.9.2.conf gnunet-0.9.2.confd gnunet-0.9.2.initd /usr/local/portage/net-p2p/gnunet/files} + +Generate Manifest files for the ebuilds:@ +@code{$ cd /usr/local/portage/net-p2p/gnunet@ + $ ebuild gnunet-0.9.2.ebuild digest@ + $ cd /usr/local/portage/media-libs/libextractor@ + $ ebuild libextractor-0.6.2.ebuild digest} + +Unmask GNUnet and dependencies in the /etc/portage/package.keywords. For +example, if you use x86-64 architecture, add the following lines:@ +@code{net-p2p/gnunet ~amd64@ + media-libs/libextractor ~amd64@ + net-libs/libmicrohttpd ~amd64@ + net-misc/curl ~amd64} + +Add either sqlite or mysql USE-flag in the /etc/portage/package.use:@ +@code{net-p2p/gnunet sqlite} + +Now everything is ready to install GNUnet:@ +@code{$ emerge -av gnunet} + +Use /etc/init.d/gnunet to start/stop GNUnet. + + + + +@node Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . +@subsection Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . +@c %**end of header + +@strong{This documentation is outdated and not valid for GNUnet 0.10.0!}@ + GNUnet installation on Fedora 8/Planetlab nodes can be done as following: + +1. Install the build tools to build GNUnet@ +@example +sudo yum -y -t --nogpgcheck install gcc make automake autoconf gettext-devel \ +texinfo zlib-devel subversion@ +@end example + +2. Install the GNUnet dependencies@ +@example +sudo yum -y -t --nogpgcheck install gnutls-devel gnutls-devel libgcrypt-devel \ +sqlite-devel postgresql-devel mysql-devel libgsf-devel libvorbis-devel \ +libidn-devel +@end example + +3. Install outdated dependencies from source@ + libtool@ +@code{@ + wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ + tar xvfz libtool-2.4.2.tar.gz@ + cd libtool-2.4.2@ + ./configure@ + sudo make install@ +} + +libtool@ +@code{@ + wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ + tar xvfz libtool-2.4.2.tar.gz@ + cd libtool-2.4.2@ + ./configure@ + sudo make install@ +} + +glpk@ +@code{@ + wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz@ + tar xvfz glpk-4.47.tar.gz@ + cd glpk-4.47@ + ./configure@ + sudo make install@ +} + +libgpg-error@ +@code{@ + wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2@ + tar xvfj libgpg-error-1.10.tar.bz2@ + cd libgpg-error-1.10@ + ./configure --prefix=/usr@ + sudo make install@ +} + +libgcrypt@ +@code{@ + wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2@ + tar xvfj libgcrypt-1.5.0.tar.tar.bz2@ + cd libgcrypt-1.5.0@ + ./configure --prefix=/usr@ + sudo make install@ +} + +libcurl@ +@code{@ + wget http://curl.haxx.se/download/curl-7.26.0.tar.gz@ + tar xvfz curl-7.26.0.tar.gz@ + cd curl-7.26.0@ + ./configure@ + sudo make install@ +} + +libunistring@ +@code{@ + wget http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz@ + tar xvfz libunistring-0.9.3.tar.gz@ + cd libunistring-0.9.3@ + ./configure@ + sudo make install@ +} + +4. Remove conflicting packages@ +@code{@ + sudo rpm -e --nodeps libgcrypt libgpg-error@ +} + +4. Install libextractor@ +@code{@ + wget ftp://ftp.gnu.org/gnu/libextractor/libextractor-0.6.3.tar.gz@ + tar xvfz libextractor-0.6.3.tar.gz@ + cd libextractor-0.6.3@ + ./configure@ + sudo make install@ +} + +5. Install libmicrohttpd and dependencies + +nettle@ +@code{@ + wget http://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz@ + tar xvfz nettle-2.5.tar.gz@ + cd nettle-2.5@ + ./configure@ + sudo make install@ +} + +GnuTLS@ +@code{@ + wget http://ftp.gnu.org/gnu/gnutls/gnutls-2.12.20.tar.bz2@ + tar xvfj gnutls-2.12.20.tar.bz2@ + cd gnutls-2.12.20@ + ./configure --without-p11-kit@ + sudo make install@ +} + +libmicrohttpd@ +@code{@ + wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.21.tar.gz@ + tar xvfz libmicrohttpd-0.9.21.tar.gz@ + cd libmicrohttpd-0.9.21@ + ./configure@ + sudo make install@ +} + +6. Set GNUnet prefix and add to PATH@ +@code{@ + export GNUNET_PREFIX=@ + export PATH=$PATH:$GNUNET_PREFIX/bin@ +} + +7. Install GNUnet from svn@ +@example + export LD_LIBRARY_PATH=/usr/local/lib@ + svn co https://gnunet.org/svn/gnunet@ + cd gnunet@ + libtoolize@ + ./bootstrap@ + ./configure --prefix=$GNUNET_PREFIX --with-extractor=/usr/local \ + --with-curl=/usr/local --with-mysql=/usr/lib/mysql --enable-logging=verbose@ + make install@ +@end example + +Done! + + +@node Build instructions for FreeBSD 8 +@subsection Build instructions for FreeBSD 8 + +To get GNUnet 0.9 to compile on FreeBSD (at least FreeBSD 8.0):@ in order to +install the library @code{libiconv}, at first change the directory to your +ports directory, e.g.@ +@code{@ + $ cd /usr/ports/@ +}@ + following that, go to the install file of @code{libiconv} and install it,@ +@code{@ + $ cd converters/libiconv,@ + $ make install@ +} + +after that, change the directory to where you will check out +@code{libextractor} and GNUnet, and install latest @code{libextractor},@ + first of all, checkout @code{libextractor}, e.g.@ +@code{@ + $ svn co https://gnunet.org/svn/Extractor@ +}@ + then change the directory into which it was checked out, e.g.@ +@code{@ + $ cd Extractor@ +}@ + before the installation, you should do following steps,@ + +@example +$ ./bootstrap@ +$ ./configure --with-ltdl-include=/usr/local/include \ + --with-ltdl-lib=/usr/local/lib@ +@end example + +if these steps complete successfully, you can install the library,@ + +@example +$ make install@ +@end example + +to check out the GNUnet, you should do the similar steps as +@code{libextractor}, firstly, change back to starting directory, e.g.@ +@code{@ + $ cd ../@ +}@ + Set the following environmental variables:@ +@code{@ + export CPPFLAGS="-I/usr/local/include"@ + export LDFLAGS="-L/usr/local/lib"@ +}@ + next, checkout GNUnet using@ +@code{@ + $ svn co https://gnunet.org/svn/gnunet@ +}@ + then change directory into newly checked out directory,@ +@code{@ + $ cd gnunet@ +}@ + at last, start to install GNUnet,@ + +@example + $ ./bootstrap@ + $ ./configure --with-ltdl-include=/usr/local/include \ + --with-ltdl-lib=/usr/local/lib --with-extractor=/usr/local + +## NOTE: you may not need the --with-extractor option!@ + +$ make install +@end example + + + +@node Basic installation for Mac OS X +@subsection Basic installation for Mac OS X + +This documentation may be outdated! + +This page is providing guidelines for users trying to install GNUnet on Mac OS +X.@ Mainly users trying to install GNUnet by building source code are the most +welcome readers.@ The steps below are tested on an Intel Architecture running +Mac OS X Tiger (10.4.11). Ideally they should work on other Mac boxes with +different configurations as all the configuration done for it is dependent on +@uref{http://www.macports.org/, MacPorts} + +For having GNUnet installed successfully, some dependencies should be firstly +resolved: + +@itemize @bullet + +@item +Install/Update your @uref{http://developer.apple.com/tools/xcode/, Xcode} +version 3.2.1 or later for Snow Leopard, 3.1.4 or later for Leopard, or 2.5 for +Tiger. + +@item +Download and install @uref{http://www.macports.org/, MacPorts}.@ +Now you are ready for installing GNunet dependencies. + +@item +First, you'd better make sure that: /opt/local/bin and /opt/local/sbin are +available in your PATH. (For doing so, open a terminal and type:@ + +@example +$ echo $PATH +@end example + +and examine the output of it). If the paths are not available in your +environment, you have to add them (You can add them by editing your .profile +file in your home directory, append them to the PATH line). Then type: +@example +$ source ~/.profile +@end example + +and re-examine the echo command output. + +@item +Use MacPorts to download and install the dependencies:@ +The libraries are: + +@itemize @bullet + +@item +@uref{http://trac.macports.org/browser/trunk/dports/www/libmicrohttpd/Portfile, libmicrohttpd.} + +@item +@uref{http://trac.macports.org/browser/trunk/dports/devel/libgcrypt/Portfile, libgcrypt.} + +@item +@uref{http://trac.macports.org/browser/trunk/dports/net/curl/Portfile, libcurl.} + +@item +@uref{http://trac.macports.org/browser/trunk/dports/devel/libtool/Portfile, libltdl.} + +@item +@uref{http://trac.macports.org/browser/trunk/dports/databases/sqlite3/Portfile, SQlite.} + +@item +libunistring + +@item +glpk + +@end itemize + +The port command is as follows:@ +@example +port install libmicrohttpd libgcrypt curl libtool sqlite3 linunistring glpk +@end example +One of the dependencies, the libextractor, should be explicitly installed, +since the version available from macports is outdated to work with GNUnet. To +install the latest libextractor: +@itemize @bullet + + +@item +Install the Subversion Client:@ +For more information about Subversion visit: +@uref{http://subversion.tigris.org/, http://subversion.tigris.org/} + +@example +# port install subversion +@end example + + +@item +Use Subversion to download the latest Extractor: +@example +$ svn checkout https://gnunet.org/svn/Extractor +@end example + + +@item +Go to the installation directory of the Extractor, compile and install it: +@example +$ ./bootstrap +$ export CPPFLAGS="-I/opt/local/include" +$ export LDFLAGS="-L/opt/local/lib" +$ ./configure --prefix=/opt/local +$ make +# make install +@end example + +@end itemize + + +@item +Now, your system is ready to install GNunet. If you downloaded GNUnet by +checking it out from svn, you should start by running the bootstrap script. +Open a terminal pointing to the GNUnet directory and type:@ + +@example +$ ./bootstrap +@end example + + +@item +Run the configure script: +@example +$ export CPPFLAGS="-I/opt/local/include" +$ export LDFLAGS="-L/opt/local/lib" +$ ./configure --prefix=/tmp/gnunet_build +@end example + + +GNUnet will be installed in the directory /tmp/gnunet_build (Of course that +installation path can be changed).@ The CPPFLAGS and LDFLAGS are mentioned in +order to inform the compiler and the linker to lookup headers and libraries in +/opt/local/include and /opt/local/lib. + +@item +Compile@ + +@example +$ make +@end example + + +@item +Install GNUnet +@example +# make install +@end example + +@end itemize + + +@node Basic Installation for Fedora/PlanetLab nodes running Fedora 12 +@subsection Basic Installation for Fedora/PlanetLab nodes running Fedora 12 + + +@strong{This documentation is outdated and not valid for GNUnet 0.10.0!}@ + +GNUnet installation on Fedora 8/Planetlab nodes can be done as following: + +1. Install the build tools to build GNUnet@ +@example +sudo yum -y -t --nogpgcheck install gcc make autoconf gettext-devel \ +texinfo subversion@ +@end example + +2. Install the GNUnet dependencies@ +@example +sudo yum -y -t --nogpgcheck install libunistring-devel libunistring-devel \ +libgcrypt-devel zlib-devel sqlite-devel postgresql-devel mysql-devel \ +libgsf-devel libvorbis-devel@ +@end example + +3. Install outdated dependencies from source@ +libtool@ +@example +wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ +tar xvfz libtool-2.4.2.tar.gz@ +cd libtool-2.4.2@ +./configure@ +sudo make install@ +@end example + +glpk@ +@example +wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz@ +tar xvfz glpk-4.47.tar.gz@ +cd glpk-4.47@ +./configure@ +sudo make install@ +@end example + +libcurl@ +@example +wget http://curl.haxx.se/download/curl-7.26.0.tar.gz@ +tar xvfz curl-7.26.0.tar.gz@ +cd curl-7.26.0@ +./configure@ +sudo make install@ +@end example + +4. Install libextractor@ +@example +svn co https://gnunet.org/svn/libextractor@ +cd libextractor@ +libtoolize@ +./bootstrap@ +./configure@ +sudo make install@ +@end example + +5. Install libmicrohttpd@ +@example +svn co https://gnunet.org/svn/libmicrohttpd@ +cd libmicrohttpd@ +libtoolize@ +./bootstrap@ +./configure@ +sudo make install@ +@end example + +6. Set GNUnet prefix and add to PATH@ +@example +export GNUNET_PREFIX=@ +export PATH=$PATH:$GNUNET_PREFIX/bin@ +@end example + +7. Install GNUnet from svn@ +@example +export LD_LIBRARY_PATH=/usr/local/lib@ +svn co https://gnunet.org/svn/gnunet@ +cd gnunet@ +libtoolize@ +./bootstrap@ +./configure --prefix=$GNUNET_PREFIX --with-extractor=/usr \ + --with-mysql=/usr/lib/mysql --enable-logging=verbose@ +make install@ +@end example + +Done! + + +@node Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . +@subsection Basic Installation for Fedora/PlanetLab nodes running Fedora 8 . +@c %**end of header + +@strong{This documentation is outdated and not valid for GNUnet 0.10.0!}@ + GNUnet installation on Fedora 8/Planetlab nodes can be done as following: + +1. Install the build tools to build GNUnet@ +@example +sudo yum -y -t --nogpgcheck install gcc make automake autoconf gettext-devel \ +texinfo zlib-devel subversion@ +@end example + +2. Install the GNUnet dependencies@ +@example +sudo yum -y -t --nogpgcheck install gnutls-devel gnutls-devel libgcrypt-devel \ +sqlite-devel postgresql-devel mysql-devel libgsf-devel libvorbis-devel \ +libidn-devel +@end example + +3. Install outdated dependencies from source@ + libtool@ +@code{@ + wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ + tar xvfz libtool-2.4.2.tar.gz@ + cd libtool-2.4.2@ + ./configure@ + sudo make install@ +} + +libtool@ +@code{@ + wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz@ + tar xvfz libtool-2.4.2.tar.gz@ + cd libtool-2.4.2@ + ./configure@ + sudo make install@ +} + +glpk@ +@code{@ + wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz@ + tar xvfz glpk-4.47.tar.gz@ + cd glpk-4.47@ + ./configure@ + sudo make install@ +} + +libgpg-error@ +@code{@ + wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2@ + tar xvfj libgpg-error-1.10.tar.bz2@ + cd libgpg-error-1.10@ + ./configure --prefix=/usr@ + sudo make install@ +} + +libgcrypt@ +@code{@ + wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2@ + tar xvfj libgcrypt-1.5.0.tar.tar.bz2@ + cd libgcrypt-1.5.0@ + ./configure --prefix=/usr@ + sudo make install@ +} + +libcurl@ +@code{@ + wget http://curl.haxx.se/download/curl-7.26.0.tar.gz@ + tar xvfz curl-7.26.0.tar.gz@ + cd curl-7.26.0@ + ./configure@ + sudo make install@ +} + +libunistring@ +@code{@ + wget http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz@ + tar xvfz libunistring-0.9.3.tar.gz@ + cd libunistring-0.9.3@ + ./configure@ + sudo make install@ +} + +4. Remove conflicting packages@ +@code{@ + sudo rpm -e --nodeps libgcrypt libgpg-error@ +} + +4. Install libextractor@ +@code{@ + wget ftp://ftp.gnu.org/gnu/libextractor/libextractor-0.6.3.tar.gz@ + tar xvfz libextractor-0.6.3.tar.gz@ + cd libextractor-0.6.3@ + ./configure@ + sudo make install@ +} + +5. Install libmicrohttpd and dependencies + +nettle@ +@code{@ + wget http://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz@ + tar xvfz nettle-2.5.tar.gz@ + cd nettle-2.5@ + ./configure@ + sudo make install@ +} + +GnuTLS@ +@code{@ + wget http://ftp.gnu.org/gnu/gnutls/gnutls-2.12.20.tar.bz2@ + tar xvfj gnutls-2.12.20.tar.bz2@ + cd gnutls-2.12.20@ + ./configure --without-p11-kit@ + sudo make install@ +} + +libmicrohttpd@ +@code{@ + wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.21.tar.gz@ + tar xvfz libmicrohttpd-0.9.21.tar.gz@ + cd libmicrohttpd-0.9.21@ + ./configure@ + sudo make install@ +} + +6. Set GNUnet prefix and add to PATH@ +@code{@ + export GNUNET_PREFIX=@ + export PATH=$PATH:$GNUNET_PREFIX/bin@ +} + +7. Install GNUnet from svn@ +@example + export LD_LIBRARY_PATH=/usr/local/lib@ + svn co https://gnunet.org/svn/gnunet@ + cd gnunet@ + libtoolize@ + ./bootstrap@ + ./configure --prefix=$GNUNET_PREFIX --with-extractor=/usr/local \ + --with-curl=/usr/local --with-mysql=/usr/lib/mysql --enable-logging=verbose@ + make install@ +@end example + +Done! + + -- cgit v1.2.3 From c70305038b19dd5c931782774b4260221c818cc5 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Sat, 9 Jun 2018 15:21:14 +0000 Subject: README: Mention further reading material Signed-off-by: Nils Gillmann --- README | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README b/README index 572d6ca84..b7a83d14a 100644 --- a/README +++ b/README @@ -427,6 +427,34 @@ throttled by ISPs that dislike P2P. Details for configuring the reverse proxy are documented on our website. +Further Reading +=============== + +* Documentation + + A preliminary rendering of the new GNUnet manual is deployed at + + https://d.n0.is/pub/doc/gnunet/manual/gnunet/ + + we plan to have a complete new gnunet.org up and running in 2019. + This website output exists as a convenience solution until then. + +* Academia / papers + + In almost 20 years various people in our community have written and + collected a good number of papers which have been implemented in + GNUnet or projects around GNUnet. + There are currently 2 ways to get them: + + * Using git: + git clone https://gnunet.org/git/bibliography.git + * Using Drupal: + https://gnunet.org/bibliography + + The Drupal access will be replaced by a new interface to our + bibliography in 2019. + + Stay tuned ========== -- cgit v1.2.3 From 9c6274c6af9b86952de81029e4c36b724a356af5 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Sat, 9 Jun 2018 15:25:20 +0000 Subject: Fix the link to the preliminary documentation Signed-off-by: Nils Gillmann --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index b7a83d14a..93c889442 100644 --- a/README +++ b/README @@ -434,7 +434,7 @@ Further Reading A preliminary rendering of the new GNUnet manual is deployed at - https://d.n0.is/pub/doc/gnunet/manual/gnunet/ + https://d.n0.is/pub/doc/gnunet/manual/ we plan to have a complete new gnunet.org up and running in 2019. This website output exists as a convenience solution until then. -- cgit v1.2.3 From 0183db872cb4df16971ea045ef204f190d901ed9 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Mon, 11 Jun 2018 06:34:14 +0000 Subject: documentation: user + developer changes Signed-off-by: Nils Gillmann --- doc/documentation/chapters/developer.texi | 383 +++++- doc/documentation/chapters/user.texi | 1926 +++++++++++++++++++++++++++++ doc/documentation/gnunet.texi | 12 +- 3 files changed, 2310 insertions(+), 11 deletions(-) diff --git a/doc/documentation/chapters/developer.texi b/doc/documentation/chapters/developer.texi index 6a895ed11..16039c8d3 100644 --- a/doc/documentation/chapters/developer.texi +++ b/doc/documentation/chapters/developer.texi @@ -11,7 +11,7 @@ For developers, GNUnet is: @itemize @bullet @item developed by a community that believes in the GNU philosophy @item Free Software (Free as in Freedom), licensed under the -GNU General Public License@footnote{@uref{https://www.gnu.org/licenses/licenses.html#GPL, https://www.gnu.org/licenses/licenses.html#GPL}} +GNU Affero General Public License@footnote{@uref{https://www.gnu.org/licenses/licenses.html#AGPL, https://www.gnu.org/licenses/licenses.html#AGPL}} @item A set of standards, including coding conventions and architectural rules @item A set of layered protocols, both specifying the communication @@ -40,6 +40,7 @@ new chapters, sections or insightful comments. @menu * Developer Introduction:: +* Internal Dependencies:: * Code overview:: * System Architecture:: * Subsystem stability:: @@ -47,6 +48,7 @@ new chapters, sections or insightful comments. * Build-system:: * Developing extensions for GNUnet using the gnunet-ext template:: * Writing testcases:: +* Building GNUnet and its dependencies:: * TESTING library:: * Performance regression analysis with Gauger:: * TESTBED Subsystem:: @@ -250,6 +252,77 @@ Finally, there are various external projects (see links for a list of those that have a public website) which build on top of the GNUnet framework. +@c *********************************************************************** +@node Internal dependencies +@section Internal dependencies + +This section tries to give an overview of what processes a typical GNUnet +peer running a particular application would consist of. All of the +processes listed here should be automatically started by +@command{gnunet-arm -s}. +The list is given as a rough first guide to users for failure diagnostics. +Ideally, end-users should never have to worry about these internal +dependencies. + +In terms of internal dependencies, a minimum file-sharing system consists +of the following GNUnet processes (in order of dependency): + +@itemize @bullet +@item gnunet-service-arm +@item gnunet-service-resolver (required by all) +@item gnunet-service-statistics (required by all) +@item gnunet-service-peerinfo +@item gnunet-service-transport (requires peerinfo) +@item gnunet-service-core (requires transport) +@item gnunet-daemon-hostlist (requires core) +@item gnunet-daemon-topology (requires hostlist, peerinfo) +@item gnunet-service-datastore +@item gnunet-service-dht (requires core) +@item gnunet-service-identity +@item gnunet-service-fs (requires identity, mesh, dht, datastore, core) +@end itemize + +@noindent +A minimum VPN system consists of the following GNUnet processes (in +order of dependency): + +@itemize @bullet +@item gnunet-service-arm +@item gnunet-service-resolver (required by all) +@item gnunet-service-statistics (required by all) +@item gnunet-service-peerinfo +@item gnunet-service-transport (requires peerinfo) +@item gnunet-service-core (requires transport) +@item gnunet-daemon-hostlist (requires core) +@item gnunet-service-dht (requires core) +@item gnunet-service-mesh (requires dht, core) +@item gnunet-service-dns (requires dht) +@item gnunet-service-regex (requires dht) +@item gnunet-service-vpn (requires regex, dns, mesh, dht) +@end itemize + +@noindent +A minimum GNS system consists of the following GNUnet processes (in +order of dependency): + +@itemize @bullet +@item gnunet-service-arm +@item gnunet-service-resolver (required by all) +@item gnunet-service-statistics (required by all) +@item gnunet-service-peerinfo +@item gnunet-service-transport (requires peerinfo) +@item gnunet-service-core (requires transport) +@item gnunet-daemon-hostlist (requires core) +@item gnunet-service-dht (requires core) +@item gnunet-service-mesh (requires dht, core) +@item gnunet-service-dns (requires dht) +@item gnunet-service-regex (requires dht) +@item gnunet-service-vpn (requires regex, dns, mesh, dht) +@item gnunet-service-identity +@item gnunet-service-namestore (requires identity) +@item gnunet-service-gns (requires vpn, dns, dht, namestore, identity) +@end itemize + @c *********************************************************************** @node Code overview @section Code overview @@ -1089,6 +1162,314 @@ typically necessary to run @code{make install} before running any testcases. Thus the canonical command @code{make check install} has to be changed to @code{make install check} for GNUnet. +@c *********************************************************************** +@cindex Building GNUnet +@node Building GNUnet and its dependencies +@section Building GNUnet and its dependencies + +In the following section we will outline how to build GNUnet and +some of its dependencies. We will assume a fair amount of knowledge +for building applications under UNIX-like systems. Furthermore we +assume that the build environment is sane and that you are aware of +any implications actions in this process could have. +Instructions here can be seen as notes for developers (an extension to +the 'HACKING' section in README) as well as package mantainers. +@b{Users should rely on the available binary packages.} +We will use Debian as an example Operating System environment. Substitute +accordingly with your own Ooperating System environment. + +For the full list of depenendencies, consult the appropriate, up-to-date +section in the @file{README} file. + +First, we need to build or install (depending on your OS) the following +packages. If you build them from source, build them in this exact order: + +@exmaple +libgpgerror, libgcrypt, libnettle, libunbound, GnuTLS (with libunbound +support) +@end example + +After we have build and installed those packages, we continue with +packages closer to GNUnet in this step: libgnurl (our libcurl fork), +GNU libmicrohttpd, and GNU libextractor. Again, if your package manager +provides one of these packages, use the packages provided from it +unless you have good reasons (package version too old, conflicts, etc). +We advise against compiling widely used packages such as GnuTLS +yourself if your OS provides a variant already unless you take care +of maintenance of the packages then. + +In the optimistic case, this command will give you all the dependencies: + +@example +sudo apt-get install libgnurl libmicrohttpd libextractor +@end example + +From experience we know that at the very least libgnurl is not +available in some environments. You could substitute libgnurl +with libcurl, but we recommend to install libgnurl, as it gives +you a predefined libcurl with the small set GNUnet requires. In +the past namespaces of libcurl and libgnurl were shared, which +caused problems when you wanted to integrate both of them in one +Operating System. This has been resolved, and they can be installed +side by side now. + +@cindex libgnurl +@cindex compiling libgnurl +GNUnet and some of its function depend on a limited subset of cURL/libcurl. +Rather than trying to enforce a certain configuration on the world, we +opted to maintain a microfork of it that ensures we can link against the +right set of features. We called this specialized set of libcurl +``libgnurl''. It is fully ABI compatible with libcurl and currently used +by GNUnet and some of its dependencies. + +We download libgnurl and its digital signature from the GNU fileserver, +assuming @env{TMPDIR} exists@footnote{It might be @file{/tmp}, @env{TMPDIR}, @env{TMP} or any other location. For consistency we assume @env{TMPDIR} points to @file{/tmp} for the remainder of this section.} + +@example +cd \$TMPDIR +wget https://ftp.gnu.org/gnu/gnunet/gnurl-7.60.0.tar.Z +wget https://ftp.gnu.org/gnu/gnunet/gnurl-7.60.0.tar.Z.sig +@end example + +Next, verify the digital signature of the file: + +@example +gpg --verify gnurl-7.60.0.tar.Z.sig +@end example + +If gpg fails, you might try with @command{gpg2} on your OS. If the error +states that ``the key can not be found'' or it is unknown, you have to +retrieve the key (A88C8ADD129828D7EAC02E52E22F9BBFEE348588) from a +keyserver first: + +@example +gpg --keyserver pgp.mit.edu --recv-keys A88C8ADD129828D7EAC02E52E22F9BBFEE348588 +@end example + +and rerun the verification command. + +libgnurl will require the following packages to be present at runtime: +gnutls (with DANE support / libunbound), libidn, zlib and at compile time: +libtool, groff, perl, pkg-config, and python 2.7. + +Once you have verified that all the required packages are present on your +system, we can proceed to compile libgnurl: + +@example +tar -xvf gnurl-7.60.0.tar.Z +cd gnurl-7.60.0 +sh configure --disable-ntlm-wb +make +make -C tests test +sudo make install +@end example + +After you've compiled and installed libgnurl, we can proceed to building +GNUnet. + + + + +First, in addition to the GNUnet sources you might require downloading the +latest version of various dependencies, depending on how recent the +software versions in your distribution of GNU/Linux are. +Most distributions do not include sufficiently recent versions of these +dependencies. +Thus, a typically installation on a "modern" GNU/Linux distribution +requires you to install the following dependencies (ideally in this +order): + +@itemize @bullet +@item libgpgerror and libgcrypt +@item libnettle and libunbound (possibly from distribution), GnuTLS +@item libgnurl (read the README) +@item GNU libmicrohttpd +@item GNU libextractor +@end itemize + +Make sure to first install the various mandatory and optional +dependencies including development headers from your distribution. + +Other dependencies that you should strongly consider to install is a +database (MySQL, sqlite or Postgres). +The following instructions will assume that you installed at least sqlite. +For most distributions you should be able to find pre-build packages for +the database. Again, make sure to install the client libraries @b{and} the +respective development headers (if they are packaged separately) as well. + +You can find specific, detailed instructions for installing of the +dependencies (and possibly the rest of the GNUnet installation) in the +platform-specific descriptions, which can be found in the Index. +Please consult them now. +If your distribution is not listed, please study +@ref{Build instructions for Debian 8}, the build instructions for +Debian stable, carefully as you try to install the dependencies for your +own distribution. +Contributing additional instructions for further platforms is always +appreciated. +Please take in mind that operating system development tends to move at +a rather fast speed. Due to this you should be aware that some of +the instructions could be outdated by the time you are reading this. +If you find a mistake, please tell us about it (or even better: send +a patch to the documentation to fix it!). + +Before proceeding further, please double-check the dependency list. +Note that in addition to satisfying the dependencies, you might have to +make sure that development headers for the various libraries are also +installed. +There maybe files for other distributions, or you might be able to find +equivalent packages for your distribution. + +While it is possible to build and install GNUnet without having root +access, we will assume that you have full control over your system in +these instructions. +First, you should create a system user @emph{gnunet} and an additional +group @emph{gnunetdns}. On the GNU/Linux distributions Debian and Ubuntu, +type: + +@example +sudo adduser --system --home /var/lib/gnunet --group \ +--disabled-password gnunet +sudo addgroup --system gnunetdns +@end example + +@noindent +On other Unixes and GNU systems, this should have the same effect: + +@example +sudo useradd --system --groups gnunet --home-dir /var/lib/gnunet +sudo addgroup --system gnunetdns +@end example + +Now compile and install GNUnet using: + +@example +tar xvf gnunet-@value{VERSION}.tar.gz +cd gnunet-@value{VERSION} +./configure --with-sudo=sudo --with-nssdir=/lib +make +sudo make install +@end example + +If you want to be able to enable DEBUG-level log messages, add +@code{--enable-logging=verbose} to the end of the +@command{./configure} command. +@code{DEBUG}-level log messages are in English only and +should only be useful for developers (or for filing +really detailed bug reports). + +@noindent +Next, edit the file @file{/etc/gnunet.conf} to contain the following: + +@example +[arm] +SYSTEM_ONLY = YES +USER_ONLY = NO +@end example + +@noindent +You may need to update your @code{ld.so} cache to include +files installed in @file{/usr/local/lib}: + +@example +# ldconfig +@end example + +@noindent +Then, switch from user @code{root} to user @code{gnunet} to start +the peer: + +@example +# su -s /bin/sh - gnunet +$ gnunet-arm -c /etc/gnunet.conf -s +@end example + +You may also want to add the last line in the gnunet user's @file{crontab} +prefixed with @code{@@reboot} so that it is executed whenever the system +is booted: + +@example +@@reboot /usr/local/bin/gnunet-arm -c /etc/gnunet.conf -s +@end example + +@noindent +This will only start the system-wide GNUnet services. +Type @command{exit} to get back your root shell. +Now, you need to configure the per-user part. For each +user that should get access to GNUnet on the system, run +(replace alice with your username): + +@example +sudo adduser alice gnunet +@end example + +@noindent +to allow them to access the system-wide GNUnet services. Then, each +user should create a configuration file @file{~/.config/gnunet.conf} +with the lines: + +@example +[arm] +SYSTEM_ONLY = NO +USER_ONLY = YES +DEFAULTSERVICES = gns +@end example + +@noindent +and start the per-user services using + +@example +$ gnunet-arm -c ~/.config/gnunet.conf -s +@end example + +@noindent +Again, adding a @code{crontab} entry to autostart the peer is advised: + +@example +@@reboot /usr/local/bin/gnunet-arm -c $HOME/.config/gnunet.conf -s +@end example + +@noindent +Note that some GNUnet services (such as SOCKS5 proxies) may need a +system-wide TCP port for each user. +For those services, systems with more than one user may require each user +to specify a different port number in their personal configuration file. + +Finally, the user should perform the basic initial setup for the GNU Name +System (GNS) certificate authority. This is done by running: + +@example +$ gnunet-gns-proxy-setup-ca +@end example + +@noindent +The first generates the default zones, wheras the second setups the GNS +Certificate Authority with the user's browser. Now, to activate GNS in the +normal DNS resolution process, you need to edit your +@file{/etc/nsswitch.conf} where you should find a line like this: + +@example +hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 +@end example + +@noindent +The exact details may differ a bit, which is fine. Add the text +@emph{"gns [NOTFOUND=return]"} after @emph{"files"}. +Keep in mind that we included a backslash ("\") here just for +markup reasons. You should write the text below on @b{one line} +and @b{without} the "\": + +@example +hosts: files gns [NOTFOUND=return] mdns4_minimal \ +[NOTFOUND=return] dns mdns4 +@end example + +@c FIXME: Document new behavior. +You might want to make sure that @file{/lib/libnss_gns.so.2} exists on +your system, it should have been created during the installation. + + +@c ********************************************************************** @cindex TESTING library @node TESTING library @section TESTING library diff --git a/doc/documentation/chapters/user.texi b/doc/documentation/chapters/user.texi index e5ebf5371..48fcc04c3 100644 --- a/doc/documentation/chapters/user.texi +++ b/doc/documentation/chapters/user.texi @@ -27,6 +27,8 @@ Comments and extensions of this documentation are always welcome. * File-sharing:: * The GNU Name System:: * Using the Virtual Public Network:: +* The graphical configuration interface:: +* How to start and stop a GNUnet peer:: @end menu @node Checking the Installation @@ -2006,3 +2008,1927 @@ service offered by that peer, you can create an IP tunnel to that peer by specifying the peer's identity, service name and protocol (--tcp or --udp) and you will again receive an IP address that will terminate at the respective peer's service. + + + +@c NOTE: Inserted from Installation Handbook in original ``order'': +@c FIXME: Move this to User Handbook. +@node The graphical configuration interface +@section The graphical configuration interface + +If you also would like to use @command{gnunet-gtk} and +@command{gnunet-setup} (highly recommended for beginners), do: + +@menu +* Configuring your peer:: +* Configuring the Friend-to-Friend (F2F) mode:: +* Configuring the hostlist to bootstrap:: +* Configuration of the HOSTLIST proxy settings:: +* Configuring your peer to provide a hostlist :: +* Configuring the datastore:: +* Configuring the MySQL database:: +* Reasons for using MySQL:: +* Reasons for not using MySQL:: +* Setup Instructions:: +* Testing:: +* Performance Tuning:: +* Setup for running Testcases:: +* Configuring the Postgres database:: +* Reasons to use Postgres:: +* Reasons not to use Postgres:: +* Manual setup instructions:: +* Testing the setup manually:: +* Configuring the datacache:: +* Configuring the file-sharing service:: +* Configuring logging:: +* Configuring the transport service and plugins:: +* Configuring the wlan transport plugin:: +* Configuring HTTP(S) reverse proxy functionality using Apache or nginx:: +* Blacklisting peers:: +* Configuration of the HTTP and HTTPS transport plugins:: +* Configuring the GNU Name System:: +* Configuring the GNUnet VPN:: +* Bandwidth Configuration:: +* Configuring NAT:: +* Peer configuration for distributions:: +@end menu + +@node Configuring your peer +@subsection Configuring your peer + +This chapter will describe the various configuration options in GNUnet. + +The easiest way to configure your peer is to use the +@command{gnunet-setup} tool. +@command{gnunet-setup} is part of the @command{gnunet-gtk} +application. You might have to install it separately. + +Many of the specific sections from this chapter actually are linked from +within @command{gnunet-setup} to help you while using the setup tool. + +While you can also configure your peer by editing the configuration +file by hand, this is not recommended for anyone except for developers +as it requires a more in-depth understanding of the configuration files +and internal dependencies of GNUnet. + +@node Configuring the Friend-to-Friend (F2F) mode +@subsection Configuring the Friend-to-Friend (F2F) mode + +GNUnet knows three basic modes of operation: +@itemize @bullet +@item In standard "peer-to-peer" mode, +your peer will connect to any peer. +@item In the pure "friend-to-friend" +mode, your peer will ONLY connect to peers from a list of friends +specified in the configuration. +@item Finally, in mixed mode, +GNUnet will only connect to arbitrary peers if it +has at least a specified number of connections to friends. +@end itemize + +When configuring any of the F2F ("friend-to-friend") modes, +you first need to create a file with the peer identities +of your friends. Ask your friends to run + +@example +$ gnunet-peerinfo -sq +@end example + +@noindent +The resulting output of this command needs to be added to your +@file{friends} file, which is simply a plain text file with one line +per friend with the output from the above command. + +You then specify the location of your @file{friends} file in the +@code{FRIENDS} option of the "topology" section. + +Once you have created the @file{friends} file, you can tell GNUnet to only +connect to your friends by setting the @code{FRIENDS-ONLY} option +(again in the "topology" section) to YES. + +If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a +minimum number of friends to have (before connecting to arbitrary peers) +under the "MINIMUM-FRIENDS" option. + +If you want to operate in normal P2P-only mode, simply set +@code{MINIMUM-FRIENDS} to zero and @code{FRIENDS_ONLY} to NO. +This is the default. + +@node Configuring the hostlist to bootstrap +@subsection Configuring the hostlist to bootstrap + +After installing the software you need to get connected to the GNUnet +network. The configuration file included in your download is already +configured to connect you to the GNUnet network. +In this section the relevant configuration settings are explained. + +To get an initial connection to the GNUnet network and to get to know +peers already connected to the network you can use the so called +"bootstrap servers". +These servers can give you a list of peers connected to the network. +To use these bootstrap servers you have to configure the hostlist daemon +to activate bootstrapping. + +To activate bootstrapping, edit the @code{[hostlist]}-section in your +configuration file. You have to set the argument @command{-b} in the +options line: + +@example +[hostlist] +OPTIONS = -b +@end example + +Additionally you have to specify which server you want to use. +The default bootstrapping server is +"@uref{http://v10.gnunet.org/hostlist, http://v10.gnunet.org/hostlist}". +[^] To set the server you have to edit the line "SERVERS" in the hostlist +section. To use the default server you should set the lines to + +@example +SERVERS = http://v10.gnunet.org/hostlist [^] +@end example + +@noindent +To use bootstrapping your configuration file should include these lines: + +@example +[hostlist] +OPTIONS = -b +SERVERS = http://v10.gnunet.org/hostlist [^] +@end example + +@noindent +Besides using bootstrap servers you can configure your GNUnet peer to +recieve hostlist advertisements. +Peers offering hostlists to other peers can send advertisement messages +to peers that connect to them. If you configure your peer to receive these +messages, your peer can download these lists and connect to the peers +included. These lists are persistent, which means that they are saved to +your hard disk regularly and are loaded during startup. + +To activate hostlist learning you have to add the @command{-e} +switch to the @code{OPTIONS} line in the hostlist section: + +@example +[hostlist] +OPTIONS = -b -e +@end example + +@noindent +Furthermore you can specify in which file the lists are saved. +To save the lists in the file @file{hostlists.file} just add the line: + +@example +HOSTLISTFILE = hostlists.file +@end example + +@noindent +Best practice is to activate both bootstrapping and hostlist learning. +So your configuration file should include these lines: + +@example +[hostlist] +OPTIONS = -b -e +HTTPPORT = 8080 +SERVERS = http://v10.gnunet.org/hostlist [^] +HOSTLISTFILE = $SERVICEHOME/hostlists.file +@end example + +@node Configuration of the HOSTLIST proxy settings +@subsection Configuration of the HOSTLIST proxy settings + +The hostlist client can be configured to use a proxy to connect to the +hostlist server. +This functionality can be configured in the configuration file directly +or using the @command{gnunet-setup} tool. + +The hostlist client supports the following proxy types at the moment: + +@itemize @bullet +@item HTTP and HTTP 1.0 only proxy +@item SOCKS 4/4a/5/5 with hostname +@end itemize + +In addition authentication at the proxy with username and password can be +configured. + +To configure proxy support for the hostlist client in the +@command{gnunet-setup} tool, select the "hostlist" tab and select +the appropriate proxy type. +The hostname or IP address (including port if required) has to be entered +in the "Proxy hostname" textbox. If required, enter username and password +in the "Proxy username" and "Proxy password" boxes. +Be aware that this information will be stored in the configuration in +plain text (TODO: Add explanation and generalize the part in Chapter 3.6 +about the encrypted home). + +To provide these options directly in the configuration, you can +enter the following settings in the @code{[hostlist]} section of +the configuration: + +@example +# Type of proxy server, +# Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME +# Default: HTTP +# PROXY_TYPE = HTTP + +# Hostname or IP of proxy server +# PROXY = +# User name for proxy server +# PROXY_USERNAME = +# User password for proxy server +# PROXY_PASSWORD = +@end example + +@node Configuring your peer to provide a hostlist +@subsection Configuring your peer to provide a hostlist + +If you operate a peer permanently connected to GNUnet you can configure +your peer to act as a hostlist server, providing other peers the list of +peers known to him. + +Your server can act as a bootstrap server and peers needing to obtain a +list of peers can contact it to download this list. +To download this hostlist the peer uses HTTP. +For this reason you have to build your peer with libgnurl (or libcurl) +and microhttpd support. +How you build your peer with these options can be found here: +@xref{Generic installation instructions}. + +To configure your peer to act as a bootstrap server you have to add the +@command{-p} option to @code{OPTIONS} in the @code{[hostlist]} section +of your configuration file. +Besides that you have to specify a port number for the http server. +In conclusion you have to add the following lines: + +@example +[hostlist] +HTTPPORT = 12980 +OPTIONS = -p +@end example + +@noindent +If your peer acts as a bootstrap server other peers should know about +that. You can advertise the hostlist your are providing to other peers. +Peers connecting to your peer will get a message containing an +advertisement for your hostlist and the URL where it can be downloaded. +If this peer is in learning mode, it will test the hostlist and, in the +case it can obtain the list successfully, it will save it for +bootstrapping. + +To activate hostlist advertisement on your peer, you have to set the +following lines in your configuration file: + +@example +[hostlist] +EXTERNAL_DNS_NAME = example.org +HTTPPORT = 12981 +OPTIONS = -p -a +@end example + +@noindent +With this configuration your peer will a act as a bootstrap server and +advertise this hostlist to other peers connecting to it. +The URL used to download the list will be +@code{@uref{http://example.org:12981/, http://example.org:12981/}}. + +Please notice: + +@itemize @bullet +@item The hostlist is @b{not} human readable, so you should not try to +download it using your webbrowser. Just point your GNUnet peer to the +address! +@item Advertising without providing a hostlist does not make sense and +will not work. +@end itemize + +@node Configuring the datastore +@subsection Configuring the datastore + +The datastore is what GNUnet uses for long-term storage of file-sharing +data. Note that long-term does not mean 'forever' since content does have +an expiration date, and of course storage space is finite (and hence +sometimes content may have to be discarded). + +Use the @code{QUOTA} option to specify how many bytes of storage space +you are willing to dedicate to GNUnet. + +In addition to specifying the maximum space GNUnet is allowed to use for +the datastore, you need to specify which database GNUnet should use to do +so. Currently, you have the choice between sqLite, MySQL and Postgres. + +@node Configuring the MySQL database +@subsection Configuring the MySQL database + +This section describes how to setup the MySQL database for GNUnet. + +Note that the mysql plugin does NOT work with mysql before 4.1 since we +need prepared statements. +We are generally testing the code against MySQL 5.1 at this point. + +@node Reasons for using MySQL +@subsection Reasons for using MySQL + +@itemize @bullet + +@item On up-to-date hardware wher +mysql can be used comfortably, this module +will have better performance than the other database choices (according +to our tests). + +@item Its often possible to recover the mysql database from internal +inconsistencies. Some of the other databases do not support repair. +@end itemize + +@node Reasons for not using MySQL +@subsection Reasons for not using MySQL + +@itemize @bullet +@item Memory usage (likely not an issue if you have more than 1 GB) +@item Complex manual setup +@end itemize + +@node Setup Instructions +@subsection Setup Instructions + +@itemize @bullet + +@item In @file{gnunet.conf} set in section @code{DATASTORE} the value for +@code{DATABASE} to @code{mysql}. + +@item Access mysql as root: + +@example +$ mysql -u root -p +@end example + +@noindent +and issue the following commands, replacing $USER with the username +that will be running @command{gnunet-arm} (so typically "gnunet"): + +@example +CREATE DATABASE gnunet; +GRANT select,insert,update,delete,create,alter,drop,create \ +temporary tables ON gnunet.* TO $USER@@localhost; +SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like'); +FLUSH PRIVILEGES; +@end example + +@item +In the $HOME directory of $USER, create a @file{.my.cnf} file with the +following lines + +@example +[client] +user=$USER +password=$the_password_you_like +@end example + +@end itemize + +Thats it. Note that @file{.my.cnf} file is a slight security risk unless +its on a safe partition. The @file{$HOME/.my.cnf} can of course be +a symbolic link. +Luckily $USER has only priviledges to mess up GNUnet's tables, +which should be pretty harmless. + +@node Testing +@subsection Testing + +You should briefly try if the database connection works. First, login +as $USER. Then use: + +@example +$ mysql -u $USER +mysql> use gnunet; +@end example + +@noindent +If you get the message + +@example +Database changed +@end example + +@noindent +it probably works. + +If you get + +@example +ERROR 2002: Can't connect to local MySQL server +through socket '/tmp/mysql.sock' (2) +@end example + +@noindent +it may be resolvable by + +@example +ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock +@end example + +@noindent +so there may be some additional trouble depending on your mysql setup. + +@node Performance Tuning +@subsection Performance Tuning + +For GNUnet, you probably want to set the option + +@example +innodb_flush_log_at_trx_commit = 0 +@end example + +@noindent +for a rather dramatic boost in MySQL performance. However, this reduces +the "safety" of your database as with this options you may loose +transactions during a power outage. +While this is totally harmless for GNUnet, the option applies to all +applications using MySQL. So you should set it if (and only if) GNUnet is +the only application on your system using MySQL. + +@node Setup for running Testcases +@subsection Setup for running Testcases + +If you want to run the testcases, you must create a second database +"gnunetcheck" with the same username and password. This database will +then be used for testing (@command{make check}). + +@node Configuring the Postgres database +@subsection Configuring the Postgres database + +This text describes how to setup the Postgres database for GNUnet. + +This Postgres plugin was developed for Postgres 8.3 but might work for +earlier versions as well. + +@node Reasons to use Postgres +@subsection Reasons to use Postgres + +@itemize @bullet +@item Easier to setup than MySQL +@item Real database +@end itemize + +@node Reasons not to use Postgres +@subsection Reasons not to use Postgres + +@itemize @bullet +@item Quite slow +@item Still some manual setup required +@end itemize + +@node Manual setup instructions +@subsection Manual setup instructions + +@itemize @bullet +@item In @file{gnunet.conf} set in section @code{DATASTORE} the value for +@code{DATABASE} to @code{postgres}. +@item Access Postgres to create a user: + +@table @asis +@item with Postgres 8.x, use: + +@example +# su - postgres +$ createuser +@end example + +@noindent +and enter the name of the user running GNUnet for the role interactively. +Then, when prompted, do not set it to superuser, allow the creation of +databases, and do not allow the creation of new roles. + +@item with Postgres 9.x, use: + +@example +# su - postgres +$ createuser -d $GNUNET_USER +@end example + +@noindent +where $GNUNET_USER is the name of the user running GNUnet. + +@end table + + +@item +As that user (so typically as user "gnunet"), create a database (or two): + +@example +$ createdb gnunet +# this way you can run "make check" +$ createdb gnunetcheck +@end example + +@end itemize + +Now you should be able to start @code{gnunet-arm}. + +@node Testing the setup manually +@subsection Testing the setup manually + +You may want to try if the database connection works. First, again login +as the user who will run @command{gnunet-arm}. Then use: + +@example +$ psql gnunet # or gnunetcheck +gnunet=> \dt +@end example + +@noindent +If, after you have started @command{gnunet-arm} at least once, you get +a @code{gn090} table here, it probably works. + +@node Configuring the datacache +@subsection Configuring the datacache +@c %**end of header + +The datacache is what GNUnet uses for storing temporary data. This data is +expected to be wiped completely each time GNUnet is restarted (or the +system is rebooted). + +You need to specify how many bytes GNUnet is allowed to use for the +datacache using the @code{QUOTA} option in the section @code{[dhtcache]}. +Furthermore, you need to specify which database backend should be used to +store the data. Currently, you have the choice between +sqLite, MySQL and Postgres. + +@node Configuring the file-sharing service +@subsection Configuring the file-sharing service + +In order to use GNUnet for file-sharing, you first need to make sure +that the file-sharing service is loaded. +This is done by setting the @code{AUTOSTART} option in +section @code{[fs]} to "YES". Alternatively, you can run + +@example +$ gnunet-arm -i fs +@end example + +@noindent +to start the file-sharing service by hand. + +Except for configuring the database and the datacache the only important +option for file-sharing is content migration. + +Content migration allows your peer to cache content from other peers as +well as send out content stored on your system without explicit requests. +This content replication has positive and negative impacts on both system +performance and privacy. + +FIXME: discuss the trade-offs. Here is some older text about it... + +Setting this option to YES allows gnunetd to migrate data to the local +machine. Setting this option to YES is highly recommended for efficiency. +Its also the default. If you set this value to YES, GNUnet will store +content on your machine that you cannot decrypt. +While this may protect you from liability if the judge is sane, it may +not (IANAL). If you put illegal content on your machine yourself, setting +this option to YES will probably increase your chances to get away with it +since you can plausibly deny that you inserted the content. +Note that in either case, your anonymity would have to be broken first +(which may be possible depending on the size of the GNUnet network and the +strength of the adversary). + +@node Configuring logging +@subsection Configuring logging + +Logging in GNUnet 0.9.0 is controlled via the "-L" and "-l" options. +Using @code{-L}, a log level can be specified. With log level +@code{ERROR} only serious errors are logged. +The default log level is @code{WARNING} which causes anything of +concern to be logged. +Log level @code{INFO} can be used to log anything that might be +interesting information whereas +@code{DEBUG} can be used by developers to log debugging messages +(but you need to run @code{./configure} with +@code{--enable-logging=verbose} to get them compiled). +The @code{-l} option is used to specify the log file. + +Since most GNUnet services are managed by @code{gnunet-arm}, using the +@code{-l} or @code{-L} options directly is not possible. +Instead, they can be specified using the @code{OPTIONS} configuration +value in the respective section for the respective service. +In order to enable logging globally without editing the @code{OPTIONS} +values for each service, @command{gnunet-arm} supports a +@code{GLOBAL_POSTFIX} option. +The value specified here is given as an extra option to all services for +which the configuration does contain a service-specific @code{OPTIONS} +field. + +@code{GLOBAL_POSTFIX} can contain the special sequence "@{@}" which +is replaced by the name of the service that is being started. +Furthermore, @code{GLOBAL_POSTFIX} is special in that sequences +starting with "$" anywhere in the string are expanded (according +to options in @code{PATHS}); this expansion otherwise is +only happening for filenames and then the "$" must be the +first character in the option. Both of these restrictions do +not apply to @code{GLOBAL_POSTFIX}. +Note that specifying @code{%} anywhere in the @code{GLOBAL_POSTFIX} +disables both of these features. + +In summary, in order to get all services to log at level +@code{INFO} to log-files called @code{SERVICENAME-logs}, the +following global prefix should be used: + +@example +GLOBAL_POSTFIX = -l $SERVICEHOME/@{@}-logs -L INFO +@end example + +@node Configuring the transport service and plugins +@subsection Configuring the transport service and plugins + +The transport service in GNUnet is responsible to maintain basic +connectivity to other peers. +Besides initiating and keeping connections alive it is also responsible +for address validation. + +The GNUnet transport supports more than one transport protocol. +These protocols are configured together with the transport service. + +The configuration section for the transport service itself is quite +similar to all the other services + +@example +AUTOSTART = YES +@@UNIXONLY@@ PORT = 2091 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +#PREFIX = valgrind +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = tcp udp +UNIXPATH = /tmp/gnunet-service-transport.sock +@end example + +Different are the settings for the plugins to load @code{PLUGINS}. +The first setting specifies which transport plugins to load. + +@itemize @bullet +@item transport-unix +A plugin for local only communication with UNIX domain sockets. Used for +testing and available on unix systems only. Just set the port + +@example +[transport-unix] +PORT = 22086 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example + +@item transport-tcp +A plugin for communication with TCP. Set port to 0 for client mode with +outbound only connections + +@example +[transport-tcp] +# Use 0 to ONLY advertise as a peer behind NAT (no port binding) +PORT = 2086 +ADVERTISED_PORT = 2086 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +# Maximum number of open TCP connections allowed +MAX_CONNECTIONS = 128 +@end example + +@item transport-udp +A plugin for communication with UDP. Supports peer discovery using +broadcasts. + +@example +[transport-udp] +PORT = 2086 +BROADCAST = YES +BROADCAST_INTERVAL = 30 s +MAX_BPS = 1000000 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example + +@item transport-http +HTTP and HTTPS support is split in two part: a client plugin initiating +outbound connections and a server part accepting connections from the +client. The client plugin just takes the maximum number of connections as +an argument. + +@example +[transport-http_client] +MAX_CONNECTIONS = 128 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example + +@example +[transport-https_client] +MAX_CONNECTIONS = 128 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example + +@noindent +The server has a port configured and the maximum nunber of connections. +The HTTPS part has two files with the certificate key and the certificate +file. + +The server plugin supports reverse proxies, so a external hostname can be +set using the @code{EXTERNAL_HOSTNAME} setting. +The webserver under this address should forward the request to the peer +and the configure port. + +@example +[transport-http_server] +EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet +PORT = 1080 +MAX_CONNECTIONS = 128 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example + +@example +[transport-https_server] +PORT = 4433 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example + +@item transport-wlan + +The next section describes how to setup the WLAN plugin, +so here only the settings. Just specify the interface to use: + +@example +[transport-wlan] +# Name of the interface in monitor mode (typically monX) +INTERFACE = mon0 +# Real hardware, no testing +TESTMODE = 0 +TESTING_IGNORE_KEYS = ACCEPT_FROM; +@end example +@end itemize + +@node Configuring the wlan transport plugin +@subsection Configuring the wlan transport plugin + +The wlan transport plugin enables GNUnet to send and to receive data on a +wlan interface. +It has not to be connected to a wlan network as long as sender and +receiver are on the same channel. This enables you to get connection to +GNUnet where no internet access is possible, for example during +catastrophes or when censorship cuts you off from the internet. + + +@menu +* Requirements for the WLAN plugin:: +* Configuration:: +* Before starting GNUnet:: +* Limitations and known bugs:: +@end menu + + +@node Requirements for the WLAN plugin +@subsubsection Requirements for the WLAN plugin + +@itemize @bullet + +@item wlan network card with monitor support and packet injection +(see @uref{http://www.aircrack-ng.org/, aircrack-ng.org}) + +@item Linux kernel with mac80211 stack, introduced in 2.6.22, tested with +2.6.35 and 2.6.38 + +@item Wlantools to create the a monitor interface, tested with airmon-ng +of the aircrack-ng package +@end itemize + +@node Configuration +@subsubsection Configuration + +There are the following options for the wlan plugin (they should be like +this in your default config file, you only need to adjust them if the +values are incorrect for your system) + +@example +# section for the wlan transport plugin +[transport-wlan] +# interface to use, more information in the +# "Before starting GNUnet" section of the handbook. +INTERFACE = mon0 +# testmode for developers: +# 0 use wlan interface, +#1 or 2 use loopback driver for tests 1 = server, 2 = client +TESTMODE = 0 +@end example + +@node Before starting GNUnet +@subsubsection Before starting GNUnet + +Before starting GNUnet, you have to make sure that your wlan interface is +in monitor mode. +One way to put the wlan interface into monitor mode (if your interface +name is wlan0) is by executing: + +@example +sudo airmon-ng start wlan0 +@end example + +@noindent +Here is an example what the result should look like: + +@example +Interface Chipset Driver +wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0] +(monitor mode enabled on mon0) +@end example + +@noindent +The monitor interface is mon0 is the one that you have to put into the +configuration file. + +@node Limitations and known bugs +@subsubsection Limitations and known bugs + +Wlan speed is at the maximum of 1 Mbit/s because support for choosing the +wlan speed with packet injection was removed in newer kernels. +Please pester the kernel developers about fixing this. + +The interface channel depends on the wlan network that the card is +connected to. If no connection has been made since the start of the +computer, it is usually the first channel of the card. +Peers will only find each other and communicate if they are on the same +channel. Channels must be set manually, i.e. using: + +@example +iwconfig wlan0 channel 1 +@end example + +@node Configuring HTTP(S) reverse proxy functionality using Apache or nginx +@subsection Configuring HTTP(S) reverse proxy functionality using Apache or nginx + +The HTTP plugin supports data transfer using reverse proxies. A reverse +proxy forwards the HTTP request he receives with a certain URL to another +webserver, here a GNUnet peer. + +So if you have a running Apache or nginx webserver you can configure it to +be a GNUnet reverse proxy. Especially if you have a well-known webiste +this improves censorship resistance since it looks as normal surfing +behaviour. + +To do so, you have to do two things: + +@itemize @bullet +@item Configure your webserver to forward the GNUnet HTTP traffic +@item Configure your GNUnet peer to announce the respective address +@end itemize + +As an example we want to use GNUnet peer running: + +@itemize @bullet + +@item HTTP server plugin on @code{gnunet.foo.org:1080} + +@item HTTPS server plugin on @code{gnunet.foo.org:4433} + +@item A apache or nginx webserver on +@uref{http://www.foo.org/, http://www.foo.org:80/} + +@item A apache or nginx webserver on https://www.foo.org:443/ +@end itemize + +And we want the webserver to accept GNUnet traffic under +@code{http://www.foo.org/bar/}. The required steps are described here: + +@menu +* Reverse Proxy - Configure your Apache2 HTTP webserver:: +* Reverse Proxy - Configure your Apache2 HTTPS webserver:: +* Reverse Proxy - Configure your nginx HTTPS webserver:: +* Reverse Proxy - Configure your nginx HTTP webserver:: +* Reverse Proxy - Configure your GNUnet peer:: +@end menu + +@node Reverse Proxy - Configure your Apache2 HTTP webserver +@subsubsection Reverse Proxy - Configure your Apache2 HTTP webserver + +First of all you need mod_proxy installed. + +Edit your webserver configuration. Edit +@code{/etc/apache2/apache2.conf} or the site-specific configuration file. + +In the respective @code{server config},@code{virtual host} or +@code{directory} section add the following lines: + +@example +ProxyTimeout 300 +ProxyRequests Off + +ProxyPass http://gnunet.foo.org:1080/ +ProxyPassReverse http://gnunet.foo.org:1080/ + +@end example + +@node Reverse Proxy - Configure your Apache2 HTTPS webserver +@subsubsection Reverse Proxy - Configure your Apache2 HTTPS webserver + +We assume that you already have an HTTPS server running, if not please +check how to configure a HTTPS host. An uncomplicated to use example +is the example configuration file for Apache2/HTTPD provided in +@file{apache2/sites-available/default-ssl}. + +In the respective HTTPS @code{server config},@code{virtual host} or +@code{directory} section add the following lines: + +@example +SSLProxyEngine On +ProxyTimeout 300 +ProxyRequests Off + +ProxyPass https://gnunet.foo.org:4433/ +ProxyPassReverse https://gnunet.foo.org:4433/ + +@end example + +@noindent +More information about the apache mod_proxy configuration can be found +in the Apache documentation@footnote{@uref{http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass, http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass}} + +@node Reverse Proxy - Configure your nginx HTTPS webserver +@subsubsection Reverse Proxy - Configure your nginx HTTPS webserver + +Since nginx does not support chunked encoding, you first of all have to +install the @code{chunkin} module@footnote{@uref{http://wiki.nginx.org/HttpChunkinModule, http://wiki.nginx.org/HttpChunkinModule}} + +To enable chunkin add: + +@example +chunkin on; +error_page 411 = @@my_411_error; +location @@my_411_error @{ +chunkin_resume; +@} +@end example + +@noindent +Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or +the site-specific configuration file. + +In the @code{server} section add: + +@example +location /bar/ @{ +proxy_pass http://gnunet.foo.org:1080/; +proxy_buffering off; +proxy_connect_timeout 5; # more than http_server +proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout +proxy_http_version 1.1; # 1.0 default +proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504; +@} +@end example + +@node Reverse Proxy - Configure your nginx HTTP webserver +@subsubsection Reverse Proxy - Configure your nginx HTTP webserver + +Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or +the site-specific configuration file. + +In the @code{server} section add: + +@example +ssl_session_timeout 6m; +location /bar/ +@{ +proxy_pass https://gnunet.foo.org:4433/; +proxy_buffering off; +proxy_connect_timeout 5; # more than http_server +proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout +proxy_http_version 1.1; # 1.0 default +proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504; +@} +@end example + +@node Reverse Proxy - Configure your GNUnet peer +@subsubsection Reverse Proxy - Configure your GNUnet peer + +To have your GNUnet peer announce the address, you have to specify the +@code{EXTERNAL_HOSTNAME} option in the @code{[transport-http_server]} +section: + +@example +[transport-http_server] +EXTERNAL_HOSTNAME = http://www.foo.org/bar/ +@end example + +@noindent +and/or @code{[transport-https_server]} section: + +@example +[transport-https_server] +EXTERNAL_HOSTNAME = https://www.foo.org/bar/ +@end example + +@noindent +Now restart your webserver and your peer... + +@node Blacklisting peers +@subsection Blacklisting peers + +Transport service supports to deny connecting to a specific peer of to a +specific peer with a specific transport plugin using te blacklisting +component of transport service. With@ blacklisting it is possible to deny +connections to specific peers of@ to use a specific plugin to a specific +peer. Peers can be blacklisted using@ the configuration or a blacklist +client can be asked. + +To blacklist peers using the configuration you have to add a section to +your configuration containing the peer id of the peer to blacklist and +the plugin@ if required. + +Examples: + +To blacklist connections to P565... on peer AG2P... using tcp add: + +@c FIXME: This is too long and produces errors in the pdf. +@example +[transport-blacklist AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520] +P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp +@end example + +To blacklist connections to P565... on peer AG2P... using all plugins add: + +@example +[transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520] +P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = +@end example + +You can also add a blacklist client usign the blacklist API. On a +blacklist check, blacklisting first checks internally if the peer is +blacklisted and if not, it asks the blacklisting clients. Clients are +asked if it is OK to connect to a peer ID, the plugin is omitted. + +On blacklist check for (peer, plugin) +@itemize @bullet +@item Do we have a local blacklist entry for this peer and this plugin?@ +@item YES: disallow connection@ +@item Do we have a local blacklist entry for this peer and all plugins?@ +@item YES: disallow connection@ +@item Does one of the clients disallow?@ +@item YES: disallow connection +@end itemize + +@node Configuration of the HTTP and HTTPS transport plugins +@subsection Configuration of the HTTP and HTTPS transport plugins + +The client parts of the http and https transport plugins can be configured +to use a proxy to connect to the hostlist server. This functionality can +be configured in the configuration file directly or using the +gnunet-setup tool. + +Both the HTTP and HTTPS clients support the following proxy types at +the moment: + +@itemize @bullet +@item HTTP 1.1 proxy +@item SOCKS 4/4a/5/5 with hostname +@end itemize + +In addition authentication at the proxy with username and password can be +configured. + +To configure proxy support for the clients in the gnunet-setup tool, +select the "transport" tab and activate the respective plugin. Now you +can select the appropriate proxy type. The hostname or IP address +(including port if required) has to be entered in the "Proxy hostname" +textbox. If required, enter username and password in the "Proxy username" +and "Proxy password" boxes. Be aware that these information will be stored +in the configuration in plain text. + +To configure these options directly in the configuration, you can +configure the following settings in the @code{[transport-http_client]} +and @code{[transport-https_client]} section of the configuration: + +@example +# Type of proxy server, +# Valid values: HTTP, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME +# Default: HTTP +# PROXY_TYPE = HTTP + +# Hostname or IP of proxy server +# PROXY = +# User name for proxy server +# PROXY_USERNAME = +# User password for proxy server +# PROXY_PASSWORD = +@end example + +@node Configuring the GNU Name System +@subsection Configuring the GNU Name System + +@menu +* Configuring system-wide DNS interception:: +* Configuring the GNS nsswitch plugin:: +* Configuring GNS on W32:: +* GNS Proxy Setup:: +* Setup of the GNS CA:: +* Testing the GNS setup:: +@end menu + + +@node Configuring system-wide DNS interception +@subsubsection Configuring system-wide DNS interception + +Before you install GNUnet, make sure you have a user and group 'gnunet' +as well as an empty group 'gnunetdns'. + +When using GNUnet with system-wide DNS interception, it is absolutely +necessary for all GNUnet service processes to be started by +@code{gnunet-service-arm} as user and group 'gnunet'. You also need to be +sure to run @code{make install} as root (or use the @code{sudo} option to +configure) to grant GNUnet sufficient privileges. + +With this setup, all that is required for enabling system-wide DNS +interception is for some GNUnet component (VPN or GNS) to request it. +The @code{gnunet-service-dns} will then start helper programs that will +make the necessary changes to your firewall (@code{iptables}) rules. + +Note that this will NOT work if your system sends out DNS traffic to a +link-local IPv6 address, as in this case GNUnet can intercept the traffic, +but not inject the responses from the link-local IPv6 address. Hence you +cannot use system-wide DNS interception in conjunction with link-local +IPv6-based DNS servers. If such a DNS server is used, it will bypass +GNUnet's DNS traffic interception. + +Using the GNU Name System (GNS) requires two different configuration +steps. +First of all, GNS needs to be integrated with the operating system. Most +of this section is about the operating system level integration. + +The remainder of this chapter will detail the various methods for +configuring the use of GNS with your operating system. + +At this point in time you have different options depending on your OS: + +@table @asis + +@item Use the gnunet-gns-proxy This approach works for all operating +systems and is likely the easiest. However, it enables GNS only for +browsers, not for other applications that might be using DNS, such as SSH. +Still, using the proxy is required for using HTTP with GNS and is thus +recommended for all users. To do this, you simply have to run the +@code{gnunet-gns-proxy-setup-ca} script as the user who will run the +browser (this will create a GNS certificate authority (CA) on your system +and import its key into your browser), then start @code{gnunet-gns-proxy} +and inform your browser to use the Socks5 proxy which +@code{gnunet-gns-proxy} makes available by default on port 7777. +@item Use a nsswitch plugin (recommended on GNU systems) +This approach has the advantage of offering fully personalized resolution +even on multi-user systems. A potential disadvantage is that some +applications might be able to bypass GNS. +@item Use a W32 resolver plugin (recommended on W32) +This is currently the only option on W32 systems. +@item Use system-wide DNS packet interception +This approach is recommended for the GNUnet VPN. It can be used to handle +GNS at the same time; however, if you only use this method, you will only +get one root zone per machine (not so great for multi-user systems). +@end table + +You can combine system-wide DNS packet interception with the nsswitch +plugin. +The setup of the system-wide DNS interception is described here. All of +the other GNS-specific configuration steps are described in the following +sections. + +@node Configuring the GNS nsswitch plugin +@subsubsection Configuring the GNS nsswitch plugin + +The Name Service Switch (NSS) is a facility in Unix-like operating systems +@footnote{More accurate: NSS is a functionality of the GNU C Library} +that provides a variety of sources for common configuration databases and +name resolution mechanisms. +A superuser (system administrator) usually configures the +operating system's name services using the file +@file{/etc/nsswitch.conf}. + +GNS provides a NSS plugin to integrate GNS name resolution with the +operating system's name resolution process. +To use the GNS NSS plugin you have to either + +@itemize @bullet +@item install GNUnet as root or +@item compile GNUnet with the @code{--with-sudo=yes} switch. +@end itemize + +Name resolution is controlled by the @emph{hosts} section in the NSS +configuration. By default this section first performs a lookup in the +@file{/etc/hosts} file and then in DNS. +The nsswitch file should contain a line similar to: + +@example +hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4 +@end example + +@noindent +Here the GNS NSS plugin can be added to perform a GNS lookup before +performing a DNS lookup. +The GNS NSS plugin has to be added to the "hosts" section in +@file{/etc/nsswitch.conf} file before DNS related plugins: + +@example +... +hosts: files gns [NOTFOUND=return] dns mdns4_minimal mdns4 +... +@end example + +@noindent +The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not +found in GNS it will not be queried in DNS. + +@node Configuring GNS on W32 +@subsubsection Configuring GNS on W32 + +This document is a guide to configuring GNU Name System on W32-compatible +platforms. + +After GNUnet is installed, run the w32nsp-install tool: + +@example +w32nsp-install.exe libw32nsp-0.dll +@end example + +@noindent +('0' is the library version of W32 NSP; it might increase in the future, +change the invocation accordingly). + +This will install GNS namespace provider into the system and allow other +applications to resolve names that end in '@strong{gnu}' +and '@strong{zkey}'. Note that namespace provider requires +gnunet-gns-helper-service-w32 to be running, as well as gns service +itself (and its usual dependencies). + +Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353}, +and this is where gnunet-gns-helper-service-w32 should be listening to +(and is configured to listen to by default). + +To uninstall the provider, run: + +@example +w32nsp-uninstall.exe +@end example + +@noindent +(uses provider GUID to uninstall it, does not need a dll name). + +Note that while MSDN claims that other applications will only be able to +use the new namespace provider after re-starting, in reality they might +stat to use it without that. Conversely, they might stop using the +provider after it's been uninstalled, even if they were not re-started. +W32 will not permit namespace provider library to be deleted or +overwritten while the provider is installed, and while there is at least +one process still using it (even after it was uninstalled). + +@node GNS Proxy Setup +@subsubsection GNS Proxy Setup + +When using the GNU Name System (GNS) to browse the WWW, there are several +issues that can be solved by adding the GNS Proxy to your setup: + +@itemize @bullet + +@item If the target website does not support GNS, it might assume that it +is operating under some name in the legacy DNS system (such as +example.com). It may then attempt to set cookies for that domain, and the +web server might expect a @code{Host: example.com} header in the request +from your browser. +However, your browser might be using @code{example.gnu} for the +@code{Host} header and might only accept (and send) cookies for +@code{example.gnu}. The GNS Proxy will perform the necessary translations +of the hostnames for cookies and HTTP headers (using the LEHO record for +the target domain as the desired substitute). + +@item If using HTTPS, the target site might include an SSL certificate +which is either only valid for the LEHO domain or might match a TLSA +record in GNS. However, your browser would expect a valid certificate for +@code{example.gnu}, not for some legacy domain name. The proxy will +validate the certificate (either against LEHO or TLSA) and then +on-the-fly produce a valid certificate for the exchange, signed by your +own CA. Assuming you installed the CA of your proxy in your browser's +certificate authority list, your browser will then trust the +HTTPS/SSL/TLS connection, as the hostname mismatch is hidden by the proxy. + +@item Finally, the proxy will in the future indicate to the server that it +speaks GNS, which will enable server operators to deliver GNS-enabled web +sites to your browser (and continue to deliver legacy links to legacy +browsers) +@end itemize + +@node Setup of the GNS CA +@subsubsection Setup of the GNS CA + +First you need to create a CA certificate that the proxy can use. +To do so use the provided script gnunet-gns-proxy-ca: + +@example +$ gnunet-gns-proxy-setup-ca +@end example + +@noindent +This will create a personal certification authority for you and add this +authority to the firefox and chrome database. The proxy will use the this +CA certificate to generate @code{*.gnu} client certificates on the fly. + +Note that the proxy uses libcurl. Make sure your version of libcurl uses +GnuTLS and NOT OpenSSL. The proxy will @b{not} work with libcurl compiled +against OpenSSL. + +You can check the configuration your libcurl was build with by +running: + +@example +curl --version +@end example + +the output will look like this (without the linebreaks): + +@example +gnurl --version +curl 7.56.0 (x86_64-unknown-linux-gnu) libcurl/7.56.0 \ +GnuTLS/3.5.13 zlib/1.2.11 libidn2/2.0.4 +Release-Date: 2017-10-08 +Protocols: http https +Features: AsynchDNS IDN IPv6 Largefile NTLM SSL libz \ +TLS-SRP UnixSockets HTTPS-proxy +@end example + +@node Testing the GNS setup +@subsubsection Testing the GNS setup + +Now for testing purposes we can create some records in our zone to test +the SSL functionality of the proxy: + +@example +$ gnunet-identity -C test +$ gnunet-namestore -a -e "1 d" -n "homepage" \ + -t A -V 131.159.74.67 -z test +$ gnunet-namestore -a -e "1 d" -n "homepage" \ + -t LEHO -V "gnunet.org" -z test +@end example + +@noindent +At this point we can start the proxy. Simply execute + +@example +$ gnunet-gns-proxy +@end example + +@noindent +Configure your browser to use this SOCKSv5 proxy on port 7777 and visit +this link. +If you use @command{Firefox} (or one of its deriviates/forks such as +Icecat) you also have to go to @code{about:config} and set the key +@code{network.proxy.socks_remote_dns} to @code{true}. + +When you visit @code{https://homepage.test/}, you should get to the +@code{https://gnunet.org/} frontpage and the browser (with the correctly +configured proxy) should give you a valid SSL certificate for +@code{homepage.gnu} and no warnings. It should look like this: + +@c FIXME: Image does not exist, create it or save it from Drupal? +@c @image{images/gnunethpgns.png,5in,, picture of homepage.gnu in Webbrowser} + + +@node Configuring the GNUnet VPN +@subsection Configuring the GNUnet VPN + +@menu +* IPv4 address for interface:: +* IPv6 address for interface:: +* Configuring the GNUnet VPN DNS:: +* Configuring the GNUnet VPN Exit Service:: +* IP Address of external DNS resolver:: +* IPv4 address for Exit interface:: +* IPv6 address for Exit interface:: +@end menu + +Before configuring the GNUnet VPN, please make sure that system-wide DNS +interception is configured properly as described in the section on the +GNUnet DNS setup. @pxref{Configuring the GNU Name System}, +if you haven't done so already. + +The default options for the GNUnet VPN are usually sufficient to use +GNUnet as a Layer 2 for your Internet connection. +However, what you always have to specify is which IP protocol you want +to tunnel: IPv4, IPv6 or both. +Furthermore, if you tunnel both, you most likely should also tunnel +all of your DNS requests. +You theoretically can tunnel "only" your DNS traffic, but that usually +makes little sense. + +The other options as shown on the gnunet-setup tool are: + +@node IPv4 address for interface +@subsubsection IPv4 address for interface + +This is the IPv4 address the VPN interface will get. You should pick an +'private' IPv4 network that is not yet in use for you system. For example, +if you use @code{10.0.0.1/255.255.0.0} already, you might use +@code{10.1.0.1/255.255.0.0}. +If you use @code{10.0.0.1/255.0.0.0} already, then you might use +@code{192.168.0.1/255.255.0.0}. +If your system is not in a private IP-network, using any of the above will +work fine. +You should try to make the mask of the address big enough +(@code{255.255.0.0} or, even better, @code{255.0.0.0}) to allow more +mappings of remote IP Addresses into this range. +However, even a @code{255.255.255.0} mask will suffice for most users. + +@node IPv6 address for interface +@subsubsection IPv6 address for interface + +The IPv6 address the VPN interface will get. Here you can specify any +non-link-local address (the address should not begin with @code{fe80:}). +A subnet Unique Local Unicast (@code{fd00::/8} prefix) that you are +currently not using would be a good choice. + +@node Configuring the GNUnet VPN DNS +@subsubsection Configuring the GNUnet VPN DNS + +To resolve names for remote nodes, activate the DNS exit option. + +@node Configuring the GNUnet VPN Exit Service +@subsubsection Configuring the GNUnet VPN Exit Service + +If you want to allow other users to share your Internet connection (yes, +this may be dangerous, just as running a Tor exit node) or want to +provide access to services on your host (this should be less dangerous, +as long as those services are secure), you have to enable the GNUnet exit +daemon. + +You then get to specify which exit functions you want to provide. By +enabling the exit daemon, you will always automatically provide exit +functions for manually configured local services (this component of the +system is under +development and not documented further at this time). As for those +services you explicitly specify the target IP address and port, there is +no significant security risk in doing so. + +Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet. +Being a DNS exit is usually pretty harmless. However, enabling IPv4 or +IPv6-exit without further precautions may enable adversaries to access +your local network, send spam, attack other systems from your Internet +connection and to other mischief that will appear to come from your +machine. This may or may not get you into legal trouble. +If you want to allow IPv4 or IPv6-exit functionality, you should strongly +consider adding additional firewall rules manually to protect your local +network and to restrict outgoing TCP traffic (i.e. by not allowing access +to port 25). While we plan to improve exit-filtering in the future, +you're currently on your own here. +Essentially, be prepared for any kind of IP-traffic to exit the respective +TUN interface (and GNUnet will enable IP-forwarding and NAT for the +interface automatically). + +Additional configuration options of the exit as shown by the gnunet-setup +tool are: + +@node IP Address of external DNS resolver +@subsubsection IP Address of external DNS resolver + +If DNS traffic is to exit your machine, it will be send to this DNS +resolver. You can specify an IPv4 or IPv6 address. + +@node IPv4 address for Exit interface +@subsubsection IPv4 address for Exit interface + +This is the IPv4 address the Interface will get. Make the mask of the +address big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more +mappings of IP addresses into this range. As for the VPN interface, any +unused, private IPv4 address range will do. + +@node IPv6 address for Exit interface +@subsubsection IPv6 address for Exit interface + +The public IPv6 address the interface will get. If your kernel is not a +very recent kernel and you are willing to manually enable IPv6-NAT, the +IPv6 address you specify here must be a globally routed IPv6 address of +your host. + +Suppose your host has the address @code{2001:4ca0::1234/64}, then +using @code{2001:4ca0::1:0/112} would be fine (keep the first 64 bits, +then change at least one bit in the range before the bitmask, in the +example above we changed bit 111 from 0 to 1). + +You may also have to configure your router to route traffic for the entire +subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this +should be automatic with IPv6, but obviously anything can be +disabled). + +@node Bandwidth Configuration +@subsection Bandwidth Configuration + +You can specify how many bandwidth GNUnet is allowed to use to receive +and send data. This is important for users with limited bandwidth or +traffic volume. + +@node Configuring NAT +@subsection Configuring NAT + +Most hosts today do not have a normal global IP address but instead are +behind a router performing Network Address Translation (NAT) which assigns +each host in the local network a private IP address. +As a result, these machines cannot trivially receive inbound connections +from the Internet. GNUnet supports NAT traversal to enable these machines +to receive incoming connections from other peers despite their +limitations. + +In an ideal world, you can press the "Attempt automatic configuration" +button in gnunet-setup to automatically configure your peer correctly. +Alternatively, your distribution might have already triggered this +automatic configuration during the installation process. +However, automatic configuration can fail to determine the optimal +settings, resulting in your peer either not receiving as many connections +as possible, or in the worst case it not connecting to the network at all. + +To manually configure the peer, you need to know a few things about your +network setup. First, determine if you are behind a NAT in the first +place. +This is always the case if your IP address starts with "10.*" or +"192.168.*". Next, if you have control over your NAT router, you may +choose to manually configure it to allow GNUnet traffic to your host. +If you have configured your NAT to forward traffic on ports 2086 (and +possibly 1080) to your host, you can check the "NAT ports have been opened +manually" option, which corresponds to the "PUNCHED_NAT" option in the +configuration file. If you did not punch your NAT box, it may still be +configured to support UPnP, which allows GNUnet to automatically +configure it. In that case, you need to install the "upnpc" command, +enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal +via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the +configuration file). + +Some NAT boxes can be traversed using the autonomous NAT traversal method. +This requires certain GNUnet components to be installed with "SUID" +prividledges on your system (so if you're installing on a system you do +not have administrative rights to, this will not work). +If you installed as 'root', you can enable autonomous NAT traversal by +checking the "Enable NAT traversal using ICMP method". +The ICMP method requires a way to determine your NAT's external (global) +IP address. This can be done using either UPnP, DynDNS, or by manual +configuration. If you have a DynDNS name or know your external IP address, +you should enter that name under "External (public) IPv4 address" (which +corresponds to the "EXTERNAL_ADDRESS" option in the configuration file). +If you leave the option empty, GNUnet will try to determine your external +IP address automatically (which may fail, in which case autonomous +NAT traversal will then not work). + +Finally, if you yourself are not behind NAT but want to be able to +connect to NATed peers using autonomous NAT traversal, you need to check +the "Enable connecting to NATed peers using ICMP method" box. + + +@node Peer configuration for distributions +@subsection Peer configuration for distributions + +The "GNUNET_DATA_HOME" in "[path]" in @file{/etc/gnunet.conf} should be +manually set to "/var/lib/gnunet/data/" as the default +"~/.local/share/gnunet/" is probably not that appropriate in this case. +Similarly, distributions may consider pointing "GNUNET_RUNTIME_DIR" to +"/var/run/gnunet/" and "GNUNET_HOME" to "/var/lib/gnunet/". Also, should a +distribution decide to override system defaults, all of these changes +should be done in a custom @file{/etc/gnunet.conf} and not in the files +in the @file{config.d/} directory. + +Given the proposed access permissions, the "gnunet-setup" tool must be +run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it +modifies the system configuration). As always, gnunet-setup should be run +after the GNUnet peer was stopped using "gnunet-arm -e". Distributions +might want to include a wrapper for gnunet-setup that allows the +desktop-user to "sudo" (i.e. using gtksudo) to the "gnunet" user account +and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in +sequence. + +@node How to start and stop a GNUnet peer +@section How to start and stop a GNUnet peer + +This section describes how to start a GNUnet peer. It assumes that you +have already compiled and installed GNUnet and its' dependencies. +Before you start a GNUnet peer, you may want to create a configuration +file using gnunet-setup (but you do not have to). +Sane defaults should exist in your +@file{$GNUNET_PREFIX/share/gnunet/config.d/} directory, so in practice +you could simply start without any configuration. If you want to +configure your peer later, you need to stop it before invoking the +@code{gnunet-setup} tool to customize further and to test your +configuration (@code{gnunet-setup} has build-in test functions). + +The most important option you might have to still set by hand is in +[PATHS]. Here, you use the option "GNUNET_HOME" to specify the path where +GNUnet should store its data. +It defaults to @code{$HOME/}, which again should work for most users. +Make sure that the directory specified as GNUNET_HOME is writable to +the user that you will use to run GNUnet (note that you can run frontends +using other users, GNUNET_HOME must only be accessible to the user used to +run the background processes). + +You will also need to make one central decision: should all of GNUnet be +run under your normal UID, or do you want distinguish between system-wide +(user-independent) GNUnet services and personal GNUnet services. The +multi-user setup is slightly more complicated, but also more secure and +generally recommended. + +@menu +* The Single-User Setup:: +* The Multi-User Setup:: +* Killing GNUnet services:: +* Access Control for GNUnet:: +@end menu + +@node The Single-User Setup +@subsection The Single-User Setup + +For the single-user setup, you do not need to do anything special and can +just start the GNUnet background processes using @code{gnunet-arm}. +By default, GNUnet looks in @file{~/.config/gnunet.conf} for a +configuration (or @code{$XDG_CONFIG_HOME/gnunet.conf} if@ +@code{$XDG_CONFIG_HOME} is defined). If your configuration lives +elsewhere, you need to pass the @code{-c FILENAME} option to all GNUnet +commands. + +Assuming the configuration file is called @file{~/.config/gnunet.conf}, +you start your peer using the @code{gnunet-arm} command (say as user +@code{gnunet}) using: + +@example +gnunet-arm -c ~/.config/gnunet.conf -s +@end example + +@noindent +The "-s" option here is for "start". The command should return almost +instantly. If you want to stop GNUnet, you can use: + +@example +gnunet-arm -c ~/.config/gnunet.conf -e +@end example + +@noindent +The "-e" option here is for "end". + +Note that this will only start the basic peer, no actual applications +will be available. +If you want to start the file-sharing service, use (after starting +GNUnet): + +@example +gnunet-arm -c ~/.config/gnunet.conf -i fs +@end example + +@noindent +The "-i fs" option here is for "initialize" the "fs" (file-sharing) +application. You can also selectively kill only file-sharing support using + +@example +gnunet-arm -c ~/.config/gnunet.conf -k fs +@end example + +@noindent +Assuming that you want certain services (like file-sharing) to be always +automatically started whenever you start GNUnet, you can activate them by +setting "FORCESTART=YES" in the respective section of the configuration +file (for example, "[fs]"). Then GNUnet with file-sharing support would +be started whenever you@ enter: + +@example +gnunet-arm -c ~/.config/gnunet.conf -s +@end example + +@noindent +Alternatively, you can combine the two options: + +@example +gnunet-arm -c ~/.config/gnunet.conf -s -i fs +@end example + +@noindent +Using @code{gnunet-arm} is also the preferred method for initializing +GNUnet from @code{init}. + +Finally, you should edit your @code{crontab} (using the @code{crontab} +command) and insert a line@ + +@example +@@reboot gnunet-arm -c ~/.config/gnunet.conf -s +@end example + +to automatically start your peer whenever your system boots. + +@node The Multi-User Setup +@subsection The Multi-User Setup + +This requires you to create a user @code{gnunet} and an additional group +@code{gnunetdns}, prior to running @code{make install} during +installation. +Then, you create a configuration file @file{/etc/gnunet.conf} which should +contain the lines:@ + +@example +[arm] +SYSTEM_ONLY = YES +USER_ONLY = NO +@end example + +@noindent +Then, perform the same steps to run GNUnet as in the per-user +configuration, except as user @code{gnunet} (including the +@code{crontab} installation). +You may also want to run @code{gnunet-setup} to configure your peer +(databases, etc.). +Make sure to pass @code{-c /etc/gnunet.conf} to all commands. If you +run @code{gnunet-setup} as user @code{gnunet}, you might need to change +permissions on @file{/etc/gnunet.conf} so that the @code{gnunet} user can +write to the file (during setup). + +Afterwards, you need to perform another setup step for each normal user +account from which you want to access GNUnet. First, grant the normal user +(@code{$USER}) permission to the group gnunet: + +@example +# adduser $USER gnunet +@end example + +@noindent +Then, create a configuration file in @file{~/.config/gnunet.conf} for the +$USER with the lines: + +@example +[arm] +SYSTEM_ONLY = NO +USER_ONLY = YES +@end example + +@noindent +This will ensure that @code{gnunet-arm} when started by the normal user +will only run services that are per-user, and otherwise rely on the +system-wide services. +Note that the normal user may run gnunet-setup, but the +configuration would be ineffective as the system-wide services will use +@file{/etc/gnunet.conf} and ignore options set by individual users. + +Again, each user should then start the peer using +@file{gnunet-arm -s} --- and strongly consider adding logic to start +the peer automatically to their crontab. + +Afterwards, you should see two (or more, if you have more than one USER) +@code{gnunet-service-arm} processes running in your system. + +@node Killing GNUnet services +@subsection Killing GNUnet services + +It is not necessary to stop GNUnet services explicitly when shutting +down your computer. + +It should be noted that manually killing "most" of the +@code{gnunet-service} processes is generally not a successful method for +stopping a peer (since @code{gnunet-service-arm} will instantly restart +them). The best way to explicitly stop a peer is using +@code{gnunet-arm -e}; note that the per-user services may need to be +terminated before the system-wide services will terminate normally. + +@node Access Control for GNUnet +@subsection Access Control for GNUnet + +This chapter documents how we plan to make access control work within the +GNUnet system for a typical peer. It should be read as a best-practice +installation guide for advanced users and builders of binary +distributions. The recommendations in this guide apply to POSIX-systems +with full support for UNIX domain sockets only. + +Note that this is an advanced topic. The discussion presumes a very good +understanding of users, groups and file permissions. Normal users on +hosts with just a single user can just install GNUnet under their own +account (and possibly allow the installer to use SUDO to grant additional +permissions for special GNUnet tools that need additional rights). +The discussion below largely applies to installations where multiple users +share a system and to installations where the best possible security is +paramount. + +A typical GNUnet system consists of components that fall into four +categories: + +@table @asis + +@item User interfaces +User interfaces are not security sensitive and are supposed to be run and +used by normal system users. +The GTK GUIs and most command-line programs fall into this category. +Some command-line tools (like gnunet-transport) should be excluded as they +offer low-level access that normal users should not need. +@item System services and support tools +System services should always run and offer services that can then be +accessed by the normal users. +System services do not require special permissions, but as they are not +specific to a particular user, they probably should not run as a +particular user. Also, there should typically only be one GNUnet peer per +host. System services include the gnunet-service and gnunet-daemon +programs; support tools include command-line programs such as gnunet-arm. +@item Priviledged helpers +Some GNUnet components require root rights to open raw sockets or perform +other special operations. These gnunet-helper binaries are typically +installed SUID and run from services or daemons. +@item Critical services +Some GNUnet services (such as the DNS service) can manipulate the service +in deep and possibly highly security sensitive ways. For example, the DNS +service can be used to intercept and alter any DNS query originating from +the local machine. Access to the APIs of these critical services and their +priviledged helpers must be tightly controlled. +@end table + +@c FIXME: The titles of these chapters are too long in the index. + +@menu +* Recommendation - Disable access to services via TCP:: +* Recommendation - Run most services as system user "gnunet":: +* Recommendation - Control access to services using group "gnunet":: +* Recommendation - Limit access to certain SUID binaries by group "gnunet":: +* Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns":: +* Differences between "make install" and these recommendations:: +@end menu + +@node Recommendation - Disable access to services via TCP +@subsubsection Recommendation - Disable access to services via TCP + +GNUnet services allow two types of access: via TCP socket or via UNIX +domain socket. +If the service is available via TCP, access control can only be +implemented by restricting connections to a particular range of IP +addresses. +This is acceptable for non-critical services that are supposed to be +available to all users on the local system or local network. +However, as TCP is generally less efficient and it is rarely the case +that a single GNUnet peer is supposed to serve an entire local network, +the default configuration should disable TCP access to all GNUnet +services on systems with support for UNIX domain sockets. +As of GNUnet 0.9.2, configuration files with TCP access disabled should be +generated by default. Users can re-enable TCP access to particular +services simply by specifying a non-zero port number in the section of +the respective service. + + +@node Recommendation - Run most services as system user "gnunet" +@subsubsection Recommendation - Run most services as system user "gnunet" + +GNUnet's main services should be run as a separate user "gnunet" in a +special group "gnunet". +The user "gnunet" should start the peer using "gnunet-arm -s" during +system startup. The home directory for this user should be +@file{/var/lib/gnunet} and the configuration file should be +@file{/etc/gnunet.conf}. +Only the @code{gnunet} user should have the right to access +@file{/var/lib/gnunet} (@emph{mode: 700}). + +@node Recommendation - Control access to services using group "gnunet" +@subsubsection Recommendation - Control access to services using group "gnunet" + +Users that should be allowed to use the GNUnet peer should be added to the +group "gnunet". Using GNUnet's access control mechanism for UNIX domain +sockets, those services that are considered useful to ordinary users +should be made available by setting "UNIX_MATCH_GID=YES" for those +services. +Again, as shipped, GNUnet provides reasonable defaults. +Permissions to access the transport and core subsystems might additionally +be granted without necessarily causing security concerns. +Some services, such as DNS, must NOT be made accessible to the "gnunet" +group (and should thus only be accessible to the "gnunet" user and +services running with this UID). + +@node Recommendation - Limit access to certain SUID binaries by group "gnunet" +@subsubsection Recommendation - Limit access to certain SUID binaries by group "gnunet" + +Most of GNUnet's SUID binaries should be safe even if executed by normal +users. However, it is possible to reduce the risk a little bit more by +making these binaries owned by the group "gnunet" and restricting their +execution to user of the group "gnunet" as well (4750). + +@node Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns" +@subsubsection Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns" + +A special group "gnunetdns" should be created for controlling access to +the "gnunet-helper-dns". +The binary should then be owned by root and be in group "gnunetdns" and +be installed SUID and only be group-executable (2750). +@b{Note that the group "gnunetdns" should have no users in it at all, +ever.} +The "gnunet-service-dns" program should be executed by user "gnunet" (via +gnunet-service-arm) with the binary owned by the user "root" and the group +"gnunetdns" and be SGID (2700). This way, @strong{only} +"gnunet-service-dns" can change its group to "gnunetdns" and execute the +helper, and the helper can then run as root (as per SUID). +Access to the API offered by "gnunet-service-dns" is in turn restricted +to the user "gnunet" (not the group!), which means that only +"benign" services can manipulate DNS queries using "gnunet-service-dns". + +@node Differences between "make install" and these recommendations +@subsubsection Differences between "make install" and these recommendations + +The current build system does not set all permissions automatically based +on the recommendations above. In particular, it does not use the group +"gnunet" at all (so setting gnunet-helpers other than the +gnunet-helper-dns to be owned by group "gnunet" must be done manually). +Furthermore, 'make install' will silently fail to set the DNS binaries to +be owned by group "gnunetdns" unless that group already exists (!). +An alternative name for the "gnunetdns" group can be specified using the +@code{--with-gnunetdns=GRPNAME} configure option. diff --git a/doc/documentation/gnunet.texi b/doc/documentation/gnunet.texi index 13c3aa9c8..618915501 100644 --- a/doc/documentation/gnunet.texi +++ b/doc/documentation/gnunet.texi @@ -123,6 +123,8 @@ Using GNUnet * File-sharing:: * The GNU Name System:: * Using the Virtual Public Network:: +* The graphical configuration interface:: +* How to start and stop a GNUnet peer:: GNUnet Contributors Handbook @@ -183,20 +185,10 @@ GNUnet Developer Handbook @include chapters/philosophy.texi @c ********************************************************************* -@c WIP: -@c @include chapters/vocabulary.texi - -@c ********************************************************************* -@include chapters/installation.texi -@c ********************************************************************* - @c ********************************************************************* @include chapters/user.texi @c ********************************************************************* -@c WIP: -@c @include chapters/configuration.texi - @include chapters/contributing.texi @c ********************************************************************* -- cgit v1.2.3 From ae8b5cb2eac770be0d18b7d46c238bf865e34023 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 12 Jun 2018 11:09:50 +0200 Subject: complain if datacache returns expired values --- src/dht/gnunet-service-dht_datacache.c | 5 +++++ src/gns/gnunet-service-gns_resolver.c | 16 +++++++++++++++- src/gnsrecord/gnsrecord_crypto.c | 12 ++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c index 1f01387ff..7ad9aa728 100644 --- a/src/dht/gnunet-service-dht_datacache.c +++ b/src/dht/gnunet-service-dht_datacache.c @@ -171,6 +171,11 @@ datacache_get_iterator (void *cls, struct GetRequestContext *ctx = cls; enum GNUNET_BLOCK_EvaluationResult eval; + if (0 == GNUNET_TIME_absolute_get_remaining (exp).rel_value_us) + { + GNUNET_break (0); /* why does datacache return expired values? */ + return GNUNET_OK; /* skip expired record */ + } if ( (NULL == data) && (0 == data_size) ) data = &non_null; /* point anywhere, but not to NULL */ diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index a90cc4c0e..54c3cba23 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -1377,6 +1377,10 @@ vpn_allocation_cb (void *cls, } } GNUNET_assert (i < vpn_ctx->rd_count); + if (0 == vpn_ctx->rd_count) + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + _("VPN returned empty result for `%s'\n"), + rh->name); handle_gns_resolution_result (rh, vpn_ctx->rd_count, rd); @@ -1859,7 +1863,8 @@ handle_gns_resolution_result (void *cls, if (0 == rd_count) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - _("GNS lookup failed (zero records found)\n")); + _("GNS lookup failed (zero records found for `%s')\n"), + rh->name); fail_resolution (rh); return; } @@ -2370,6 +2375,11 @@ handle_dht_response (void *cls, fail_resolution (rh); return; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Decrypting DHT block of size %u for `%s', expires %s\n", + ntohl (block->purpose.size), + rh->name, + GNUNET_STRINGS_absolute_time_to_string (exp)); if (GNUNET_OK != GNUNET_GNSRECORD_block_decrypt (block, &ac->authority_info.gns_authority, @@ -2450,6 +2460,10 @@ handle_gns_namecache_resolution_result (void *cls, { struct GNS_ResolverHandle *rh = cls; + if (0 == rd_count) + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + _("GNS namecache returned empty result for `%s'\n"), + rh->name); handle_gns_resolution_result (rh, rd_count, rd); diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index 0752086fe..295d31100 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c @@ -377,6 +377,8 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ) { include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Ignoring shadow record\n"); break; } } @@ -395,6 +397,16 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, rd[j] = rd[i]; j++; } + else + { + struct GNUNET_TIME_Absolute at; + + at.abs_value_us = rd[i].expiration_time; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Excluding record that expired %s (%llu ago)\n", + GNUNET_STRINGS_absolute_time_to_string (at), + (unsigned long long) rd[i].expiration_time - now.abs_value_us); + } } rd_count = j; if (NULL != proc) -- cgit v1.2.3 From f6a87ee66310529edf76c0fab76cdc7cd2aac216 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 12 Jun 2018 14:48:00 +0200 Subject: ensure datacache does not return expired records, fixig pq behavior with respect to FOREVER absolute time --- src/datacache/plugin_datacache_heap.c | 3 ++ src/datacache/plugin_datacache_postgres.c | 33 +++++++----- src/datacache/test_datacache.c | 73 +++++++++++++++++++------- src/datacache/test_datacache_quota.c | 31 ++++++++--- src/pq/pq_query_helper.c | 58 ++++++++++++++++++++- src/pq/pq_result_helper.c | 85 ++++++++++++++++++++++++++++++- 6 files changed, 242 insertions(+), 41 deletions(-) diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c index 2a08fc81b..494d1ae17 100644 --- a/src/datacache/plugin_datacache_heap.c +++ b/src/datacache/plugin_datacache_heap.c @@ -314,6 +314,9 @@ get_cb (void *cls, if ( (get_ctx->type != val->type) && (GNUNET_BLOCK_TYPE_ANY != get_ctx->type) ) return GNUNET_OK; + if (0 == + GNUNET_TIME_absolute_get_remaining (val->discard_time).rel_value_us) + return GNUNET_OK; if (NULL != get_ctx->iter) ret = get_ctx->iter (get_ctx->iter_cls, key, diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index 6eeeb5873..ea87acc1f 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c @@ -82,12 +82,12 @@ init_connection (struct Plugin *plugin) struct GNUNET_PQ_PreparedStatement ps[] = { GNUNET_PQ_make_prepare ("getkt", "SELECT discard_time,type,value,path FROM gn011dc " - "WHERE key=$1 AND type=$2", - 2), + "WHERE key=$1 AND type=$2 AND discard_time >= $3", + 3), GNUNET_PQ_make_prepare ("getk", "SELECT discard_time,type,value,path FROM gn011dc " - "WHERE key=$1", - 1), + "WHERE key=$1 AND discard_time >= $2", + 2), GNUNET_PQ_make_prepare ("getex", "SELECT length(value) AS len,oid,key FROM gn011dc" " WHERE discard_time < $1" @@ -97,18 +97,15 @@ init_connection (struct Plugin *plugin) "SELECT length(value) AS len,oid,key FROM gn011dc" " ORDER BY prox ASC, discard_time ASC LIMIT 1", 0), - GNUNET_PQ_make_prepare ("getp", - "SELECT length(value) AS len,oid,key FROM gn011dc " - "ORDER BY discard_time ASC LIMIT 1", - 0), GNUNET_PQ_make_prepare ("get_random", - "SELECT discard_time,type,value,path,key FROM gn011dc " - "ORDER BY key ASC LIMIT 1 OFFSET $1", - 1), + "SELECT discard_time,type,value,path,key FROM gn011dc" + " WHERE discard_time >= $1" + " ORDER BY key ASC LIMIT 1 OFFSET $2", + 2), GNUNET_PQ_make_prepare ("get_closest", "SELECT discard_time,type,value,path,key FROM gn011dc " - "WHERE key>=$1 ORDER BY key ASC LIMIT $2", - 1), + "WHERE key>=$1 AND discard_time >= $2 ORDER BY key ASC LIMIT $3", + 3), GNUNET_PQ_make_prepare ("delrow", "DELETE FROM gn011dc WHERE oid=$1", 1), @@ -313,18 +310,22 @@ postgres_plugin_get (void *cls, { struct Plugin *plugin = cls; uint32_t type32 = (uint32_t) type; + struct GNUNET_TIME_Absolute now; struct GNUNET_PQ_QueryParam paramk[] = { GNUNET_PQ_query_param_auto_from_type (key), + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_QueryParam paramkt[] = { GNUNET_PQ_query_param_auto_from_type (key), GNUNET_PQ_query_param_uint32 (&type32), + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_end }; enum GNUNET_DB_QueryStatus res; struct HandleResultContext hr_ctx; + now = GNUNET_TIME_absolute_get (); hr_ctx.iter = iter; hr_ctx.iter_cls = iter_cls; hr_ctx.key = key; @@ -427,6 +428,7 @@ postgres_plugin_get_random (void *cls, { struct Plugin *plugin = cls; uint32_t off; + struct GNUNET_TIME_Absolute now; struct GNUNET_TIME_Absolute expiration_time; size_t data_size; void *data; @@ -436,6 +438,7 @@ postgres_plugin_get_random (void *cls, uint32_t type; enum GNUNET_DB_QueryStatus res; struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_uint32 (&off), GNUNET_PQ_query_param_end }; @@ -459,6 +462,7 @@ postgres_plugin_get_random (void *cls, return 0; if (NULL == iter) return 1; + now = GNUNET_TIME_absolute_get (); off = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, plugin->num_items); res = GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, @@ -620,8 +624,10 @@ postgres_plugin_get_closest (void *cls, { struct Plugin *plugin = cls; uint32_t num_results32 = (uint32_t) num_results; + struct GNUNET_TIME_Absolute now; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (key), + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_uint32 (&num_results32), GNUNET_PQ_query_param_end }; @@ -630,6 +636,7 @@ postgres_plugin_get_closest (void *cls, erc.iter = iter; erc.iter_cls = iter_cls; + now = GNUNET_TIME_absolute_get (); res = GNUNET_PQ_eval_prepared_multi_select (plugin->dbh, "get_closest", params, diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c index 12edb62f8..50e45012d 100644 --- a/src/datacache/test_datacache.c +++ b/src/datacache/test_datacache.c @@ -44,6 +44,11 @@ checkIt (void *cls, unsigned int path_len, const struct GNUNET_PeerIdentity *path) { + (void) key; + (void) type; + (void) exp; + (void) path_len; + (void) path; if (size != sizeof (struct GNUNET_HashCode)) { GNUNET_break (0); @@ -59,17 +64,22 @@ checkIt (void *cls, static void -run (void *cls, char *const *args, const char *cfgfile, +run (void *cls, + char *const *args, + const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct GNUNET_DATACACHE_Handle *h; struct GNUNET_HashCode k; struct GNUNET_HashCode n; struct GNUNET_TIME_Absolute exp; - unsigned int i; + (void) cls; + (void) args; + (void) cfgfile; ok = 0; - h = GNUNET_DATACACHE_create (cfg, "testcache"); + h = GNUNET_DATACACHE_create (cfg, + "testcache"); if (h == NULL) { FPRINTF (stderr, @@ -81,7 +91,7 @@ run (void *cls, char *const *args, const char *cfgfile, exp = GNUNET_TIME_absolute_get (); exp.abs_value_us += 5 * 60 * 1000 * 1000LL; memset (&k, 0, sizeof (struct GNUNET_HashCode)); - for (i = 0; i < 100; i++) + for (unsigned int i = 0; i < 100; i++) { GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); ASSERT (GNUNET_OK == @@ -93,26 +103,43 @@ run (void *cls, char *const *args, const char *cfgfile, 0, NULL)); k = n; } - memset (&k, 0, sizeof (struct GNUNET_HashCode)); - for (i = 0; i < 100; i++) + memset (&k, + 0, + sizeof (struct GNUNET_HashCode)); + for (unsigned int i = 0; i < 100; i++) { - GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); - ASSERT (1 == GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n)); + GNUNET_CRYPTO_hash (&k, + sizeof (struct GNUNET_HashCode), + &n); + ASSERT (1 == GNUNET_DATACACHE_get (h, + &k, + 1 + i % 16, + &checkIt, + &n)); k = n; } - memset (&k, 42, sizeof (struct GNUNET_HashCode)); - GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); + memset (&k, + 42, + sizeof (struct GNUNET_HashCode)); + GNUNET_CRYPTO_hash (&k, + sizeof (struct GNUNET_HashCode), + &n); ASSERT (GNUNET_OK == GNUNET_DATACACHE_put (h, &k, GNUNET_YES, sizeof (struct GNUNET_HashCode), - (const char *) &n, 792, + (const char *) &n, + 792, GNUNET_TIME_UNIT_FOREVER_ABS, - 0, NULL)); - ASSERT (0 != GNUNET_DATACACHE_get (h, &k, 792, &checkIt, &n)); - + 0, + NULL)); + ASSERT (0 != GNUNET_DATACACHE_get (h, + &k, + 792, + &checkIt, + &n)); GNUNET_DATACACHE_destroy (h); ASSERT (ok == 0); return; @@ -137,16 +164,26 @@ main (int argc, char *argv[]) GNUNET_GETOPT_OPTION_END }; + (void) argc; GNUNET_log_setup ("test-datacache", "WARNING", NULL); plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); - GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_datacache_data_%s.conf", + GNUNET_snprintf (cfg_name, + sizeof (cfg_name), + "test_datacache_data_%s.conf", plugin_name); - GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv, - "test-datacache", "nohelp", options, &run, NULL); + GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, + xargv, + "test-datacache", + "nohelp", + options, + &run, + NULL); if ( (0 != ok) && (77 != ok) ) - FPRINTF (stderr, "Missed some testcases: %d\n", ok); + FPRINTF (stderr, + "Missed some testcases: %d\n", + ok); return ok; } diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c index 3d02a7244..21e373608 100644 --- a/src/datacache/test_datacache_quota.c +++ b/src/datacache/test_datacache_quota.c @@ -41,7 +41,9 @@ static const char *plugin_name; * some of the data from the last iteration is still there. */ static void -run (void *cls, char *const *args, const char *cfgfile, +run (void *cls, + char *const *args, + const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct GNUNET_DATACACHE_Handle *h; @@ -50,8 +52,12 @@ run (void *cls, char *const *args, const char *cfgfile, char buf[3200]; struct GNUNET_TIME_Absolute exp; + (void) cls; + (void) args; + (void) cfgfile; ok = 0; - h = GNUNET_DATACACHE_create (cfg, "testcache"); + h = GNUNET_DATACACHE_create (cfg, + "testcache"); if (h == NULL) { @@ -112,7 +118,8 @@ FAILURE: int -main (int argc, char *argv[]) +main (int argc, + char *argv[]) { char cfg_name[128]; char *const xargv[] = { @@ -125,17 +132,27 @@ main (int argc, char *argv[]) GNUNET_GETOPT_OPTION_END }; + (void) argc; GNUNET_log_setup ("test-datacache-quota", "WARNING", NULL); plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); - GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_datacache_data_%s.conf", + GNUNET_snprintf (cfg_name, + sizeof (cfg_name), + "test_datacache_data_%s.conf", plugin_name); - GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv, - "test-datacache-quota", "nohelp", options, &run, NULL); + GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, + xargv, + "test-datacache-quota", + "nohelp", + options, + &run, + NULL); if (0 != ok) - FPRINTF (stderr, "Missed some testcases: %d\n", ok); + FPRINTF (stderr, + "Missed some testcases: %d\n", + ok); return ok; } diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c index 799f82ebe..98f697b5d 100644 --- a/src/pq/pq_query_helper.c +++ b/src/pq/pq_query_helper.c @@ -50,6 +50,8 @@ qconv_fixed (void *cls, void *scratch[], unsigned int scratch_length) { + (void) scratch; + (void) scratch_length; GNUNET_break (NULL == cls); if (1 != param_length) return -1; @@ -117,6 +119,8 @@ qconv_uint16 (void *cls, const uint16_t *u_hbo = data; uint16_t *u_nbo; + (void) scratch; + (void) scratch_length; GNUNET_break (NULL == cls); if (1 != param_length) return -1; @@ -172,6 +176,8 @@ qconv_uint32 (void *cls, const uint32_t *u_hbo = data; uint32_t *u_nbo; + (void) scratch; + (void) scratch_length; GNUNET_break (NULL == cls); if (1 != param_length) return -1; @@ -227,6 +233,8 @@ qconv_uint64 (void *cls, const uint64_t *u_hbo = data; uint64_t *u_nbo; + (void) scratch; + (void) scratch_length; GNUNET_break (NULL == cls); if (1 != param_length) return -1; @@ -370,6 +378,51 @@ GNUNET_PQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) } +/** + * Function called to convert input argument into SQL parameters. + * + * @param cls closure + * @param data pointer to input argument + * @param data_len number of bytes in @a data (if applicable) + * @param[out] param_values SQL data to set + * @param[out] param_lengths SQL length data to set + * @param[out] param_formats SQL format data to set + * @param param_length number of entries available in the @a param_values, @a param_lengths and @a param_formats arrays + * @param[out] scratch buffer for dynamic allocations (to be done via #GNUNET_malloc() + * @param scratch_length number of entries left in @a scratch + * @return -1 on error, number of offsets used in @a scratch otherwise + */ +static int +qconv_abs_time (void *cls, + const void *data, + size_t data_len, + void *param_values[], + int param_lengths[], + int param_formats[], + unsigned int param_length, + void *scratch[], + unsigned int scratch_length) +{ + const struct GNUNET_TIME_Absolute *u = data; + struct GNUNET_TIME_Absolute abs; + uint64_t *u_nbo; + + GNUNET_break (NULL == cls); + if (1 != param_length) + return -1; + abs = *u; + if (abs.abs_value_us > INT64_MAX) + abs.abs_value_us = INT64_MAX; + u_nbo = GNUNET_new (uint64_t); + scratch[0] = u_nbo; + *u_nbo = GNUNET_htonll (abs.abs_value_us); + param_values[0] = (void *) u_nbo; + param_lengths[0] = sizeof (uint64_t); + param_formats[0] = 1; + return 1; +} + + /** * Generate query parameter for an absolute time value. * The database must store a 64-bit integer. @@ -380,7 +433,10 @@ GNUNET_PQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x) { - return GNUNET_PQ_query_param_uint64 (&x->abs_value_us); + struct GNUNET_PQ_QueryParam res = + { &qconv_abs_time, NULL, x, sizeof (*x), 1 }; + + return res; } diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c index 3805b8a8d..dc1a1554f 100644 --- a/src/pq/pq_result_helper.c +++ b/src/pq/pq_result_helper.c @@ -38,6 +38,7 @@ clean_varsize_blob (void *cls, { void **dst = rd; + (void) cls; if (NULL != *dst) { GNUNET_free (*dst); @@ -72,6 +73,7 @@ extract_varsize_blob (void *cls, void *idst; int fnum; + (void) cls; *dst_size = 0; *((void **) dst) = NULL; @@ -154,6 +156,7 @@ extract_fixed_blob (void *cls, const char *res; int fnum; + (void) cls; fnum = PQfnumber (result, fname); if (fnum < 0) @@ -237,6 +240,7 @@ extract_rsa_public_key (void *cls, const char *res; int fnum; + (void) cls; *pk = NULL; fnum = PQfnumber (result, fname); @@ -284,6 +288,7 @@ clean_rsa_public_key (void *cls, { struct GNUNET_CRYPTO_RsaPublicKey **pk = rd; + (void) cls; if (NULL != *pk) { GNUNET_CRYPTO_rsa_public_key_free (*pk); @@ -338,6 +343,7 @@ extract_rsa_signature (void *cls, const char *res; int fnum; + (void) cls; *sig = NULL; fnum = PQfnumber (result, fname); @@ -385,6 +391,7 @@ clean_rsa_signature (void *cls, { struct GNUNET_CRYPTO_RsaSignature **sig = rd; + (void) cls; if (NULL != *sig) { GNUNET_CRYPTO_rsa_signature_free (*sig); @@ -439,6 +446,7 @@ extract_string (void *cls, const char *res; int fnum; + (void) cls; *str = NULL; fnum = PQfnumber (result, fname); @@ -486,6 +494,7 @@ clean_string (void *cls, { char **str = rd; + (void) cls; if (NULL != *str) { GNUNET_free (*str); @@ -514,6 +523,71 @@ GNUNET_PQ_result_spec_string (const char *name, } +/** + * Extract data from a Postgres database @a result at row @a row. + * + * @param cls closure + * @param result where to extract data from + * @param int row to extract data from + * @param fname name (or prefix) of the fields to extract from + * @param[in,out] dst_size where to store size of result, may be NULL + * @param[out] dst where to store the result + * @return + * #GNUNET_YES if all results could be extracted + * #GNUNET_SYSERR if a result was invalid (non-existing field or NULL) + */ +static int +extract_abs_time (void *cls, + PGresult *result, + int row, + const char *fname, + size_t *dst_size, + void *dst) +{ + struct GNUNET_TIME_Absolute *udst = dst; + const int64_t *res; + int fnum; + + (void) cls; + fnum = PQfnumber (result, + fname); + if (fnum < 0) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + if (PQgetisnull (result, + row, + fnum)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + GNUNET_assert (NULL != dst); + if (sizeof (struct GNUNET_TIME_Absolute) != *dst_size) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + if (sizeof (int64_t) != + PQgetlength (result, + row, + fnum)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + res = (int64_t *) PQgetvalue (result, + row, + fnum); + if (INT64_MAX == *res) + *udst = GNUNET_TIME_UNIT_FOREVER_ABS; + else + udst->abs_value_us = GNUNET_ntohll ((uint64_t) *res); + return GNUNET_OK; +} + + /** * Absolute time expected. * @@ -525,8 +599,12 @@ struct GNUNET_PQ_ResultSpec GNUNET_PQ_result_spec_absolute_time (const char *name, struct GNUNET_TIME_Absolute *at) { - return GNUNET_PQ_result_spec_uint64 (name, - &at->abs_value_us); + struct GNUNET_PQ_ResultSpec res = + { &extract_abs_time, + NULL, + NULL, + (void *) at, sizeof (*at), (name), NULL }; + return res; } @@ -572,6 +650,7 @@ extract_uint16 (void *cls, const uint16_t *res; int fnum; + (void) cls; fnum = PQfnumber (result, fname); if (fnum < 0) @@ -653,6 +732,7 @@ extract_uint32 (void *cls, const uint32_t *res; int fnum; + (void) cls; fnum = PQfnumber (result, fname); if (fnum < 0) @@ -734,6 +814,7 @@ extract_uint64 (void *cls, const uint64_t *res; int fnum; + (void) cls; fnum = PQfnumber (result, fname); if (fnum < 0) -- cgit v1.2.3 From 3e5842e44aac604c505edd60a4f3dd8a360ff45b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 12 Jun 2018 14:57:51 +0200 Subject: tell mysql that our integers are unsigned --- src/my/my.c | 26 +++++++++++--------------- src/my/my_query_helper.c | 22 +++++++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/my/my.c b/src/my/my.c index b9d5c8424..2f4cd3ba3 100644 --- a/src/my/my.c +++ b/src/my/my.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet - Copyright (C) 2016 Inria & GNUnet e.V. + Copyright (C) 2016, 2018 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -43,19 +43,20 @@ GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc, { const struct GNUNET_MY_QueryParam *p; unsigned int num; - unsigned int i; MYSQL_STMT *stmt; num = 0; - for (i=0;NULL != params[i].conv;i++) + for (unsigned int i=0;NULL != params[i].conv;i++) num += params[i].num_params; { MYSQL_BIND qbind[num]; unsigned int off; - memset (qbind, 0, sizeof(qbind)); + memset (qbind, + 0, + sizeof(qbind)); off = 0; - for (i=0;NULL != (p = ¶ms[i])->conv;i++) + for (unsigned int i=0;NULL != (p = ¶ms[i])->conv;i++) { if (GNUNET_OK != p->conv (p->conv_cls, @@ -111,9 +112,7 @@ void GNUNET_MY_cleanup_query (struct GNUNET_MY_QueryParam *qp, MYSQL_BIND *qbind) { - unsigned int i; - - for (i=0; NULL != qp[i].conv ;i++) + for (unsigned int i=0; NULL != qp[i].conv ;i++) if (NULL != qp[i].cleaner) qp[i].cleaner (qp[i].conv_cls, &qbind[i]); @@ -136,7 +135,6 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, struct GNUNET_MY_ResultSpec *rs) { unsigned int num_fields; - unsigned int i; int ret; MYSQL_STMT *stmt; @@ -153,7 +151,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, } num_fields = 0; - for (i=0;NULL != rs[i].pre_conv;i++) + for (unsigned int i=0;NULL != rs[i].pre_conv;i++) num_fields += rs[i].num_fields; if (mysql_stmt_field_count (stmt) != num_fields) @@ -169,7 +167,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, memset (result, 0, sizeof (MYSQL_BIND) * num_fields); field_off = 0; - for (i=0;NULL != rs[i].pre_conv;i++) + for (unsigned int i=0;NULL != rs[i].pre_conv;i++) { struct GNUNET_MY_ResultSpec *rp = &rs[i]; @@ -221,7 +219,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, return GNUNET_SYSERR; } field_off = 0; - for (i=0;NULL != rs[i].post_conv;i++) + for (unsigned int i=0;NULL != rs[i].post_conv;i++) { struct GNUNET_MY_ResultSpec *rp = &rs[i]; @@ -256,9 +254,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, void GNUNET_MY_cleanup_result (struct GNUNET_MY_ResultSpec *rs) { - unsigned int i; - - for (i=0;NULL != rs[i].post_conv;i++) + for (unsigned int i=0;NULL != rs[i].post_conv;i++) if (NULL != rs[i].cleaner) rs[i].cleaner (rs[i].conv_cls, &rs[i]); diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c index c4516715a..b2a893a44 100644 --- a/src/my/my_query_helper.c +++ b/src/my/my_query_helper.c @@ -37,6 +37,7 @@ static void my_clean_query (void *cls, MYSQL_BIND *qbind) { + (void) cls; GNUNET_free (qbind[0].buffer); } @@ -54,6 +55,7 @@ my_conv_fixed_size (void *cls, const struct GNUNET_MY_QueryParam *qp, MYSQL_BIND *qbind) { + (void) cls; GNUNET_assert (1 == qp->num_params); qbind->buffer = (void *) qp->data; qbind->buffer_length = qp->data_len; @@ -99,12 +101,11 @@ my_conv_string (void *cls, const struct GNUNET_MY_QueryParam *qp, MYSQL_BIND *qbind) { + (void) cls; GNUNET_assert (1 == qp->num_params); - qbind->buffer = (void *) qp->data; qbind->buffer_length = qp->data_len; qbind->buffer_type = MYSQL_TYPE_STRING; - return 1; } @@ -142,10 +143,12 @@ my_conv_uint16 (void *cls, const struct GNUNET_MY_QueryParam *qp, MYSQL_BIND *qbind) { + (void) cls; GNUNET_assert (1 == qp->num_params); qbind->buffer = (void *) qp->data; qbind->buffer_length = sizeof (uint16_t); qbind->buffer_type = MYSQL_TYPE_SHORT; + qbind->is_unsigned = 1; return 1; } @@ -184,11 +187,12 @@ my_conv_uint32 (void *cls, const struct GNUNET_MY_QueryParam *qp, MYSQL_BIND *qbind) { + (void) cls; GNUNET_assert (1 == qp->num_params); qbind->buffer = (void *) qp->data; qbind->buffer_length = sizeof(uint32_t); qbind->buffer_type = MYSQL_TYPE_LONG; - + qbind->is_unsigned = 1; return 1; } @@ -227,10 +231,12 @@ my_conv_uint64 (void *cls, const struct GNUNET_MY_QueryParam *qp, MYSQL_BIND * qbind) { + (void) cls; GNUNET_assert (1 == qp->num_params); qbind->buffer = (void *) qp->data; qbind->buffer_length = sizeof (uint64_t); qbind->buffer_type = MYSQL_TYPE_LONGLONG; + qbind->is_unsigned = 1; return 1; } @@ -273,14 +279,13 @@ my_conv_rsa_public_key (void *cls, char *buf; size_t buf_size; + (void) cls; GNUNET_assert(1 == qp->num_params); - - buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, &buf); - + buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, + &buf); qbind->buffer = (void *) buf; qbind->buffer_length = buf_size; qbind->buffer_type = MYSQL_TYPE_BLOB; - return 1; } @@ -325,14 +330,13 @@ my_conv_rsa_signature (void *cls, char *buf; size_t buf_size; + (void) cls; GNUNET_assert(1 == qp->num_params); - buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig, &buf); qbind->buffer = (void *) buf; qbind->buffer_length = buf_size; qbind->buffer_type = MYSQL_TYPE_BLOB; - return 1; } -- cgit v1.2.3 From c4ea87522edf51a18538715bec7f4baa87c13cd4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 12 Jun 2018 15:10:52 +0200 Subject: ensure DHT never accepts or passes along expired blocks --- src/dht/gnunet-service-dht_neighbours.c | 76 +++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 9c1395782..56639448f 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -468,6 +468,7 @@ free_connect_info (void *cls, { struct ConnectInfo *ci = value; + (void) cls; GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multipeermap_remove (all_desired_peers, peer, @@ -579,7 +580,10 @@ update_desire_strength (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) { - try_connect (pid, NULL); + (void) cls; + (void) value; + try_connect (pid, + NULL); return GNUNET_YES; } @@ -616,6 +620,8 @@ add_known_to_bloom (void *cls, struct GNUNET_BLOCK_Group *bg = cls; struct GNUNET_HashCode key_hash; + (void) cls; + (void) value; GNUNET_CRYPTO_hash (key, sizeof (struct GNUNET_PeerIdentity), &key_hash); @@ -643,7 +649,8 @@ send_find_peer_message (void *cls) struct GNUNET_BLOCK_Group *bg; struct GNUNET_CONTAINER_BloomFilter *peer_bf; - find_peer_task = NULL; + (void) cls; + find_peer_task = NULL; if (newly_found_peers > bucket_size) { /* If we are finding many peers already, no need to send out our request right now! */ @@ -716,7 +723,8 @@ handle_core_connect (void *cls, { struct PeerInfo *pi; - /* Check for connect to self message */ + (void) cls; + /* Check for connect to self message */ if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) @@ -739,13 +747,13 @@ handle_core_connect (void *cls, &pi->phash); pi->peer_bucket = find_bucket (&pi->phash); GNUNET_assert ( (pi->peer_bucket >= 0) && - (pi->peer_bucket < MAX_BUCKETS) ); + ((unsigned int) pi->peer_bucket < MAX_BUCKETS) ); GNUNET_CONTAINER_DLL_insert_tail (k_buckets[pi->peer_bucket].head, k_buckets[pi->peer_bucket].tail, pi); k_buckets[pi->peer_bucket].peers_size++; closest_bucket = GNUNET_MAX (closest_bucket, - pi->peer_bucket); + (unsigned int) pi->peer_bucket); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_put (all_connected_peers, pi->id, @@ -783,6 +791,7 @@ handle_core_disconnect (void *cls, { struct PeerInfo *to_remove = internal_cls; + (void) cls; /* Check for disconnect from self message */ if (NULL == to_remove) return; @@ -946,23 +955,23 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key, int bits; int other_bits; int bucket_num; - int count; struct PeerInfo *pos; - if (0 == memcmp (&my_identity_hash, key, sizeof (struct GNUNET_HashCode))) + if (0 == memcmp (&my_identity_hash, + key, + sizeof (struct GNUNET_HashCode))) return GNUNET_YES; bucket_num = find_bucket (key); GNUNET_assert (bucket_num >= 0); bits = GNUNET_CRYPTO_hash_matching_bits (&my_identity_hash, key); pos = k_buckets[bucket_num].head; - count = 0; - while ((NULL != pos) && (count < bucket_size)) + while (NULL != pos) { - if ((NULL != bloom) && - (GNUNET_YES == - GNUNET_CONTAINER_bloomfilter_test (bloom, - &pos->phash))) + if ( (NULL != bloom) && + (GNUNET_YES == + GNUNET_CONTAINER_bloomfilter_test (bloom, + &pos->phash)) ) { pos = pos->next; continue; /* Skip already checked entries */ @@ -1594,6 +1603,7 @@ static void core_init (void *cls, const struct GNUNET_PeerIdentity *identity) { + (void) cls; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CORE called, I am %s\n", GNUNET_i2s (identity)); @@ -1619,6 +1629,7 @@ check_dht_p2p_put (void *cls, uint32_t putlen; uint16_t msize; + (void) cls; msize = ntohs (put->header.size); putlen = ntohl (put->put_path_length); if ((msize < @@ -1654,7 +1665,17 @@ handle_dht_p2p_put (void *cls, struct GNUNET_CONTAINER_BloomFilter *bf; struct GNUNET_HashCode test_key; int forwarded; + struct GNUNET_TIME_Absolute exp_time; + exp_time = GNUNET_TIME_absolute_ntoh (put->expiration_time); + if (0 == GNUNET_TIME_absolute_get_remaining (exp_time).rel_value_us) + { + GNUNET_STATISTICS_update (GDS_stats, + gettext_noop ("# Expired PUTs discarded"), + 1, + GNUNET_NO); + return; + } msize = ntohs (put->header.size); putlen = ntohl (put->put_path_length); GNUNET_STATISTICS_update (GDS_stats, @@ -1790,7 +1811,7 @@ handle_dht_p2p_put (void *cls, putlen = 0; /* give to local clients */ - GDS_CLIENTS_handle_reply (GNUNET_TIME_absolute_ntoh (put->expiration_time), + GDS_CLIENTS_handle_reply (exp_time, &put->key, 0, NULL, @@ -1802,7 +1823,7 @@ handle_dht_p2p_put (void *cls, /* store locally */ if ((0 != (options & GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) || (GDS_am_closest_peer (&put->key, bf))) - GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), + GDS_DATACACHE_handle_put (exp_time, &put->key, putlen, pp, @@ -1813,7 +1834,7 @@ handle_dht_p2p_put (void *cls, forwarded = GDS_NEIGHBOURS_handle_put (ntohl (put->type), options, ntohl (put->desired_replication_level), - GNUNET_TIME_absolute_ntoh (put->expiration_time), + exp_time, ntohl (put->hop_count), bf, &put->key, @@ -1830,7 +1851,7 @@ handle_dht_p2p_put (void *cls, ntohl (put->hop_count), ntohl (put->desired_replication_level), putlen, pp, - GNUNET_TIME_absolute_ntoh (put->expiration_time), + exp_time, &put->key, payload, payload_size); @@ -1907,9 +1928,9 @@ handle_find_peer (const struct GNUNET_PeerIdentity *sender, sizeof (struct GNUNET_HashCode))) bucket_idx = closest_bucket; else - bucket_idx = GNUNET_MIN (closest_bucket, + bucket_idx = GNUNET_MIN ((int) closest_bucket, find_bucket (key)); - if (bucket_idx == GNUNET_SYSERR) + if (bucket_idx < 0) return; bucket = &k_buckets[bucket_idx]; if (bucket->peers_size == 0) @@ -2016,6 +2037,7 @@ check_dht_p2p_get (void *cls, uint32_t xquery_size; uint16_t msize; + (void) cls; msize = ntohs (get->header.size); xquery_size = ntohl (get->xquery_size); if (msize < sizeof (struct PeerGetMessage) + xquery_size) @@ -2203,6 +2225,7 @@ check_dht_p2p_result (void *cls, uint32_t put_path_length; uint16_t msize; + (void) cls; msize = ntohs (prm->header.size); put_path_length = ntohl (prm->put_path_length); get_path_length = ntohl (prm->get_path_length); @@ -2316,8 +2339,18 @@ handle_dht_p2p_result (void *cls, uint16_t msize; size_t data_size; enum GNUNET_BLOCK_Type type; + struct GNUNET_TIME_Absolute exp_time; /* parse and validate message */ + exp_time = GNUNET_TIME_absolute_ntoh (prm->expiration_time); + if (0 == GNUNET_TIME_absolute_get_remaining (exp_time).rel_value_us) + { + GNUNET_STATISTICS_update (GDS_stats, + gettext_noop ("# Expired results discarded"), + 1, + GNUNET_NO); + return; + } msize = ntohs (prm->header.size); put_path_length = ntohl (prm->put_path_length); get_path_length = ntohl (prm->get_path_length); @@ -2391,7 +2424,6 @@ handle_dht_p2p_result (void *cls, h); } - /* First, check if 'peer' is already on the path, and if so, truncate it instead of expanding. */ for (unsigned int i=0;i<=get_path_length;i++) @@ -2399,7 +2431,7 @@ handle_dht_p2p_result (void *cls, peer->id, sizeof (struct GNUNET_PeerIdentity))) { - process_reply_with_path (GNUNET_TIME_absolute_ntoh (prm->expiration_time), + process_reply_with_path (exp_time, &prm->key, i, get_path, @@ -2420,7 +2452,7 @@ handle_dht_p2p_result (void *cls, get_path_length * sizeof (struct GNUNET_PeerIdentity)); xget_path[get_path_length] = *peer->id; - process_reply_with_path (GNUNET_TIME_absolute_ntoh (prm->expiration_time), + process_reply_with_path (exp_time, &prm->key, get_path_length + 1, xget_path, -- cgit v1.2.3 From f24f95b6664f5e1d2a8e3cd6d03c957b0d2efd74 Mon Sep 17 00:00:00 2001 From: Julius Bünger Date: Tue, 12 Jun 2018 23:03:47 +0200 Subject: rps profiler: generate output for randomness tests --- src/rps/gnunet-rps-profiler.c | 21 +++- src/rps/rps-test_util.c | 219 +++++++++++++++++++++++++++++++++++++++--- src/rps/rps-test_util.h | 8 +- 3 files changed, 233 insertions(+), 15 deletions(-) diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index 5ef42187f..4a7a89b15 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c @@ -41,6 +41,11 @@ */ static uint32_t num_peers; +/** + * @brief numer of bits required to represent the largest peer id + */ +static unsigned bits_needed; + /** * How long do we run the test? * In seconds. @@ -1698,6 +1703,7 @@ profiler_reply_handle (void *cls, char *file_name; char *file_name_dh; char *file_name_dhr; + char *file_name_dhru; unsigned int i; struct PendingReply *pending_rep = (struct PendingReply *) cls; @@ -1706,6 +1712,7 @@ profiler_reply_handle (void *cls, file_name = "/tmp/rps/received_ids"; file_name_dh = "/tmp/rps/diehard_input"; file_name_dhr = "/tmp/rps/diehard_input_raw"; + file_name_dhru = "/tmp/rps/diehard_input_raw_aligned"; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "[%s] got %" PRIu64 " peers:\n", GNUNET_i2s (rps_peer->peer_id), @@ -1725,8 +1732,12 @@ profiler_reply_handle (void *cls, "%" PRIu32 "\n", (uint32_t) rcv_rps_peer->index); to_file_raw (file_name_dhr, - &rcv_rps_peer->index, + (char *) &rcv_rps_peer->index, sizeof (uint32_t)); + to_file_raw_unaligned (file_name_dhru, + (char *) &rcv_rps_peer->index, + sizeof (uint32_t), + bits_needed); } default_reply_handle (cls, n, recv_peers); } @@ -2626,6 +2637,14 @@ run (void *cls, GNUNET_DISK_directory_create ("/tmp/rps/"); timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, timeout_s); + /* Compute number of bits for representing largest peer id */ + for (bits_needed = 1; (bits_needed << 1) < num_peers - 1; bits_needed++) + ; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Need %u bits to represent largest peer id %" PRIu32 "\n", + bits_needed, + num_peers - 1); + rps_peers = GNUNET_new_array (num_peers, struct RPSPeer); peer_map = GNUNET_CONTAINER_multipeermap_create (num_peers, GNUNET_NO); rps_peer_ids = GNUNET_new_array (num_peers, struct GNUNET_PeerIdentity); diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c index ea55deac5..64ef5b986 100644 --- a/src/rps/rps-test_util.c +++ b/src/rps/rps-test_util.c @@ -29,13 +29,37 @@ #include -#define LOG(kind, ...) GNUNET_log_from(kind,"rps-sampler",__VA_ARGS__) +#define LOG(kind, ...) GNUNET_log_from(kind,"rps-test_util",__VA_ARGS__) #ifndef TO_FILE #define TO_FILE #endif /* TO_FILE */ #ifdef TO_FILE + +#define B2B_PAT "%c%c%c%c%c%c%c%c" +#define B2B(byte) \ + (byte & 0x80 ? '1' : '0'), \ + (byte & 0x40 ? '1' : '0'), \ + (byte & 0x20 ? '1' : '0'), \ + (byte & 0x10 ? '1' : '0'), \ + (byte & 0x08 ? '1' : '0'), \ + (byte & 0x04 ? '1' : '0'), \ + (byte & 0x02 ? '1' : '0'), \ + (byte & 0x01 ? '1' : '0') + +#define min(x,y) ((x) > (y) ? (y) : (x)) + +/** + * @brief buffer for storing the unaligned bits for the next write + */ +static char buf_unaligned; + +/** + * @brief number of bits in unaligned buffer + */ +static unsigned num_bits_buf_unaligned; + void to_file_ (const char *file_name, char *line) { @@ -108,11 +132,10 @@ to_file_ (const char *file_name, char *line) } void -to_file_raw (const char *file_name, void *buf, size_t size_buf) +to_file_raw (const char *file_name, const char *buf, size_t size_buf) { struct GNUNET_DISK_FileHandle *f; - size_t size2; - + size_t size_written; if (NULL == (f = GNUNET_DISK_file_open (file_name, GNUNET_DISK_OPEN_APPEND | @@ -129,13 +152,13 @@ to_file_raw (const char *file_name, void *buf, size_t size_buf) return; } - size2 = GNUNET_DISK_file_write (f, buf, size_buf); - if (size_buf != size2) + size_written = GNUNET_DISK_file_write (f, buf, size_buf); + if (size_buf != size_written) { LOG (GNUNET_ERROR_TYPE_WARNING, - "Unable to write to file! (Size: %u, size2: %u)\n", + "Unable to write to file! (Size: %u, size_written: %u)\n", size_buf, - size2); + size_written); if (GNUNET_YES != GNUNET_DISK_file_close (f)) LOG (GNUNET_ERROR_TYPE_WARNING, @@ -143,15 +166,185 @@ to_file_raw (const char *file_name, void *buf, size_t size_buf) return; } +} - //if (512 < size_buf) +void +to_file_raw_unaligned (const char *file_name, + const char *buf, + size_t size_buf, + unsigned bits_needed) +{ + // TODO endianness! + GNUNET_assert (size_buf >= (bits_needed/8)); + //if (0 == num_bits_buf_unaligned) //{ - // GNUNET_free (output_buffer_p); + // if (0 == (bits_needed % 8)) + // { + // to_file_raw (file_name, buf, size_buf); + // return; + // } + // to_file_raw (file_name, buf, size_buf - 1); + // buf_unaligned = buf[size_buf - 1]; + // num_bits_buf_unaligned = bits_needed % 8; + // return; //} - //if (GNUNET_YES != GNUNET_DISK_file_close (f)) - // LOG (GNUNET_ERROR_TYPE_WARNING, - // "Unable to close file\n"); + char buf_write[size_buf + 1]; + const unsigned bytes_iter = (0 != bits_needed % 8? + (bits_needed/8)+1: + bits_needed/8); + // TODO what if no iteration happens? + unsigned size_buf_write = 0; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "num_bits_buf_unaligned: %u\n", + num_bits_buf_unaligned); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "ua args: size_buf: %u, bits_needed: %u -> iter: %u\n", + size_buf, + bits_needed, + bytes_iter); + buf_write[0] = buf_unaligned; + /* Iterate over input bytes */ + for (unsigned i = 0; i < bytes_iter; i++) + { + /* Number of bits needed in this iteration - 8 for all except last iter */ + unsigned num_bits_needed_iter; + /* Mask for bits to actually use */ + unsigned mask_bits_needed_iter; + char byte_input; + /* Number of bits needed to align unaligned byte */ + unsigned num_bits_to_align; + /* Number of bits that are to be moved */ + unsigned num_bits_to_move; + /* Mask for bytes to be moved */ + char mask_input_to_move; + /* Masked bits to be moved */ + char bits_to_move; + /* The amount of bits needed to fit the bits to shift to the nearest spot */ + unsigned distance_shift_bits; + /* Shifted bits on the move */ + char bits_moving; + /* (unaligned) byte being filled with bits */ + char byte_to_fill; + /* mask for needed bits of the input byte that have not been moved */ + char mask_input_leftover; + /* needed bits of the input byte that have not been moved */ + char byte_input_leftover; + unsigned num_bits_leftover; + unsigned num_bits_discard; + char byte_unaligned_new; + + if ( (bits_needed - (i * 8)) <= 8) + { + /* last iteration */ + num_bits_needed_iter = bits_needed - (i * 8); + } + else + { + num_bits_needed_iter = 8; + } + LOG (GNUNET_ERROR_TYPE_DEBUG, + "number of bits needed in this iteration: %u\n", + num_bits_needed_iter); + mask_bits_needed_iter = ((char) 1 << num_bits_needed_iter) - 1; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "mask needed bits (current iter): "B2B_PAT"\n", + B2B(mask_bits_needed_iter)); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Unaligned byte: "B2B_PAT" (%u bits)\n", + B2B(buf_unaligned), + num_bits_buf_unaligned); + byte_input = buf[i]; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "next whole input byte: "B2B_PAT"\n", + B2B(byte_input)); + byte_input &= mask_bits_needed_iter; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "input byte, needed bits: "B2B_PAT"\n", + B2B(byte_input)); + num_bits_to_align = 8 - num_bits_buf_unaligned; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "number of bits needed to align unaligned bit: %u\n", + num_bits_to_align); + num_bits_to_move = min (num_bits_to_align, num_bits_needed_iter); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "number of bits of new byte to move: %u\n", + num_bits_to_move); + mask_input_to_move = ((char) 1 << num_bits_to_move) - 1; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "mask of bits of new byte to take for moving: "B2B_PAT"\n", + B2B(mask_input_to_move)); + bits_to_move = byte_input & mask_input_to_move; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "masked bits of new byte to take for moving: "B2B_PAT"\n", + B2B(bits_to_move)); + distance_shift_bits = num_bits_buf_unaligned; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "distance needed to shift bits to their correct spot: %u\n", + distance_shift_bits); + bits_moving = bits_to_move << distance_shift_bits; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "shifted, masked bits of new byte being moved: "B2B_PAT"\n", + B2B(bits_moving)); + byte_to_fill = buf_unaligned | bits_moving; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "byte being filled: "B2B_PAT"\n", + B2B(byte_to_fill)); + if (num_bits_buf_unaligned + num_bits_needed_iter > 8) + { + /* buf_unaligned was aligned by filling + * -> can be written to storage */ + buf_write[i] = byte_to_fill; + size_buf_write++; + + /* store the leftover, unaligned bits in buffer */ + mask_input_leftover = mask_bits_needed_iter & (~ mask_input_to_move); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "mask of leftover bits of new byte: "B2B_PAT"\n", + B2B(mask_input_leftover)); + byte_input_leftover = byte_input & mask_input_leftover; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "masked, leftover bits of new byte: "B2B_PAT"\n", + B2B(byte_input_leftover)); + num_bits_leftover = num_bits_needed_iter - num_bits_to_move; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "number of unaligned bits left: %u\n", + num_bits_leftover); + num_bits_discard = 8 - num_bits_needed_iter; + byte_unaligned_new = byte_input_leftover >> num_bits_to_move; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "new unaligned byte: "B2B_PAT"\n", + B2B(byte_unaligned_new)); + buf_unaligned = byte_unaligned_new; + num_bits_buf_unaligned = num_bits_leftover % 8; + } + else + { + /* unaligned buffer still unaligned but 'fuller' */ + buf_unaligned = byte_to_fill; + num_bits_buf_unaligned = (num_bits_buf_unaligned + bits_needed) % 8; + } + ///* Byte to be completed will consist of what is left in the unaligned + // * byte and the rest of the input byte */ + //LOG (GNUNET_ERROR_TYPE_DEBUG, + // "ua: %u - %x, %x << %u = %x\n", + // i, + // buf_unaligned, + // num_bits_buf_unaligned, + // (char) ((char) buf_unaligned << num_bits_buf_unaligned)); + //buf_write[i] = buf_write[i] | + // (char) ((char) buf_unaligned << num_bits_buf_unaligned); + //LOG (GNUNET_ERROR_TYPE_DEBUG, + // "ua: %x\n", + // buf_write[i]); + //buf_unaligned = buf[i] >> num_bits_buf_unaligned; + //LOG (GNUNET_ERROR_TYPE_DEBUG, + // "ua: %x\n" + // "---\n", + // buf_unaligned); + } + to_file_raw (file_name, buf_write, size_buf_write); + LOG (GNUNET_ERROR_TYPE_DEBUG, "\n"); } char * diff --git a/src/rps/rps-test_util.h b/src/rps/rps-test_util.h index d42422750..577a2b0a7 100644 --- a/src/rps/rps-test_util.h +++ b/src/rps/rps-test_util.h @@ -75,7 +75,13 @@ store_prefix_file_name (const struct GNUNET_PeerIdentity *peer, const char *prefix); void -to_file_raw (const char *file_name, void *buf, size_t size_buf); +to_file_raw (const char *file_name, const char *buf, size_t size_buf); + +void +to_file_raw_unaligned (const char *file_name, + const char *buf, + size_t size_buf, + unsigned bits_needed); #endif /* RPS_TEST_UTIL_H */ /* end of gnunet-service-rps.c */ -- cgit v1.2.3 From 8503c6fa26449228fa691c1dedfe3ca1a8d0b9ba Mon Sep 17 00:00:00 2001 From: Julius Bünger Date: Tue, 12 Jun 2018 23:07:53 +0200 Subject: rps profiler: cleaned debug output --- src/rps/rps-test_util.c | 86 ------------------------------------------------- 1 file changed, 86 deletions(-) diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c index 64ef5b986..9a1dfe0d8 100644 --- a/src/rps/rps-test_util.c +++ b/src/rps/rps-test_util.c @@ -37,17 +37,6 @@ #ifdef TO_FILE -#define B2B_PAT "%c%c%c%c%c%c%c%c" -#define B2B(byte) \ - (byte & 0x80 ? '1' : '0'), \ - (byte & 0x40 ? '1' : '0'), \ - (byte & 0x20 ? '1' : '0'), \ - (byte & 0x10 ? '1' : '0'), \ - (byte & 0x08 ? '1' : '0'), \ - (byte & 0x04 ? '1' : '0'), \ - (byte & 0x02 ? '1' : '0'), \ - (byte & 0x01 ? '1' : '0') - #define min(x,y) ((x) > (y) ? (y) : (x)) /** @@ -195,14 +184,6 @@ to_file_raw_unaligned (const char *file_name, bits_needed/8); // TODO what if no iteration happens? unsigned size_buf_write = 0; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "num_bits_buf_unaligned: %u\n", - num_bits_buf_unaligned); - LOG (GNUNET_ERROR_TYPE_DEBUG, - "ua args: size_buf: %u, bits_needed: %u -> iter: %u\n", - size_buf, - bits_needed, - bytes_iter); buf_write[0] = buf_unaligned; /* Iterate over input bytes */ for (unsigned i = 0; i < bytes_iter; i++) @@ -243,53 +224,16 @@ to_file_raw_unaligned (const char *file_name, { num_bits_needed_iter = 8; } - LOG (GNUNET_ERROR_TYPE_DEBUG, - "number of bits needed in this iteration: %u\n", - num_bits_needed_iter); mask_bits_needed_iter = ((char) 1 << num_bits_needed_iter) - 1; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "mask needed bits (current iter): "B2B_PAT"\n", - B2B(mask_bits_needed_iter)); - LOG (GNUNET_ERROR_TYPE_DEBUG, - "Unaligned byte: "B2B_PAT" (%u bits)\n", - B2B(buf_unaligned), - num_bits_buf_unaligned); byte_input = buf[i]; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "next whole input byte: "B2B_PAT"\n", - B2B(byte_input)); byte_input &= mask_bits_needed_iter; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "input byte, needed bits: "B2B_PAT"\n", - B2B(byte_input)); num_bits_to_align = 8 - num_bits_buf_unaligned; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "number of bits needed to align unaligned bit: %u\n", - num_bits_to_align); num_bits_to_move = min (num_bits_to_align, num_bits_needed_iter); - LOG (GNUNET_ERROR_TYPE_DEBUG, - "number of bits of new byte to move: %u\n", - num_bits_to_move); mask_input_to_move = ((char) 1 << num_bits_to_move) - 1; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "mask of bits of new byte to take for moving: "B2B_PAT"\n", - B2B(mask_input_to_move)); bits_to_move = byte_input & mask_input_to_move; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "masked bits of new byte to take for moving: "B2B_PAT"\n", - B2B(bits_to_move)); distance_shift_bits = num_bits_buf_unaligned; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "distance needed to shift bits to their correct spot: %u\n", - distance_shift_bits); bits_moving = bits_to_move << distance_shift_bits; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "shifted, masked bits of new byte being moved: "B2B_PAT"\n", - B2B(bits_moving)); byte_to_fill = buf_unaligned | bits_moving; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "byte being filled: "B2B_PAT"\n", - B2B(byte_to_fill)); if (num_bits_buf_unaligned + num_bits_needed_iter > 8) { /* buf_unaligned was aligned by filling @@ -299,22 +243,10 @@ to_file_raw_unaligned (const char *file_name, /* store the leftover, unaligned bits in buffer */ mask_input_leftover = mask_bits_needed_iter & (~ mask_input_to_move); - LOG (GNUNET_ERROR_TYPE_DEBUG, - "mask of leftover bits of new byte: "B2B_PAT"\n", - B2B(mask_input_leftover)); byte_input_leftover = byte_input & mask_input_leftover; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "masked, leftover bits of new byte: "B2B_PAT"\n", - B2B(byte_input_leftover)); num_bits_leftover = num_bits_needed_iter - num_bits_to_move; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "number of unaligned bits left: %u\n", - num_bits_leftover); num_bits_discard = 8 - num_bits_needed_iter; byte_unaligned_new = byte_input_leftover >> num_bits_to_move; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "new unaligned byte: "B2B_PAT"\n", - B2B(byte_unaligned_new)); buf_unaligned = byte_unaligned_new; num_bits_buf_unaligned = num_bits_leftover % 8; } @@ -324,24 +256,6 @@ to_file_raw_unaligned (const char *file_name, buf_unaligned = byte_to_fill; num_bits_buf_unaligned = (num_bits_buf_unaligned + bits_needed) % 8; } - ///* Byte to be completed will consist of what is left in the unaligned - // * byte and the rest of the input byte */ - //LOG (GNUNET_ERROR_TYPE_DEBUG, - // "ua: %u - %x, %x << %u = %x\n", - // i, - // buf_unaligned, - // num_bits_buf_unaligned, - // (char) ((char) buf_unaligned << num_bits_buf_unaligned)); - //buf_write[i] = buf_write[i] | - // (char) ((char) buf_unaligned << num_bits_buf_unaligned); - //LOG (GNUNET_ERROR_TYPE_DEBUG, - // "ua: %x\n", - // buf_write[i]); - //buf_unaligned = buf[i] >> num_bits_buf_unaligned; - //LOG (GNUNET_ERROR_TYPE_DEBUG, - // "ua: %x\n" - // "---\n", - // buf_unaligned); } to_file_raw (file_name, buf_write, size_buf_write); LOG (GNUNET_ERROR_TYPE_DEBUG, "\n"); -- cgit v1.2.3 From 01b37d9db39d96fc05dcdea8c35a3d62408cda59 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 13 Jun 2018 07:32:04 +0000 Subject: doc: Add new files to Makefile. Signed-off-by: Nils Gillmann --- doc/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 1070974d1..f60bde084 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,4 +7,5 @@ if !DOCUMENTATION endif EXTRA_DIST = \ - outdated-and-old-installation-instructions.txt + system_specific/outdated-and-old-installation-instructions.txt \ + system_specific/FROM_SOURCE -- cgit v1.2.3 From 1f7a2dd68d1e6260fad4af042878c0a07d39bc12 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 13 Jun 2018 08:01:51 +0000 Subject: some changes and work in user handbook. Signed-off-by: Nils Gillmann --- doc/documentation/chapters/user.texi | 48 ++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/doc/documentation/chapters/user.texi b/doc/documentation/chapters/user.texi index 48fcc04c3..b5457cf15 100644 --- a/doc/documentation/chapters/user.texi +++ b/doc/documentation/chapters/user.texi @@ -2,20 +2,21 @@ @chapter Using GNUnet @c %**end of header -This tutorial is supposed to give a first introduction for end-users -trying to do something "real" with GNUnet. Installation and +This tutorial is supposed to give a first introduction for users +trying to do something real with GNUnet. Installation and configuration are specifically outside of the scope of this tutorial. Instead, we start by briefly checking that the installation works, and then dive into uncomplicated, concrete practical things that can be done -with the network. +with the framework provided by GNUnet. -This chapter of the GNUnet Reference Documentation documents -how to use the various peer-to-peer applications of the +In short, this chapter of the ``GNUnet Reference Documentation'' will +show you how to use the various peer-to-peer applications of the GNUnet system. -As GNUnet evolves, we will add new chapters for the various +As GNUnet evolves, we will add new sections for the various applications that are being created. -Comments and extensions of this documentation are always welcome. +Comments on the content of this chapter, and extensions of it are +always welcome. @menu @@ -35,10 +36,11 @@ Comments and extensions of this documentation are always welcome. @section Checking the Installation @c %**end of header -This section describes a quick casual way to check if your GNUnet +This section describes a quick, casual way to check if your GNUnet installation works. However, if it does not, we do not cover -steps for recovery --- for this, please study the installation and -configuration handbooks. +steps for recovery --- for this, please study the instructions +provided in the developer handbook as well as the system-specific +instruction in the source code repository@footnote{The system specific instructions are not provided as part of this handbook!}. @menu @@ -47,13 +49,16 @@ configuration handbooks. * Peer Information:: @end menu +@cindex GNUnet GTK +@cindex GTK +@cindex GTK user interface @node gnunet-gtk @subsection gnunet-gtk @c %**end of header The @command{gnunet-gtk} package contains several graphical user interfaces for the respective GNUnet applications. -Those currently are: +Currently these interfaces cover: @itemize @bullet @item Statistics @@ -68,20 +73,21 @@ Those currently are: @subsection Statistics @c %**end of header -First, you should launch the graphical user interface. You can do -this from the command-line by typing +First, you should launch GNUnet gtk@footnote{Obviously you should also start gnunet, via gnunet-arm or the system provided method}. +You can do this from the command-line by typing @example -$ gnunet-statistics-gtk +gnunet-statistics-gtk @end example -If your peer is running correctly, you should see a bunch of -lines, all of which should be "significantly" above zero (at least if your -peer has been running for a few seconds). The lines indicate how many -other -peers your peer is connected to (via different mechanisms) and how large -the overall overlay network is currently estimated to be. The X-axis -represents time (in seconds since the start of @command{gnunet-gtk}). +If your peer@footnote{The term ``peer'' is a common word used in federated and distributed networks to describe a participating device which is connected to the network. Thus, your Personal Computer or whatever it is you are looking at the Gtk+ interface describes a ``Peer'' or a ``Node''.} +is running correctly, you should see a bunch of lines, +all of which should be ``significantly'' above zero (at least if your +peer has been running for more than a few seconds). The lines indicate +how many other peers your peer is connected to (via different +mechanisms) and how large the entire overlay network is currently +estimated to be. The X-axis represents time (in seconds since the +start of @command{gnunet-gtk}). You can click on "Traffic" to see information about the amount of bandwidth your peer has consumed, and on "Storage" to check the amount -- cgit v1.2.3 From e82af68d63c88ea674dab3994fc7a4bb32ebdd23 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 13 Jun 2018 08:52:41 +0000 Subject: seems like mysql is currently broken in Guix Signed-off-by: Nils Gillmann --- contrib/scripts/documentation/gnunet-doc.scm | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/contrib/scripts/documentation/gnunet-doc.scm b/contrib/scripts/documentation/gnunet-doc.scm index 4ae23b298..077efacad 100644 --- a/contrib/scripts/documentation/gnunet-doc.scm +++ b/contrib/scripts/documentation/gnunet-doc.scm @@ -76,17 +76,17 @@ (string-append (current-source-directory) "/../../../")) source-file?)))) - (package + (package (name "gnunet-doc") (version (string-append "0.10.1-" revision "." "dev")) (source (local-file ;;"../../.." - ;;%source-dir - ;;(string-append (getcwd) "/../../../") - (string-append (getcwd)) ;drrty hack and this assumes one static position FIXME! - #:recursive? #t)) - ;;#:select? (git-predicate %source-dir))) - ;;#:select? (force select?))) + ;;%source-dir + ;;(string-append (getcwd) "/../../../") + (string-append (getcwd)) ;drrty hack and this assumes one static position FIXME! + #:recursive? #t)) + ;;#:select? (git-predicate %source-dir))) + ;;#:select? (force select?))) (build-system gnu-build-system) (inputs `(("glpk" ,glpk) @@ -105,7 +105,7 @@ ("pulseaudio" ,pulseaudio) ("sqlite" ,sqlite) ("postgresql" ,postgresql) - ("mysql" ,mysql) + ("mysql" ,mariadb) ("zlib" ,zlib) ("perl" ,perl) ("python-2" ,python-2) ; tests and gnunet-qr @@ -145,34 +145,34 @@ (chdir "doc/documentation") ;;(zero? (system* "make" "dev-build")))) (zero? (system* "sh" "run-gendocs.sh")))) - ;; (zero? (system* "make" "pdf")) - ;; (zero? (system* "make" "html")) - ;; (zero? (system* "make" "info")))) - ;;(zero? (system* "make" "doc-all-give-me-the-noise")))) + ;; (zero? (system* "make" "pdf")) + ;; (zero? (system* "make" "html")) + ;; (zero? (system* "make" "info")))) + ;;(zero? (system* "make" "doc-all-give-me-the-noise")))) (replace 'install (lambda _ (zero? (system* "make" "doc-gendoc-install"))))))) - ;;(lambda* (#:key outputs #:allow-other-keys) - ;; (let* ((out (assoc-ref outputs "out")) - ;; (doc (string-append out "/share/doc/gnunet"))) - ;; (mkdir-p doc) - ;; (copy-recursively "images" - ;; (string-append doc - ;; "/images")) - ;; (mkdir-p (string-append doc "/gnunet")) - ;; (install-file "gnunet.pdf" doc) - ;; (install-file "gnunet.info" doc) - ;; (install-file "gnunet.log" doc) ;TODO: Move to 'dev' output? - ;; (copy-recursively "gnunet" - ;; (string-append doc - ;; "/gnunet")) - ;; (install-file "gnunet-c-tutorial.pdf" doc) - ;; (install-file "gnunet-c-tutorial.info" doc) - ;; (install-file "gnunet-c-tutorial.log" doc) ;TODO: Move to 'dev' output? - ;; (copy-recursively "gnunet-c-tutorial" - ;; (string-append doc - ;; "/gnunet-c-tutorial"))) - ;; #t))))) + ;;(lambda* (#:key outputs #:allow-other-keys) + ;; (let* ((out (assoc-ref outputs "out")) + ;; (doc (string-append out "/share/doc/gnunet"))) + ;; (mkdir-p doc) + ;; (copy-recursively "images" + ;; (string-append doc + ;; "/images")) + ;; (mkdir-p (string-append doc "/gnunet")) + ;; (install-file "gnunet.pdf" doc) + ;; (install-file "gnunet.info" doc) + ;; (install-file "gnunet.log" doc) ;TODO: Move to 'dev' output? + ;; (copy-recursively "gnunet" + ;; (string-append doc + ;; "/gnunet")) + ;; (install-file "gnunet-c-tutorial.pdf" doc) + ;; (install-file "gnunet-c-tutorial.info" doc) + ;; (install-file "gnunet-c-tutorial.log" doc) ;TODO: Move to 'dev' output? + ;; (copy-recursively "gnunet-c-tutorial" + ;; (string-append doc + ;; "/gnunet-c-tutorial"))) + ;; #t))))) (synopsis "Documentation of GNUnet") (description "GNUnet documentation build") -- cgit v1.2.3 From 787d5e9e1688ccb07f1449614a5286ccb4acf3fd Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 13 Jun 2018 08:53:02 +0000 Subject: fix Signed-off-by: Nils Gillmann --- doc/documentation/chapters/developer.texi | 13 ++++++------- doc/documentation/chapters/user.texi | 2 -- doc/documentation/gnunet.texi | 5 ++--- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/doc/documentation/chapters/developer.texi b/doc/documentation/chapters/developer.texi index 16039c8d3..d33072057 100644 --- a/doc/documentation/chapters/developer.texi +++ b/doc/documentation/chapters/developer.texi @@ -2,7 +2,7 @@ @node GNUnet Developer Handbook @chapter GNUnet Developer Handbook -This book is intended to be an introduction for programmers that want to +0This book is intended to be an introduction for programmers that want to extend the GNUnet framework. GNUnet is more than a simple peer-to-peer application. @@ -40,7 +40,7 @@ new chapters, sections or insightful comments. @menu * Developer Introduction:: -* Internal Dependencies:: +* Internal dependencies:: * Code overview:: * System Architecture:: * Subsystem stability:: @@ -1184,7 +1184,7 @@ section in the @file{README} file. First, we need to build or install (depending on your OS) the following packages. If you build them from source, build them in this exact order: -@exmaple +@example libgpgerror, libgcrypt, libnettle, libunbound, GnuTLS (with libunbound support) @end example @@ -1301,10 +1301,9 @@ You can find specific, detailed instructions for installing of the dependencies (and possibly the rest of the GNUnet installation) in the platform-specific descriptions, which can be found in the Index. Please consult them now. -If your distribution is not listed, please study -@ref{Build instructions for Debian 8}, the build instructions for -Debian stable, carefully as you try to install the dependencies for your -own distribution. +If your distribution is not listed, please study the build +instructions for Debian stable, carefully as you try to install the +dependencies for your own distribution. Contributing additional instructions for further platforms is always appreciated. Please take in mind that operating system development tends to move at diff --git a/doc/documentation/chapters/user.texi b/doc/documentation/chapters/user.texi index b5457cf15..422619f84 100644 --- a/doc/documentation/chapters/user.texi +++ b/doc/documentation/chapters/user.texi @@ -2258,8 +2258,6 @@ list of peers can contact it to download this list. To download this hostlist the peer uses HTTP. For this reason you have to build your peer with libgnurl (or libcurl) and microhttpd support. -How you build your peer with these options can be found here: -@xref{Generic installation instructions}. To configure your peer to act as a bootstrap server you have to add the @command{-p} option to @code{OPTIONS} in the @code{[hostlist]} section diff --git a/doc/documentation/gnunet.texi b/doc/documentation/gnunet.texi index 618915501..e1847c227 100644 --- a/doc/documentation/gnunet.texi +++ b/doc/documentation/gnunet.texi @@ -75,7 +75,6 @@ This document is the Reference Manual for GNUnet version @value{VERSION}. * Preface:: Chapter 0 * Philosophy:: About GNUnet @c * Vocabulary:: Vocabulary -* GNUnet Installation Handbook:: How to install GNUnet * Using GNUnet:: Using GNUnet @c * Configuration Handbook:: Configuring GNUnet * GNUnet Contributors Handbook:: Contributing to GNUnet @@ -136,7 +135,7 @@ GNUnet Contributors Handbook GNUnet Developer Handbook * Developer Introduction:: -* Internal Dependencies:: +* Internal dependencies:: * Code overview:: * System Architecture:: * Subsystem stability:: @@ -144,7 +143,7 @@ GNUnet Developer Handbook * Build-system:: * Developing extensions for GNUnet using the gnunet-ext template:: * Writing testcases:: -* Building GNUNet and its dependencies:: +* Building GNUnet and its dependencies:: * TESTING library:: * Performance regression analysis with Gauger:: * TESTBED Subsystem:: -- cgit v1.2.3 From d3e47663546fc190fb6bf34674de61cc723e7380 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 13 Jun 2018 09:02:54 +0000 Subject: fix Signed-off-by: Nils Gillmann --- contrib/Makefile.am | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/Makefile.am b/contrib/Makefile.am index a3cc081b7..27b1d01bc 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -34,9 +34,6 @@ dist_pkgdata_DATA = \ branding/logo/gnunet-logo-color.png \ testing_hostkeys.ecc -bin_PROGRAMS = \ - scripts/gnunet-bugreport - if MINGW tap32_DATA = \ 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys \ @@ -128,6 +125,7 @@ install-data-local: $(INSTALL_DATA) $$hello $(DESTDIR)$(pkghellodir)/ ; \ fi \ done + install scripts/gnunet-bugreport $(bindir)/gnunet-bugreport dist-hook: if test -d $(srcdir)/hellos; then \ -- cgit v1.2.3 From 9417d4af8052c4983a5eab6cb0a678d55c779188 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 13 Jun 2018 09:07:13 +0000 Subject: mariadb Signed-off-by: Nils Gillmann --- guix-env.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix-env.scm b/guix-env.scm index 64f7da06b..d905ab716 100644 --- a/guix-env.scm +++ b/guix-env.scm @@ -96,7 +96,7 @@ ("pulseaudio" ,pulseaudio) ("sqlite" ,sqlite) ("postgresql" ,postgresql) - ("mysql" ,mysql) + ("mysql" ,mariadb) ("zlib" ,zlib) ("perl" ,perl) ("python-2" ,python-2) ; tests and gnunet-qr -- cgit v1.2.3 From e532e871ca89b8a78700756fef1284de15f479c8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 13 Jun 2018 18:09:02 +0200 Subject: remove dead file --- po/POTFILES.in | 1 - 1 file changed, 1 deletion(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index dd9966302..28f51f366 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -460,7 +460,6 @@ src/util/container_multihashmap.c src/util/container_multipeermap.c src/util/container_multishortmap.c src/util/crypto_abe.c -src/util/crypto_bug.c src/util/crypto_crc.c src/util/crypto_ecc.c src/util/crypto_ecc_dlog.c -- cgit v1.2.3 From 1a7fbccc8b3fd6fc070d134892e736503286ef1b Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 13 Jun 2018 18:38:08 +0200 Subject: Expanding libgnunetcurl. Adding a method to let the user append a custom request header. --- src/curl/curl.c | 19 +++++++++++++++++++ src/include/gnunet_curl_lib.h | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/curl/curl.c b/src/curl/curl.c index 2d0b09d92..cdd39ab8e 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -447,6 +447,25 @@ download_get_result (struct DownloadBuffer *db, } +/** + * Add custom request header. + * + * @param ctx cURL context. + * @param header header string; will be given to the context AS IS. + * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. + */ +int +GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx, + const char *header) +{ + ctx->json_header = curl_slist_append (ctx->json_header, + header); + if (NULL == ctx->json_header) + return GNUNET_SYSERR; + + return GNUNET_OK; +} + /** * Run the main event loop for the Taler interaction. * diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index 17e9aeea4..2b2442a52 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -98,6 +98,17 @@ GNUNET_CURL_get_select_info (struct GNUNET_CURL_Context *ctx, long *timeout); +/** + * Add custom request header. + * + * @param ctx cURL context. + * @param header header string; will be given to the context AS IS. + * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. + */ +int +GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx, + const char *header); + /** * Run the main event loop for the CURL interaction. * -- cgit v1.2.3 From c9b52f6ce67209e000d2f679a34c23bd4724b243 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Wed, 13 Jun 2018 18:40:58 +0200 Subject: update dockerfile --- contrib/ci/docker/Dockerfile | 59 +++++++++++++------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/contrib/ci/docker/Dockerfile b/contrib/ci/docker/Dockerfile index 974e41a5e..42c64eaf3 100644 --- a/contrib/ci/docker/Dockerfile +++ b/contrib/ci/docker/Dockerfile @@ -1,57 +1,32 @@ -from fedora:26 +FROM ubuntu:18.04 # Install the required build tools -RUN dnf -y update && dnf -y install which git automake texinfo gettext-devel autoconf libtool libtool-ltdl-devel libidn-devel libunistring-devel glpk libextractor-devel libmicrohttpd-devel gnutls libgcrypt-devel jansson-devel sqlite-devel npm +RUN apt update && apt install -y apt git autopoint automake texinfo gettext autoconf libtool libidn11-dev libunistring-dev gnutls-dev libgcrypt20 libgcrypt20-dev libjansson-dev libsqlite3-dev wget flex bison libglib2.0-dev libgmp3-dev libmicrohttpd-dev libglpk-dev libextractor-dev +# Install gnurl from source at version gnurl-7.54.0 WORKDIR /usr/src +RUN git clone https://git.taler.net/gnurl.git --branch gnurl-7.57.0 +RUN cd /usr/src/gnurl && autoreconf -i && ./configure --prefix=/usr --disable-ntlm-wb && make install -# Install gnurl -RUN wget https://ftp.gnu.org/gnu/gnunet/gnurl-7.59.0.tar.gz -RUN tar xvzpf gnurl-7.59.0.tar.gz -WORKDIR /usr/src/gnurl-7.59.0 -RUN autoreconf -i -RUN ./configure --disable-ntlm-wb -RUN make install +# Install libpbc WORKDIR /usr/src +RUN wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz && tar xvzpf pbc-0.5.14.tar.gz && cd /usr/src/pbc-0.5.14 && ./configure --prefix=/usr && make install -RUN dnf -y install wget flex bison - -# Install libpbc -RUN wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz -RUN tar xvzpf pbc-0.5.14.tar.gz -WORKDIR /usr/src/pbc-0.5.14 -RUN ./configure --prefix=/usr -RUN make install +# Install libbswabe WORKDIR /usr/src +RUN git clone https://github.com/schanzen/libgabe.git && cd /usr/src/libgabe && ./configure --prefix=/usr && make install -RUN dnf -y install glib2-devel +WORKDIR /usr/src +RUN git clone git://gnunet.org/gnunet.git +RUN cd /usr/src/gnunet && ./bootstrap && ./configure --enable-experimental --prefix=/usr && make && make install -# Install libbswabe -RUN git clone https://github.com/schanzen/libgabe.git -WORKDIR /usr/src/libgabe -RUN ./configure --prefix=/usr -RUN make install - -# Install WebUI -WORKDIR /usr/src/ -RUN git clone https://github.com/schanzen/gnunet-webui.git -WORKDIR /usr/src/gnunet-webui -RUN git checkout gnuidentity - -RUN mkdir /usr/src/gnunet -WORKDIR /usr/src/gnunet -ADD . . -ARG NUM_JOBS -RUN ./bootstrap -RUN ./configure --prefix=/usr/local -RUN make -j$NUM_JOBS -RUN make install - -RUN groupadd gnunetdns -RUN adduser -S -m -h /var/lib/gnunet gnunet +RUN addgroup gnunetdns && addgroup gnunet && adduser --system --home /var/lib/gnunet gnunet RUN chown gnunet:gnunet /var/lib/gnunet RUN echo '[arm]\nSYSTEM_ONLY = YES\nUSER_ONLY = NO\n' > /etc/gnunet.conf ADD docker-entrypoint.sh . -CMD ["sh", "docker-entrypoint.sh"] +RUN rm -rf /usr/src/* +#RUN apt remove gcc + +CMD ["sh", "docker-entrypoint.sh"] -- cgit v1.2.3