aboutsummaryrefslogtreecommitdiff
path: root/doc/documentation/chapters/user.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/documentation/chapters/user.texi')
-rw-r--r--doc/documentation/chapters/user.texi1972
1 files changed, 1951 insertions, 21 deletions
diff --git a/doc/documentation/chapters/user.texi b/doc/documentation/chapters/user.texi
index e5ebf5371..422619f84 100644
--- a/doc/documentation/chapters/user.texi
+++ b/doc/documentation/chapters/user.texi
@@ -2,20 +2,21 @@
2@chapter Using GNUnet 2@chapter Using GNUnet
3@c %**end of header 3@c %**end of header
4 4
5This tutorial is supposed to give a first introduction for end-users 5This tutorial is supposed to give a first introduction for users
6trying to do something "real" with GNUnet. Installation and 6trying to do something real with GNUnet. Installation and
7configuration are specifically outside of the scope of this tutorial. 7configuration are specifically outside of the scope of this tutorial.
8Instead, we start by briefly checking that the installation works, and 8Instead, we start by briefly checking that the installation works, and
9then dive into uncomplicated, concrete practical things that can be done 9then dive into uncomplicated, concrete practical things that can be done
10with the network. 10with the framework provided by GNUnet.
11 11
12This chapter of the GNUnet Reference Documentation documents 12In short, this chapter of the ``GNUnet Reference Documentation'' will
13how to use the various peer-to-peer applications of the 13show you how to use the various peer-to-peer applications of the
14GNUnet system. 14GNUnet system.
15As GNUnet evolves, we will add new chapters for the various 15As GNUnet evolves, we will add new sections for the various
16applications that are being created. 16applications that are being created.
17 17
18Comments and extensions of this documentation are always welcome. 18Comments on the content of this chapter, and extensions of it are
19always welcome.
19 20
20 21
21@menu 22@menu
@@ -27,16 +28,19 @@ Comments and extensions of this documentation are always welcome.
27* File-sharing:: 28* File-sharing::
28* The GNU Name System:: 29* The GNU Name System::
29* Using the Virtual Public Network:: 30* Using the Virtual Public Network::
31* The graphical configuration interface::
32* How to start and stop a GNUnet peer::
30@end menu 33@end menu
31 34
32@node Checking the Installation 35@node Checking the Installation
33@section Checking the Installation 36@section Checking the Installation
34@c %**end of header 37@c %**end of header
35 38
36This section describes a quick casual way to check if your GNUnet 39This section describes a quick, casual way to check if your GNUnet
37installation works. However, if it does not, we do not cover 40installation works. However, if it does not, we do not cover
38steps for recovery --- for this, please study the installation and 41steps for recovery --- for this, please study the instructions
39configuration handbooks. 42provided in the developer handbook as well as the system-specific
43instruction in the source code repository@footnote{The system specific instructions are not provided as part of this handbook!}.
40 44
41 45
42@menu 46@menu
@@ -45,13 +49,16 @@ configuration handbooks.
45* Peer Information:: 49* Peer Information::
46@end menu 50@end menu
47 51
52@cindex GNUnet GTK
53@cindex GTK
54@cindex GTK user interface
48@node gnunet-gtk 55@node gnunet-gtk
49@subsection gnunet-gtk 56@subsection gnunet-gtk
50@c %**end of header 57@c %**end of header
51 58
52The @command{gnunet-gtk} package contains several graphical 59The @command{gnunet-gtk} package contains several graphical
53user interfaces for the respective GNUnet applications. 60user interfaces for the respective GNUnet applications.
54Those currently are: 61Currently these interfaces cover:
55 62
56@itemize @bullet 63@itemize @bullet
57@item Statistics 64@item Statistics
@@ -66,20 +73,21 @@ Those currently are:
66@subsection Statistics 73@subsection Statistics
67@c %**end of header 74@c %**end of header
68 75
69First, you should launch the graphical user interface. You can do 76First, you should launch GNUnet gtk@footnote{Obviously you should also start gnunet, via gnunet-arm or the system provided method}.
70this from the command-line by typing 77You can do this from the command-line by typing
71 78
72@example 79@example
73$ gnunet-statistics-gtk 80gnunet-statistics-gtk
74@end example 81@end example
75 82
76If your peer is running correctly, you should see a bunch of 83If your peer@footnote{The term ``peer'' is a common word used in federated and distributed networks to describe a participating device which is connected to the network. Thus, your Personal Computer or whatever it is you are looking at the Gtk+ interface describes a ``Peer'' or a ``Node''.}
77lines, all of which should be "significantly" above zero (at least if your 84is running correctly, you should see a bunch of lines,
78peer has been running for a few seconds). The lines indicate how many 85all of which should be ``significantly'' above zero (at least if your
79other 86peer has been running for more than a few seconds). The lines indicate
80peers your peer is connected to (via different mechanisms) and how large 87how many other peers your peer is connected to (via different
81the overall overlay network is currently estimated to be. The X-axis 88mechanisms) and how large the entire overlay network is currently
82represents time (in seconds since the start of @command{gnunet-gtk}). 89estimated to be. The X-axis represents time (in seconds since the
90start of @command{gnunet-gtk}).
83 91
84You can click on "Traffic" to see information about the amount of 92You can click on "Traffic" to see information about the amount of
85bandwidth your peer has consumed, and on "Storage" to check the amount 93bandwidth your peer has consumed, and on "Storage" to check the amount
@@ -2006,3 +2014,1925 @@ service offered by that peer, you can create an IP tunnel to
2006that peer by specifying the peer's identity, service name and 2014that peer by specifying the peer's identity, service name and
2007protocol (--tcp or --udp) and you will again receive an IP address 2015protocol (--tcp or --udp) and you will again receive an IP address
2008that will terminate at the respective peer's service. 2016that will terminate at the respective peer's service.
2017
2018
2019
2020@c NOTE: Inserted from Installation Handbook in original ``order'':
2021@c FIXME: Move this to User Handbook.
2022@node The graphical configuration interface
2023@section The graphical configuration interface
2024
2025If you also would like to use @command{gnunet-gtk} and
2026@command{gnunet-setup} (highly recommended for beginners), do:
2027
2028@menu
2029* Configuring your peer::
2030* Configuring the Friend-to-Friend (F2F) mode::
2031* Configuring the hostlist to bootstrap::
2032* Configuration of the HOSTLIST proxy settings::
2033* Configuring your peer to provide a hostlist ::
2034* Configuring the datastore::
2035* Configuring the MySQL database::
2036* Reasons for using MySQL::
2037* Reasons for not using MySQL::
2038* Setup Instructions::
2039* Testing::
2040* Performance Tuning::
2041* Setup for running Testcases::
2042* Configuring the Postgres database::
2043* Reasons to use Postgres::
2044* Reasons not to use Postgres::
2045* Manual setup instructions::
2046* Testing the setup manually::
2047* Configuring the datacache::
2048* Configuring the file-sharing service::
2049* Configuring logging::
2050* Configuring the transport service and plugins::
2051* Configuring the wlan transport plugin::
2052* Configuring HTTP(S) reverse proxy functionality using Apache or nginx::
2053* Blacklisting peers::
2054* Configuration of the HTTP and HTTPS transport plugins::
2055* Configuring the GNU Name System::
2056* Configuring the GNUnet VPN::
2057* Bandwidth Configuration::
2058* Configuring NAT::
2059* Peer configuration for distributions::
2060@end menu
2061
2062@node Configuring your peer
2063@subsection Configuring your peer
2064
2065This chapter will describe the various configuration options in GNUnet.
2066
2067The easiest way to configure your peer is to use the
2068@command{gnunet-setup} tool.
2069@command{gnunet-setup} is part of the @command{gnunet-gtk}
2070application. You might have to install it separately.
2071
2072Many of the specific sections from this chapter actually are linked from
2073within @command{gnunet-setup} to help you while using the setup tool.
2074
2075While you can also configure your peer by editing the configuration
2076file by hand, this is not recommended for anyone except for developers
2077as it requires a more in-depth understanding of the configuration files
2078and internal dependencies of GNUnet.
2079
2080@node Configuring the Friend-to-Friend (F2F) mode
2081@subsection Configuring the Friend-to-Friend (F2F) mode
2082
2083GNUnet knows three basic modes of operation:
2084@itemize @bullet
2085@item In standard "peer-to-peer" mode,
2086your peer will connect to any peer.
2087@item In the pure "friend-to-friend"
2088mode, your peer will ONLY connect to peers from a list of friends
2089specified in the configuration.
2090@item Finally, in mixed mode,
2091GNUnet will only connect to arbitrary peers if it
2092has at least a specified number of connections to friends.
2093@end itemize
2094
2095When configuring any of the F2F ("friend-to-friend") modes,
2096you first need to create a file with the peer identities
2097of your friends. Ask your friends to run
2098
2099@example
2100$ gnunet-peerinfo -sq
2101@end example
2102
2103@noindent
2104The resulting output of this command needs to be added to your
2105@file{friends} file, which is simply a plain text file with one line
2106per friend with the output from the above command.
2107
2108You then specify the location of your @file{friends} file in the
2109@code{FRIENDS} option of the "topology" section.
2110
2111Once you have created the @file{friends} file, you can tell GNUnet to only
2112connect to your friends by setting the @code{FRIENDS-ONLY} option
2113(again in the "topology" section) to YES.
2114
2115If you want to run in mixed-mode, set "FRIENDS-ONLY" to NO and configure a
2116minimum number of friends to have (before connecting to arbitrary peers)
2117under the "MINIMUM-FRIENDS" option.
2118
2119If you want to operate in normal P2P-only mode, simply set
2120@code{MINIMUM-FRIENDS} to zero and @code{FRIENDS_ONLY} to NO.
2121This is the default.
2122
2123@node Configuring the hostlist to bootstrap
2124@subsection Configuring the hostlist to bootstrap
2125
2126After installing the software you need to get connected to the GNUnet
2127network. The configuration file included in your download is already
2128configured to connect you to the GNUnet network.
2129In this section the relevant configuration settings are explained.
2130
2131To get an initial connection to the GNUnet network and to get to know
2132peers already connected to the network you can use the so called
2133"bootstrap servers".
2134These servers can give you a list of peers connected to the network.
2135To use these bootstrap servers you have to configure the hostlist daemon
2136to activate bootstrapping.
2137
2138To activate bootstrapping, edit the @code{[hostlist]}-section in your
2139configuration file. You have to set the argument @command{-b} in the
2140options line:
2141
2142@example
2143[hostlist]
2144OPTIONS = -b
2145@end example
2146
2147Additionally you have to specify which server you want to use.
2148The default bootstrapping server is
2149"@uref{http://v10.gnunet.org/hostlist, http://v10.gnunet.org/hostlist}".
2150[^] To set the server you have to edit the line "SERVERS" in the hostlist
2151section. To use the default server you should set the lines to
2152
2153@example
2154SERVERS = http://v10.gnunet.org/hostlist [^]
2155@end example
2156
2157@noindent
2158To use bootstrapping your configuration file should include these lines:
2159
2160@example
2161[hostlist]
2162OPTIONS = -b
2163SERVERS = http://v10.gnunet.org/hostlist [^]
2164@end example
2165
2166@noindent
2167Besides using bootstrap servers you can configure your GNUnet peer to
2168recieve hostlist advertisements.
2169Peers offering hostlists to other peers can send advertisement messages
2170to peers that connect to them. If you configure your peer to receive these
2171messages, your peer can download these lists and connect to the peers
2172included. These lists are persistent, which means that they are saved to
2173your hard disk regularly and are loaded during startup.
2174
2175To activate hostlist learning you have to add the @command{-e}
2176switch to the @code{OPTIONS} line in the hostlist section:
2177
2178@example
2179[hostlist]
2180OPTIONS = -b -e
2181@end example
2182
2183@noindent
2184Furthermore you can specify in which file the lists are saved.
2185To save the lists in the file @file{hostlists.file} just add the line:
2186
2187@example
2188HOSTLISTFILE = hostlists.file
2189@end example
2190
2191@noindent
2192Best practice is to activate both bootstrapping and hostlist learning.
2193So your configuration file should include these lines:
2194
2195@example
2196[hostlist]
2197OPTIONS = -b -e
2198HTTPPORT = 8080
2199SERVERS = http://v10.gnunet.org/hostlist [^]
2200HOSTLISTFILE = $SERVICEHOME/hostlists.file
2201@end example
2202
2203@node Configuration of the HOSTLIST proxy settings
2204@subsection Configuration of the HOSTLIST proxy settings
2205
2206The hostlist client can be configured to use a proxy to connect to the
2207hostlist server.
2208This functionality can be configured in the configuration file directly
2209or using the @command{gnunet-setup} tool.
2210
2211The hostlist client supports the following proxy types at the moment:
2212
2213@itemize @bullet
2214@item HTTP and HTTP 1.0 only proxy
2215@item SOCKS 4/4a/5/5 with hostname
2216@end itemize
2217
2218In addition authentication at the proxy with username and password can be
2219configured.
2220
2221To configure proxy support for the hostlist client in the
2222@command{gnunet-setup} tool, select the "hostlist" tab and select
2223the appropriate proxy type.
2224The hostname or IP address (including port if required) has to be entered
2225in the "Proxy hostname" textbox. If required, enter username and password
2226in the "Proxy username" and "Proxy password" boxes.
2227Be aware that this information will be stored in the configuration in
2228plain text (TODO: Add explanation and generalize the part in Chapter 3.6
2229about the encrypted home).
2230
2231To provide these options directly in the configuration, you can
2232enter the following settings in the @code{[hostlist]} section of
2233the configuration:
2234
2235@example
2236# Type of proxy server,
2237# Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
2238# Default: HTTP
2239# PROXY_TYPE = HTTP
2240
2241# Hostname or IP of proxy server
2242# PROXY =
2243# User name for proxy server
2244# PROXY_USERNAME =
2245# User password for proxy server
2246# PROXY_PASSWORD =
2247@end example
2248
2249@node Configuring your peer to provide a hostlist
2250@subsection Configuring your peer to provide a hostlist
2251
2252If you operate a peer permanently connected to GNUnet you can configure
2253your peer to act as a hostlist server, providing other peers the list of
2254peers known to him.
2255
2256Your server can act as a bootstrap server and peers needing to obtain a
2257list of peers can contact it to download this list.
2258To download this hostlist the peer uses HTTP.
2259For this reason you have to build your peer with libgnurl (or libcurl)
2260and microhttpd support.
2261
2262To configure your peer to act as a bootstrap server you have to add the
2263@command{-p} option to @code{OPTIONS} in the @code{[hostlist]} section
2264of your configuration file.
2265Besides that you have to specify a port number for the http server.
2266In conclusion you have to add the following lines:
2267
2268@example
2269[hostlist]
2270HTTPPORT = 12980
2271OPTIONS = -p
2272@end example
2273
2274@noindent
2275If your peer acts as a bootstrap server other peers should know about
2276that. You can advertise the hostlist your are providing to other peers.
2277Peers connecting to your peer will get a message containing an
2278advertisement for your hostlist and the URL where it can be downloaded.
2279If this peer is in learning mode, it will test the hostlist and, in the
2280case it can obtain the list successfully, it will save it for
2281bootstrapping.
2282
2283To activate hostlist advertisement on your peer, you have to set the
2284following lines in your configuration file:
2285
2286@example
2287[hostlist]
2288EXTERNAL_DNS_NAME = example.org
2289HTTPPORT = 12981
2290OPTIONS = -p -a
2291@end example
2292
2293@noindent
2294With this configuration your peer will a act as a bootstrap server and
2295advertise this hostlist to other peers connecting to it.
2296The URL used to download the list will be
2297@code{@uref{http://example.org:12981/, http://example.org:12981/}}.
2298
2299Please notice:
2300
2301@itemize @bullet
2302@item The hostlist is @b{not} human readable, so you should not try to
2303download it using your webbrowser. Just point your GNUnet peer to the
2304address!
2305@item Advertising without providing a hostlist does not make sense and
2306will not work.
2307@end itemize
2308
2309@node Configuring the datastore
2310@subsection Configuring the datastore
2311
2312The datastore is what GNUnet uses for long-term storage of file-sharing
2313data. Note that long-term does not mean 'forever' since content does have
2314an expiration date, and of course storage space is finite (and hence
2315sometimes content may have to be discarded).
2316
2317Use the @code{QUOTA} option to specify how many bytes of storage space
2318you are willing to dedicate to GNUnet.
2319
2320In addition to specifying the maximum space GNUnet is allowed to use for
2321the datastore, you need to specify which database GNUnet should use to do
2322so. Currently, you have the choice between sqLite, MySQL and Postgres.
2323
2324@node Configuring the MySQL database
2325@subsection Configuring the MySQL database
2326
2327This section describes how to setup the MySQL database for GNUnet.
2328
2329Note that the mysql plugin does NOT work with mysql before 4.1 since we
2330need prepared statements.
2331We are generally testing the code against MySQL 5.1 at this point.
2332
2333@node Reasons for using MySQL
2334@subsection Reasons for using MySQL
2335
2336@itemize @bullet
2337
2338@item On up-to-date hardware wher
2339mysql can be used comfortably, this module
2340will have better performance than the other database choices (according
2341to our tests).
2342
2343@item Its often possible to recover the mysql database from internal
2344inconsistencies. Some of the other databases do not support repair.
2345@end itemize
2346
2347@node Reasons for not using MySQL
2348@subsection Reasons for not using MySQL
2349
2350@itemize @bullet
2351@item Memory usage (likely not an issue if you have more than 1 GB)
2352@item Complex manual setup
2353@end itemize
2354
2355@node Setup Instructions
2356@subsection Setup Instructions
2357
2358@itemize @bullet
2359
2360@item In @file{gnunet.conf} set in section @code{DATASTORE} the value for
2361@code{DATABASE} to @code{mysql}.
2362
2363@item Access mysql as root:
2364
2365@example
2366$ mysql -u root -p
2367@end example
2368
2369@noindent
2370and issue the following commands, replacing $USER with the username
2371that will be running @command{gnunet-arm} (so typically "gnunet"):
2372
2373@example
2374CREATE DATABASE gnunet;
2375GRANT select,insert,update,delete,create,alter,drop,create \
2376temporary tables ON gnunet.* TO $USER@@localhost;
2377SET PASSWORD FOR $USER@@localhost=PASSWORD('$the_password_you_like');
2378FLUSH PRIVILEGES;
2379@end example
2380
2381@item
2382In the $HOME directory of $USER, create a @file{.my.cnf} file with the
2383following lines
2384
2385@example
2386[client]
2387user=$USER
2388password=$the_password_you_like
2389@end example
2390
2391@end itemize
2392
2393Thats it. Note that @file{.my.cnf} file is a slight security risk unless
2394its on a safe partition. The @file{$HOME/.my.cnf} can of course be
2395a symbolic link.
2396Luckily $USER has only priviledges to mess up GNUnet's tables,
2397which should be pretty harmless.
2398
2399@node Testing
2400@subsection Testing
2401
2402You should briefly try if the database connection works. First, login
2403as $USER. Then use:
2404
2405@example
2406$ mysql -u $USER
2407mysql> use gnunet;
2408@end example
2409
2410@noindent
2411If you get the message
2412
2413@example
2414Database changed
2415@end example
2416
2417@noindent
2418it probably works.
2419
2420If you get
2421
2422@example
2423ERROR 2002: Can't connect to local MySQL server
2424through socket '/tmp/mysql.sock' (2)
2425@end example
2426
2427@noindent
2428it may be resolvable by
2429
2430@example
2431ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
2432@end example
2433
2434@noindent
2435so there may be some additional trouble depending on your mysql setup.
2436
2437@node Performance Tuning
2438@subsection Performance Tuning
2439
2440For GNUnet, you probably want to set the option
2441
2442@example
2443innodb_flush_log_at_trx_commit = 0
2444@end example
2445
2446@noindent
2447for a rather dramatic boost in MySQL performance. However, this reduces
2448the "safety" of your database as with this options you may loose
2449transactions during a power outage.
2450While this is totally harmless for GNUnet, the option applies to all
2451applications using MySQL. So you should set it if (and only if) GNUnet is
2452the only application on your system using MySQL.
2453
2454@node Setup for running Testcases
2455@subsection Setup for running Testcases
2456
2457If you want to run the testcases, you must create a second database
2458"gnunetcheck" with the same username and password. This database will
2459then be used for testing (@command{make check}).
2460
2461@node Configuring the Postgres database
2462@subsection Configuring the Postgres database
2463
2464This text describes how to setup the Postgres database for GNUnet.
2465
2466This Postgres plugin was developed for Postgres 8.3 but might work for
2467earlier versions as well.
2468
2469@node Reasons to use Postgres
2470@subsection Reasons to use Postgres
2471
2472@itemize @bullet
2473@item Easier to setup than MySQL
2474@item Real database
2475@end itemize
2476
2477@node Reasons not to use Postgres
2478@subsection Reasons not to use Postgres
2479
2480@itemize @bullet
2481@item Quite slow
2482@item Still some manual setup required
2483@end itemize
2484
2485@node Manual setup instructions
2486@subsection Manual setup instructions
2487
2488@itemize @bullet
2489@item In @file{gnunet.conf} set in section @code{DATASTORE} the value for
2490@code{DATABASE} to @code{postgres}.
2491@item Access Postgres to create a user:
2492
2493@table @asis
2494@item with Postgres 8.x, use:
2495
2496@example
2497# su - postgres
2498$ createuser
2499@end example
2500
2501@noindent
2502and enter the name of the user running GNUnet for the role interactively.
2503Then, when prompted, do not set it to superuser, allow the creation of
2504databases, and do not allow the creation of new roles.
2505
2506@item with Postgres 9.x, use:
2507
2508@example
2509# su - postgres
2510$ createuser -d $GNUNET_USER
2511@end example
2512
2513@noindent
2514where $GNUNET_USER is the name of the user running GNUnet.
2515
2516@end table
2517
2518
2519@item
2520As that user (so typically as user "gnunet"), create a database (or two):
2521
2522@example
2523$ createdb gnunet
2524# this way you can run "make check"
2525$ createdb gnunetcheck
2526@end example
2527
2528@end itemize
2529
2530Now you should be able to start @code{gnunet-arm}.
2531
2532@node Testing the setup manually
2533@subsection Testing the setup manually
2534
2535You may want to try if the database connection works. First, again login
2536as the user who will run @command{gnunet-arm}. Then use:
2537
2538@example
2539$ psql gnunet # or gnunetcheck
2540gnunet=> \dt
2541@end example
2542
2543@noindent
2544If, after you have started @command{gnunet-arm} at least once, you get
2545a @code{gn090} table here, it probably works.
2546
2547@node Configuring the datacache
2548@subsection Configuring the datacache
2549@c %**end of header
2550
2551The datacache is what GNUnet uses for storing temporary data. This data is
2552expected to be wiped completely each time GNUnet is restarted (or the
2553system is rebooted).
2554
2555You need to specify how many bytes GNUnet is allowed to use for the
2556datacache using the @code{QUOTA} option in the section @code{[dhtcache]}.
2557Furthermore, you need to specify which database backend should be used to
2558store the data. Currently, you have the choice between
2559sqLite, MySQL and Postgres.
2560
2561@node Configuring the file-sharing service
2562@subsection Configuring the file-sharing service
2563
2564In order to use GNUnet for file-sharing, you first need to make sure
2565that the file-sharing service is loaded.
2566This is done by setting the @code{AUTOSTART} option in
2567section @code{[fs]} to "YES". Alternatively, you can run
2568
2569@example
2570$ gnunet-arm -i fs
2571@end example
2572
2573@noindent
2574to start the file-sharing service by hand.
2575
2576Except for configuring the database and the datacache the only important
2577option for file-sharing is content migration.
2578
2579Content migration allows your peer to cache content from other peers as
2580well as send out content stored on your system without explicit requests.
2581This content replication has positive and negative impacts on both system
2582performance and privacy.
2583
2584FIXME: discuss the trade-offs. Here is some older text about it...
2585
2586Setting this option to YES allows gnunetd to migrate data to the local
2587machine. Setting this option to YES is highly recommended for efficiency.
2588Its also the default. If you set this value to YES, GNUnet will store
2589content on your machine that you cannot decrypt.
2590While this may protect you from liability if the judge is sane, it may
2591not (IANAL). If you put illegal content on your machine yourself, setting
2592this option to YES will probably increase your chances to get away with it
2593since you can plausibly deny that you inserted the content.
2594Note that in either case, your anonymity would have to be broken first
2595(which may be possible depending on the size of the GNUnet network and the
2596strength of the adversary).
2597
2598@node Configuring logging
2599@subsection Configuring logging
2600
2601Logging in GNUnet 0.9.0 is controlled via the "-L" and "-l" options.
2602Using @code{-L}, a log level can be specified. With log level
2603@code{ERROR} only serious errors are logged.
2604The default log level is @code{WARNING} which causes anything of
2605concern to be logged.
2606Log level @code{INFO} can be used to log anything that might be
2607interesting information whereas
2608@code{DEBUG} can be used by developers to log debugging messages
2609(but you need to run @code{./configure} with
2610@code{--enable-logging=verbose} to get them compiled).
2611The @code{-l} option is used to specify the log file.
2612
2613Since most GNUnet services are managed by @code{gnunet-arm}, using the
2614@code{-l} or @code{-L} options directly is not possible.
2615Instead, they can be specified using the @code{OPTIONS} configuration
2616value in the respective section for the respective service.
2617In order to enable logging globally without editing the @code{OPTIONS}
2618values for each service, @command{gnunet-arm} supports a
2619@code{GLOBAL_POSTFIX} option.
2620The value specified here is given as an extra option to all services for
2621which the configuration does contain a service-specific @code{OPTIONS}
2622field.
2623
2624@code{GLOBAL_POSTFIX} can contain the special sequence "@{@}" which
2625is replaced by the name of the service that is being started.
2626Furthermore, @code{GLOBAL_POSTFIX} is special in that sequences
2627starting with "$" anywhere in the string are expanded (according
2628to options in @code{PATHS}); this expansion otherwise is
2629only happening for filenames and then the "$" must be the
2630first character in the option. Both of these restrictions do
2631not apply to @code{GLOBAL_POSTFIX}.
2632Note that specifying @code{%} anywhere in the @code{GLOBAL_POSTFIX}
2633disables both of these features.
2634
2635In summary, in order to get all services to log at level
2636@code{INFO} to log-files called @code{SERVICENAME-logs}, the
2637following global prefix should be used:
2638
2639@example
2640GLOBAL_POSTFIX = -l $SERVICEHOME/@{@}-logs -L INFO
2641@end example
2642
2643@node Configuring the transport service and plugins
2644@subsection Configuring the transport service and plugins
2645
2646The transport service in GNUnet is responsible to maintain basic
2647connectivity to other peers.
2648Besides initiating and keeping connections alive it is also responsible
2649for address validation.
2650
2651The GNUnet transport supports more than one transport protocol.
2652These protocols are configured together with the transport service.
2653
2654The configuration section for the transport service itself is quite
2655similar to all the other services
2656
2657@example
2658AUTOSTART = YES
2659@@UNIXONLY@@ PORT = 2091
2660HOSTNAME = localhost
2661HOME = $SERVICEHOME
2662CONFIG = $DEFAULTCONFIG
2663BINARY = gnunet-service-transport
2664#PREFIX = valgrind
2665NEIGHBOUR_LIMIT = 50
2666ACCEPT_FROM = 127.0.0.1;
2667ACCEPT_FROM6 = ::1;
2668PLUGINS = tcp udp
2669UNIXPATH = /tmp/gnunet-service-transport.sock
2670@end example
2671
2672Different are the settings for the plugins to load @code{PLUGINS}.
2673The first setting specifies which transport plugins to load.
2674
2675@itemize @bullet
2676@item transport-unix
2677A plugin for local only communication with UNIX domain sockets. Used for
2678testing and available on unix systems only. Just set the port
2679
2680@example
2681[transport-unix]
2682PORT = 22086
2683TESTING_IGNORE_KEYS = ACCEPT_FROM;
2684@end example
2685
2686@item transport-tcp
2687A plugin for communication with TCP. Set port to 0 for client mode with
2688outbound only connections
2689
2690@example
2691[transport-tcp]
2692# Use 0 to ONLY advertise as a peer behind NAT (no port binding)
2693PORT = 2086
2694ADVERTISED_PORT = 2086
2695TESTING_IGNORE_KEYS = ACCEPT_FROM;
2696# Maximum number of open TCP connections allowed
2697MAX_CONNECTIONS = 128
2698@end example
2699
2700@item transport-udp
2701A plugin for communication with UDP. Supports peer discovery using
2702broadcasts.
2703
2704@example
2705[transport-udp]
2706PORT = 2086
2707BROADCAST = YES
2708BROADCAST_INTERVAL = 30 s
2709MAX_BPS = 1000000
2710TESTING_IGNORE_KEYS = ACCEPT_FROM;
2711@end example
2712
2713@item transport-http
2714HTTP and HTTPS support is split in two part: a client plugin initiating
2715outbound connections and a server part accepting connections from the
2716client. The client plugin just takes the maximum number of connections as
2717an argument.
2718
2719@example
2720[transport-http_client]
2721MAX_CONNECTIONS = 128
2722TESTING_IGNORE_KEYS = ACCEPT_FROM;
2723@end example
2724
2725@example
2726[transport-https_client]
2727MAX_CONNECTIONS = 128
2728TESTING_IGNORE_KEYS = ACCEPT_FROM;
2729@end example
2730
2731@noindent
2732The server has a port configured and the maximum nunber of connections.
2733The HTTPS part has two files with the certificate key and the certificate
2734file.
2735
2736The server plugin supports reverse proxies, so a external hostname can be
2737set using the @code{EXTERNAL_HOSTNAME} setting.
2738The webserver under this address should forward the request to the peer
2739and the configure port.
2740
2741@example
2742[transport-http_server]
2743EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet
2744PORT = 1080
2745MAX_CONNECTIONS = 128
2746TESTING_IGNORE_KEYS = ACCEPT_FROM;
2747@end example
2748
2749@example
2750[transport-https_server]
2751PORT = 4433
2752CRYPTO_INIT = NORMAL
2753KEY_FILE = https.key
2754CERT_FILE = https.cert
2755MAX_CONNECTIONS = 128
2756TESTING_IGNORE_KEYS = ACCEPT_FROM;
2757@end example
2758
2759@item transport-wlan
2760
2761The next section describes how to setup the WLAN plugin,
2762so here only the settings. Just specify the interface to use:
2763
2764@example
2765[transport-wlan]
2766# Name of the interface in monitor mode (typically monX)
2767INTERFACE = mon0
2768# Real hardware, no testing
2769TESTMODE = 0
2770TESTING_IGNORE_KEYS = ACCEPT_FROM;
2771@end example
2772@end itemize
2773
2774@node Configuring the wlan transport plugin
2775@subsection Configuring the wlan transport plugin
2776
2777The wlan transport plugin enables GNUnet to send and to receive data on a
2778wlan interface.
2779It has not to be connected to a wlan network as long as sender and
2780receiver are on the same channel. This enables you to get connection to
2781GNUnet where no internet access is possible, for example during
2782catastrophes or when censorship cuts you off from the internet.
2783
2784
2785@menu
2786* Requirements for the WLAN plugin::
2787* Configuration::
2788* Before starting GNUnet::
2789* Limitations and known bugs::
2790@end menu
2791
2792
2793@node Requirements for the WLAN plugin
2794@subsubsection Requirements for the WLAN plugin
2795
2796@itemize @bullet
2797
2798@item wlan network card with monitor support and packet injection
2799(see @uref{http://www.aircrack-ng.org/, aircrack-ng.org})
2800
2801@item Linux kernel with mac80211 stack, introduced in 2.6.22, tested with
28022.6.35 and 2.6.38
2803
2804@item Wlantools to create the a monitor interface, tested with airmon-ng
2805of the aircrack-ng package
2806@end itemize
2807
2808@node Configuration
2809@subsubsection Configuration
2810
2811There are the following options for the wlan plugin (they should be like
2812this in your default config file, you only need to adjust them if the
2813values are incorrect for your system)
2814
2815@example
2816# section for the wlan transport plugin
2817[transport-wlan]
2818# interface to use, more information in the
2819# "Before starting GNUnet" section of the handbook.
2820INTERFACE = mon0
2821# testmode for developers:
2822# 0 use wlan interface,
2823#1 or 2 use loopback driver for tests 1 = server, 2 = client
2824TESTMODE = 0
2825@end example
2826
2827@node Before starting GNUnet
2828@subsubsection Before starting GNUnet
2829
2830Before starting GNUnet, you have to make sure that your wlan interface is
2831in monitor mode.
2832One way to put the wlan interface into monitor mode (if your interface
2833name is wlan0) is by executing:
2834
2835@example
2836sudo airmon-ng start wlan0
2837@end example
2838
2839@noindent
2840Here is an example what the result should look like:
2841
2842@example
2843Interface Chipset Driver
2844wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0]
2845(monitor mode enabled on mon0)
2846@end example
2847
2848@noindent
2849The monitor interface is mon0 is the one that you have to put into the
2850configuration file.
2851
2852@node Limitations and known bugs
2853@subsubsection Limitations and known bugs
2854
2855Wlan speed is at the maximum of 1 Mbit/s because support for choosing the
2856wlan speed with packet injection was removed in newer kernels.
2857Please pester the kernel developers about fixing this.
2858
2859The interface channel depends on the wlan network that the card is
2860connected to. If no connection has been made since the start of the
2861computer, it is usually the first channel of the card.
2862Peers will only find each other and communicate if they are on the same
2863channel. Channels must be set manually, i.e. using:
2864
2865@example
2866iwconfig wlan0 channel 1
2867@end example
2868
2869@node Configuring HTTP(S) reverse proxy functionality using Apache or nginx
2870@subsection Configuring HTTP(S) reverse proxy functionality using Apache or nginx
2871
2872The HTTP plugin supports data transfer using reverse proxies. A reverse
2873proxy forwards the HTTP request he receives with a certain URL to another
2874webserver, here a GNUnet peer.
2875
2876So if you have a running Apache or nginx webserver you can configure it to
2877be a GNUnet reverse proxy. Especially if you have a well-known webiste
2878this improves censorship resistance since it looks as normal surfing
2879behaviour.
2880
2881To do so, you have to do two things:
2882
2883@itemize @bullet
2884@item Configure your webserver to forward the GNUnet HTTP traffic
2885@item Configure your GNUnet peer to announce the respective address
2886@end itemize
2887
2888As an example we want to use GNUnet peer running:
2889
2890@itemize @bullet
2891
2892@item HTTP server plugin on @code{gnunet.foo.org:1080}
2893
2894@item HTTPS server plugin on @code{gnunet.foo.org:4433}
2895
2896@item A apache or nginx webserver on
2897@uref{http://www.foo.org/, http://www.foo.org:80/}
2898
2899@item A apache or nginx webserver on https://www.foo.org:443/
2900@end itemize
2901
2902And we want the webserver to accept GNUnet traffic under
2903@code{http://www.foo.org/bar/}. The required steps are described here:
2904
2905@menu
2906* Reverse Proxy - Configure your Apache2 HTTP webserver::
2907* Reverse Proxy - Configure your Apache2 HTTPS webserver::
2908* Reverse Proxy - Configure your nginx HTTPS webserver::
2909* Reverse Proxy - Configure your nginx HTTP webserver::
2910* Reverse Proxy - Configure your GNUnet peer::
2911@end menu
2912
2913@node Reverse Proxy - Configure your Apache2 HTTP webserver
2914@subsubsection Reverse Proxy - Configure your Apache2 HTTP webserver
2915
2916First of all you need mod_proxy installed.
2917
2918Edit your webserver configuration. Edit
2919@code{/etc/apache2/apache2.conf} or the site-specific configuration file.
2920
2921In the respective @code{server config},@code{virtual host} or
2922@code{directory} section add the following lines:
2923
2924@example
2925ProxyTimeout 300
2926ProxyRequests Off
2927<Location /bar/ >
2928ProxyPass http://gnunet.foo.org:1080/
2929ProxyPassReverse http://gnunet.foo.org:1080/
2930</Location>
2931@end example
2932
2933@node Reverse Proxy - Configure your Apache2 HTTPS webserver
2934@subsubsection Reverse Proxy - Configure your Apache2 HTTPS webserver
2935
2936We assume that you already have an HTTPS server running, if not please
2937check how to configure a HTTPS host. An uncomplicated to use example
2938is the example configuration file for Apache2/HTTPD provided in
2939@file{apache2/sites-available/default-ssl}.
2940
2941In the respective HTTPS @code{server config},@code{virtual host} or
2942@code{directory} section add the following lines:
2943
2944@example
2945SSLProxyEngine On
2946ProxyTimeout 300
2947ProxyRequests Off
2948<Location /bar/ >
2949ProxyPass https://gnunet.foo.org:4433/
2950ProxyPassReverse https://gnunet.foo.org:4433/
2951</Location>
2952@end example
2953
2954@noindent
2955More information about the apache mod_proxy configuration can be found
2956in the Apache documentation@footnote{@uref{http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass, http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass}}
2957
2958@node Reverse Proxy - Configure your nginx HTTPS webserver
2959@subsubsection Reverse Proxy - Configure your nginx HTTPS webserver
2960
2961Since nginx does not support chunked encoding, you first of all have to
2962install the @code{chunkin} module@footnote{@uref{http://wiki.nginx.org/HttpChunkinModule, http://wiki.nginx.org/HttpChunkinModule}}
2963
2964To enable chunkin add:
2965
2966@example
2967chunkin on;
2968error_page 411 = @@my_411_error;
2969location @@my_411_error @{
2970chunkin_resume;
2971@}
2972@end example
2973
2974@noindent
2975Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
2976the site-specific configuration file.
2977
2978In the @code{server} section add:
2979
2980@example
2981location /bar/ @{
2982proxy_pass http://gnunet.foo.org:1080/;
2983proxy_buffering off;
2984proxy_connect_timeout 5; # more than http_server
2985proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
2986proxy_http_version 1.1; # 1.0 default
2987proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
2988@}
2989@end example
2990
2991@node Reverse Proxy - Configure your nginx HTTP webserver
2992@subsubsection Reverse Proxy - Configure your nginx HTTP webserver
2993
2994Edit your webserver configuration. Edit @file{/etc/nginx/nginx.conf} or
2995the site-specific configuration file.
2996
2997In the @code{server} section add:
2998
2999@example
3000ssl_session_timeout 6m;
3001location /bar/
3002@{
3003proxy_pass https://gnunet.foo.org:4433/;
3004proxy_buffering off;
3005proxy_connect_timeout 5; # more than http_server
3006proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout
3007proxy_http_version 1.1; # 1.0 default
3008proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
3009@}
3010@end example
3011
3012@node Reverse Proxy - Configure your GNUnet peer
3013@subsubsection Reverse Proxy - Configure your GNUnet peer
3014
3015To have your GNUnet peer announce the address, you have to specify the
3016@code{EXTERNAL_HOSTNAME} option in the @code{[transport-http_server]}
3017section:
3018
3019@example
3020[transport-http_server]
3021EXTERNAL_HOSTNAME = http://www.foo.org/bar/
3022@end example
3023
3024@noindent
3025and/or @code{[transport-https_server]} section:
3026
3027@example
3028[transport-https_server]
3029EXTERNAL_HOSTNAME = https://www.foo.org/bar/
3030@end example
3031
3032@noindent
3033Now restart your webserver and your peer...
3034
3035@node Blacklisting peers
3036@subsection Blacklisting peers
3037
3038Transport service supports to deny connecting to a specific peer of to a
3039specific peer with a specific transport plugin using te blacklisting
3040component of transport service. With@ blacklisting it is possible to deny
3041connections to specific peers of@ to use a specific plugin to a specific
3042peer. Peers can be blacklisted using@ the configuration or a blacklist
3043client can be asked.
3044
3045To blacklist peers using the configuration you have to add a section to
3046your configuration containing the peer id of the peer to blacklist and
3047the plugin@ if required.
3048
3049Examples:
3050
3051To blacklist connections to P565... on peer AG2P... using tcp add:
3052
3053@c FIXME: This is too long and produces errors in the pdf.
3054@example
3055[transport-blacklist AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
3056P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp
3057@end example
3058
3059To blacklist connections to P565... on peer AG2P... using all plugins add:
3060
3061@example
3062[transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520]
3063P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G =
3064@end example
3065
3066You can also add a blacklist client usign the blacklist API. On a
3067blacklist check, blacklisting first checks internally if the peer is
3068blacklisted and if not, it asks the blacklisting clients. Clients are
3069asked if it is OK to connect to a peer ID, the plugin is omitted.
3070
3071On blacklist check for (peer, plugin)
3072@itemize @bullet
3073@item Do we have a local blacklist entry for this peer and this plugin?@
3074@item YES: disallow connection@
3075@item Do we have a local blacklist entry for this peer and all plugins?@
3076@item YES: disallow connection@
3077@item Does one of the clients disallow?@
3078@item YES: disallow connection
3079@end itemize
3080
3081@node Configuration of the HTTP and HTTPS transport plugins
3082@subsection Configuration of the HTTP and HTTPS transport plugins
3083
3084The client parts of the http and https transport plugins can be configured
3085to use a proxy to connect to the hostlist server. This functionality can
3086be configured in the configuration file directly or using the
3087gnunet-setup tool.
3088
3089Both the HTTP and HTTPS clients support the following proxy types at
3090the moment:
3091
3092@itemize @bullet
3093@item HTTP 1.1 proxy
3094@item SOCKS 4/4a/5/5 with hostname
3095@end itemize
3096
3097In addition authentication at the proxy with username and password can be
3098configured.
3099
3100To configure proxy support for the clients in the gnunet-setup tool,
3101select the "transport" tab and activate the respective plugin. Now you
3102can select the appropriate proxy type. The hostname or IP address
3103(including port if required) has to be entered in the "Proxy hostname"
3104textbox. If required, enter username and password in the "Proxy username"
3105and "Proxy password" boxes. Be aware that these information will be stored
3106in the configuration in plain text.
3107
3108To configure these options directly in the configuration, you can
3109configure the following settings in the @code{[transport-http_client]}
3110and @code{[transport-https_client]} section of the configuration:
3111
3112@example
3113# Type of proxy server,
3114# Valid values: HTTP, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
3115# Default: HTTP
3116# PROXY_TYPE = HTTP
3117
3118# Hostname or IP of proxy server
3119# PROXY =
3120# User name for proxy server
3121# PROXY_USERNAME =
3122# User password for proxy server
3123# PROXY_PASSWORD =
3124@end example
3125
3126@node Configuring the GNU Name System
3127@subsection Configuring the GNU Name System
3128
3129@menu
3130* Configuring system-wide DNS interception::
3131* Configuring the GNS nsswitch plugin::
3132* Configuring GNS on W32::
3133* GNS Proxy Setup::
3134* Setup of the GNS CA::
3135* Testing the GNS setup::
3136@end menu
3137
3138
3139@node Configuring system-wide DNS interception
3140@subsubsection Configuring system-wide DNS interception
3141
3142Before you install GNUnet, make sure you have a user and group 'gnunet'
3143as well as an empty group 'gnunetdns'.
3144
3145When using GNUnet with system-wide DNS interception, it is absolutely
3146necessary for all GNUnet service processes to be started by
3147@code{gnunet-service-arm} as user and group 'gnunet'. You also need to be
3148sure to run @code{make install} as root (or use the @code{sudo} option to
3149configure) to grant GNUnet sufficient privileges.
3150
3151With this setup, all that is required for enabling system-wide DNS
3152interception is for some GNUnet component (VPN or GNS) to request it.
3153The @code{gnunet-service-dns} will then start helper programs that will
3154make the necessary changes to your firewall (@code{iptables}) rules.
3155
3156Note that this will NOT work if your system sends out DNS traffic to a
3157link-local IPv6 address, as in this case GNUnet can intercept the traffic,
3158but not inject the responses from the link-local IPv6 address. Hence you
3159cannot use system-wide DNS interception in conjunction with link-local
3160IPv6-based DNS servers. If such a DNS server is used, it will bypass
3161GNUnet's DNS traffic interception.
3162
3163Using the GNU Name System (GNS) requires two different configuration
3164steps.
3165First of all, GNS needs to be integrated with the operating system. Most
3166of this section is about the operating system level integration.
3167
3168The remainder of this chapter will detail the various methods for
3169configuring the use of GNS with your operating system.
3170
3171At this point in time you have different options depending on your OS:
3172
3173@table @asis
3174
3175@item Use the gnunet-gns-proxy This approach works for all operating
3176systems and is likely the easiest. However, it enables GNS only for
3177browsers, not for other applications that might be using DNS, such as SSH.
3178Still, using the proxy is required for using HTTP with GNS and is thus
3179recommended for all users. To do this, you simply have to run the
3180@code{gnunet-gns-proxy-setup-ca} script as the user who will run the
3181browser (this will create a GNS certificate authority (CA) on your system
3182and import its key into your browser), then start @code{gnunet-gns-proxy}
3183and inform your browser to use the Socks5 proxy which
3184@code{gnunet-gns-proxy} makes available by default on port 7777.
3185@item Use a nsswitch plugin (recommended on GNU systems)
3186This approach has the advantage of offering fully personalized resolution
3187even on multi-user systems. A potential disadvantage is that some
3188applications might be able to bypass GNS.
3189@item Use a W32 resolver plugin (recommended on W32)
3190This is currently the only option on W32 systems.
3191@item Use system-wide DNS packet interception
3192This approach is recommended for the GNUnet VPN. It can be used to handle
3193GNS at the same time; however, if you only use this method, you will only
3194get one root zone per machine (not so great for multi-user systems).
3195@end table
3196
3197You can combine system-wide DNS packet interception with the nsswitch
3198plugin.
3199The setup of the system-wide DNS interception is described here. All of
3200the other GNS-specific configuration steps are described in the following
3201sections.
3202
3203@node Configuring the GNS nsswitch plugin
3204@subsubsection Configuring the GNS nsswitch plugin
3205
3206The Name Service Switch (NSS) is a facility in Unix-like operating systems
3207@footnote{More accurate: NSS is a functionality of the GNU C Library}
3208that provides a variety of sources for common configuration databases and
3209name resolution mechanisms.
3210A superuser (system administrator) usually configures the
3211operating system's name services using the file
3212@file{/etc/nsswitch.conf}.
3213
3214GNS provides a NSS plugin to integrate GNS name resolution with the
3215operating system's name resolution process.
3216To use the GNS NSS plugin you have to either
3217
3218@itemize @bullet
3219@item install GNUnet as root or
3220@item compile GNUnet with the @code{--with-sudo=yes} switch.
3221@end itemize
3222
3223Name resolution is controlled by the @emph{hosts} section in the NSS
3224configuration. By default this section first performs a lookup in the
3225@file{/etc/hosts} file and then in DNS.
3226The nsswitch file should contain a line similar to:
3227
3228@example
3229hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4
3230@end example
3231
3232@noindent
3233Here the GNS NSS plugin can be added to perform a GNS lookup before
3234performing a DNS lookup.
3235The GNS NSS plugin has to be added to the "hosts" section in
3236@file{/etc/nsswitch.conf} file before DNS related plugins:
3237
3238@example
3239...
3240hosts: files gns [NOTFOUND=return] dns mdns4_minimal mdns4
3241...
3242@end example
3243
3244@noindent
3245The @code{NOTFOUND=return} will ensure that if a @code{.gnu} name is not
3246found in GNS it will not be queried in DNS.
3247
3248@node Configuring GNS on W32
3249@subsubsection Configuring GNS on W32
3250
3251This document is a guide to configuring GNU Name System on W32-compatible
3252platforms.
3253
3254After GNUnet is installed, run the w32nsp-install tool:
3255
3256@example
3257w32nsp-install.exe libw32nsp-0.dll
3258@end example
3259
3260@noindent
3261('0' is the library version of W32 NSP; it might increase in the future,
3262change the invocation accordingly).
3263
3264This will install GNS namespace provider into the system and allow other
3265applications to resolve names that end in '@strong{gnu}'
3266and '@strong{zkey}'. Note that namespace provider requires
3267gnunet-gns-helper-service-w32 to be running, as well as gns service
3268itself (and its usual dependencies).
3269
3270Namespace provider is hardcoded to connect to @strong{127.0.0.1:5353},
3271and this is where gnunet-gns-helper-service-w32 should be listening to
3272(and is configured to listen to by default).
3273
3274To uninstall the provider, run:
3275
3276@example
3277w32nsp-uninstall.exe
3278@end example
3279
3280@noindent
3281(uses provider GUID to uninstall it, does not need a dll name).
3282
3283Note that while MSDN claims that other applications will only be able to
3284use the new namespace provider after re-starting, in reality they might
3285stat to use it without that. Conversely, they might stop using the
3286provider after it's been uninstalled, even if they were not re-started.
3287W32 will not permit namespace provider library to be deleted or
3288overwritten while the provider is installed, and while there is at least
3289one process still using it (even after it was uninstalled).
3290
3291@node GNS Proxy Setup
3292@subsubsection GNS Proxy Setup
3293
3294When using the GNU Name System (GNS) to browse the WWW, there are several
3295issues that can be solved by adding the GNS Proxy to your setup:
3296
3297@itemize @bullet
3298
3299@item If the target website does not support GNS, it might assume that it
3300is operating under some name in the legacy DNS system (such as
3301example.com). It may then attempt to set cookies for that domain, and the
3302web server might expect a @code{Host: example.com} header in the request
3303from your browser.
3304However, your browser might be using @code{example.gnu} for the
3305@code{Host} header and might only accept (and send) cookies for
3306@code{example.gnu}. The GNS Proxy will perform the necessary translations
3307of the hostnames for cookies and HTTP headers (using the LEHO record for
3308the target domain as the desired substitute).
3309
3310@item If using HTTPS, the target site might include an SSL certificate
3311which is either only valid for the LEHO domain or might match a TLSA
3312record in GNS. However, your browser would expect a valid certificate for
3313@code{example.gnu}, not for some legacy domain name. The proxy will
3314validate the certificate (either against LEHO or TLSA) and then
3315on-the-fly produce a valid certificate for the exchange, signed by your
3316own CA. Assuming you installed the CA of your proxy in your browser's
3317certificate authority list, your browser will then trust the
3318HTTPS/SSL/TLS connection, as the hostname mismatch is hidden by the proxy.
3319
3320@item Finally, the proxy will in the future indicate to the server that it
3321speaks GNS, which will enable server operators to deliver GNS-enabled web
3322sites to your browser (and continue to deliver legacy links to legacy
3323browsers)
3324@end itemize
3325
3326@node Setup of the GNS CA
3327@subsubsection Setup of the GNS CA
3328
3329First you need to create a CA certificate that the proxy can use.
3330To do so use the provided script gnunet-gns-proxy-ca:
3331
3332@example
3333$ gnunet-gns-proxy-setup-ca
3334@end example
3335
3336@noindent
3337This will create a personal certification authority for you and add this
3338authority to the firefox and chrome database. The proxy will use the this
3339CA certificate to generate @code{*.gnu} client certificates on the fly.
3340
3341Note that the proxy uses libcurl. Make sure your version of libcurl uses
3342GnuTLS and NOT OpenSSL. The proxy will @b{not} work with libcurl compiled
3343against OpenSSL.
3344
3345You can check the configuration your libcurl was build with by
3346running:
3347
3348@example
3349curl --version
3350@end example
3351
3352the output will look like this (without the linebreaks):
3353
3354@example
3355gnurl --version
3356curl 7.56.0 (x86_64-unknown-linux-gnu) libcurl/7.56.0 \
3357GnuTLS/3.5.13 zlib/1.2.11 libidn2/2.0.4
3358Release-Date: 2017-10-08
3359Protocols: http https
3360Features: AsynchDNS IDN IPv6 Largefile NTLM SSL libz \
3361TLS-SRP UnixSockets HTTPS-proxy
3362@end example
3363
3364@node Testing the GNS setup
3365@subsubsection Testing the GNS setup
3366
3367Now for testing purposes we can create some records in our zone to test
3368the SSL functionality of the proxy:
3369
3370@example
3371$ gnunet-identity -C test
3372$ gnunet-namestore -a -e "1 d" -n "homepage" \
3373 -t A -V 131.159.74.67 -z test
3374$ gnunet-namestore -a -e "1 d" -n "homepage" \
3375 -t LEHO -V "gnunet.org" -z test
3376@end example
3377
3378@noindent
3379At this point we can start the proxy. Simply execute
3380
3381@example
3382$ gnunet-gns-proxy
3383@end example
3384
3385@noindent
3386Configure your browser to use this SOCKSv5 proxy on port 7777 and visit
3387this link.
3388If you use @command{Firefox} (or one of its deriviates/forks such as
3389Icecat) you also have to go to @code{about:config} and set the key
3390@code{network.proxy.socks_remote_dns} to @code{true}.
3391
3392When you visit @code{https://homepage.test/}, you should get to the
3393@code{https://gnunet.org/} frontpage and the browser (with the correctly
3394configured proxy) should give you a valid SSL certificate for
3395@code{homepage.gnu} and no warnings. It should look like this:
3396
3397@c FIXME: Image does not exist, create it or save it from Drupal?
3398@c @image{images/gnunethpgns.png,5in,, picture of homepage.gnu in Webbrowser}
3399
3400
3401@node Configuring the GNUnet VPN
3402@subsection Configuring the GNUnet VPN
3403
3404@menu
3405* IPv4 address for interface::
3406* IPv6 address for interface::
3407* Configuring the GNUnet VPN DNS::
3408* Configuring the GNUnet VPN Exit Service::
3409* IP Address of external DNS resolver::
3410* IPv4 address for Exit interface::
3411* IPv6 address for Exit interface::
3412@end menu
3413
3414Before configuring the GNUnet VPN, please make sure that system-wide DNS
3415interception is configured properly as described in the section on the
3416GNUnet DNS setup. @pxref{Configuring the GNU Name System},
3417if you haven't done so already.
3418
3419The default options for the GNUnet VPN are usually sufficient to use
3420GNUnet as a Layer 2 for your Internet connection.
3421However, what you always have to specify is which IP protocol you want
3422to tunnel: IPv4, IPv6 or both.
3423Furthermore, if you tunnel both, you most likely should also tunnel
3424all of your DNS requests.
3425You theoretically can tunnel "only" your DNS traffic, but that usually
3426makes little sense.
3427
3428The other options as shown on the gnunet-setup tool are:
3429
3430@node IPv4 address for interface
3431@subsubsection IPv4 address for interface
3432
3433This is the IPv4 address the VPN interface will get. You should pick an
3434'private' IPv4 network that is not yet in use for you system. For example,
3435if you use @code{10.0.0.1/255.255.0.0} already, you might use
3436@code{10.1.0.1/255.255.0.0}.
3437If you use @code{10.0.0.1/255.0.0.0} already, then you might use
3438@code{192.168.0.1/255.255.0.0}.
3439If your system is not in a private IP-network, using any of the above will
3440work fine.
3441You should try to make the mask of the address big enough
3442(@code{255.255.0.0} or, even better, @code{255.0.0.0}) to allow more
3443mappings of remote IP Addresses into this range.
3444However, even a @code{255.255.255.0} mask will suffice for most users.
3445
3446@node IPv6 address for interface
3447@subsubsection IPv6 address for interface
3448
3449The IPv6 address the VPN interface will get. Here you can specify any
3450non-link-local address (the address should not begin with @code{fe80:}).
3451A subnet Unique Local Unicast (@code{fd00::/8} prefix) that you are
3452currently not using would be a good choice.
3453
3454@node Configuring the GNUnet VPN DNS
3455@subsubsection Configuring the GNUnet VPN DNS
3456
3457To resolve names for remote nodes, activate the DNS exit option.
3458
3459@node Configuring the GNUnet VPN Exit Service
3460@subsubsection Configuring the GNUnet VPN Exit Service
3461
3462If you want to allow other users to share your Internet connection (yes,
3463this may be dangerous, just as running a Tor exit node) or want to
3464provide access to services on your host (this should be less dangerous,
3465as long as those services are secure), you have to enable the GNUnet exit
3466daemon.
3467
3468You then get to specify which exit functions you want to provide. By
3469enabling the exit daemon, you will always automatically provide exit
3470functions for manually configured local services (this component of the
3471system is under
3472development and not documented further at this time). As for those
3473services you explicitly specify the target IP address and port, there is
3474no significant security risk in doing so.
3475
3476Furthermore, you can serve as a DNS, IPv4 or IPv6 exit to the Internet.
3477Being a DNS exit is usually pretty harmless. However, enabling IPv4 or
3478IPv6-exit without further precautions may enable adversaries to access
3479your local network, send spam, attack other systems from your Internet
3480connection and to other mischief that will appear to come from your
3481machine. This may or may not get you into legal trouble.
3482If you want to allow IPv4 or IPv6-exit functionality, you should strongly
3483consider adding additional firewall rules manually to protect your local
3484network and to restrict outgoing TCP traffic (i.e. by not allowing access
3485to port 25). While we plan to improve exit-filtering in the future,
3486you're currently on your own here.
3487Essentially, be prepared for any kind of IP-traffic to exit the respective
3488TUN interface (and GNUnet will enable IP-forwarding and NAT for the
3489interface automatically).
3490
3491Additional configuration options of the exit as shown by the gnunet-setup
3492tool are:
3493
3494@node IP Address of external DNS resolver
3495@subsubsection IP Address of external DNS resolver
3496
3497If DNS traffic is to exit your machine, it will be send to this DNS
3498resolver. You can specify an IPv4 or IPv6 address.
3499
3500@node IPv4 address for Exit interface
3501@subsubsection IPv4 address for Exit interface
3502
3503This is the IPv4 address the Interface will get. Make the mask of the
3504address big enough (255.255.0.0 or, even better, 255.0.0.0) to allow more
3505mappings of IP addresses into this range. As for the VPN interface, any
3506unused, private IPv4 address range will do.
3507
3508@node IPv6 address for Exit interface
3509@subsubsection IPv6 address for Exit interface
3510
3511The public IPv6 address the interface will get. If your kernel is not a
3512very recent kernel and you are willing to manually enable IPv6-NAT, the
3513IPv6 address you specify here must be a globally routed IPv6 address of
3514your host.
3515
3516Suppose your host has the address @code{2001:4ca0::1234/64}, then
3517using @code{2001:4ca0::1:0/112} would be fine (keep the first 64 bits,
3518then change at least one bit in the range before the bitmask, in the
3519example above we changed bit 111 from 0 to 1).
3520
3521You may also have to configure your router to route traffic for the entire
3522subnet (@code{2001:4ca0::1:0/112} for example) through your computer (this
3523should be automatic with IPv6, but obviously anything can be
3524disabled).
3525
3526@node Bandwidth Configuration
3527@subsection Bandwidth Configuration
3528
3529You can specify how many bandwidth GNUnet is allowed to use to receive
3530and send data. This is important for users with limited bandwidth or
3531traffic volume.
3532
3533@node Configuring NAT
3534@subsection Configuring NAT
3535
3536Most hosts today do not have a normal global IP address but instead are
3537behind a router performing Network Address Translation (NAT) which assigns
3538each host in the local network a private IP address.
3539As a result, these machines cannot trivially receive inbound connections
3540from the Internet. GNUnet supports NAT traversal to enable these machines
3541to receive incoming connections from other peers despite their
3542limitations.
3543
3544In an ideal world, you can press the "Attempt automatic configuration"
3545button in gnunet-setup to automatically configure your peer correctly.
3546Alternatively, your distribution might have already triggered this
3547automatic configuration during the installation process.
3548However, automatic configuration can fail to determine the optimal
3549settings, resulting in your peer either not receiving as many connections
3550as possible, or in the worst case it not connecting to the network at all.
3551
3552To manually configure the peer, you need to know a few things about your
3553network setup. First, determine if you are behind a NAT in the first
3554place.
3555This is always the case if your IP address starts with "10.*" or
3556"192.168.*". Next, if you have control over your NAT router, you may
3557choose to manually configure it to allow GNUnet traffic to your host.
3558If you have configured your NAT to forward traffic on ports 2086 (and
3559possibly 1080) to your host, you can check the "NAT ports have been opened
3560manually" option, which corresponds to the "PUNCHED_NAT" option in the
3561configuration file. If you did not punch your NAT box, it may still be
3562configured to support UPnP, which allows GNUnet to automatically
3563configure it. In that case, you need to install the "upnpc" command,
3564enable UPnP (or PMP) on your NAT box and set the "Enable NAT traversal
3565via UPnP or PMP" option (corresponding to "ENABLE_UPNP" in the
3566configuration file).
3567
3568Some NAT boxes can be traversed using the autonomous NAT traversal method.
3569This requires certain GNUnet components to be installed with "SUID"
3570prividledges on your system (so if you're installing on a system you do
3571not have administrative rights to, this will not work).
3572If you installed as 'root', you can enable autonomous NAT traversal by
3573checking the "Enable NAT traversal using ICMP method".
3574The ICMP method requires a way to determine your NAT's external (global)
3575IP address. This can be done using either UPnP, DynDNS, or by manual
3576configuration. If you have a DynDNS name or know your external IP address,
3577you should enter that name under "External (public) IPv4 address" (which
3578corresponds to the "EXTERNAL_ADDRESS" option in the configuration file).
3579If you leave the option empty, GNUnet will try to determine your external
3580IP address automatically (which may fail, in which case autonomous
3581NAT traversal will then not work).
3582
3583Finally, if you yourself are not behind NAT but want to be able to
3584connect to NATed peers using autonomous NAT traversal, you need to check
3585the "Enable connecting to NATed peers using ICMP method" box.
3586
3587
3588@node Peer configuration for distributions
3589@subsection Peer configuration for distributions
3590
3591The "GNUNET_DATA_HOME" in "[path]" in @file{/etc/gnunet.conf} should be
3592manually set to "/var/lib/gnunet/data/" as the default
3593"~/.local/share/gnunet/" is probably not that appropriate in this case.
3594Similarly, distributions may consider pointing "GNUNET_RUNTIME_DIR" to
3595"/var/run/gnunet/" and "GNUNET_HOME" to "/var/lib/gnunet/". Also, should a
3596distribution decide to override system defaults, all of these changes
3597should be done in a custom @file{/etc/gnunet.conf} and not in the files
3598in the @file{config.d/} directory.
3599
3600Given the proposed access permissions, the "gnunet-setup" tool must be
3601run as use "gnunet" (and with option "-c /etc/gnunet.conf" so that it
3602modifies the system configuration). As always, gnunet-setup should be run
3603after the GNUnet peer was stopped using "gnunet-arm -e". Distributions
3604might want to include a wrapper for gnunet-setup that allows the
3605desktop-user to "sudo" (i.e. using gtksudo) to the "gnunet" user account
3606and then runs "gnunet-arm -e", "gnunet-setup" and "gnunet-arm -s" in
3607sequence.
3608
3609@node How to start and stop a GNUnet peer
3610@section How to start and stop a GNUnet peer
3611
3612This section describes how to start a GNUnet peer. It assumes that you
3613have already compiled and installed GNUnet and its' dependencies.
3614Before you start a GNUnet peer, you may want to create a configuration
3615file using gnunet-setup (but you do not have to).
3616Sane defaults should exist in your
3617@file{$GNUNET_PREFIX/share/gnunet/config.d/} directory, so in practice
3618you could simply start without any configuration. If you want to
3619configure your peer later, you need to stop it before invoking the
3620@code{gnunet-setup} tool to customize further and to test your
3621configuration (@code{gnunet-setup} has build-in test functions).
3622
3623The most important option you might have to still set by hand is in
3624[PATHS]. Here, you use the option "GNUNET_HOME" to specify the path where
3625GNUnet should store its data.
3626It defaults to @code{$HOME/}, which again should work for most users.
3627Make sure that the directory specified as GNUNET_HOME is writable to
3628the user that you will use to run GNUnet (note that you can run frontends
3629using other users, GNUNET_HOME must only be accessible to the user used to
3630run the background processes).
3631
3632You will also need to make one central decision: should all of GNUnet be
3633run under your normal UID, or do you want distinguish between system-wide
3634(user-independent) GNUnet services and personal GNUnet services. The
3635multi-user setup is slightly more complicated, but also more secure and
3636generally recommended.
3637
3638@menu
3639* The Single-User Setup::
3640* The Multi-User Setup::
3641* Killing GNUnet services::
3642* Access Control for GNUnet::
3643@end menu
3644
3645@node The Single-User Setup
3646@subsection The Single-User Setup
3647
3648For the single-user setup, you do not need to do anything special and can
3649just start the GNUnet background processes using @code{gnunet-arm}.
3650By default, GNUnet looks in @file{~/.config/gnunet.conf} for a
3651configuration (or @code{$XDG_CONFIG_HOME/gnunet.conf} if@
3652@code{$XDG_CONFIG_HOME} is defined). If your configuration lives
3653elsewhere, you need to pass the @code{-c FILENAME} option to all GNUnet
3654commands.
3655
3656Assuming the configuration file is called @file{~/.config/gnunet.conf},
3657you start your peer using the @code{gnunet-arm} command (say as user
3658@code{gnunet}) using:
3659
3660@example
3661gnunet-arm -c ~/.config/gnunet.conf -s
3662@end example
3663
3664@noindent
3665The "-s" option here is for "start". The command should return almost
3666instantly. If you want to stop GNUnet, you can use:
3667
3668@example
3669gnunet-arm -c ~/.config/gnunet.conf -e
3670@end example
3671
3672@noindent
3673The "-e" option here is for "end".
3674
3675Note that this will only start the basic peer, no actual applications
3676will be available.
3677If you want to start the file-sharing service, use (after starting
3678GNUnet):
3679
3680@example
3681gnunet-arm -c ~/.config/gnunet.conf -i fs
3682@end example
3683
3684@noindent
3685The "-i fs" option here is for "initialize" the "fs" (file-sharing)
3686application. You can also selectively kill only file-sharing support using
3687
3688@example
3689gnunet-arm -c ~/.config/gnunet.conf -k fs
3690@end example
3691
3692@noindent
3693Assuming that you want certain services (like file-sharing) to be always
3694automatically started whenever you start GNUnet, you can activate them by
3695setting "FORCESTART=YES" in the respective section of the configuration
3696file (for example, "[fs]"). Then GNUnet with file-sharing support would
3697be started whenever you@ enter:
3698
3699@example
3700gnunet-arm -c ~/.config/gnunet.conf -s
3701@end example
3702
3703@noindent
3704Alternatively, you can combine the two options:
3705
3706@example
3707gnunet-arm -c ~/.config/gnunet.conf -s -i fs
3708@end example
3709
3710@noindent
3711Using @code{gnunet-arm} is also the preferred method for initializing
3712GNUnet from @code{init}.
3713
3714Finally, you should edit your @code{crontab} (using the @code{crontab}
3715command) and insert a line@
3716
3717@example
3718@@reboot gnunet-arm -c ~/.config/gnunet.conf -s
3719@end example
3720
3721to automatically start your peer whenever your system boots.
3722
3723@node The Multi-User Setup
3724@subsection The Multi-User Setup
3725
3726This requires you to create a user @code{gnunet} and an additional group
3727@code{gnunetdns}, prior to running @code{make install} during
3728installation.
3729Then, you create a configuration file @file{/etc/gnunet.conf} which should
3730contain the lines:@
3731
3732@example
3733[arm]
3734SYSTEM_ONLY = YES
3735USER_ONLY = NO
3736@end example
3737
3738@noindent
3739Then, perform the same steps to run GNUnet as in the per-user
3740configuration, except as user @code{gnunet} (including the
3741@code{crontab} installation).
3742You may also want to run @code{gnunet-setup} to configure your peer
3743(databases, etc.).
3744Make sure to pass @code{-c /etc/gnunet.conf} to all commands. If you
3745run @code{gnunet-setup} as user @code{gnunet}, you might need to change
3746permissions on @file{/etc/gnunet.conf} so that the @code{gnunet} user can
3747write to the file (during setup).
3748
3749Afterwards, you need to perform another setup step for each normal user
3750account from which you want to access GNUnet. First, grant the normal user
3751(@code{$USER}) permission to the group gnunet:
3752
3753@example
3754# adduser $USER gnunet
3755@end example
3756
3757@noindent
3758Then, create a configuration file in @file{~/.config/gnunet.conf} for the
3759$USER with the lines:
3760
3761@example
3762[arm]
3763SYSTEM_ONLY = NO
3764USER_ONLY = YES
3765@end example
3766
3767@noindent
3768This will ensure that @code{gnunet-arm} when started by the normal user
3769will only run services that are per-user, and otherwise rely on the
3770system-wide services.
3771Note that the normal user may run gnunet-setup, but the
3772configuration would be ineffective as the system-wide services will use
3773@file{/etc/gnunet.conf} and ignore options set by individual users.
3774
3775Again, each user should then start the peer using
3776@file{gnunet-arm -s} --- and strongly consider adding logic to start
3777the peer automatically to their crontab.
3778
3779Afterwards, you should see two (or more, if you have more than one USER)
3780@code{gnunet-service-arm} processes running in your system.
3781
3782@node Killing GNUnet services
3783@subsection Killing GNUnet services
3784
3785It is not necessary to stop GNUnet services explicitly when shutting
3786down your computer.
3787
3788It should be noted that manually killing "most" of the
3789@code{gnunet-service} processes is generally not a successful method for
3790stopping a peer (since @code{gnunet-service-arm} will instantly restart
3791them). The best way to explicitly stop a peer is using
3792@code{gnunet-arm -e}; note that the per-user services may need to be
3793terminated before the system-wide services will terminate normally.
3794
3795@node Access Control for GNUnet
3796@subsection Access Control for GNUnet
3797
3798This chapter documents how we plan to make access control work within the
3799GNUnet system for a typical peer. It should be read as a best-practice
3800installation guide for advanced users and builders of binary
3801distributions. The recommendations in this guide apply to POSIX-systems
3802with full support for UNIX domain sockets only.
3803
3804Note that this is an advanced topic. The discussion presumes a very good
3805understanding of users, groups and file permissions. Normal users on
3806hosts with just a single user can just install GNUnet under their own
3807account (and possibly allow the installer to use SUDO to grant additional
3808permissions for special GNUnet tools that need additional rights).
3809The discussion below largely applies to installations where multiple users
3810share a system and to installations where the best possible security is
3811paramount.
3812
3813A typical GNUnet system consists of components that fall into four
3814categories:
3815
3816@table @asis
3817
3818@item User interfaces
3819User interfaces are not security sensitive and are supposed to be run and
3820used by normal system users.
3821The GTK GUIs and most command-line programs fall into this category.
3822Some command-line tools (like gnunet-transport) should be excluded as they
3823offer low-level access that normal users should not need.
3824@item System services and support tools
3825System services should always run and offer services that can then be
3826accessed by the normal users.
3827System services do not require special permissions, but as they are not
3828specific to a particular user, they probably should not run as a
3829particular user. Also, there should typically only be one GNUnet peer per
3830host. System services include the gnunet-service and gnunet-daemon
3831programs; support tools include command-line programs such as gnunet-arm.
3832@item Priviledged helpers
3833Some GNUnet components require root rights to open raw sockets or perform
3834other special operations. These gnunet-helper binaries are typically
3835installed SUID and run from services or daemons.
3836@item Critical services
3837Some GNUnet services (such as the DNS service) can manipulate the service
3838in deep and possibly highly security sensitive ways. For example, the DNS
3839service can be used to intercept and alter any DNS query originating from
3840the local machine. Access to the APIs of these critical services and their
3841priviledged helpers must be tightly controlled.
3842@end table
3843
3844@c FIXME: The titles of these chapters are too long in the index.
3845
3846@menu
3847* Recommendation - Disable access to services via TCP::
3848* Recommendation - Run most services as system user "gnunet"::
3849* Recommendation - Control access to services using group "gnunet"::
3850* Recommendation - Limit access to certain SUID binaries by group "gnunet"::
3851* Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"::
3852* Differences between "make install" and these recommendations::
3853@end menu
3854
3855@node Recommendation - Disable access to services via TCP
3856@subsubsection Recommendation - Disable access to services via TCP
3857
3858GNUnet services allow two types of access: via TCP socket or via UNIX
3859domain socket.
3860If the service is available via TCP, access control can only be
3861implemented by restricting connections to a particular range of IP
3862addresses.
3863This is acceptable for non-critical services that are supposed to be
3864available to all users on the local system or local network.
3865However, as TCP is generally less efficient and it is rarely the case
3866that a single GNUnet peer is supposed to serve an entire local network,
3867the default configuration should disable TCP access to all GNUnet
3868services on systems with support for UNIX domain sockets.
3869As of GNUnet 0.9.2, configuration files with TCP access disabled should be
3870generated by default. Users can re-enable TCP access to particular
3871services simply by specifying a non-zero port number in the section of
3872the respective service.
3873
3874
3875@node Recommendation - Run most services as system user "gnunet"
3876@subsubsection Recommendation - Run most services as system user "gnunet"
3877
3878GNUnet's main services should be run as a separate user "gnunet" in a
3879special group "gnunet".
3880The user "gnunet" should start the peer using "gnunet-arm -s" during
3881system startup. The home directory for this user should be
3882@file{/var/lib/gnunet} and the configuration file should be
3883@file{/etc/gnunet.conf}.
3884Only the @code{gnunet} user should have the right to access
3885@file{/var/lib/gnunet} (@emph{mode: 700}).
3886
3887@node Recommendation - Control access to services using group "gnunet"
3888@subsubsection Recommendation - Control access to services using group "gnunet"
3889
3890Users that should be allowed to use the GNUnet peer should be added to the
3891group "gnunet". Using GNUnet's access control mechanism for UNIX domain
3892sockets, those services that are considered useful to ordinary users
3893should be made available by setting "UNIX_MATCH_GID=YES" for those
3894services.
3895Again, as shipped, GNUnet provides reasonable defaults.
3896Permissions to access the transport and core subsystems might additionally
3897be granted without necessarily causing security concerns.
3898Some services, such as DNS, must NOT be made accessible to the "gnunet"
3899group (and should thus only be accessible to the "gnunet" user and
3900services running with this UID).
3901
3902@node Recommendation - Limit access to certain SUID binaries by group "gnunet"
3903@subsubsection Recommendation - Limit access to certain SUID binaries by group "gnunet"
3904
3905Most of GNUnet's SUID binaries should be safe even if executed by normal
3906users. However, it is possible to reduce the risk a little bit more by
3907making these binaries owned by the group "gnunet" and restricting their
3908execution to user of the group "gnunet" as well (4750).
3909
3910@node Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"
3911@subsubsection Recommendation - Limit access to critical gnunet-helper-dns to group "gnunetdns"
3912
3913A special group "gnunetdns" should be created for controlling access to
3914the "gnunet-helper-dns".
3915The binary should then be owned by root and be in group "gnunetdns" and
3916be installed SUID and only be group-executable (2750).
3917@b{Note that the group "gnunetdns" should have no users in it at all,
3918ever.}
3919The "gnunet-service-dns" program should be executed by user "gnunet" (via
3920gnunet-service-arm) with the binary owned by the user "root" and the group
3921"gnunetdns" and be SGID (2700). This way, @strong{only}
3922"gnunet-service-dns" can change its group to "gnunetdns" and execute the
3923helper, and the helper can then run as root (as per SUID).
3924Access to the API offered by "gnunet-service-dns" is in turn restricted
3925to the user "gnunet" (not the group!), which means that only
3926"benign" services can manipulate DNS queries using "gnunet-service-dns".
3927
3928@node Differences between "make install" and these recommendations
3929@subsubsection Differences between "make install" and these recommendations
3930
3931The current build system does not set all permissions automatically based
3932on the recommendations above. In particular, it does not use the group
3933"gnunet" at all (so setting gnunet-helpers other than the
3934gnunet-helper-dns to be owned by group "gnunet" must be done manually).
3935Furthermore, 'make install' will silently fail to set the DNS binaries to
3936be owned by group "gnunetdns" unless that group already exists (!).
3937An alternative name for the "gnunetdns" group can be specified using the
3938@code{--with-gnunetdns=GRPNAME} configure option.