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