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