installation.texi 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496
  1. @node Installing GNUnet
  2. @chapter Installing GNUnet
  3. This guide is intended for those who want to install Gnunet from
  4. source. For instructions on how to install GNUnet as a binary package
  5. please refer to the official documentation of your operating system or
  6. package manager.
  7. For understanding this guide properly it is important to know that
  8. there are two different ways of running GNUnet:
  9. @itemize @bullet
  10. @item the @emph{single-user setup}
  11. @item the @emph{multi-user setup}
  12. @end itemize
  13. The latter variant has a better security model and requires extra
  14. preparation before running @code{make install} and a different
  15. configuration. Beginners who want to quickly try out GNUnet can
  16. use the @emph{single-user setup}.
  17. @menu
  18. * Installing dependencies::
  19. * Getting the Source Code::
  20. * Create user and groups for the system services::
  21. * Preparing and Compiling the Source Code::
  22. * Installation::
  23. * Minimal configuration::
  24. * Checking the Installation::
  25. * The graphical configuration interface::
  26. * Config Leftovers::
  27. @end menu
  28. @c -----------------------------------------------------------------------
  29. @node Installing dependencies
  30. @section Installing dependencies
  31. GNUnet needs few libraries and applications for being able to run and
  32. another few optional ones for using certain features. Preferably they
  33. should be installed with a package manager.
  34. The mandatory libraries and applications are
  35. @itemize @bullet
  36. @item autoconf 2.59 or above
  37. @item automake 1.11.1 or above
  38. @item gettext
  39. @item glibc (read below, other libcs work)
  40. @item GnuTLS 3.2.12 or above, recommended to be linked against libunbound
  41. @item GNU make 4.0 or higher (other make implementations do work)
  42. @item iptables (on Linux systems)
  43. @item libtool 2.2 or above
  44. @item libltdl (part of libtool)
  45. @item libgcrypt 1.6 or above
  46. @item libidn2 or libidn
  47. @item libmicrohttpd 0.9.63 or above
  48. @item libunistring
  49. @item libgmp
  50. @item libgnurl or libcurl (libcurl has to be linked to GnuTLS) 7.35.0 or above
  51. @item Texinfo 5.2 or above (for building the documentation)
  52. @item Texlive 2012 or above (for building the documentation, and for gnunet-bcd)
  53. @item makeinfo 4.8 or above
  54. @item pkgconf (or pkg-config)
  55. @item zlib
  56. @end itemize
  57. Glibc is required for certain NSS features:
  58. @example
  59. One mechanism of integrating GNS with legacy applications via NSS is
  60. not available if this is disabled. But applications that don't use the
  61. glibc for NS resolution won't work anyway with this, so little is lost
  62. on *BSD systems.
  63. GNS via direct use or via the HTTP or DNS proxies is unaffected.
  64. @end example
  65. Other libcs should work, the resulting builds just don't include the
  66. glibc NSS specific code. One example is the build against NetBSD's libc
  67. as detailed in @uref{https://bugs.gnunet.org/view.php?id=5605}.
  68. In addition GNUnet needs at least one of these three databases
  69. (at the minimum sqlite3)
  70. @itemize @bullet
  71. @item sqlite + libsqlite 3.8 or above (the default, requires no further configuration)
  72. @item postgres + libpq
  73. @item mysql + libmysqlclient
  74. @end itemize
  75. These are the dependencies only required for certain features
  76. @itemize @bullet
  77. @item miniupnpc (for traversing NAT boxes more reliably)
  78. @item libnss
  79. @item libopus (for running the GNUnet conversation telephony application)
  80. @item libogg (for running the GNUnet conversation telephony application)
  81. @item gstreamer OR libpulse (for running the GNUnet conversation telephony application)
  82. @item bluez (for bluetooth support)
  83. @item libextractor (optional but highly recommended, read below)
  84. @item libpbc
  85. (for attribute-based encryption and the identity provider subsystem)
  86. @item libgabe
  87. (for attribute-based encryption and the identity provider subsystem)
  88. @item texi2mdoc (for automatic mdoc generation)
  89. @item perl5 for some utilities (which are not installed)
  90. @item libjanson
  91. @end itemize
  92. About libextractor being optional:
  93. @example
  94. While libextractor ("LE") is optional, it is recommended to build gnunet
  95. against it. If you install it later, you won't benefit from libextractor.
  96. If you are a distributor, we recommend to split LE into basis + plugins
  97. rather than making LE an option as an afterthought by the user. LE
  98. itself is very small, but its dependency chain on first, second, third
  99. etc level can be big. There is a small effect on privacy if your LE
  100. build differs from one which includes all plugins (plugins are build as
  101. shared objects): if users publish a directory with a mixture of file
  102. types (for example mpeg, jpeg, png, gif) the configuration of LE could
  103. leak which plugins are installed for which filetypes are not providing
  104. more details. However, this leak is just a minor concern.
  105. @end example
  106. These are the test-suite requirements:
  107. @itemize @bullet
  108. @item python3.6 or higher
  109. @item gnunet (installation first)
  110. @item some core-utils: which(1), bc(1), curl(1), sed(1), awk(1), etc.
  111. @item a shell (very few Bash scripts, the majority are POSIX sh scripts)
  112. @end itemize
  113. These are runtime requirements:
  114. @itemize @bullet
  115. @item nss (the certutil binary, for gnunet-gns-proxy-setup-ca)
  116. @item openssl (openssl binary, for gnunet-gns-proxy-setup-ca)
  117. @end itemize
  118. @c -----------------------------------------------------------------------
  119. @node Getting the Source Code
  120. @section Getting the Source Code
  121. You can either download the source code using git (you obviously need
  122. git installed) or as an archive.
  123. Using git type
  124. @example
  125. git clone https://git.gnunet.org/gnunet.git
  126. @end example
  127. The archive can be found at
  128. @uref{https://ftpmirror.gnu.org/gnu/gnunet/}. Extract it using a graphical
  129. archive tool or @code{tar}:
  130. @example
  131. tar xzvf gnunet-@value{VERSION}.tar.gz
  132. @end example
  133. In the next chapter we will assume that the source code is available
  134. in the home directory at @code{~/gnunet}.
  135. @c -----------------------------------------------------------------------
  136. @node Create user and groups for the system services
  137. @section Create user and groups for the system services
  138. @cartouche
  139. For the single-user setup this section can be skipped.
  140. @end cartouche
  141. The multi-user setup means that there are @emph{system services}, which are
  142. run once per machine as a dedicated system user (called @code{gnunet}) and
  143. @emph{user services} which can be started by every user who wants to use
  144. GNUnet applications. The user services communicate with the system services
  145. over unix domain sockets. To gain permissions to read and write those sockets
  146. the users running GNUnet applications will need to be in the @code{gnunet}
  147. group. In addition the group @code{gnunetdns} may be needed (see below).
  148. Create user @code{gnunet} who is member of the group @code{gnunet}
  149. (automatically created) and specify a home directory where the GNUnet
  150. services will store persistent data such as information about peers.
  151. @example
  152. $ sudo useradd --system --home-dir /var/lib/gnunet --create-home gnunet
  153. @end example
  154. Now add your own user to the @code{gnunet} group.
  155. @example
  156. $ sudo usermod -aG gnunet alice
  157. @end example
  158. Create a group @code{gnunetdns}. This allows using @code{setgid} in a way
  159. that only the DNS service can run the @code{gnunet-helper-dns} binary. This
  160. is only needed if @emph{system-wide DNS interception} will be used. For more
  161. information see @xref{Configuring system-wide DNS interception}.
  162. @example
  163. $ sudo groupadd gnunetdns
  164. @end example
  165. @c -----------------------------------------------------------------------
  166. @node Preparing and Compiling the Source Code
  167. @section Preparing and Compiling the Source Code
  168. For preparing the source code for compilation a bootstrap script and
  169. @code{configure} has to be run from the source code directory. When
  170. running @code{configure} the following options can be specified to
  171. customize the compilation and installation process:
  172. @itemize @bullet
  173. @item @code{--disable-documentation} - don't build the documentation
  174. @item @code{--enable-logging=[LOGLEVEL]} - choose a loglevel (@code{debug}, @code{info}, @code{warning} or @code{error})
  175. @item @code{--prefix=[PATH]} - the directory where the GNUnet libraries and binaries will be installed
  176. @item @code{--with-extractor=[PATH]} - the path to libextractor
  177. @item @code{--with-libidn=[PATH]} - the path to libidn
  178. @item @code{--with-libidn2=[PATH]} - the path to libidn2 (takes priority over libidn if both are found)
  179. @item @code{--with-microhttpd=[PATH]} - the path to libmicrohttpd
  180. @item @code{--with-sqlite=[PATH]} - the path to libsqlite
  181. @item @code{--with-zlib=[PATH]} - the path to zlib
  182. @end itemize
  183. Note that the list above is not always up to date and you
  184. should check the output of @code{./configure --help}, read
  185. the @file{configure.ac} or send an email asking for assistance
  186. if you are in doubt of any configure options or require fixes
  187. for your operating system.
  188. The following example configures the installation prefix
  189. @code{/usr/local} and disables building the documentation
  190. @example
  191. $ cd ~/gnunet
  192. $ ./bootstrap
  193. $ configure --prefix=/usr/local --disable-documentation
  194. @end example
  195. After running the bootstrap script and @code{configure} successfully
  196. the source code can be compiled with make. Here @code{-j5} specifies
  197. that 5 threads should be used.
  198. @example
  199. $ make -j5
  200. @end example
  201. @c -----------------------------------------------------------------------
  202. @node Installation
  203. @section Installation
  204. The compiled binaries can be installed using @code{make install}. It
  205. needs to be run as root (or with sudo) because some binaries need the
  206. @code{suid} bit set. Without that some features (e.g. the VPN service,
  207. system-wide DNS interception, NAT traversal using ICMP) will not work.
  208. @example
  209. $ sudo make install
  210. @end example
  211. @menu
  212. * NSS plugin (Optional)::
  213. * Installing the GNS Certificate Authority (Optional)::
  214. @end menu
  215. @node NSS plugin (Optional)
  216. @subsection NSS plugin (Optional)
  217. @cartouche
  218. The installation of the NSS plugin is only necessary if GNS
  219. resolution shall be used with legacy applications (that only
  220. support DNS).
  221. @end cartouche
  222. One important library is the GNS plugin for NSS (the name services
  223. switch) which allows using GNS (the GNU name system) in the normal DNS
  224. resolution process. Unfortunately NSS expects it in a specific
  225. location (probably @code{/lib}) which may differ from the installation
  226. prefix (see @code{--prefix} option in the previous section). This is
  227. why the plugin has to be installed manually.
  228. Find the directory where nss plugins are installed on your system, e.g.
  229. @example
  230. $ ls -l /lib/libnss_*
  231. /lib/libnss_mymachines.so.2
  232. /lib/libnss_resolve.so.2
  233. /lib/libnss_myhostname.so.2
  234. /lib/libnss_systemd.so.2
  235. @end example
  236. Copy the GNS NSS plugin to that directory:
  237. @example
  238. cp ~/gnunet/src/gns/nss/.libs/libnss_gns.so.2 /lib
  239. @end example
  240. Now, to activate the plugin, you need to edit your
  241. @code{/etc/nsswitch.conf} where you should find a line like this:
  242. @example
  243. hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
  244. @end example
  245. The exact details may differ a bit, which is fine. Add the text
  246. @code{"gns [NOTFOUND=return]"} after @code{"files"}.
  247. @example
  248. hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4
  249. @end example
  250. @node Installing the GNS Certificate Authority (Optional)
  251. @subsection Installing the GNS Certificate Authority (Optional)
  252. @cartouche
  253. Installing the GNS certificate authority is only necessary if GNS shall
  254. be used in a browser.
  255. @end cartouche
  256. The GNS Certificate authority can provide TLS certificates for GNS names while
  257. downloading webpages from legacy webservers. This allows browsers to use HTTPS
  258. in combinations with GNS name resolution.
  259. To install it execute the GNS CA-setup script. So far Firefox and Chromium are
  260. supported.
  261. @example
  262. $ gnunet-gns-proxy-setup-ca
  263. @end example
  264. A local proxy server, that takes care of the name resolution and provides
  265. certificates on-the-fly needs to be started:
  266. @example
  267. $ /usr/lib/gnunet/libexec/gnunet-gns-proxy
  268. @end example
  269. Now GNS should work in browsers that are configured to use a SOCKS proxy on
  270. @code{localhost:7777}.
  271. @node Minimal configuration
  272. @section Minimal configuration
  273. GNUnet needs a configuration file to start (@pxref{Config file format}).
  274. For the @emph{single-user setup} an empty file is sufficient:
  275. @example
  276. $ touch ~/.config/gnunet.conf
  277. @end example
  278. For the @emph{multi-user setup} we need an extra config file for the system
  279. services. The default location is @code{/etc/gnunet.conf}. The minimal
  280. content of that file which activates the system services roll is:
  281. @example
  282. [arm]
  283. START_SYSTEM_SERVICES = YES
  284. START_USER_SERVICES = NO
  285. @end example
  286. The config file for the user services (@code{~/.config/gnunet.conf}) needs
  287. the opposite configuration to activate the user services roll:
  288. @example
  289. [arm]
  290. START_SYSTEM_SERVICES = NO
  291. START_USER_SERVICES = YES
  292. @end example
  293. @node Checking the Installation
  294. @section Checking the Installation
  295. This section describes a quick, casual way to check if your GNUnet
  296. installation works. However, if it does not, we do not cover
  297. steps for recovery --- for this, please study the instructions
  298. provided in the developer handbook as well as the system-specific
  299. instruction in the source code repository.
  300. Please note that the system specific instructions are not provided
  301. as part of this handbook!
  302. @menu
  303. * Starting GNUnet::
  304. * gnunet-gtk::
  305. * Statistics::
  306. * Peer Information::
  307. @end menu
  308. @cindex Starting GNUnet
  309. @cindex GNUnet GTK
  310. @cindex GTK
  311. @cindex GTK user interface
  312. @node Starting GNUnet
  313. @subsection Starting GNUnet
  314. The GNUnet services are started and stopped by the ARM service (Automatic
  315. Restart Manager). For the @emph{single-user setup} a simple
  316. @example
  317. $ gnunet-arm -s
  318. @end example
  319. starts a default set of services. Later GNUnet applications can request more
  320. services to start without additional user interaction. GNUnet can be stopped
  321. again using the @code{-e} option:
  322. @example
  323. $ gnunet-arm -e
  324. @end example
  325. The list of running services can be displayed using the @code{-I} option.
  326. It should look similar to this example:
  327. @example
  328. $ gnunet-arm -I
  329. Running services:
  330. topology (gnunet-daemon-topology)
  331. nat (gnunet-service-nat)
  332. vpn (gnunet-service-vpn)
  333. gns (gnunet-service-gns)
  334. cadet (gnunet-service-cadet)
  335. namecache (gnunet-service-namecache)
  336. hostlist (gnunet-daemon-hostlist)
  337. revocation (gnunet-service-revocation)
  338. ats (gnunet-service-ats)
  339. peerinfo (gnunet-service-peerinfo)
  340. zonemaster (gnunet-service-zonemaster)
  341. zonemaster-monitor (gnunet-service-zonemaster-monitor)
  342. dht (gnunet-service-dht)
  343. namestore (gnunet-service-namestore)
  344. set (gnunet-service-set)
  345. statistics (gnunet-service-statistics)
  346. nse (gnunet-service-nse)
  347. fs (gnunet-service-fs)
  348. peerstore (gnunet-service-peerstore)
  349. core (gnunet-service-core)
  350. rest (gnunet-rest-server)
  351. transport (gnunet-service-transport)
  352. datastore (gnunet-service-datastore)
  353. @end example
  354. For the @emph{multi-user setup} first the system services need to be started
  355. as the system user, i.e. the user @code{gnunet} needs to execute
  356. @code{gnunet-arm -s}. This should be done by the system's init system.
  357. Then the user who wants to start GNUnet applications has to run
  358. @code{gnunet-arm -s} too. It is recommended to automate this, e.g. using
  359. the user's crontab.
  360. @node gnunet-gtk
  361. @subsection gnunet-gtk
  362. The @command{gnunet-gtk} package contains several graphical
  363. user interfaces for the respective GNUnet applications.
  364. Currently these interfaces cover:
  365. @itemize @bullet
  366. @item Statistics
  367. @item Peer Information
  368. @item GNU Name System
  369. @item File Sharing
  370. @item Conversation
  371. @item Setup
  372. @end itemize
  373. Previously, many of these interfaces were combined into one application
  374. called @command{gnunet-gtk}, with different tabs for each interface. This
  375. combined application has been removed in version 0.11.0, but each of the
  376. interfaces is still available as a standalone application
  377. (@command{gnunet-statistics-gtk} for statistics, @command{gnunet-fs-gtk}
  378. for filesharing, etc).
  379. @node Statistics
  380. @subsection Statistics
  381. We assume that you have started gnunet via @code{gnunet-arm} or via your
  382. system-provided method for starting services.
  383. First, you should launch GNUnet's graphical statistics interface.
  384. You can do this from the command-line by typing
  385. @example
  386. gnunet-statistics-gtk
  387. @end example
  388. If your peer is running correctly, you should see a bunch
  389. of lines, all of which should be ``significantly'' above zero (at
  390. least if your peer has been running for more than a few seconds). The
  391. lines indicate how many other peers your peer is connected to (via
  392. different mechanisms) and how large the entire overlay network is
  393. currently estimated to be. The X-axis represents time (in seconds
  394. since the start of @command{gnunet-statistics-gtk}).
  395. You can click on "Traffic" to see information about the amount of
  396. bandwidth your peer has consumed, and on "Storage" to check the amount
  397. of storage available and used by your peer. Note that "Traffic" is
  398. plotted cumulatively, so you should see a strict upwards trend in the
  399. traffic.
  400. The term ``peer'' is a common word used in
  401. federated and distributed networks to describe a participating device
  402. which is connected to the network. Thus, your Personal Computer or
  403. whatever it is you are looking at the Gtk+ interface describes a
  404. ``Peer'' or a ``Node''.
  405. @node Peer Information
  406. @subsection Peer Information
  407. First, you should launch the peer information graphical user interface.
  408. You can do this from the command-line by typing
  409. @example
  410. $ gnunet-peerinfo-gtk
  411. @end example
  412. Once you have done this, you will see a list of known peers (by the
  413. first four characters of their public key), their friend status (all
  414. should be marked as not-friends initially), their connectivity (green
  415. is connected, red is disconnected), assigned bandwidth, country of
  416. origin (if determined) and address information. If hardly any peers
  417. are listed and/or if there are very few peers with a green light for
  418. connectivity, there is likely a problem with your network
  419. configuration.
  420. @c NOTE: Inserted from Installation Handbook in original ``order'':
  421. @c FIXME: Move this to User Handbook.
  422. @node The graphical configuration interface
  423. @section The graphical configuration interface
  424. If you also would like to use @command{gnunet-gtk} and
  425. @command{gnunet-setup} (highly recommended for beginners), do:
  426. @menu
  427. * Configuring your peer::
  428. * Configuring the Friend-to-Friend (F2F) mode::
  429. * Configuring the hostlist to bootstrap::
  430. * Configuration of the HOSTLIST proxy settings::
  431. * Configuring your peer to provide a hostlist ::
  432. * Configuring the datastore::
  433. * Configuring the MySQL database::
  434. * Reasons for using MySQL::
  435. * Reasons for not using MySQL::
  436. * Setup Instructions::
  437. * Testing::
  438. * Performance Tuning::
  439. * Setup for running Testcases::
  440. * Configuring the Postgres database::
  441. * Reasons to use Postgres::
  442. * Reasons not to use Postgres::
  443. * Manual setup instructions::
  444. * Testing the setup manually::
  445. * Configuring the datacache::
  446. * Configuring the file-sharing service::
  447. * Configuring logging::
  448. * Configuring the transport service and plugins::
  449. * Configuring the WLAN transport plugin::
  450. * Configuring HTTP(S) reverse proxy functionality using Apache or nginx::
  451. * Blacklisting peers::
  452. * Configuration of the HTTP and HTTPS transport plugins::
  453. * Configuring the GNU Name System::
  454. * Configuring the GNUnet VPN::
  455. * Bandwidth Configuration::
  456. * Configuring NAT::
  457. * Peer configuration for distributors (e.g. Operating Systems)::
  458. @end menu
  459. @node Configuring your peer
  460. @subsection Configuring your peer
  461. This chapter will describe the various configuration options in GNUnet.
  462. The easiest way to configure your peer is to use the
  463. @command{gnunet-setup} tool.
  464. @command{gnunet-setup} is part of the @command{gnunet-gtk}
  465. package. You might have to install it separately.
  466. Many of the specific sections from this chapter actually are linked from
  467. within @command{gnunet-setup} to help you while using the setup tool.
  468. While you can also configure your peer by editing the configuration
  469. file by hand, this is not recommended for anyone except for developers
  470. as it requires a more in-depth understanding of the configuration files
  471. and internal dependencies of GNUnet.
  472. @node Configuring the Friend-to-Friend (F2F) mode
  473. @subsection Configuring the Friend-to-Friend (F2F) mode
  474. GNUnet knows three basic modes of operation:
  475. @itemize @bullet
  476. @item In standard "peer-to-peer" mode,
  477. your peer will connect to any peer.
  478. @item In the pure "friend-to-friend"
  479. mode, your peer will ONLY connect to peers from a list of friends
  480. specified in the configuration.
  481. @item Finally, in mixed mode,
  482. GNUnet will only connect to arbitrary peers if it
  483. has at least a specified number of connections to friends.
  484. @end itemize
  485. When configuring any of the F2F ("friend-to-friend") modes,
  486. you first need to create a file with the peer identities
  487. of your friends. Ask your friends to run
  488. @example
  489. $ gnunet-peerinfo -sq
  490. @end example
  491. @noindent
  492. The resulting output of this command needs to be added to your
  493. @file{friends} file, which is simply a plain text file with one line
  494. per friend with the output from the above command.
  495. You then specify the location of your @file{friends} file in the
  496. @code{FRIENDS} option of the "topology" section.
  497. Once you have created the @file{friends} file, you can tell GNUnet to only
  498. connect to your friends by setting the @code{FRIENDS-ONLY} option
  499. (again in the "topology" section) to YES.
  500. If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a
  501. minimum number of friends to have (before connecting to arbitrary peers)
  502. under the "MINIMUM-FRIENDS" option.
  503. If you want to operate in normal P2P-only mode, simply set
  504. @code{MINIMUM-FRIENDS} to zero and @code{FRIENDS_ONLY} to NO.
  505. This is the default.
  506. @node Configuring the hostlist to bootstrap
  507. @subsection Configuring the hostlist to bootstrap
  508. After installing the software you need to get connected to the GNUnet
  509. network. The configuration file included in your download is already
  510. configured to connect you to the GNUnet network.
  511. In this section the relevant configuration settings are explained.
  512. To get an initial connection to the GNUnet network and to get to know
  513. peers already connected to the network you can use the so called
  514. "bootstrap servers".
  515. These servers can give you a list of peers connected to the network.
  516. To use these bootstrap servers you have to configure the hostlist daemon
  517. to activate bootstrapping.
  518. To activate bootstrapping, edit the @code{[hostlist]}-section in your
  519. configuration file. You have to set the argument @command{-b} in the
  520. options line:
  521. @example
  522. [hostlist]
  523. OPTIONS = -b
  524. @end example
  525. Additionally you have to specify which server you want to use.
  526. The default bootstrapping server is
  527. "@uref{http://v10.gnunet.org/hostlist, http://v10.gnunet.org/hostlist}".
  528. [^] To set the server you have to edit the line "SERVERS" in the hostlist
  529. section. To use the default server you should set the lines to
  530. @example
  531. SERVERS = http://v10.gnunet.org/hostlist [^]
  532. @end example
  533. @noindent
  534. To use bootstrapping your configuration file should include these lines:
  535. @example
  536. [hostlist]
  537. OPTIONS = -b
  538. SERVERS = http://v10.gnunet.org/hostlist [^]
  539. @end example
  540. @noindent
  541. Besides using bootstrap servers you can configure your GNUnet peer to
  542. receive hostlist advertisements.
  543. Peers offering hostlists to other peers can send advertisement messages
  544. to peers that connect to them. If you configure your peer to receive these
  545. messages, your peer can download these lists and connect to the peers
  546. included. These lists are persistent, which means that they are saved to
  547. your hard disk regularly and are loaded during startup.
  548. To activate hostlist learning you have to add the @command{-e}
  549. switch to the @code{OPTIONS} line in the hostlist section:
  550. @example
  551. [hostlist]
  552. OPTIONS = -b -e
  553. @end example
  554. @noindent
  555. Furthermore you can specify in which file the lists are saved.
  556. To save the lists in the file @file{hostlists.file} just add the line:
  557. @example
  558. HOSTLISTFILE = hostlists.file
  559. @end example
  560. @noindent
  561. Best practice is to activate both bootstrapping and hostlist learning.
  562. So your configuration file should include these lines:
  563. @example
  564. [hostlist]
  565. OPTIONS = -b -e
  566. HTTPPORT = 8080
  567. SERVERS = http://v10.gnunet.org/hostlist [^]
  568. HOSTLISTFILE = $SERVICEHOME/hostlists.file
  569. @end example
  570. @node Configuration of the HOSTLIST proxy settings
  571. @subsection Configuration of the HOSTLIST proxy settings
  572. The hostlist client can be configured to use a proxy to connect to the
  573. hostlist server.
  574. This functionality can be configured in the configuration file directly
  575. or using the @command{gnunet-setup} tool.
  576. The hostlist client supports the following proxy types at the moment:
  577. @itemize @bullet
  578. @item HTTP and HTTP 1.0 only proxy
  579. @item SOCKS 4/4a/5/5 with hostname
  580. @end itemize
  581. In addition authentication at the proxy with username and password can be
  582. configured.
  583. To configure proxy support for the hostlist client in the
  584. @command{gnunet-setup} tool, select the "hostlist" tab and select
  585. the appropriate proxy type.
  586. The hostname or IP address (including port if required) has to be entered
  587. in the "Proxy hostname" textbox. If required, enter username and password
  588. in the "Proxy username" and "Proxy password" boxes.
  589. Be aware that this information will be stored in the configuration in
  590. plain text (TODO: Add explanation and generalize the part in Chapter 3.6
  591. about the encrypted home).
  592. To provide these options directly in the configuration, you can
  593. enter the following settings in the @code{[hostlist]} section of
  594. the configuration:
  595. @example
  596. # Type of proxy server,
  597. # Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
  598. # Default: HTTP
  599. # PROXY_TYPE = HTTP
  600. # Hostname or IP of proxy server
  601. # PROXY =
  602. # User name for proxy server
  603. # PROXY_USERNAME =
  604. # User password for proxy server
  605. # PROXY_PASSWORD =
  606. @end example
  607. @node Configuring your peer to provide a hostlist
  608. @subsection Configuring your peer to provide a hostlist
  609. If you operate a peer permanently connected to GNUnet you can configure
  610. your peer to act as a hostlist server, providing other peers the list of
  611. peers known to him.
  612. Your server can act as a bootstrap server and peers needing to obtain a
  613. list of peers can contact it to download this list.
  614. To download this hostlist the peer uses HTTP.
  615. For this reason you have to build your peer with libgnurl (or libcurl)
  616. and microhttpd support.
  617. To configure your peer to act as a bootstrap server you have to add the
  618. @command{-p} option to @code{OPTIONS} in the @code{[hostlist]} section
  619. of your configuration file.
  620. Besides that you have to specify a port number for the http server.
  621. In conclusion you have to add the following lines:
  622. @example
  623. [hostlist]
  624. HTTPPORT = 12980
  625. OPTIONS = -p
  626. @end example
  627. @noindent
  628. If your peer acts as a bootstrap server other peers should know about
  629. that. You can advertise the hostlist your are providing to other peers.
  630. Peers connecting to your peer will get a message containing an
  631. advertisement for your hostlist and the URL where it can be downloaded.
  632. If this peer is in learning mode, it will test the hostlist and, in the
  633. case it can obtain the list successfully, it will save it for
  634. bootstrapping.
  635. To activate hostlist advertisement on your peer, you have to set the
  636. following lines in your configuration file:
  637. @example
  638. [hostlist]
  639. EXTERNAL_DNS_NAME = example.org
  640. HTTPPORT = 12981
  641. OPTIONS = -p -a
  642. @end example
  643. @noindent
  644. With this configuration your peer will a act as a bootstrap server and
  645. advertise this hostlist to other peers connecting to it.
  646. The URL used to download the list will be
  647. @code{@uref{http://example.org:12981/, http://example.org:12981/}}.
  648. Please notice:
  649. @itemize @bullet
  650. @item The hostlist is @b{not} human readable, so you should not try to
  651. download it using your webbrowser. Just point your GNUnet peer to the
  652. address!
  653. @item Advertising without providing a hostlist does not make sense and
  654. will not work.
  655. @end itemize
  656. @node Configuring the datastore
  657. @subsection Configuring the datastore
  658. The datastore is what GNUnet uses for long-term storage of file-sharing
  659. data. Note that long-term does not mean 'forever' since content does have
  660. an expiration date, and of course storage space is finite (and hence
  661. sometimes content may have to be discarded).
  662. Use the @code{QUOTA} option to specify how many bytes of storage space
  663. you are willing to dedicate to GNUnet.
  664. In addition to specifying the maximum space GNUnet is allowed to use for
  665. the datastore, you need to specify which database GNUnet should use to do
  666. so. Currently, you have the choice between sqLite, MySQL and Postgres.
  667. @node Configuring the MySQL database
  668. @subsection Configuring the MySQL database
  669. This section describes how to setup the MySQL database for GNUnet.
  670. Note that the mysql plugin does NOT work with mysql before 4.1 since we
  671. need prepared statements.
  672. We are generally testing the code against MySQL 5.1 at this point.
  673. @node Reasons for using MySQL
  674. @subsection Reasons for using MySQL
  675. @itemize @bullet
  676. @item On up-to-date hardware where
  677. mysql can be used comfortably, this module
  678. will have better performance than the other database choices (according
  679. to our tests).
  680. @item Its often possible to recover the mysql database from internal
  681. inconsistencies. Some of the other databases do not support repair.
  682. @end itemize
  683. @node Reasons for not using MySQL
  684. @subsection Reasons for not using MySQL
  685. @itemize @bullet
  686. @item Memory usage (likely not an issue if you have more than 1 GB)
  687. @item Complex manual setup
  688. @end itemize
  689. @node Setup Instructions
  690. @subsection Setup Instructions
  691. @itemize @bullet
  692. @item In @file{gnunet.conf} set in section @code{DATASTORE} the value for
  693. @code{DATABASE} to @code{mysql}.
  694. @item Access mysql as root:
  695. @example
  696. $ mysql -u root -p
  697. @end example
  698. @noindent
  699. and issue the following commands, replacing $USER with the username
  700. that will be running @command{gnunet-arm} (so typically "gnunet"):
  701. @example
  702. CREATE DATABASE gnunet;
  703. GRANT select,insert,update,delete,create,alter,drop,create \
  704. temporary tables ON gnunet.* TO $USER@@localhost;
  705. SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like');
  706. FLUSH PRIVILEGES;
  707. @end example
  708. @item
  709. In the $HOME directory of $USER, create a @file{.my.cnf} file with the
  710. following lines
  711. @example
  712. [client]
  713. user=$USER
  714. password=$the_password_you_like
  715. @end example
  716. @end itemize
  717. That's it. Note that @file{.my.cnf} file is a slight security risk unless
  718. its on a safe partition. The @file{$HOME/.my.cnf} can of course be
  719. a symbolic link.
  720. Luckily $USER has only privileges to mess up GNUnet's tables,
  721. which should be pretty harmless.
  722. @node Testing
  723. @subsection Testing
  724. You should briefly try if the database connection works. First, login
  725. as $USER. Then use:
  726. @example
  727. $ mysql -u $USER
  728. mysql> use gnunet;
  729. @end example
  730. @noindent
  731. If you get the message
  732. @example
  733. Database changed
  734. @end example
  735. @noindent
  736. it probably works.
  737. If you get
  738. @example
  739. ERROR 2002: Can't connect to local MySQL server
  740. through socket '/tmp/mysql.sock' (2)
  741. @end example
  742. @noindent
  743. it may be resolvable by
  744. @example
  745. ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
  746. @end example
  747. @noindent
  748. so there may be some additional trouble depending on your mysql setup.
  749. @node Performance Tuning
  750. @subsection Performance Tuning
  751. For GNUnet, you probably want to set the option
  752. @example
  753. innodb_flush_log_at_trx_commit = 0
  754. @end example
  755. @noindent
  756. for a rather dramatic boost in MySQL performance. However, this reduces
  757. the "safety" of your database as with this options you may loose
  758. transactions during a power outage.
  759. While this is totally harmless for GNUnet, the option applies to all
  760. applications using MySQL. So you should set it if (and only if) GNUnet is
  761. the only application on your system using MySQL.
  762. @node Setup for running Testcases
  763. @subsection Setup for running Testcases
  764. If you want to run the testcases, you must create a second database
  765. "gnunetcheck" with the same username and password. This database will
  766. then be used for testing (@command{make check}).
  767. @node Configuring the Postgres database
  768. @subsection Configuring the Postgres database
  769. This text describes how to setup the Postgres database for GNUnet.
  770. This Postgres plugin was developed for Postgres 8.3 but might work for
  771. earlier versions as well.
  772. @node Reasons to use Postgres
  773. @subsection Reasons to use Postgres
  774. @itemize @bullet
  775. @item Easier to setup than MySQL
  776. @item Real database
  777. @end itemize
  778. @node Reasons not to use Postgres
  779. @subsection Reasons not to use Postgres
  780. @itemize @bullet
  781. @item Quite slow
  782. @item Still some manual setup required
  783. @end itemize
  784. @node Manual setup instructions
  785. @subsection Manual setup instructions
  786. @itemize @bullet
  787. @item In @file{gnunet.conf} set in section @code{DATASTORE} the value for
  788. @code{DATABASE} to @code{postgres}.
  789. @item Access Postgres to create a user:
  790. @table @asis
  791. @item with Postgres 8.x, use:
  792. @example
  793. # su - postgres
  794. $ createuser
  795. @end example
  796. @noindent
  797. and enter the name of the user running GNUnet for the role interactively.
  798. Then, when prompted, do not set it to superuser, allow the creation of
  799. databases, and do not allow the creation of new roles.
  800. @item with Postgres 9.x, use:
  801. @example
  802. # su - postgres
  803. $ createuser -d $GNUNET_USER
  804. @end example
  805. @noindent
  806. where $GNUNET_USER is the name of the user running GNUnet.
  807. @end table
  808. @item
  809. As that user (so typically as user "gnunet"), create a database (or two):
  810. @example
  811. $ createdb gnunet
  812. # this way you can run "make check"
  813. $ createdb gnunetcheck
  814. @end example
  815. @end itemize
  816. Now you should be able to start @code{gnunet-arm}.
  817. @node Testing the setup manually
  818. @subsection Testing the setup manually
  819. You may want to try if the database connection works. First, again login
  820. as the user who will run @command{gnunet-arm}. Then use:
  821. @example
  822. $ psql gnunet # or gnunetcheck
  823. gnunet=> \dt
  824. @end example
  825. @noindent
  826. If, after you have started @command{gnunet-arm} at least once, you get
  827. a @code{gn090} table here, it probably works.
  828. @node Configuring the datacache
  829. @subsection Configuring the datacache
  830. The datacache is what GNUnet uses for storing temporary data. This data is
  831. expected to be wiped completely each time GNUnet is restarted (or the
  832. system is rebooted).
  833. You need to specify how many bytes GNUnet is allowed to use for the
  834. datacache using the @code{QUOTA} option in the section @code{[dhtcache]}.
  835. Furthermore, you need to specify which database backend should be used to
  836. store the data. Currently, you have the choice between
  837. sqLite, MySQL and Postgres.
  838. @node Configuring the file-sharing service
  839. @subsection Configuring the file-sharing service
  840. In order to use GNUnet for file-sharing, you first need to make sure
  841. that the file-sharing service is loaded.
  842. This is done by setting the @code{START_ON_DEMAND} option in
  843. section @code{[fs]} to "YES". Alternatively, you can run
  844. @example
  845. $ gnunet-arm -i fs
  846. @end example
  847. @noindent
  848. to start the file-sharing service by hand.
  849. Except for configuring the database and the datacache the only important
  850. option for file-sharing is content migration.
  851. Content migration allows your peer to cache content from other peers as
  852. well as send out content stored on your system without explicit requests.
  853. This content replication has positive and negative impacts on both system
  854. performance and privacy.
  855. FIXME: discuss the trade-offs. Here is some older text about it...
  856. Setting this option to YES allows gnunetd to migrate data to the local
  857. machine. Setting this option to YES is highly recommended for efficiency.
  858. Its also the default. If you set this value to YES, GNUnet will store
  859. content on your machine that you cannot decrypt.
  860. While this may protect you from liability if the judge is sane, it may
  861. not (IANAL). If you put illegal content on your machine yourself, setting
  862. this option to YES will probably increase your chances to get away with it
  863. since you can plausibly deny that you inserted the content.
  864. Note that in either case, your anonymity would have to be broken first
  865. (which may be possible depending on the size of the GNUnet network and the
  866. strength of the adversary).
  867. @node Configuring logging
  868. @subsection Configuring logging
  869. Since version 0.9.0, logging in GNUnet is controlled via the
  870. @code{-L} and @code{-l} options.
  871. Using @code{-L}, a log level can be specified. With log level
  872. @code{ERROR} only serious errors are logged.
  873. The default log level is @code{WARNING} which causes anything of
  874. concern to be logged.
  875. Log level @code{INFO} can be used to log anything that might be
  876. interesting information whereas
  877. @code{DEBUG} can be used by developers to log debugging messages
  878. (but you need to run @code{./configure} with
  879. @code{--enable-logging=verbose} to get them compiled).
  880. The @code{-l} option is used to specify the log file.
  881. Since most GNUnet services are managed by @code{gnunet-arm}, using the
  882. @code{-l} or @code{-L} options directly is not possible.
  883. Instead, they can be specified using the @code{OPTIONS} configuration
  884. value in the respective section for the respective service.
  885. In order to enable logging globally without editing the @code{OPTIONS}
  886. values for each service, @command{gnunet-arm} supports a
  887. @code{GLOBAL_POSTFIX} option.
  888. The value specified here is given as an extra option to all services for
  889. which the configuration does contain a service-specific @code{OPTIONS}
  890. field.
  891. @code{GLOBAL_POSTFIX} can contain the special sequence "@{@}" which
  892. is replaced by the name of the service that is being started.
  893. Furthermore, @code{GLOBAL_POSTFIX} is special in that sequences
  894. starting with "$" anywhere in the string are expanded (according
  895. to options in @code{PATHS}); this expansion otherwise is
  896. only happening for filenames and then the "$" must be the
  897. first character in the option. Both of these restrictions do
  898. not apply to @code{GLOBAL_POSTFIX}.
  899. Note that specifying @code{%} anywhere in the @code{GLOBAL_POSTFIX}
  900. disables both of these features.
  901. In summary, in order to get all services to log at level
  902. @code{INFO} to log-files called @code{SERVICENAME-logs}, the
  903. following global prefix should be used:
  904. @example
  905. GLOBAL_POSTFIX = -l $SERVICEHOME/@{@}-logs -L INFO
  906. @end example
  907. @node Configuring the transport service and plugins
  908. @subsection Configuring the transport service and plugins
  909. The transport service in GNUnet is responsible to maintain basic
  910. connectivity to other peers.
  911. Besides initiating and keeping connections alive it is also responsible
  912. for address validation.
  913. The GNUnet transport supports more than one transport protocol.
  914. These protocols are configured together with the transport service.
  915. The configuration section for the transport service itself is quite
  916. similar to all the other services
  917. @example
  918. START_ON_DEMAND = YES
  919. @@UNIXONLY@@ PORT = 2091
  920. HOSTNAME = localhost
  921. HOME = $SERVICEHOME
  922. CONFIG = $DEFAULTCONFIG
  923. BINARY = gnunet-service-transport
  924. #PREFIX = valgrind
  925. NEIGHBOUR_LIMIT = 50
  926. ACCEPT_FROM = 127.0.0.1;
  927. ACCEPT_FROM6 = ::1;
  928. PLUGINS = tcp udp
  929. UNIXPATH = /tmp/gnunet-service-transport.sock
  930. @end example
  931. Different are the settings for the plugins to load @code{PLUGINS}.
  932. The first setting specifies which transport plugins to load.
  933. @itemize @bullet
  934. @item transport-unix
  935. A plugin for local only communication with UNIX domain sockets. Used for
  936. testing and available on unix systems only. Just set the port
  937. @example
  938. [transport-unix]
  939. PORT = 22086
  940. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  941. @end example
  942. @item transport-tcp
  943. A plugin for communication with TCP. Set port to 0 for client mode with
  944. outbound only connections
  945. @example
  946. [transport-tcp]
  947. # Use 0 to ONLY advertise as a peer behind NAT (no port binding)
  948. PORT = 2086
  949. ADVERTISED_PORT = 2086
  950. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  951. # Maximum number of open TCP connections allowed
  952. MAX_CONNECTIONS = 128
  953. @end example
  954. @item transport-udp
  955. A plugin for communication with UDP. Supports peer discovery using
  956. broadcasts.
  957. @example
  958. [transport-udp]
  959. PORT = 2086
  960. BROADCAST = YES
  961. BROADCAST_INTERVAL = 30 s
  962. MAX_BPS = 1000000
  963. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  964. @end example
  965. @item transport-http
  966. HTTP and HTTPS support is split in two part: a client plugin initiating
  967. outbound connections and a server part accepting connections from the
  968. client. The client plugin just takes the maximum number of connections as
  969. an argument.
  970. @example
  971. [transport-http_client]
  972. MAX_CONNECTIONS = 128
  973. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  974. @end example
  975. @example
  976. [transport-https_client]
  977. MAX_CONNECTIONS = 128
  978. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  979. @end example
  980. @noindent
  981. The server has a port configured and the maximum number of connections.
  982. The HTTPS part has two files with the certificate key and the certificate
  983. file.
  984. The server plugin supports reverse proxies, so a external hostname can be
  985. set using the @code{EXTERNAL_HOSTNAME} setting.
  986. The webserver under this address should forward the request to the peer
  987. and the configure port.
  988. @example
  989. [transport-http_server]
  990. EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet
  991. PORT = 1080
  992. MAX_CONNECTIONS = 128
  993. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  994. @end example
  995. @example
  996. [transport-https_server]
  997. PORT = 4433
  998. CRYPTO_INIT = NORMAL
  999. KEY_FILE = https.key
  1000. CERT_FILE = https.cert
  1001. MAX_CONNECTIONS = 128
  1002. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  1003. @end example
  1004. @item transport-wlan
  1005. The next section describes how to setup the WLAN plugin,
  1006. so here only the settings. Just specify the interface to use:
  1007. @example
  1008. [transport-wlan]
  1009. # Name of the interface in monitor mode (typically monX)
  1010. INTERFACE = mon0
  1011. # Real hardware, no testing
  1012. TESTMODE = 0
  1013. TESTING_IGNORE_KEYS = ACCEPT_FROM;
  1014. @end example
  1015. @end itemize
  1016. @node Configuring the WLAN transport plugin
  1017. @subsection Configuring the WLAN transport plugin
  1018. The wlan transport plugin enables GNUnet to send and to receive data on a
  1019. wlan interface.
  1020. It has not to be connected to a wlan network as long as sender and
  1021. receiver are on the same channel. This enables you to get connection to
  1022. GNUnet where no internet access is possible, for example during
  1023. catastrophes or when censorship cuts you off from the internet.
  1024. @menu
  1025. * Requirements for the WLAN plugin::
  1026. * Configuration::
  1027. * Before starting GNUnet::
  1028. * Limitations and known bugs::
  1029. @end menu
  1030. @node Requirements for the WLAN plugin
  1031. @subsubsection Requirements for the WLAN plugin
  1032. @itemize @bullet
  1033. @item wlan network card with monitor support and packet injection
  1034. (see @uref{http://www.aircrack-ng.org/, aircrack-ng.org})
  1035. @item Linux kernel with mac80211 stack, introduced in 2.6.22, tested with
  1036. 2.6.35 and 2.6.38
  1037. @item Wlantools to create the a monitor interface, tested with airmon-ng
  1038. of the aircrack-ng package
  1039. @end itemize
  1040. @node Configuration
  1041. @subsubsection Configuration
  1042. There are the following options for the wlan plugin (they should be like
  1043. this in your default config file, you only need to adjust them if the
  1044. values are incorrect for your system)
  1045. @example
  1046. # section for the wlan transport plugin
  1047. [transport-wlan]
  1048. # interface to use, more information in the
  1049. # "Before starting GNUnet" section of the handbook.
  1050. INTERFACE = mon0
  1051. # testmode for developers:
  1052. # 0 use wlan interface,
  1053. #1 or 2 use loopback driver for tests 1 = server, 2 = client
  1054. TESTMODE = 0
  1055. @end example
  1056. @node Before starting GNUnet
  1057. @subsubsection Before starting GNUnet
  1058. Before starting GNUnet, you have to make sure that your wlan interface is
  1059. in monitor mode.
  1060. One way to put the wlan interface into monitor mode (if your interface
  1061. name is wlan0) is by executing:
  1062. @example
  1063. sudo airmon-ng start wlan0
  1064. @end example
  1065. @noindent
  1066. Here is an example what the result should look like:
  1067. @example
  1068. Interface Chipset Driver
  1069. wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0]
  1070. (monitor mode enabled on mon0)
  1071. @end example
  1072. @noindent
  1073. The monitor interface is mon0 is the one that you have to put into the
  1074. configuration file.
  1075. @node Limitations and known bugs
  1076. @subsubsection Limitations and known bugs
  1077. Wlan speed is at the maximum of 1 Mbit/s because support for choosing the
  1078. wlan speed with packet injection was removed in newer kernels.
  1079. Please pester the kernel developers about fixing this.
  1080. The interface channel depends on the wlan network that the card is
  1081. connected to. If no connection has been made since the start of the
  1082. computer, it is usually the first channel of the card.
  1083. Peers will only find each other and communicate if they are on the same
  1084. channel. Channels must be set manually, e.g. by using:
  1085. @example
  1086. iwconfig wlan0 channel 1
  1087. @end example
  1088. @node Configuring HTTP(S) reverse proxy functionality using Apache or nginx
  1089. @subsection Configuring HTTP(S) reverse proxy functionality using Apache or nginx
  1090. The HTTP plugin supports data transfer using reverse proxies. A reverse
  1091. proxy forwards the HTTP request he receives with a certain URL to another
  1092. webserver, here a GNUnet peer.
  1093. So if you have a running Apache or nginx webserver you can configure it to
  1094. be a GNUnet reverse proxy. Especially if you have a well-known website
  1095. this improves censorship resistance since it looks as normal surfing
  1096. behaviour.
  1097. To do so, you have to do two things:
  1098. @itemize @bullet
  1099. @item Configure your webserver to forward the GNUnet HTTP traffic
  1100. @item Configure your GNUnet peer to announce the respective address
  1101. @end itemize
  1102. As an example we want to use GNUnet peer running:
  1103. @itemize @bullet
  1104. @item HTTP server plugin on @code{gnunet.foo.org:1080}
  1105. @item HTTPS server plugin on @code{gnunet.foo.org:4433}
  1106. @item A apache or nginx webserver on
  1107. @uref{http://www.foo.org/, http://www.foo.org:80/}
  1108. @item A apache or nginx webserver on https://www.foo.org:443/
  1109. @end itemize
  1110. And we want the webserver to accept GNUnet traffic under
  1111. @code{http://www.foo.org/bar/}. The required steps are described here:
  1112. @menu
  1113. * Reverse Proxy - Configure your Apache2 HTTP webserver::
  1114. * Reverse Proxy - Configure your Apache2 HTTPS webserver::
  1115. * Reverse Proxy - Configure your nginx HTTPS webserver::
  1116. * Reverse Proxy - Configure your nginx HTTP webserver::
  1117. * Reverse Proxy - Configure your GNUnet peer::
  1118. @end menu
  1119. @node Reverse Proxy - Configure your Apache2 HTTP webserver
  1120. @subsubsection Reverse Proxy - Configure your Apache2 HTTP webserver
  1121. First of all you need mod_proxy installed.
  1122. Edit your webserver configuration. Edit
  1123. @code{/etc/apache2/apache2.conf} or the site-specific configuration file.
  1124. In the respective @code{server config},@code{virtual host} or
  1125. @code{directory} section add the following lines:
  1126. @example
  1127. ProxyTimeout 300
  1128. ProxyRequests Off
  1129. <Location /bar/ >
  1130. ProxyPass http://gnunet.foo.org:1080/
  1131. ProxyPassReverse http://gnunet.foo.org:1080/
  1132. </Location>
  1133. @end example
  1134. @node Reverse Proxy - Configure your Apache2 HTTPS webserver
  1135. @subsubsection Reverse Proxy - Configure your Apache2 HTTPS webserver
  1136. We assume that you already have an HTTPS server running, if not please
  1137. check how to configure a HTTPS host. An uncomplicated to use example
  1138. is the example configuration file for Apache2/HTTPD provided in
  1139. @file{apache2/sites-available/default-ssl}.
  1140. In the respective HTTPS @code{server config},@code{virtual host} or
  1141. @code{directory} section add the following lines:
  1142. @example
  1143. SSLProxyEngine On
  1144. ProxyTimeout 300
  1145. ProxyRequests Off
  1146. <Location /bar/ >
  1147. ProxyPass https://gnunet.foo.org:4433/
  1148. ProxyPassReverse https://gnunet.foo.org:4433/
  1149. </Location>
  1150. @end example
  1151. @noindent
  1152. More information about the apache mod_proxy configuration can be found
  1153. in the
  1154. @uref{http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass, Apache documentation}.
  1155. @node Reverse Proxy - Configure your nginx HTTPS webserver
  1156. @subsubsection Reverse Proxy - Configure your nginx HTTPS webserver
  1157. Since nginx does not support chunked encoding, you first of all have to
  1158. install the @code{chunkin}
  1159. @uref{http://wiki.nginx.org/HttpChunkinModule, module}.
  1160. To enable chunkin add:
  1161. @example
  1162. chunkin on;
  1163. error_page 411 = @@my_411_error;
  1164. location @@my_411_error @{
  1165. chunkin_resume;
  1166. @}
  1167. @end example
  1168. @noindent
  1169. Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
  1170. the site-specific configuration file.
  1171. In the @code{server} section add:
  1172. @example
  1173. location /bar/ @{
  1174. proxy_pass http://gnunet.foo.org:1080/;
  1175. proxy_buffering off;
  1176. proxy_connect_timeout 5; # more than http_server
  1177. proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
  1178. proxy_http_version 1.1; # 1.0 default
  1179. proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
  1180. @}
  1181. @end example
  1182. @node Reverse Proxy - Configure your nginx HTTP webserver
  1183. @subsubsection Reverse Proxy - Configure your nginx HTTP webserver
  1184. Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
  1185. the site-specific configuration file.
  1186. In the @code{server} section add:
  1187. @example
  1188. ssl_session_timeout 6m;
  1189. location /bar/
  1190. @{
  1191. proxy_pass https://gnunet.foo.org:4433/;
  1192. proxy_buffering off;
  1193. proxy_connect_timeout 5; # more than http_server
  1194. proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
  1195. proxy_http_version 1.1; # 1.0 default
  1196. proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
  1197. @}
  1198. @end example
  1199. @node Reverse Proxy - Configure your GNUnet peer
  1200. @subsubsection Reverse Proxy - Configure your GNUnet peer
  1201. To have your GNUnet peer announce the address, you have to specify the
  1202. @code{EXTERNAL_HOSTNAME} option in the @code{[transport-http_server]}
  1203. section:
  1204. @example
  1205. [transport-http_server]
  1206. EXTERNAL_HOSTNAME = http://www.foo.org/bar/
  1207. @end example
  1208. @noindent
  1209. and/or @code{[transport-https_server]} section:
  1210. @example
  1211. [transport-https_server]
  1212. EXTERNAL_HOSTNAME = https://www.foo.org/bar/
  1213. @end example
  1214. @noindent
  1215. Now restart your webserver and your peer...
  1216. @node Blacklisting peers
  1217. @subsection Blacklisting peers
  1218. Transport service supports to deny connecting to a specific peer of to a
  1219. specific peer with a specific transport plugin using the blacklisting
  1220. component of transport service. With@ blacklisting it is possible to deny
  1221. connections to specific peers of@ to use a specific plugin to a specific
  1222. peer. Peers can be blacklisted using@ the configuration or a blacklist
  1223. client can be asked.
  1224. To blacklist peers using the configuration you have to add a section to
  1225. your configuration containing the peer id of the peer to blacklist and
  1226. the plugin@ if required.
  1227. Examples:
  1228. To blacklist connections to P565... on peer AG2P... using tcp add:
  1229. @c FIXME: This is too long and produces errors in the pdf.
  1230. @example
  1231. [transport-blacklist AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
  1232. P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp
  1233. @end example
  1234. To blacklist connections to P565... on peer AG2P... using all plugins add:
  1235. @example
  1236. [transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
  1237. P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G =
  1238. @end example
  1239. You can also add a blacklist client using the blacklist API. On a
  1240. blacklist check, blacklisting first checks internally if the peer is
  1241. blacklisted and if not, it asks the blacklisting clients. Clients are
  1242. asked if it is OK to connect to a peer ID, the plugin is omitted.
  1243. On blacklist check for (peer, plugin)
  1244. @itemize @bullet
  1245. @item Do we have a local blacklist entry for this peer and this plugin?
  1246. @item YES: disallow connection
  1247. @item Do we have a local blacklist entry for this peer and all plugins?
  1248. @item YES: disallow connection
  1249. @item Does one of the clients disallow?
  1250. @item YES: disallow connection
  1251. @end itemize
  1252. @node Configuration of the HTTP and HTTPS transport plugins
  1253. @subsection Configuration of the HTTP and HTTPS transport plugins
  1254. The client parts of the http and https transport plugins can be configured
  1255. to use a proxy to connect to the hostlist server. This functionality can
  1256. be configured in the configuration file directly or using the
  1257. gnunet-setup tool.
  1258. Both the HTTP and HTTPS clients support the following proxy types at
  1259. the moment:
  1260. @itemize @bullet
  1261. @item HTTP 1.1 proxy
  1262. @item SOCKS 4/4a/5/5 with hostname
  1263. @end itemize
  1264. In addition authentication at the proxy with username and password can be
  1265. configured.
  1266. To configure proxy support for the clients in the gnunet-setup tool,
  1267. select the "transport" tab and activate the respective plugin. Now you
  1268. can select the appropriate proxy type. The hostname or IP address
  1269. (including port if required) has to be entered in the "Proxy hostname"
  1270. textbox. If required, enter username and password in the "Proxy username"
  1271. and "Proxy password" boxes. Be aware that these information will be stored
  1272. in the configuration in plain text.
  1273. To configure these options directly in the configuration, you can
  1274. configure the following settings in the @code{[transport-http_client]}
  1275. and @code{[transport-https_client]} section of the configuration:
  1276. @example
  1277. # Type of proxy server,
  1278. # Valid values: HTTP, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
  1279. # Default: HTTP
  1280. # PROXY_TYPE = HTTP
  1281. # Hostname or IP of proxy server
  1282. # PROXY =
  1283. # User name for proxy server
  1284. # PROXY_USERNAME =
  1285. # User password for proxy server
  1286. # PROXY_PASSWORD =
  1287. @end example
  1288. @node Configuring the GNU Name System
  1289. @subsection Configuring the GNU Name System
  1290. @menu
  1291. * Configuring system-wide DNS interception::
  1292. * Configuring the GNS nsswitch plugin::
  1293. @c * Configuring GNS on W32::
  1294. * GNS Proxy Setup::
  1295. * Setup of the GNS CA::
  1296. * Testing the GNS setup::
  1297. * Migrating existing DNS zones into GNS::
  1298. @end menu
  1299. @node Configuring system-wide DNS interception
  1300. @subsubsection Configuring system-wide DNS interception
  1301. Before you install GNUnet, make sure you have a user and group 'gnunet'
  1302. as well as an empty group 'gnunetdns'.
  1303. When using GNUnet with system-wide DNS interception, it is absolutely
  1304. necessary for all GNUnet service processes to be started by
  1305. @code{gnunet-service-arm} as user and group 'gnunet'. You also need to be
  1306. sure to run @code{make install} as root (or use the @code{sudo} option to
  1307. configure) to grant GNUnet sufficient privileges.
  1308. With this setup, all that is required for enabling system-wide DNS
  1309. interception is for some GNUnet component (VPN or GNS) to request it.
  1310. The @code{gnunet-service-dns} will then start helper programs that will
  1311. make the necessary changes to your firewall (@code{iptables}) rules.
  1312. Note that this will NOT work if your system sends out DNS traffic to a
  1313. link-local IPv6 address, as in this case GNUnet can intercept the traffic,
  1314. but not inject the responses from the link-local IPv6 address. Hence you
  1315. cannot use system-wide DNS interception in conjunction with link-local
  1316. IPv6-based DNS servers. If such a DNS server is used, it will bypass
  1317. GNUnet's DNS traffic interception.
  1318. Using the GNU Name System (GNS) requires two different configuration
  1319. steps.
  1320. First of all, GNS needs to be integrated with the operating system. Most
  1321. of this section is about the operating system level integration.
  1322. The remainder of this chapter will detail the various methods for
  1323. configuring the use of GNS with your operating system.
  1324. At this point in time you have different options depending on your OS:
  1325. @itemize @bullet
  1326. @item Use the gnunet-gns-proxy@*
  1327. This approach works for all operating systems and is likely the
  1328. easiest. However, it enables GNS only for browsers, not for other
  1329. applications that might be using DNS, such as SSH. Still, using the
  1330. proxy is required for using HTTP with GNS and is thus recommended for
  1331. all users. To do this, you simply have to run the
  1332. @code{gnunet-gns-proxy-setup-ca} script as the user who will run the
  1333. browser (this will create a GNS certificate authority (CA) on your
  1334. system and import its key into your browser), then start
  1335. @code{gnunet-gns-proxy} and inform your browser to use the Socks5
  1336. proxy which @code{gnunet-gns-proxy} makes available by default on port
  1337. 7777.
  1338. @item Use a nsswitch plugin (recommended on GNU systems)@*
  1339. This approach has the advantage of offering fully personalized
  1340. resolution even on multi-user systems. A potential disadvantage is
  1341. that some applications might be able to bypass GNS.
  1342. @item Use a W32 resolver plugin (recommended on W32)@*
  1343. This is currently the only option on W32 systems.
  1344. @item Use system-wide DNS packet interception@*
  1345. This approach is recommended for the GNUnet VPN. It can be used to
  1346. handle GNS at the same time; however, if you only use this method, you
  1347. will only get one root zone per machine (not so great for multi-user
  1348. systems).
  1349. @end itemize
  1350. You can combine system-wide DNS packet interception with the nsswitch
  1351. plugin.
  1352. The setup of the system-wide DNS interception is described here. All of
  1353. the other GNS-specific configuration steps are described in the following
  1354. sections.
  1355. @node Configuring the GNS nsswitch plugin
  1356. @subsubsection Configuring the GNS nsswitch plugin
  1357. The Name Service Switch (NSS) is a facility in Unix-like operating systems
  1358. (in most cases provided by the GNU C Library)
  1359. that provides a variety of sources for common configuration databases and
  1360. name resolution mechanisms.
  1361. A superuser (system administrator) usually configures the
  1362. operating system's name services using the file
  1363. @file{/etc/nsswitch.conf}.
  1364. GNS provides a NSS plugin to integrate GNS name resolution with the
  1365. operating system's name resolution process.
  1366. To use the GNS NSS plugin you have to either
  1367. @itemize @bullet
  1368. @item install GNUnet as root or
  1369. @item compile GNUnet with the @code{--with-sudo=yes} switch.
  1370. @end itemize
  1371. Name resolution is controlled by the @emph{hosts} section in the NSS
  1372. configuration. By default this section first performs a lookup in the
  1373. @file{/etc/hosts} file and then in DNS.
  1374. The nsswitch file should contain a line similar to:
  1375. @example
  1376. hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4
  1377. @end example
  1378. @noindent
  1379. Here the GNS NSS plugin can be added to perform a GNS lookup before
  1380. performing a DNS lookup.
  1381. The GNS NSS plugin has to be added to the "hosts" section in
  1382. @file{/etc/nsswitch.conf} file before DNS related plugins:
  1383. @example
  1384. ...
  1385. hosts: files gns [NOTFOUND=return] dns mdns4_minimal mdns4
  1386. ...
  1387. @end example
  1388. @noindent
  1389. The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not
  1390. found in GNS it will not be queried in DNS.
  1391. @c @node Configuring GNS on W32
  1392. @c @subsubsection Configuring GNS on W32
  1393. @c This document is a guide to configuring GNU Name System on W32-compatible
  1394. @c platforms.
  1395. @c After GNUnet is installed, run the w32nsp-install tool:
  1396. @c @example
  1397. @c w32nsp-install.exe libw32nsp-0.dll
  1398. @c @end example
  1399. @c @noindent
  1400. @c ('0' is the library version of W32 NSP; it might increase in the future,
  1401. @c change the invocation accordingly).
  1402. @c This will install GNS namespace provider into the system and allow other
  1403. @c applications to resolve names that end in '@strong{gnu}'
  1404. @c and '@strong{zkey}'. Note that namespace provider requires
  1405. @c gnunet-gns-helper-service-w32 to be running, as well as gns service
  1406. @c itself (and its usual dependencies).
  1407. @c Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353},
  1408. @c and this is where gnunet-gns-helper-service-w32 should be listening to
  1409. @c (and is configured to listen to by default).
  1410. @c To uninstall the provider, run:
  1411. @c @example
  1412. @c w32nsp-uninstall.exe
  1413. @c @end example
  1414. @c @noindent
  1415. @c (uses provider GUID to uninstall it, does not need a dll name).
  1416. @c Note that while MSDN claims that other applications will only be able to
  1417. @c use the new namespace provider after re-starting, in reality they might
  1418. @c stat to use it without that. Conversely, they might stop using the
  1419. @c provider after it's been uninstalled, even if they were not re-started.
  1420. @c W32 will not permit namespace provider library to be deleted or
  1421. @c overwritten while the provider is installed, and while there is at least
  1422. @c one process still using it (even after it was uninstalled).
  1423. @node GNS Proxy Setup
  1424. @subsubsection GNS Proxy Setup
  1425. When using the GNU Name System (GNS) to browse the WWW, there are several
  1426. issues that can be solved by adding the GNS Proxy to your setup:
  1427. @itemize @bullet
  1428. @item If the target website does not support GNS, it might assume that it
  1429. is operating under some name in the legacy DNS system (such as
  1430. example.com). It may then attempt to set cookies for that domain, and the
  1431. web server might expect a @code{Host: example.com} header in the request
  1432. from your browser.
  1433. However, your browser might be using @code{example.gnu} for the
  1434. @code{Host} header and might only accept (and send) cookies for
  1435. @code{example.gnu}. The GNS Proxy will perform the necessary translations
  1436. of the hostnames for cookies and HTTP headers (using the LEHO record for
  1437. the target domain as the desired substitute).
  1438. @item If using HTTPS, the target site might include an SSL certificate
  1439. which is either only valid for the LEHO domain or might match a TLSA
  1440. record in GNS. However, your browser would expect a valid certificate for
  1441. @code{example.gnu}, not for some legacy domain name. The proxy will
  1442. validate the certificate (either against LEHO or TLSA) and then
  1443. on-the-fly produce a valid certificate for the exchange, signed by your
  1444. own CA. Assuming you installed the CA of your proxy in your browser's
  1445. certificate authority list, your browser will then trust the
  1446. HTTPS/SSL/TLS connection, as the hostname mismatch is hidden by the proxy.
  1447. @item Finally, the proxy will in the future indicate to the server that it
  1448. speaks GNS, which will enable server operators to deliver GNS-enabled web
  1449. sites to your browser (and continue to deliver legacy links to legacy
  1450. browsers)
  1451. @end itemize
  1452. @node Setup of the GNS CA
  1453. @subsubsection Setup of the GNS CA
  1454. First you need to create a CA certificate that the proxy can use.
  1455. To do so use the provided script gnunet-gns-proxy-ca:
  1456. @example
  1457. $ gnunet-gns-proxy-setup-ca
  1458. @end example
  1459. @noindent
  1460. This will create a personal certification authority for you and add this
  1461. authority to the firefox and chrome database. The proxy will use the this
  1462. CA certificate to generate @code{*.gnu} client certificates on the fly.
  1463. Note that the proxy uses libcurl. Make sure your version of libcurl uses
  1464. GnuTLS and NOT OpenSSL. The proxy will @b{not} work with libcurl compiled
  1465. against OpenSSL.
  1466. You can check the configuration your libcurl was build with by
  1467. running:
  1468. @example
  1469. curl --version
  1470. @end example
  1471. the output will look like this (without the linebreaks):
  1472. @example
  1473. gnurl --version
  1474. curl 7.56.0 (x86_64-unknown-linux-gnu) libcurl/7.56.0 \
  1475. GnuTLS/3.5.13 zlib/1.2.11 libidn2/2.0.4
  1476. Release-Date: 2017-10-08
  1477. Protocols: http https
  1478. Features: AsynchDNS IDN IPv6 Largefile NTLM SSL libz \
  1479. TLS-SRP UnixSockets HTTPS-proxy
  1480. @end example
  1481. @node Testing the GNS setup
  1482. @subsubsection Testing the GNS setup
  1483. Now for testing purposes we can create some records in our zone to test
  1484. the SSL functionality of the proxy:
  1485. @example
  1486. $ gnunet-identity -C test
  1487. $ gnunet-namestore -a -e "1 d" -n "homepage" \
  1488. -t A -V 131.159.74.67 -z test
  1489. $ gnunet-namestore -a -e "1 d" -n "homepage" \
  1490. -t LEHO -V "gnunet.org" -z test
  1491. @end example
  1492. @noindent
  1493. At this point we can start the proxy. Simply execute
  1494. @example
  1495. $ gnunet-arm -i gns-proxy
  1496. @end example
  1497. To run the proxy at all times in the future, you should
  1498. change your configuration as follows:
  1499. @example
  1500. $ gnunet-config -s gns-proxy -o AUTOSTART -V YES
  1501. @end example
  1502. @noindent
  1503. Configure your browser to use this SOCKSv5 proxy using
  1504. @code{localhost} on port 7777.
  1505. If you use @command{Firefox} (or one of its derivatives/forks such as
  1506. Icecat) you also have to go to @code{about:config} and set the key
  1507. @code{network.proxy.socks_remote_dns} to @code{true}.
  1508. When you visit @code{https://homepage.test/}, you should get to the
  1509. @code{https://gnunet.org/} frontpage and the browser (with the correctly
  1510. configured proxy) should give you a valid SSL certificate for
  1511. @code{homepage.gnu} and no warnings. It should look like this:
  1512. @c FIXME: Image does not exist, create it or save it from Drupal?
  1513. @c @image{images/gnunethpgns.png,5in,, picture of homepage.gnu in Webbrowser}
  1514. @node Migrating existing DNS zones into GNS
  1515. @subsubsection Migrating existing DNS zones into GNS
  1516. To migrate an existing zone into GNS use the Ascension tool.
  1517. Ascension transfers entire zones into GNS by doing incremental zone transfers
  1518. and then adding the records to GNS.
  1519. Compared to the gnunet-zoneimport tool it strictly uses AXFR or IXFR depending
  1520. on whether or not there exists a SOA record for the zone. If that is the case it
  1521. will take the serial as a reference point and request the zone. The server will
  1522. either answer the IXFR request with a correct incremental zone or with the
  1523. entire zone, which depends on the server configuration.
  1524. You can find the source code here: @code{https://git.gnunet.org/ascension.git/}
  1525. The software can be installed into a Python virtual environment like this:
  1526. @example
  1527. $ python3 -m venv .venv
  1528. $ source .venv/bin/activate
  1529. $ python3 setup.py install
  1530. @end example
  1531. Or installed globally like this:
  1532. @example
  1533. $ sudo python3 setup.py install
  1534. @end example
  1535. Pip will then install all the necessary requirements that are needed to run
  1536. Ascension. For development purposes a virtual environment should suffice.
  1537. Keeping a virtual environment helps with keeping things tidy and prevents
  1538. breaking of Ascension through a future Python update.
  1539. The advantage of using a virtual environment is, that all the dependencies can
  1540. be installed separately in different versions without touching your systems
  1541. Python installation and its dependencies.
  1542. Another way to install Ascension on Debian is to install the python3-ascension
  1543. package. It can be found within the above mentioned Ascension git repository.
  1544. This also adds a system user called ascension and runs a GNUnet peer in the
  1545. background. Please note: This only works if a recent version of GNUnet is
  1546. installed on your system. The version number of Ascension is chosen according
  1547. to the required feature level of GNUnet: Ascension 0.11.5 is only
  1548. compatible with GNUnet 0.11.5 or later and so on.
  1549. As Debian's packages for GNUnet are outdated even in experimental,
  1550. you will need to install GNUnet manually
  1551. @xref{Installing GNUnet}.
  1552. Please check @xref{Migrating an existing DNS zone into GNS}, for usage manual
  1553. of the tool.
  1554. @node Configuring the GNUnet VPN
  1555. @subsection Configuring the GNUnet VPN
  1556. @menu
  1557. * IPv4 address for interface::
  1558. * IPv6 address for interface::
  1559. * Configuring the GNUnet VPN DNS::
  1560. * Configuring the GNUnet VPN Exit Service::
  1561. * IP Address of external DNS resolver::
  1562. * IPv4 address for Exit interface::
  1563. * IPv6 address for Exit interface::
  1564. @end menu
  1565. Before configuring the GNUnet VPN, please make sure that system-wide DNS
  1566. interception is configured properly as described in the section on the
  1567. GNUnet DNS setup. @pxref{Configuring the GNU Name System},
  1568. if you haven't done so already.
  1569. The default options for the GNUnet VPN are usually sufficient to use
  1570. GNUnet as a Layer 2 for your Internet connection.
  1571. However, what you always have to specify is which IP protocol you want
  1572. to tunnel: IPv4, IPv6 or both.
  1573. Furthermore, if you tunnel both, you most likely should also tunnel
  1574. all of your DNS requests.
  1575. You theoretically can tunnel "only" your DNS traffic, but that usually
  1576. makes little sense.
  1577. The other options as shown on the gnunet-setup tool are:
  1578. @node IPv4 address for interface
  1579. @subsubsection IPv4 address for interface
  1580. This is the IPv4 address the VPN interface will get. You should pick a
  1581. 'private' IPv4 network that is not yet in use for you system. For example,
  1582. if you use @code{10.0.0.1/255.255.0.0} already, you might use
  1583. @code{10.1.0.1/255.255.0.0}.
  1584. If you use @code{10.0.0.1/255.0.0.0} already, then you might use
  1585. @code{192.168.0.1/255.255.0.0}.
  1586. If your system is not in a private IP-network, using any of the above will
  1587. work fine.
  1588. You should try to make the mask of the address big enough
  1589. (@code{255.255.0.0} or, even better, @code{255.0.0.0}) to allow more
  1590. mappings of remote IP Addresses into this range.
  1591. However, even a @code{255.255.255.0} mask will suffice for most users.
  1592. @node IPv6 address for interface
  1593. @subsubsection IPv6 address for interface
  1594. The IPv6 address the VPN interface will get. Here you can specify any
  1595. non-link-local address (the address should not begin with @code{fe80:}).
  1596. A subnet Unique Local Unicast (@code{fd00::/8} prefix) that you are
  1597. currently not using would be a good choice.
  1598. @node Configuring the GNUnet VPN DNS
  1599. @subsubsection Configuring the GNUnet VPN DNS
  1600. To resolve names for remote nodes, activate the DNS exit option.
  1601. @node Configuring the GNUnet VPN Exit Service
  1602. @subsubsection Configuring the GNUnet VPN Exit Service
  1603. If you want to allow other users to share your Internet connection (yes,
  1604. this may be dangerous, just as running a Tor exit node) or want to
  1605. provide access to services on your host (this should be less dangerous,
  1606. as long as those services are secure), you have to enable the GNUnet exit
  1607. daemon.
  1608. You then get to specify which exit functions you want to provide. By
  1609. enabling the exit daemon, you will always automatically provide exit
  1610. functions for manually configured local services (this component of the
  1611. system is under
  1612. development and not documented further at this time). As for those
  1613. services you explicitly specify the target IP address and port, there is
  1614. no significant security risk in doing so.
  1615. Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet.
  1616. Being a DNS exit is usually pretty harmless. However, enabling IPv4 or
  1617. IPv6-exit without further precautions may enable adversaries to access
  1618. your local network, send spam, attack other systems from your Internet
  1619. connection and do other mischiefs that will appear to come from your
  1620. machine. This may or may not get you into legal trouble.
  1621. If you want to allow IPv4 or IPv6-exit functionality, you should strongly
  1622. consider adding additional firewall rules manually to protect your local
  1623. network and to restrict outgoing TCP traffic (e.g. by not allowing access
  1624. to port 25). While we plan to improve exit-filtering in the future,
  1625. you're currently on your own here.
  1626. Essentially, be prepared for any kind of IP-traffic to exit the respective
  1627. TUN interface (and GNUnet will enable IP-forwarding and NAT for the
  1628. interface automatically).
  1629. Additional configuration options of the exit as shown by the gnunet-setup
  1630. tool are:
  1631. @node IP Address of external DNS resolver
  1632. @subsubsection IP Address of external DNS resolver
  1633. If DNS traffic is to exit your machine, it will be send to this DNS
  1634. resolver. You can specify an IPv4 or IPv6 address.
  1635. @node IPv4 address for Exit interface
  1636. @subsubsection IPv4 address for Exit interface
  1637. This is the IPv4 address the Interface will get. Make the mask of the
  1638. address big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more
  1639. mappings of IP addresses into this range. As for the VPN interface, any
  1640. unused, private IPv4 address range will do.
  1641. @node IPv6 address for Exit interface
  1642. @subsubsection IPv6 address for Exit interface
  1643. The public IPv6 address the interface will get. If your kernel is not a
  1644. very recent kernel and you are willing to manually enable IPv6-NAT, the
  1645. IPv6 address you specify here must be a globally routed IPv6 address of
  1646. your host.
  1647. Suppose your host has the address @code{2001:4ca0::1234/64}, then
  1648. using @code{2001:4ca0::1:0/112} would be fine (keep the first 64 bits,
  1649. then change at least one bit in the range before the bitmask, in the
  1650. example above we changed bit 111 from 0 to 1).
  1651. You may also have to configure your router to route traffic for the entire
  1652. subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this
  1653. should be automatic with IPv6, but obviously anything can be
  1654. disabled).
  1655. @node Bandwidth Configuration
  1656. @subsection Bandwidth Configuration
  1657. You can specify how many bandwidth GNUnet is allowed to use to receive
  1658. and send data. This is important for users with limited bandwidth or
  1659. traffic volume.
  1660. @node Configuring NAT
  1661. @subsection Configuring NAT
  1662. Most hosts today do not have a normal global IP address but instead are
  1663. behind a router performing Network Address Translation (NAT) which assigns
  1664. each host in the local network a private IP address.
  1665. As a result, these machines cannot trivially receive inbound connections
  1666. from the Internet. GNUnet supports NAT traversal to enable these machines
  1667. to receive incoming connections from other peers despite their
  1668. limitations.
  1669. In an ideal world, you can press the "Attempt automatic configuration"
  1670. button in gnunet-setup to automatically configure your peer correctly.
  1671. Alternatively, your distribution might have already triggered this
  1672. automatic configuration during the installation process.
  1673. However, automatic configuration can fail to determine the optimal
  1674. settings, resulting in your peer either not receiving as many connections
  1675. as possible, or in the worst case it not connecting to the network at all.
  1676. To manually configure the peer, you need to know a few things about your
  1677. network setup. First, determine if you are behind a NAT in the first
  1678. place.
  1679. This is always the case if your IP address starts with "10.*" or
  1680. "192.168.*". Next, if you have control over your NAT router, you may
  1681. choose to manually configure it to allow GNUnet traffic to your host.
  1682. If you have configured your NAT to forward traffic on ports 2086 (and
  1683. possibly 1080) to your host, you can check the "NAT ports have been opened
  1684. manually" option, which corresponds to the "PUNCHED_NAT" option in the
  1685. configuration file. If you did not punch your NAT box, it may still be
  1686. configured to support UPnP, which allows GNUnet to automatically
  1687. configure it. In that case, you need to install the "upnpc" command,
  1688. enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal
  1689. via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the
  1690. configuration file).
  1691. Some NAT boxes can be traversed using the autonomous NAT traversal method.
  1692. This requires certain GNUnet components to be installed with "SUID"
  1693. privileges on your system (so if you're installing on a system you do
  1694. not have administrative rights to, this will not work).
  1695. If you installed as 'root', you can enable autonomous NAT traversal by
  1696. checking the "Enable NAT traversal using ICMP method".
  1697. The ICMP method requires a way to determine your NAT's external (global)
  1698. IP address. This can be done using either UPnP, DynDNS, or by manual
  1699. configuration. If you have a DynDNS name or know your external IP address,
  1700. you should enter that name under "External (public) IPv4 address" (which
  1701. corresponds to the "EXTERNAL_ADDRESS" option in the configuration file).
  1702. If you leave the option empty, GNUnet will try to determine your external
  1703. IP address automatically (which may fail, in which case autonomous
  1704. NAT traversal will then not work).
  1705. Finally, if you yourself are not behind NAT but want to be able to
  1706. connect to NATed peers using autonomous NAT traversal, you need to check
  1707. the "Enable connecting to NATed peers using ICMP method" box.
  1708. @node Peer configuration for distributors (e.g. Operating Systems)
  1709. @subsection Peer configuration for distributors (e.g. Operating Systems)
  1710. The "GNUNET_DATA_HOME" in "[PATHS]" in @file{/etc/gnunet.conf} should be
  1711. manually set to "/var/lib/gnunet/data/" as the default
  1712. "~/.local/share/gnunet/" is probably not that appropriate in this case.
  1713. Similarly, distributors may consider pointing "GNUNET_RUNTIME_DIR" to
  1714. "/var/run/gnunet/" and "GNUNET_HOME" to "/var/lib/gnunet/". Also, should a
  1715. distributor decide to override system defaults, all of these changes
  1716. should be done in a custom @file{/etc/gnunet.conf} and not in the files
  1717. in the @file{config.d/} directory.
  1718. Given the proposed access permissions, the "gnunet-setup" tool must be
  1719. run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it
  1720. modifies the system configuration). As always, gnunet-setup should be run
  1721. after the GNUnet peer was stopped using "gnunet-arm -e". Distributors
  1722. might want to include a wrapper for gnunet-setup that allows the
  1723. desktop-user to "sudo" (e.g. using gtksudo) to the "gnunet" user account
  1724. and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in
  1725. sequence.
  1726. @node Config Leftovers
  1727. @section Config Leftovers
  1728. This section describes how to start a GNUnet peer. It assumes that you
  1729. have already compiled and installed GNUnet and its' dependencies.
  1730. Before you start a GNUnet peer, you may want to create a configuration
  1731. file using gnunet-setup (but you do not have to).
  1732. Sane defaults should exist in your
  1733. @file{$GNUNET_PREFIX/share/gnunet/config.d/} directory, so in practice
  1734. you could simply start without any configuration. If you want to
  1735. configure your peer later, you need to stop it before invoking the
  1736. @code{gnunet-setup} tool to customize further and to test your
  1737. configuration (@code{gnunet-setup} has built-in test functions).
  1738. The most important option you might have to still set by hand is in
  1739. [PATHS]. Here, you use the option "GNUNET_HOME" to specify the path where
  1740. GNUnet should store its data.
  1741. It defaults to @code{$HOME/}, which again should work for most users.
  1742. Make sure that the directory specified as GNUNET_HOME is writable to
  1743. the user that you will use to run GNUnet (note that you can run frontends
  1744. using other users, GNUNET_HOME must only be accessible to the user used to
  1745. run the background processes).
  1746. You will also need to make one central decision: should all of GNUnet be
  1747. run under your normal UID, or do you want distinguish between system-wide
  1748. (user-independent) GNUnet services and personal GNUnet services. The
  1749. multi-user setup is slightly more complicated, but also more secure and
  1750. generally recommended.
  1751. @menu
  1752. * The Single-User Setup::
  1753. * The Multi-User Setup::
  1754. * Killing GNUnet services::
  1755. * Access Control for GNUnet::
  1756. @end menu
  1757. @node The Single-User Setup
  1758. @subsection The Single-User Setup
  1759. For the single-user setup, you do not need to do anything special and can
  1760. just start the GNUnet background processes using @code{gnunet-arm}.
  1761. By default, GNUnet looks in @file{~/.config/gnunet.conf} for a
  1762. configuration (or @code{$XDG_CONFIG_HOME/gnunet.conf} if@
  1763. @code{$XDG_CONFIG_HOME} is defined). If your configuration lives
  1764. elsewhere, you need to pass the @code{-c FILENAME} option to all GNUnet
  1765. commands.
  1766. Assuming the configuration file is called @file{~/.config/gnunet.conf},
  1767. you start your peer using the @code{gnunet-arm} command (say as user
  1768. @code{gnunet}) using:
  1769. @example
  1770. gnunet-arm -c ~/.config/gnunet.conf -s
  1771. @end example
  1772. @noindent
  1773. The "-s" option here is for "start". The command should return almost
  1774. instantly. If you want to stop GNUnet, you can use:
  1775. @example
  1776. gnunet-arm -c ~/.config/gnunet.conf -e
  1777. @end example
  1778. @noindent
  1779. The "-e" option here is for "end".
  1780. Note that this will only start the basic peer, no actual applications
  1781. will be available.
  1782. If you want to start the file-sharing service, use (after starting
  1783. GNUnet):
  1784. @example
  1785. gnunet-arm -c ~/.config/gnunet.conf -i fs
  1786. @end example
  1787. @noindent
  1788. The "-i fs" option here is for "initialize" the "fs" (file-sharing)
  1789. application. You can also selectively kill only file-sharing support using
  1790. @example
  1791. gnunet-arm -c ~/.config/gnunet.conf -k fs
  1792. @end example
  1793. @noindent
  1794. Assuming that you want certain services (like file-sharing) to be always
  1795. automatically started whenever you start GNUnet, you can activate them by
  1796. setting "IMMEDIATE_START=YES" in the respective section of the configuration
  1797. file (for example, "[fs]"). Then GNUnet with file-sharing support would
  1798. be started whenever you@ enter:
  1799. @example
  1800. gnunet-arm -c ~/.config/gnunet.conf -s
  1801. @end example
  1802. @noindent
  1803. Alternatively, you can combine the two options:
  1804. @example
  1805. gnunet-arm -c ~/.config/gnunet.conf -s -i fs
  1806. @end example
  1807. @noindent
  1808. Using @code{gnunet-arm} is also the preferred method for initializing
  1809. GNUnet from @code{init}.
  1810. Finally, you should edit your @code{crontab} (using the @code{crontab}
  1811. command) and insert a line@
  1812. @example
  1813. @@reboot gnunet-arm -c ~/.config/gnunet.conf -s
  1814. @end example
  1815. to automatically start your peer whenever your system boots.
  1816. @node The Multi-User Setup
  1817. @subsection The Multi-User Setup
  1818. This requires you to create a user @code{gnunet} and an additional group
  1819. @code{gnunetdns}, prior to running @code{make install} during
  1820. installation.
  1821. Then, you create a configuration file @file{/etc/gnunet.conf} which should
  1822. contain the lines:@
  1823. @example
  1824. [arm]
  1825. START_SYSTEM_SERVICES = YES
  1826. START_USER_SERVICES = NO
  1827. @end example
  1828. @noindent
  1829. Then, perform the same steps to run GNUnet as in the per-user
  1830. configuration, except as user @code{gnunet} (including the
  1831. @code{crontab} installation).
  1832. You may also want to run @code{gnunet-setup} to configure your peer
  1833. (databases, etc.).
  1834. Make sure to pass @code{-c /etc/gnunet.conf} to all commands. If you
  1835. run @code{gnunet-setup} as user @code{gnunet}, you might need to change
  1836. permissions on @file{/etc/gnunet.conf} so that the @code{gnunet} user can
  1837. write to the file (during setup).
  1838. Afterwards, you need to perform another setup step for each normal user
  1839. account from which you want to access GNUnet. First, grant the normal user
  1840. (@code{$USER}) permission to the group gnunet:
  1841. @example
  1842. # adduser $USER gnunet
  1843. @end example
  1844. @noindent
  1845. Then, create a configuration file in @file{~/.config/gnunet.conf} for the
  1846. $USER with the lines:
  1847. @example
  1848. [arm]
  1849. START_SYSTEM_SERVICES = NO
  1850. START_USER_SERVICES = YES
  1851. @end example
  1852. @noindent
  1853. This will ensure that @code{gnunet-arm} when started by the normal user
  1854. will only run services that are per-user, and otherwise rely on the
  1855. system-wide services.
  1856. Note that the normal user may run gnunet-setup, but the
  1857. configuration would be ineffective as the system-wide services will use
  1858. @file{/etc/gnunet.conf} and ignore options set by individual users.
  1859. Again, each user should then start the peer using
  1860. @file{gnunet-arm -s} --- and strongly consider adding logic to start
  1861. the peer automatically to their crontab.
  1862. Afterwards, you should see two (or more, if you have more than one USER)
  1863. @code{gnunet-service-arm} processes running in your system.
  1864. @node Killing GNUnet services
  1865. @subsection Killing GNUnet services
  1866. It is not necessary to stop GNUnet services explicitly when shutting
  1867. down your computer.
  1868. It should be noted that manually killing "most" of the
  1869. @code{gnunet-service} processes is generally not a successful method for
  1870. stopping a peer (since @code{gnunet-service-arm} will instantly restart
  1871. them). The best way to explicitly stop a peer is using
  1872. @code{gnunet-arm -e}; note that the per-user services may need to be
  1873. terminated before the system-wide services will terminate normally.
  1874. @node Access Control for GNUnet
  1875. @subsection Access Control for GNUnet
  1876. This chapter documents how we plan to make access control work within the
  1877. GNUnet system for a typical peer. It should be read as a best-practice
  1878. installation guide for advanced users and builders of binary
  1879. distributions. The recommendations in this guide apply to POSIX-systems
  1880. with full support for UNIX domain sockets only.
  1881. Note that this is an advanced topic. The discussion presumes a very good
  1882. understanding of users, groups and file permissions. Normal users on
  1883. hosts with just a single user can just install GNUnet under their own
  1884. account (and possibly allow the installer to use SUDO to grant additional
  1885. permissions for special GNUnet tools that need additional rights).
  1886. The discussion below largely applies to installations where multiple users
  1887. share a system and to installations where the best possible security is
  1888. paramount.
  1889. A typical GNUnet system consists of components that fall into four
  1890. categories:
  1891. @table @asis
  1892. @item User interfaces
  1893. User interfaces are not security sensitive and are supposed to be run and
  1894. used by normal system users.
  1895. The GTK GUIs and most command-line programs fall into this category.
  1896. Some command-line tools (like gnunet-transport) should be excluded as they
  1897. offer low-level access that normal users should not need.
  1898. @item System services and support tools
  1899. System services should always run and offer services that can then be
  1900. accessed by the normal users.
  1901. System services do not require special permissions, but as they are not
  1902. specific to a particular user, they probably should not run as a
  1903. particular user. Also, there should typically only be one GNUnet peer per
  1904. host. System services include the gnunet-service and gnunet-daemon
  1905. programs; support tools include command-line programs such as gnunet-arm.
  1906. @item Privileged helpers
  1907. Some GNUnet components require root rights to open raw sockets or perform
  1908. other special operations. These gnunet-helper binaries are typically
  1909. installed SUID and run from services or daemons.
  1910. @item Critical services
  1911. Some GNUnet services (such as the DNS service) can manipulate the service
  1912. in deep and possibly highly security sensitive ways. For example, the DNS
  1913. service can be used to intercept and alter any DNS query originating from
  1914. the local machine. Access to the APIs of these critical services and their
  1915. privileged helpers must be tightly controlled.
  1916. @end table
  1917. @c FIXME: The titles of these chapters are too long in the index.
  1918. @menu
  1919. * Recommendation - Disable access to services via TCP::
  1920. * Recommendation - Run most services as system user "gnunet"::
  1921. * Recommendation - Control access to services using group "gnunet"::
  1922. * Recommendation - Limit access to certain SUID binaries by group "gnunet"::
  1923. * Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"::
  1924. * Differences between "make install" and these recommendations::
  1925. @end menu
  1926. @node Recommendation - Disable access to services via TCP
  1927. @subsubsection Recommendation - Disable access to services via TCP
  1928. GNUnet services allow two types of access: via TCP socket or via UNIX
  1929. domain socket.
  1930. If the service is available via TCP, access control can only be
  1931. implemented by restricting connections to a particular range of IP
  1932. addresses.
  1933. This is acceptable for non-critical services that are supposed to be
  1934. available to all users on the local system or local network.
  1935. However, as TCP is generally less efficient and it is rarely the case
  1936. that a single GNUnet peer is supposed to serve an entire local network,
  1937. the default configuration should disable TCP access to all GNUnet
  1938. services on systems with support for UNIX domain sockets.
  1939. Since GNUnet 0.9.2, configuration files with TCP access disabled should be
  1940. generated by default. Users can re-enable TCP access to particular
  1941. services simply by specifying a non-zero port number in the section of
  1942. the respective service.
  1943. @node Recommendation - Run most services as system user "gnunet"
  1944. @subsubsection Recommendation - Run most services as system user "gnunet"
  1945. GNUnet's main services should be run as a separate user "gnunet" in a
  1946. special group "gnunet".
  1947. The user "gnunet" should start the peer using "gnunet-arm -s" during
  1948. system startup. The home directory for this user should be
  1949. @file{/var/lib/gnunet} and the configuration file should be
  1950. @file{/etc/gnunet.conf}.
  1951. Only the @code{gnunet} user should have the right to access
  1952. @file{/var/lib/gnunet} (@emph{mode: 700}).
  1953. @node Recommendation - Control access to services using group "gnunet"
  1954. @subsubsection Recommendation - Control access to services using group "gnunet"
  1955. Users that should be allowed to use the GNUnet peer should be added to the
  1956. group "gnunet". Using GNUnet's access control mechanism for UNIX domain
  1957. sockets, those services that are considered useful to ordinary users
  1958. should be made available by setting "UNIX_MATCH_GID=YES" for those
  1959. services.
  1960. Again, as shipped, GNUnet provides reasonable defaults.
  1961. Permissions to access the transport and core subsystems might additionally
  1962. be granted without necessarily causing security concerns.
  1963. Some services, such as DNS, must NOT be made accessible to the "gnunet"
  1964. group (and should thus only be accessible to the "gnunet" user and
  1965. services running with this UID).
  1966. @node Recommendation - Limit access to certain SUID binaries by group "gnunet"
  1967. @subsubsection Recommendation - Limit access to certain SUID binaries by group "gnunet"
  1968. Most of GNUnet's SUID binaries should be safe even if executed by normal
  1969. users. However, it is possible to reduce the risk a little bit more by
  1970. making these binaries owned by the group "gnunet" and restricting their
  1971. execution to user of the group "gnunet" as well (4750).
  1972. @node Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"
  1973. @subsubsection Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"
  1974. A special group "gnunetdns" should be created for controlling access to
  1975. the "gnunet-helper-dns".
  1976. The binary should then be owned by root and be in group "gnunetdns" and
  1977. be installed SUID and only be group-executable (2750).
  1978. @b{Note that the group "gnunetdns" should have no users in it at all,
  1979. ever.}
  1980. The "gnunet-service-dns" program should be executed by user "gnunet" (via
  1981. gnunet-service-arm) with the binary owned by the user "root" and the group
  1982. "gnunetdns" and be SGID (2700). This way, @strong{only}
  1983. "gnunet-service-dns" can change its group to "gnunetdns" and execute the
  1984. helper, and the helper can then run as root (as per SUID).
  1985. Access to the API offered by "gnunet-service-dns" is in turn restricted
  1986. to the user "gnunet" (not the group!), which means that only
  1987. "benign" services can manipulate DNS queries using "gnunet-service-dns".
  1988. @node Differences between "make install" and these recommendations
  1989. @subsubsection Differences between "make install" and these recommendations
  1990. The current build system does not set all permissions automatically based
  1991. on the recommendations above. In particular, it does not use the group
  1992. "gnunet" at all (so setting gnunet-helpers other than the
  1993. gnunet-helper-dns to be owned by group "gnunet" must be done manually).
  1994. Furthermore, 'make install' will silently fail to set the DNS binaries to
  1995. be owned by group "gnunetdns" unless that group already exists (!).
  1996. An alternative name for the "gnunetdns" group can be specified using the
  1997. @code{--with-gnunetdns=GRPNAME} configure option.