412867037df092d50e8d5db7a8675346136cfc76
[oweals/gnunet.git] / README
1                        Welcome to GNUnet
2
3
4 What is GNUnet?
5 ===============
6
7 GNUnet is peer-to-peer framework focusing on security.  The first and
8 primary application for GNUnet is anonymous file-sharing.  GNUnet is
9 currently developed by a worldwide group of independent free software
10 developers.  GNUnet is a GNU package (http://www.gnu.org/).
11
12 This is an ALPHA release.  There are known and significant bugs as 
13 well as many missing features in this release.  
14
15 Additional documentation about GNUnet can be found at
16 https://gnunet.org/.
17
18
19 Dependencies:
20 =============
21
22 Please note that for many of its dependencies GNUnet requires very
23 recent versions of the libraries which are often NOT to be found in
24 stable distributions in 2011.  While using older packages may in some
25 cases on some operating systems may seem to work in some limited
26 fashion, we are in many cases aware of serious problems with older
27 packages.  Hence please make sure to use  the versions listed below.
28
29 These are the direct dependencies for running GNUnet:
30
31 - libextractor  >= 0.6.1
32 - libmicrohttpd >= 0.9.18
33 - libgcrypt     >= 1.2
34 - libcurl       >= 7.21.3
35 - libunistring  >= 0.9.2
36 - gnutls        >= 2.12.0
37 - libltdl       >= 2.2 (part of GNU libtool)
38 - sqlite        >= 3.0 (default database)
39 - mysql         >= 5.1 (alternative to sqLite)
40 - postgres      >= 8.3 (alternative to sqLite)
41
42 Recommended autotools for compiling the SVN version are:
43 - autoconf >= 2.59
44 - automake >= 1.11.1
45 - libtool  >= 2.2 
46
47
48 How to install?
49 ===============
50
51 The fastest way is to use a binary package if it is available for your
52 system.  For a more detailed description, read the installation
53 instructions on the webpage at https://gnunet.org/installation.
54
55 Note that some functions of GNUnet require "root" access.  GNUnet will
56 install (tiny) SUID binaries for those functions is you run "make
57 install" as root.  If you do not, GNUnet will still work, but some
58 functionality will not be available (including certain forms of NAT
59 traversal).
60
61 GNUnet requires the GNU MP library (http://www.gnu.org/software/gmp/)
62 and libgcrypt (http://www.gnupg.org/).  You can specify the path to
63 libgcrypt by passing "--with-gcrypt=PATH" to configure.  You will also
64 need either sqlite (http://www.sqlite.org/), MySQL
65 (http://www.mysql.org/) or PostGres (http://www.postgres.org/).
66
67 If you install from source, you need to install GNU libextractor first
68 (download from http://www.gnu.org/software/libextractor/).  We also
69 recommend installing GNU libmicrohttpd (download from
70 http://www.gnu.org/software/libmicrohttpd/).  Then you can start the
71 actual GNUnet compilation and installation process with:
72
73 $ export GNUNET_PREFIX=/usr/local # or other directory of your choice
74 $ addgroup gnunetdns
75 $ adduser gnunet gnunet
76 $ ./configure --prefix=$GNUNET_PREFIX --with-extractor=$LE_PREFIX
77 $ make
78 # make install
79 # sudo -u gnunet gnunet-arm -s
80
81 This will create the users and groups needed for running GNUnet
82 securely and then compile and install GNUnet to $GNUNET_PREFIX/bin/,
83 $GNUNET_PREFIX/lib/ and $GNUNET_PREFIX/share/ and start the system
84 with the default configuration.  It is strongly recommended that you
85 add a user "gnunet" to run "gnunet-arm".  You can then still run the
86 end-user applications as another user.  
87
88 If you create a system user "gnunet", it is recommended that you edit
89 the configuration file slightly so that data can be stored in the
90 system user home directory at "/var/lib/gnunet".  Depending on what
91 the $HOME-directory of your "gnunet" user is, you might need to set
92 the SERVICEHOME option in section "[PATHS]" to "/var/lib/gnunet" to
93 do this.  Depending on your personal preferences, you may also want to
94 use "/etc/gnunet.conf" for the location of the configuration file in
95 this case (instead of ~gnunet/.gnunet/gnunet.conf").  In this case,
96 you need to start GNUnet using "gnunet-arm -s -c /etc/gnunet.conf".
97
98 You can avoid running 'make install' as root if you run configure
99 with the "--with-sudo=yes" option and have extensive sudo rights
100 (can run "chmod +s" and "chown" via 'sudo').  If you run 'make install'
101 as a normal user without sudo rights (or the configure option),
102 certain binaries that require additional priviledges will not be
103 installed properly (and autonomous NAT traversal, WLAN, DNS/GNS and 
104 the VPN will then not work).
105
106 If you run 'configure' and 'make install' as root or use the SUDO
107 option, GNUnet's build system will install "libnss_gns*" libraries to
108 "/lib/" regardless (!) of the $GNUNET_PREFIX you might have specified,
109 as those libraries must be in "/lib/".  If you are packaging GNUnet
110 for binary distribution, this may cause your packaging script to miss
111 those plugins, so you might need to do some additional manual work to
112 include those libraries in your binary package(s).  Similarly, if you
113 want to use the GNUnet naming system and did NOT run GNUnet's 'make
114 install' process with SUDO rights, the libraries will be installed to
115 "$GNUNET_PREFIX/lib" and you will have to move them to "/lib/"
116 manually.
117
118 Finally, if you are compiling the code from subversion, you have to
119 run ". bootstrap" before ./configure.  If you receive an error during
120 the running of ". bootstrap" that looks like "macro `AM_PATH_GTK' not
121 found in library", you may need to run aclocal by hand with the -I
122 option, pointing to your aclocal m4 macros, i.e.
123
124 $ aclocal -I /usr/local/share/aclocal
125
126
127 Configuration
128 =============
129
130 Note that additional, per-user configuration files can be created by
131 each user.  However, this is usually not necessary as there are few
132 per-user options that normal users would want to modify.  The defaults
133 that are shipped with the installation are usually just fine.
134
135 The gnunet-setup tool is particularly useful to generate the master
136 configuration for the peer.  gnunet-setup can be used to configure and
137 test (!) the network settings, choose which applications should be run
138 and configure databases.  Other options you might want to control
139 include system limitations (such as disk space consumption, bandwidth,
140 etc.).  The resulting configuration files are human-readable and can
141 theoretically be created or edited by hand.
142
143 gnunet-setup is a separate download and requires somewhat recent
144 versions of GTK+ and Glade. You can also create the configuration file
145 by hand, but this is not recommended.  For more general information
146 about the GNU build process read the INSTALL file.
147
148 GNUnet uses two types of configuration files, one that specifies the
149 system-wide defaults (typically located in
150 $GNUNET_PREFIX/share/gnunet/config.d/) and a second one that overrides
151 default values with user-specific preferences.  The user-specific
152 configuration file should be located in "~/.gnunet/gnunet.conf" or its
153 location can be specified by giving the "-c" option to the respective
154 GNUnet application.
155
156
157 Usage
158 =====
159
160 First, you must obtain an initial list of GNUnet hosts.  Knowing a
161 single peer is sufficient since after that GNUnet propagates
162 information about other peers.  Note that the default configuration
163 contains URLs from where GNUnet downloads an initial hostlist
164 whenever it is started.  If you want to create an alternative URL for
165 others to use, the file can be generated on any machine running
166 GNUnet by periodically executing
167
168 $ cat $SERVICEHOME/data/hosts/* > the_file
169
170 and offering 'the_file' via your web server.  Alternatively, you can
171 run the build-in web server by adding '-p' to the OPTIONS value
172 in the "hostlist" section of gnunet.conf and opening the respective
173 HTTPPORT to the public.
174
175 If the solution with the hostlist URL is not feasible for your
176 situation, you can also add hosts manually.  Simply copy the hostkeys
177 to "$SERVICEHOME/data/hosts/" (where $SERVICEHOME is the directory
178 specified in the gnunet.conf configuration file).  You can also use
179 "gnunet-peerinfo -g" to GET a URI for a peer and "gnunet-peerinfo -p
180 URI" to add a URI from another peer.  Finally, GNUnet peers that use
181 UDP or WLAN will discover each other automatically (if they are in the
182 vicinity of each other) using broadcasts (IPv4/WLAN) or multicasts
183 (IPv6).
184
185 The local node is started using "gnunet-arm -s".  GNUnet should run
186 24/7 if you want to maximize your anonymity, as this makes partitioning
187 attacks harder.
188
189 Once your peer is running, you should then be able to access GNUnet
190 using the shell:
191
192 $ gnunet-search KEYWORD
193
194 This will display a list of results to the console.  You can abort
195 the command using "CTRL-C".  Then use
196
197 $ gnunet-download -o FILENAME GNUNET_URI
198
199 to retrieve a file.  The GNUNET_URI is printed by gnunet-search
200 together with a description.  To publish files on GNUnet, use the
201 "gnunet-publish" command.
202
203
204 The GTK user interface is shipped separately.  After downloading and
205 installing gnunet-gtk, you can invoke the setup tool and the 
206 file-sharing GUI with:
207
208 $ gnunet-setup
209 $ gnunet-fs-gtk
210
211 For further documentation, see our webpage.
212
213
214 Hacking GNUnet
215 ==============
216
217 Contributions are welcome, please submit bugs to
218 https://gnunet.org/bugs/.  Please make sure to run contrib/report.sh
219 and include the output with your bug reports.  More about how to
220 report bugs can be found in the GNUnet FAQ on the webpage.  Submit
221 patches via E-Mail to gnunet-developers@gnu.org.
222
223 In order to run the unit tests with "make check", you need to
224 set an environment variable ("GNUNET_PREFIX") to the directory
225 where GNUnet is installed (usually, GNUnet will use OS specific
226 tricks in order to try to figure out the PREFIX, but since the
227 testcase binaries are not installed, that trick does not work
228 for them).  Also, before running any testcases, you must
229 complete the installation first.  Quick summary:
230
231 $ ./configure --prefix=$SOMEWHERE
232 $ make
233 $ make install
234 $ export GNUNET_PREFIX=$SOMEWHERE
235 $ make check
236
237 Some of the testcases require python >= 2.6 and pexpect to be
238 installed.  If any testcases fail to pass on your system, run 
239 "contrib/report.sh" and report the output together with 
240 information about the failing testcase to the Mantis bugtracking 
241 system at https://gnunet.org/bugs/.
242
243
244 Running HTTP on port 80 and HTTPS on port 443
245 =============================================
246
247 In order to hide GNUnet's HTTP/HTTPS traffic perfectly, you might
248 consider running GNUnet's HTTP/HTTPS transport on port 80/443.
249 However, we do not recommend running GNUnet as root.  Instead, forward
250 port 80 to say 1080 with this command (as root, in your startup
251 scripts):
252
253 # iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 1080
254
255 or for HTTPS
256
257 # iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 4433
258
259 Then set in the HTTP section of gnunet.conf the "ADVERTISED_PORT" to
260 "80" and "PORT" to 1080 and similarly in the HTTPS section the
261 "ADVERTISED_PORT" to "443" and "PORT" to 4433.
262
263 You can do the same trick for the TCP and UDP transports if you want
264 to map them to a priviledged port (from the point of view of the
265 network).  However, we are not aware of this providing any advantages
266 at this point.
267
268 If you are already running an HTTP or HTTPS server on port 80 (or 443),
269 you may be able to configure it as a "ReverseProxy".  Here, you tell
270 GNUnet that the externally visible URI is some sub-page on your website,
271 and GNUnet can then tunnel its traffic via your existing HTTP server.
272 This is particularly powerful if your existing server uses HTTPS, as
273 it makes it harder for an adversary to distinguish normal traffic to
274 your server from GNUnet traffic.  Finally, even if you just use HTTP,
275 you might benefit (!) from ISP's traffic shaping as opposed to being
276 throttled by ISPs that dislike P2P.  Details for configuring the
277 reverse proxy are documented on our website.
278
279
280 Stay tuned
281 ==========
282
283 * https://gnunet.org/
284 * https://gnunet.org/bugs/
285 * https://gnunet.org/svn/
286 * http://www.gnu.org/software/gnunet/
287 * http://mail.gnu.org/mailman/listinfo/gnunet-developers
288 * http://mail.gnu.org/mailman/listinfo/help-gnunet
289 * http://mail.gnu.org/mailman/listinfo/info-gnunet
290 * http://mail.gnu.org/mailman/listinfo/gnunet-svn