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