aboutsummaryrefslogtreecommitdiff
path: root/doc/old/handbook/chapters/user.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/old/handbook/chapters/user.texi')
-rw-r--r--doc/old/handbook/chapters/user.texi2603
1 files changed, 2603 insertions, 0 deletions
diff --git a/doc/old/handbook/chapters/user.texi b/doc/old/handbook/chapters/user.texi
new file mode 100644
index 000000000..714336228
--- /dev/null
+++ b/doc/old/handbook/chapters/user.texi
@@ -0,0 +1,2603 @@
1@node Using GNUnet
2@chapter Using GNUnet
3
4
5This tutorial is supposed to give a first introduction for users
6trying to do something real with GNUnet. Installation and
7configuration are specifically outside of the scope of this tutorial.
8Instead, we start by briefly checking that the installation works, and
9then dive into uncomplicated, concrete practical things that can be done
10with the framework provided by GNUnet.
11
12In short, this chapter of the ``GNUnet Reference Documentation'' will
13show you how to use the various peer-to-peer applications of the
14GNUnet system.
15As GNUnet evolves, we will add new sections for the various
16applications that are being created.
17
18Comments on the content of this chapter, and extensions of it are
19always welcome.
20
21
22@menu
23* Start and stop GNUnet::
24* First steps - Using the GNU Name System::
25* First steps - Using GNUnet Conversation::
26* First steps - Using the GNUnet VPN::
27* File-sharing::
28* The GNU Name System::
29* reclaimID Identity Provider::
30* Using the Virtual Public Network::
31* Using the GNUnet Messenger::
32@end menu
33
34@node Start and stop GNUnet
35@section Start and stop GNUnet
36
37Prior to using any GNUnet-based application, one has to start a node:
38
39@example
40$ gnunet-arm -s -l gnunet.log
41@end example
42
43To stop GNUnet:
44
45@example
46$ gnunet-arm -e
47@end example
48
49@node First steps - Using the GNU Name System
50@section First steps - Using the GNU Name System
51
52
53@menu
54* Preliminaries::
55* Managing Egos::
56* The GNS Tab::
57* Creating a Record::
58* Resolving GNS records::
59* Integration with Browsers (DNS2GNS service)::
60* Integration with Browsers (SOCKS proxy)::
61* Creating a Business Card::
62* Be Social::
63* Backup of Identities and Egos::
64* Revocation::
65* What's Next?::
66@end menu
67
68@node Preliminaries
69@subsection Preliminaries
70
71In the default configuration, there are two zones defined and shipped with
72GNUnet:
73
74The first is ``gnunet.org'', which points to the authoritate zone of the
75GNUnet project. It can be used to resolve, for example, ``www.gnunet.org''.
76
77``.pin'' is another default zone which points to a special zone also managed
78by gnunet.org. Users may register submodomains on a first-come first-served-basis
79at @url{https://fcfs.gnunet.org}.
80
81Use @code{gnunet-config -s gns} to view the GNS configuration, including
82all configured zones that are operated by other users. The respective
83configuration entry names start with a ``.'', e.g. ``.pin''.
84
85You can configure any number of top-level domains, and point them to
86the respective zones of your friends! For this, simply obtain the
87respective public key (you will learn how below) and extend the
88configuration:
89
90@example
91$ gnunet-config -s gns -o .myfriend -V PUBLIC_KEY
92@end example
93
94@node Managing Egos
95@subsection Managing Egos
96
97In GNUnet, identity management is about managing egos. Egos can
98correspond to pseudonyms or real-world identities. If you value your
99privacy, you are encouraged to use separate egos for separate
100activities.
101
102Technically, an ego is first of all a public-private key pair, and
103thus egos also always correspond to a GNS zone. Egos are managed by
104the IDENTITY service. Note that this service has nothing to do with
105the peer identity. The IDENTITY service essentially stores the
106private keys under human-readable names, and keeps a mapping of which
107private key should be used for particular important system functions.
108The existing identities can be listed using the command
109@command{gnunet-identity --display}
110
111@example
112gnu - JTDVJC69NHU6GQS4B5721MV8VM7J6G2DVRGJV0ONIT6QH7OI6D50
113rules - GO0T87F9BPMF8NKD5A54L2AH1T0GRML539TPFSRMCEA98182QD30
114@end example
115
116
117@node The GNS Tab
118@subsection The GNS Tab
119
120
121Maintaining your zones is through the NAMESTORE service and is discussed
122here. You can manage your zone using @command{gnunet-identity} and
123@command{gnunet-namestore}, or most conveniently using
124@command{gnunet-namestore-gtk}.
125
126We will use the GTK+ interface in this introduction. Please start
127@command{gnunet-gkt} and switch to the GNS tab, which is the tab in
128the middle with the letters "GNS" connected by a graph.
129
130Next to the ``Add'' button there is a field where you can enter the
131label (pseudonym in IDENTITY subsystem speak) of a zone you would like
132to create. Pushing the ``Add'' button will create the zone.
133Afterwards, you can change the label in the combo box below at any
134time. The label will be the top-level domain that the GNU Name System
135will resolve using your zone. For the label, you should pick
136a name by which you would like to
137be known by your friends (or colleagues). You should pick a label that
138is reasonably unique within your social group. Be aware that
139the label will be published together with every record in that zone.
140
141Once you have created a first zone, you should see a QR code for the
142zone on the right. Next to it is a "Copy" button to copy the public
143key string to the clipboard. You can also save the QR code image to
144disk.
145
146Furthermore, you now can see the bottom part of the dialog. The
147bottom of the window contains the existing entries in the selected zone.
148
149@node Creating a Record
150@subsection Creating a Record
151
152
153We will begin by creating a simple record in your master zone.
154To do this, click on the text "<new name>" in the table. The field is
155editable, allowing you to enter a fresh label. Labels are restricted
156to 63 characters and must not contain dots. For now, simply enter
157"test", then press ENTER to confirm. This will create a new (empty)
158record group under the label "test". Now click on "<new record>" next
159to the new label "test". In the drop-down menu, select "A" and push
160ENTER to confirm. Afterwards, a new dialog will pop up, asking to enter
161details for the "A" record.
162
163"A" records are used in the @dfn{Domain Name System} (DNS) to specify
164IPv4 addresses. An IPv4 address is a number that is used to identify
165and address a computer on the Internet (version 4). Please enter
166"217.92.15.146" in the dialog below "Destination IPv4 Address" and
167select "Record is public". Do not change any of the other options.
168Note that as you enter a (well-formed) IPv4 address, the "Save"
169button in the bottom right corner becomes sensitive. In general, buttons
170in dialogs are often insensitive as long as the contents of the dialog
171are incorrect.
172
173Once finished, press the "Save" button. Back in the main dialog, select
174the tiny triangle left of the "test" label. By doing so, you get to see
175all of the records under "test". Note that you can right-click a record
176to edit it later.
177
178
179@node Resolving GNS records
180@subsection Resolving GNS records
181
182
183Next, you should try resolving your own GNS records. The method we
184found to be the most uncomplicated is to do this by explicitly
185resolving using @code{gnunet-gns}. For this exercise, we will assume
186that you used the string ``gnu'' for the pseudonym (or label) of your
187GNS zone. If you used something else, replace ``.gnu'' with your real
188pseudonym in the examples below.
189
190In the shell, type:
191
192@example
193$ gnunet-gns -u test.gnu # what follows is the reply
194test.gnu:
195Got `A' record: 217.92.15.146
196@end example
197
198@noindent
199That shows that resolution works, once GNS is integrated with
200the application.
201
202@node Integration with Browsers (DNS2GNS service)
203@subsection Integration with Browsers (DNS2GNS service)
204
205Most OSes allow you to either modify your @code{/etc/resolv.conf} directly or
206through @code{resolvectl}.
207We are going to configure the @code{dns2gns} service in order to translate DNS name
208queries by applications to GNS name queries where applicable and else fall back
209to DNS.
210
211Optionally, you may want to configure your @code{dns2gns} service to run on a
212non-priviledged port like 5353.
213But, in case you are going to edit @code{/etc/resolv.conf} directly, the
214@code{dns2gns} service MUST run on port 53 as you cannot specify the port number.
215A $FALLBACK_DNS variable should be a DNS server you trust such as your local router:
216
217@example
218$ gnunet-config -s dns2gns -o OPTIONS -V "-d $FALLBACK_DNS -p 5252"
219$ gnunet-arm -i dns2gns # Make sure the service is started
220@end example
221
222If you edit your resolv.conf directly, it should contain and entry like this:
223
224@example
225nameserver 127.0.0.1
226@end example
227
228In any case, it is very likely that the method of modification of your
229resolver is OS specific.
230Recently, the combination of NetworkManager and systemd-resolved is becoming
231increasingly popular.
232
233If you use resolvectl and systemd-resolved you can temporarily
234set the nameserver like this:
235
236@example
237$ resolvectl $INTERFACE 127.0.0.1:5353
238@end example
239
240Where @code{$INTERFACE} is your network interface such as ``eth0''.
241
242In order to automatically set the DNS2GNS server if it is running already you
243can use NetworkManager-dispatcher. First, enable it:
244
245@example
246$ sudo systemctl enable NetworkManager-dispatcher.service
247$ sudo systemctl start NetworkManager-dispatcher.service
248@end example
249
250Then, create a script /etc/NetworkManager/dispatch.h/10-dns2-gns.sh:
251
252@example
253#!/bin/sh
254interface=$1
255status=$2
256
257if [ "$interface" = "eth0" ]; then
258 case $status in
259 up)
260 if nc -u -z 127.0.0.1 5353; then
261 resolvectl dns $interface 127.0.0.1:5353
262 fi
263 ;;
264 down)
265 ;;
266 esac
267fi
268@end example
269
270Make sure the script is owned by root and executable:
271
272@example
273$ sudo root:root /etc/NetworkManager/dispatch.d/10-dns2gns.sh
274$ sudo +x /etc/NetworkManager/dispatch.d/10-dns2gns.sh
275@end example
276
277You can test accessing this website using your browser or curl:
278
279@example
280$ curl www.gnunet.org
281@end example
282
283Note that ``gnunet.org'' is a domain that also exists in DNS and for which the
284GNUnet project webservers can provide trusted TLS certificates.
285When using non-DNS names with GNS or aliases, this may result in issues
286when accessing HTTPS websites with browsers.
287In order learn how to provide relief for this issue, read on.
288
289@node Integration with Browsers (SOCKS proxy)
290@subsection Integration with Browsers (SOCKS proxy)
291
292While we recommend integrating GNS using the DNS2GNS service or the
293NSSwitch plugin, you can also
294integrate GNS directly with your browser via the @code{gnunet-gns-proxy}.
295This method can have the advantage that the proxy can validate
296TLS/X.509 records and thus strengthen web security; however, the proxy
297is still a bit brittle, so expect subtle failures. We have had reasonable
298success with Chromium, and various frustrations with Firefox in this area
299recently.
300
301The first step is to start the proxy. As the proxy is (usually)
302not started by default, this is done as a unprivileged user
303using @command{gnunet-arm -i gns-proxy}. Use @command{gnunet-arm -I}
304as a unprivileged user to check that the proxy was actually
305started. (The most common error for why the proxy may fail to start
306is that you did not run @command{gnunet-gns-proxy-setup-ca} during
307installation.) The proxy is a SOCKS5 proxy running (by default)
308on port 7777. Thus, you need to now configure your browser to use
309this proxy. With Chromium, you can do this by starting the browser
310as a unprivileged user using
311@command{chromium --proxy-server="socks5://localhost:7777"}
312For @command{Firefox} (or @command{Icecat}), select "Edit-Preferences"
313in the menu, and then select the "Advanced" tab in the dialog
314and then "Network":
315
316Here, select "Settings..." to open the proxy settings dialog.
317Select "Manual proxy configuration" and enter @code{localhost}
318with port 7777 under SOCKS Host. Furthermore, set the
319checkbox ``Proxy DNS when using SOCKS v5'' at the bottom of
320the dialog. Finally, push "OK".
321
322You must also go to about:config and change the
323@code{browser.fixup.alternate.enabled} option to @code{false},
324otherwise the browser will autoblunder an address like
325@code{@uref{http://www.gnu/, www.gnu}} to
326@code{@uref{http://www.gnu.com/, www.gnu.com}}. If you want
327to resolve @@ in your own TLDs, you must additionally
328set @code{browser.fixup.dns_first_use_for_single_words} to @code{true}.
329
330After configuring your browser, you might want to first confirm that it
331continues to work as before. (The proxy is still experimental and if you
332experience "odd" failures with some webpages, you might want to disable
333it again temporarily.) Next, test if things work by typing
334"@uref{http://test.gnu/}" into the URL bar of your browser.
335This currently fails with (my version of) Firefox as Firefox is
336super-smart and tries to resolve "@uref{http://www.test.gnu/}" instead of
337"@uref{test.gnu}". Chromium can be convinced to comply if you explicitly
338include the "http://" prefix --- otherwise a Google search might be
339attempted, which is not what you want. If successful, you should
340see a simple website.
341
342Note that while you can use GNS to access ordinary websites, this is
343more an experimental feature and not really our primary goal at this
344time. Still, it is a possible use-case and we welcome help with testing
345and development.
346
347@pindex gnunet-bcd
348@node Creating a Business Card
349@subsection Creating a Business Card
350@c FIXME: Which parts of texlive are needed? Some systems offer a modular
351@c texlive (smaller size).
352Before we can really use GNS, you should create a business card.
353Note that this requires having @command{LaTeX} installed on your system.
354If you are using a Debian GNU/Linux based operating system, the
355following command should install the required components.
356Keep in mind that this @b{requires 3GB} of downloaded data and possibly
357@b{even more} when unpacked. On a GNU Guix based system texlive 2017 has
358returns a DAG size of 5032.4 MiB.
359The packages which are confirmed to be required are:
360
361@itemize @bullet
362@item texlive-units
363@item texlive-labels
364@item texlive-pst-barcode
365@item texlive-luatex85
366@item texlive-preview
367@item texlive-pdfcrop
368@item texlive-koma-script
369@end itemize
370
371
372@b{We welcome any help in identifying the required components of the
373TexLive Distribution. This way we could just state the required components
374without pulling in the full distribution of TexLive.}
375
376@example
377apt-get install texlive-full
378@end example
379
380@noindent
381Start creating a business card by clicking the "Copy" button
382in @command{gnunet-namestore-gtk}. Next, you should start
383the @command{gnunet-bcd} program (in the terminal, on the command-line).
384You do not need to pass any options, and please be not surprised if
385there is no output:
386
387@example
388$ gnunet-bcd # seems to hang...
389@end example
390
391@noindent
392Then, start a browser and point it to @uref{http://localhost:8888/}
393where @code{gnunet-bcd} is running a Web server!
394
395First, you might want to fill in the "GNS Public Key" field by
396right-clicking and selecting "Paste", filling in the public key
397from the copy you made in @command{gnunet-namestore-gtk}.
398Then, fill in all of the other fields, including your @b{GNS NICKname}.
399Adding a GPG fingerprint is optional.
400Once finished, click "Submit Query".
401If your @code{LaTeX} installation is incomplete, the result will be
402disappointing.
403Otherwise, you should get a PDF containing fancy 5x2 double-sided
404translated business cards with a QR code containing your public key
405and a GNUnet logo.
406We'll explain how to use those a bit later.
407You can now go back to the shell running @code{gnunet-bcd} and press
408@b{CTRL-C} to shut down the Web server.
409
410
411@node Be Social
412@subsection Be Social
413
414
415Next, you should print out your business card and be social.
416Find a friend, help them install GNUnet and exchange business cards with
417them. Or, if you're a desperate loner, you might try the next step with
418your own card. Still, it'll be hard to have a conversation with
419yourself later, so it would be better if you could find a friend.
420You might also want a camera attached to your computer, so
421you might need a trip to the store together.
422
423Before we get started, we need to tell @code{gnunet-qr} which zone
424it should import new records into. For this, run:
425
426@pindex gnunet-identity
427@example
428$ gnunet-identity -s namestore -e NAME
429@end example
430where NAME is the name of the zone you want to import records
431into. In our running example, this would be ``gnu''.
432
433@pindex gnunet-qr
434Henceforth, for every business card you collect, simply run:
435@example
436$ gnunet-qr
437@end example
438
439@noindent
440to open a window showing whatever your camera points at.
441Hold up your friend's business card and tilt it until
442the QR code is recognized. At that point, the window should
443automatically close. At that point, your friend's NICKname and their
444public key should have been automatically imported into your zone.
445
446Assuming both of your peers are properly integrated in the
447GNUnet network at this time, you should thus be able to
448resolve your friends names. Suppose your friend's nickname
449is "Bob". Then, type
450
451@pindex gnunet-gns
452@example
453$ gnunet-gns -u test.bob.gnu
454@end example
455
456@noindent
457to check if your friend was as good at following instructions
458as you were.
459
460
461@node Backup of Identities and Egos
462@subsection Backup of Identities and Egos
463
464
465One should always backup their files, especially in these SSD days (our
466team has suffered 3 SSD crashes over a span of 2 weeks). Backing up peer
467identity and zones is achieved by copying the following files:
468
469The peer identity file can be found
470in @file{~/.local/share/gnunet/private_key.ecc}
471
472The private keys of your egos are stored in the
473directory @file{~/.local/share/gnunet/identity/egos/}.
474They are stored in files whose filenames correspond to the zones'
475ego names. These are probably the most important files you want
476to backup from a GNUnet installation.
477
478Note: All these files contain cryptographic keys and they are
479stored without any encryption. So it is advisable to backup
480encrypted copies of them.
481
482
483@node Revocation
484@subsection Revocation
485
486Now, in the situation of an attacker gaining access to the private key of
487one of your egos, the attacker can create records in the respective
488GNS zone
489and publish them as if you published them. Anyone resolving your
490domain will get these new records and when they verify they seem
491authentic because the attacker has signed them with your key.
492
493To address this potential security issue, you can pre-compute
494a revocation certificate corresponding to your ego. This certificate,
495when published on the P2P network, flags your private key as invalid,
496and all further resolutions or other checks involving the key will fail.
497
498@pindex gnunet-revocation
499A revocation certificate is thus a useful tool when things go out of
500control, but at the same time it should be stored securely.
501Generation of the revocation certificate for a zone can be done through
502@command{gnunet-revocation}. For example, the following command (as
503unprivileged user) generates a revocation file
504@file{revocation.dat} for the zone @code{zone1}:
505@command{gnunet-revocation -f revocation.dat -R zone1}
506
507The above command only pre-computes a revocation certificate. It does
508not revoke the given zone. Pre-computing a revocation certificate
509involves computing a proof-of-work and hence may take up to 4 to 5 days
510on a modern processor. Note that you can abort and resume the
511calculation at any time. Also, even if you did not finish the
512calculation, the resulting file will contain the signature, which is
513sufficient to complete the revocation process even without access to
514the private key. So instead of waiting for a few days, you can just
515abort with CTRL-C, backup the revocation certificate and run the
516calculation only if your key actually was compromised. This has the
517disadvantage of revocation taking longer after the incident, but
518the advantage of saving a significant amount of energy. So unless
519you believe that a key compromise will need a rapid response, we
520urge you to wait with generating the revocation certificate.
521Also, the calculation is deliberately expensive, to deter people from
522doing this just for fun (as the actual revocation operation is expensive
523for the network, not for the peer performing the revocation).
524
525
526@c FIXME: The Manual should give away the command using an example that is
527@c very likely to never exist.
528To avoid TL;DR ones from accidentally revocating their zones, we are not
529giving away the command, but it is uncomplicated: the actual revocation is
530performed by using the @command{-p} option of @command{gnunet-revocation}.
531
532
533@node What's Next?
534@subsection What's Next?
535
536
537This may seem not like much of an application yet, but you have
538just been one of the first to perform a decentralized secure name
539lookup (where nobody could have altered the value supplied by your
540friend) in a privacy-preserving manner (your query on the network
541and the corresponding response were always encrypted). So what
542can you really do with this? Well, to start with, you can publish your
543GnuPG fingerprint in GNS as a "CERT" record and replace the public
544web-of-trust with its complicated trust model with explicit names
545and privacy-preserving resolution. Also, you should read the next
546chapter of the tutorial and learn how to use GNS to have a
547private conversation with your friend. Finally, help us
548with the next GNUnet release for even more applications
549using this new public key infrastructure.
550
551@pindex gnunet-conservation-gtk
552@node First steps - Using GNUnet Conversation
553@section First steps - Using GNUnet Conversation
554
555
556First, you should launch the graphical user interface. You can do
557this from the command-line by typing
558
559@example
560$ gnunet-conversation-gtk
561@end example
562
563@menu
564* Testing your Audio Equipment::
565* GNS Zones::
566@end menu
567
568@node Testing your Audio Equipment
569@subsection Testing your Audio Equipment
570
571
572First, you should use @code{gnunet-conversation-test} to check that your
573microphone and speaker are working correctly. You will be prompted to
574speak for 5 seconds, and then those 5 seconds will be replayed to you.
575The network is not involved in this test. If it fails, you should run
576your pulse audio configuration tool to check that microphone and
577speaker are not muted and, if you have multiple input/output devices,
578that the correct device is being associated with GNUnet's audio tools.
579
580@node GNS Zones
581@subsection GNS Zones
582
583
584@code{gnunet-conversation} uses GNS for addressing. This means that
585you need to have a GNS zone created before using it. Information
586about how to create GNS zones can be found here.
587
588
589@menu
590* Picking an Identity::
591* Calling somebody::
592@end menu
593
594@node Picking an Identity
595@subsubsection Picking an Identity
596
597
598To make a call with @code{gnunet-conversation}, you first
599need to choose an identity. This identity is both the caller ID
600that will show up when you call somebody else, as well as the
601GNS zone that will be used to resolve names of users that you
602are calling. Run
603
604@pindex gnunet-conversation
605@example
606gnunet-conversation -e zone-name
607@end example
608
609@noindent
610to start the command-line tool. You will see a message saying
611that your phone is now "active on line 0". You can connect
612multiple phones on different lines at the same peer. For the
613first phone, the line zero is of course a fine choice.
614
615Next, you should type in @command{/help} for a list of
616available commands. We will explain the important ones
617during this tutorial. First, you will need to type in
618@command{/address} to determine the address of your
619phone. The result should look something like this:
620
621@example
622/address
6230-PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0
624@end example
625
626@noindent
627Here, the "0" is your phone line, and what follows
628after the hyphen is your peer's identity. This information will
629need to be placed in a PHONE record of
630your GNS master-zone so that other users can call you.
631
632Start @code{gnunet-namestore-gtk} now (possibly from another
633shell) and create an entry home-phone in your master zone.
634For the record type, select PHONE. You should then see the
635PHONE dialog:
636
637@image{images/gnunet-namestore-gtk-phone,5in,,Dialog to publish a PHONE record}
638
639Note: Do not choose the expiry time to be 'Never'. If you
640do that, you assert that this record will never change and
641can be cached indefinitely by the DHT and the peers which
642resolve this record. A reasonable period is 1 year.
643
644Enter your peer identity under Peer and leave the line
645at zero. Select the first option to make the record public.
646If you entered your peer identity incorrectly,
647the "Save" button will not work; you might want to use
648copy-and-paste instead of typing in the peer identity
649manually. Save the record.
650
651@node Calling somebody
652@subsubsection Calling somebody
653
654
655Now you can call a buddy. Obviously, your buddy will have to have GNUnet
656installed and must have performed the same steps. Also, you must have
657your buddy in your GNS master zone, for example by having imported
658your buddy's public key using @code{gnunet-qr}. Suppose your buddy
659is in your zone as @code{buddy.mytld} and they also created their
660phone using a label "home-phone". Then you can initiate a call using:
661
662@example
663/call home-phone.buddy.mytld
664@end example
665
666It may take some time for GNUnet to resolve the name and to establish
667a link. If your buddy has your public key in their master zone, they
668should see an incoming call with your name. If your public key is not
669in their master zone, they will just see the public key as the caller ID.
670
671Your buddy then can answer the call using the "/accept" command. After
672that, (encrypted) voice data should be relayed between your two peers.
673Either of you can end the call using @command{/cancel}. You can exit
674@code{gnunet-conversation} using @command{/quit}.
675
676
677@node First steps - Using the GNUnet VPN
678@section First steps - Using the GNUnet VPN
679
680
681
682@menu
683* VPN Preliminaries::
684* GNUnet-Exit configuration::
685* GNS configuration::
686* Accessing the service::
687* Using a Browser::
688@end menu
689
690@node VPN Preliminaries
691@subsection VPN Preliminaries
692
693
694To test the GNUnet VPN, we should first run a web server.
695The easiest way to do this is to just start @code{gnunet-bcd},
696which will run a webserver on port @code{8888} by default.
697Naturally, you can run some other HTTP server for our little tutorial.
698
699If you have not done this, you should also configure your
700Name System Service switch to use GNS. In your @code{/etc/nsswitch.conf}
701you should fine a line like this:
702
703@example
704hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
705@end example
706
707@noindent
708The exact details may differ a bit, which is fine. Add the text
709@code{gns [NOTFOUND=return]} after @code{files}:
710
711@example
712hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4
713@end example
714
715@c TODO: outdated section, we no longer install this as part of the
716@c TODO: standard installation procedure and should point out the manual
717@c TODO: steps required to make it useful.
718@noindent
719You might want to make sure that @code{/lib/libnss_gns.so.2} exists on
720your system, it should have been created during the installation.
721If not, re-run
722
723@example
724$ configure --with-nssdir=/lib
725$ cd src/gns/nss; sudo make install
726@end example
727
728@noindent
729to install the NSS plugins in the proper location.
730
731@node GNUnet-Exit configuration
732@subsection GNUnet-Exit configuration
733
734
735Stop your peer (as user @code{gnunet}, run @command{gnunet-arm -e}) and
736run @command{gnunet-setup}. In @command{gnunet-setup}, make sure to
737activate the @strong{EXIT} and @strong{GNS} services in the General tab.
738Then select the Exit tab. Most of the defaults should be fine (but
739you should check against the screenshot that they have not been modified).
740In the bottom area, enter @code{bcd} under Identifier and change the
741Destination to @code{169.254.86.1:8888} (if your server runs on a port
742other than 8888, change the 8888 port accordingly).
743
744Now exit @command{gnunet-setup} and restart your peer
745(@command{gnunet-arm -s}).
746
747@node GNS configuration
748@subsection GNS configuration
749
750
751Now, using your normal user (not the @code{gnunet} system user), run
752@command{gnunet-namestore-gtk}. Add a new label www in your
753master zone. For the record type, select @code{VPN}. You should then
754see the VPN dialog:
755
756@image{images/gnunet-namestore-gtk-vpn,5in,,Dialog to publish a VPN record}
757
758Under peer, you need to supply the peer identity of your own peer. You can
759obtain the respective string by running @command{gnunet-peerinfo -sq}
760as the @code{gnunet} user. For the Identifier, you need to supply the same
761identifier that we used in the Exit setup earlier, so here supply "bcd".
762If you want others to be able to use the service, you should probably make
763the record public. For non-public services, you should use a passphrase
764instead of the string "bcd". Save the record and
765exit @command{gnunet-namestore-gtk}.
766
767@node Accessing the service
768@subsection Accessing the service
769
770
771You should now be able to access your webserver. Type in:
772
773@example
774$ wget http://www.gnu/
775@end example
776
777@noindent
778The request will resolve to the VPN record, telling the GNS resolver
779to route it via the GNUnet VPN. The GNS resolver will ask the
780GNUnet VPN for an IPv4 address to return to the application. The
781VPN service will use the VPN information supplied by GNS to create
782a tunnel (via GNUnet's MESH service) to the EXIT peer.
783At the EXIT, the name "bcd" and destination port (80) will be mapped
784to the specified destination IP and port. While all this is currently
785happening on just the local machine, it should also work with other
786peers --- naturally, they will need a way to access your GNS zone
787first, for example by learning your public key from a QR code on
788your business card.
789
790@node Using a Browser
791@subsection Using a Browser
792
793
794Sadly, modern browsers tend to bypass the Name Services Switch and
795attempt DNS resolution directly. You can either run
796a @code{gnunet-dns2gns} DNS proxy, or point the browsers to an
797HTTP proxy. When we tried it, Iceweasel did not like to connect to
798the socks proxy for @code{.gnu} TLDs, even if we disabled its
799autoblunder of changing @code{.gnu} to ".gnu.com". Still,
800using the HTTP proxy with Chrome does work.
801
802@node File-sharing
803@section File-sharing
804
805
806This chapter documents the GNUnet file-sharing application. The original
807file-sharing implementation for GNUnet was designed to provide
808@strong{anonymous} file-sharing. However, over time, we have also added
809support for non-anonymous file-sharing (which can provide better
810performance). Anonymous and non-anonymous file-sharing are quite
811integrated in GNUnet and, except for routing, share most of the concepts
812and implementation. There are three primary file-sharing operations:
813publishing, searching and downloading. For each of these operations,
814the user specifies an @strong{anonymity level}. If both the publisher and
815the searcher/downloader specify "no anonymity", non-anonymous
816file-sharing is used. If either user specifies some desired degree
817of anonymity, anonymous file-sharing will be used.
818
819After a short introduction, we will first look at the various concepts
820in GNUnet's file-sharing implementation. Then, we will discuss
821specifics as to how they impact users that publish, search or download
822files.
823
824
825@menu
826* fs-Searching::
827* fs-Downloading::
828* fs-Publishing::
829* fs-Concepts::
830* Namespace Management::
831* File-Sharing URIs::
832* GTK User Interface::
833@end menu
834
835@node fs-Searching
836@subsection Searching
837
838
839The command @command{gnunet-search} can be used to search
840for content on GNUnet. The format is:
841
842@example
843$ gnunet-search [-t TIMEOUT] KEYWORD
844@end example
845
846@noindent
847The @command{-t} option specifies that the query should timeout after
848approximately TIMEOUT seconds. A value of zero (``0'') is interpreted
849as @emph{no timeout}, which is the default. In this case,
850@command{gnunet-search} will never terminate (unless you press
851@command{CTRL-C}).
852
853If multiple words are passed as keywords, they will all be
854considered optional. Prefix keywords with a "+" to make them mandatory.
855
856Note that searching using
857
858@example
859$ gnunet-search Das Kapital
860@end example
861
862@noindent
863is not the same as searching for
864
865@example
866$ gnunet-search "Das Kapital"
867@end example
868
869@noindent
870as the first will match files shared under the keywords
871"Das" or "Kapital" whereas the second will match files
872shared under the keyword "Das Kapital".
873
874Search results are printed by @command{gnunet-search} like this:
875
876@c it will be better the avoid the ellipsis altogether because I don't
877@c understand the explanation below that
878@c ng0: who is ``I'' and what was the complete sentence?
879@example
880#15:
881gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446
882
883@end example
884
885@noindent
886The whole line is the command you would have to enter to download
887the file. The first argument passed to @code{-o} is the suggested
888filename (you may change it to whatever you like).
889It is followed by the key for decrypting the file, the query for
890searching the file, a checksum (in hexadecimal) finally the size of
891the file in bytes.
892
893@node fs-Downloading
894@subsection Downloading
895
896
897In order to download a file, you need the whole line returned by
898@command{gnunet-search}.
899You can then use the tool @command{gnunet-download} to obtain the file:
900
901@example
902$ gnunet-download -o <FILENAME> <GNUNET-URL>
903@end example
904
905@noindent
906FILENAME specifies the name of the file where GNUnet is supposed
907to write the result. Existing files are overwritten. If the
908existing file contains blocks that are identical to the
909desired download, those blocks will not be downloaded again
910(automatic resume).
911
912If you want to download the GPL from the previous example,
913you do the following:
914
915@example
916$ gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446
917@end example
918
919@noindent
920If you ever have to abort a download, you can continue it at any time by
921re-issuing @command{gnunet-download} with the same filename.
922In that case, GNUnet will @strong{not} download blocks again that are
923already present.
924
925GNUnet's file-encoding mechanism will ensure file integrity, even if the
926existing file was not downloaded from GNUnet in the first place.
927
928You may want to use the @command{-V} switch to turn on verbose
929reporting. In this case, @command{gnunet-download} will print the
930current number of bytes downloaded whenever new data was received.
931
932@node fs-Publishing
933@subsection Publishing
934
935
936The command @command{gnunet-publish} can be used to add content
937to the network. The basic format of the command is
938
939@example
940$ gnunet-publish [-n] [-k KEYWORDS]* [-m TYPE:VALUE] FILENAME
941@end example
942
943For example
944@example
945$ gnunet-publish -m "description:GNU License" -k gpl -k test -m "mimetype:text/plain" COPYING
946@end example
947
948@menu
949* Important command-line options::
950* Indexing vs. Inserting::
951@end menu
952
953@node Important command-line options
954@subsubsection Important command-line options
955
956
957The option @code{-k} is used to specify keywords for the file that
958should be inserted. You can supply any number of keywords,
959and each of the keywords will be sufficient to locate and
960retrieve the file. Please note that you must use the @code{-k} option
961more than once -- one for each expression you use as a keyword for
962the filename.
963
964The -m option is used to specify meta-data, such as descriptions.
965You can use -m multiple times. The TYPE passed must be from the
966list of meta-data types known to libextractor. You can obtain this
967list by running @command{extract -L}. Use quotes around the entire
968meta-data argument if the value contains spaces. The meta-data
969is displayed to other users when they select which files to
970download. The meta-data and the keywords are optional and
971may be inferred using @code{GNU libextractor}.
972
973@command{gnunet-publish} has a few additional options to handle
974namespaces and directories. Refer to the man-page for details:
975
976@example
977man gnunet-publish
978@end example
979
980@node Indexing vs. Inserting
981@subsubsection Indexing vs Inserting
982
983
984By default, GNUnet indexes a file instead of making a full copy.
985This is much more efficient, but requires the file to stay unaltered
986at the location where it was when it was indexed. If you intend to move,
987delete or alter a file, consider using the option @code{-n} which will
988force GNUnet to make a copy of the file in the database.
989
990Since it is much less efficient, this is strongly discouraged for large
991files. When GNUnet indexes a file (default), GNUnet does @strong{not}
992create an additional encrypted copy of the file but just computes a
993summary (or index) of the file. That summary is approximately two percent
994of the size of the original file and is stored in GNUnet's database.
995Whenever a request for a part of an indexed file reaches GNUnet,
996this part is encrypted on-demand and send out. This way, there is no
997need for an additional encrypted copy of the file to stay anywhere
998on the drive. This is different from other systems, such as Freenet,
999where each file that is put online must be in Freenet's database in
1000encrypted format, doubling the space requirements if the user wants
1001to preserve a directly accessible copy in plaintext.
1002
1003Thus indexing should be used for all files where the user will keep
1004using this file (at the location given to gnunet-publish) and does
1005not want to retrieve it back from GNUnet each time. If you want to
1006remove a file that you have indexed from the local peer, use the tool
1007@command{gnunet-unindex} to un-index the file.
1008
1009The option @code{-n} may be used if the user fears that the file might
1010be found on their drive (assuming the computer comes under the control
1011of an adversary). When used with the @code{-n} flag, the user has a
1012much better chance of denying knowledge of the existence of the file,
1013even if it is still (encrypted) on the drive and the adversary is
1014able to crack the encryption (e.g. by guessing the keyword.
1015
1016@node fs-Concepts
1017@subsection Concepts
1018
1019
1020For better results with filesharing it is useful to understand the
1021following concepts.
1022In addition to anonymous routing GNUnet attempts to give users a better
1023experience in searching for content. GNUnet uses cryptography to safely
1024break content into smaller pieces that can be obtained from different
1025sources without allowing participants to corrupt files. GNUnet makes it
1026difficult for an adversary to send back bogus search results. GNUnet
1027enables content providers to group related content and to establish a
1028reputation. Furthermore, GNUnet allows updates to certain content to be
1029made available. This section is supposed to introduce users to the
1030concepts that are used to achieve these goals.
1031
1032
1033@menu
1034* Files::
1035* Keywords::
1036* Directories::
1037* Egos and File-Sharing::
1038* Namespaces::
1039* Advertisements::
1040* Anonymity level::
1041* Content Priority::
1042* Replication::
1043@end menu
1044
1045@node Files
1046@subsubsection Files
1047
1048
1049A file in GNUnet is just a sequence of bytes. Any file-format is allowed
1050and the maximum file size is theoretically @math{2^64 - 1} bytes, except
1051that it would take an impractical amount of time to share such a file.
1052GNUnet itself never interprets the contents of shared files, except when
1053using GNU libextractor to obtain keywords.
1054
1055@node Keywords
1056@subsubsection Keywords
1057
1058
1059Keywords are the most simple mechanism to find files on GNUnet.
1060Keywords are @strong{case-sensitive} and the search string
1061must always match @strong{exactly} the keyword used by the
1062person providing the file. Keywords are never transmitted in
1063plaintext. The only way for an adversary to determine the keyword
1064that you used to search is to guess it (which then allows the
1065adversary to produce the same search request). Since providing
1066keywords by hand for each shared file is tedious, GNUnet uses
1067GNU libextractor to help automate this process. Starting a
1068keyword search on a slow machine can take a little while since
1069the keyword search involves computing a fresh RSA key to formulate the
1070request.
1071
1072@node Directories
1073@subsubsection Directories
1074
1075
1076A directory in GNUnet is a list of file identifiers with meta data.
1077The file identifiers provide sufficient information about the files
1078to allow downloading the contents. Once a directory has been created,
1079it cannot be changed since it is treated just like an ordinary file
1080by the network. Small files (of a few kilobytes) can be inlined in
1081the directory, so that a separate download becomes unnecessary.
1082
1083Directories are shared just like ordinary files. If you download a
1084directory with @command{gnunet-download}, you can use
1085@command{gnunet-directory} to list its contents. The canonical
1086extension for GNUnet directories when stored as files in your
1087local file-system is ".gnd". The contents of a directory are URIs and
1088meta data.
1089The URIs contain all the information required by
1090@command{gnunet-download} to retrieve the file. The meta data
1091typically includes the mime-type, description, a filename and
1092other meta information, and possibly even the full original file
1093(if it was small).
1094
1095@node Egos and File-Sharing
1096@subsubsection Egos and File-Sharing
1097
1098When sharing files, it is sometimes desirable to build a reputation as
1099a source for quality information. With egos, publishers can
1100(cryptographically) sign files, thereby demonstrating that various
1101files were published by the same entity. An ego thus allows users to
1102link different publication events, thereby deliberately reducing
1103anonymity to pseudonymity.
1104
1105Egos used in GNUnet's file-sharing for such pseudonymous publishing
1106also correspond to the egos used to identify and sign zones in the
1107GNU Name System. However, if the same ego is used for file-sharing
1108and for a GNS zone, this will weaken the privacy assurances provided
1109by the anonymous file-sharing protocol.
1110
1111Note that an ego is NOT bound to a GNUnet peer. There can be multiple
1112egos for a single user, and users could (theoretically) share
1113the private keys of an ego by copying the respective private keys.
1114
1115
1116@node Namespaces
1117@subsubsection Namespaces
1118
1119A namespace is a set of files that were signed by the same ego.
1120Today, namespaces are implemented independently of GNS zones, but
1121in the future we plan to merge the two such that a GNS zone can
1122basically contain files using a file-sharing specific record type.
1123
1124Files (or directories) that have been signed and placed into a
1125namespace can be updated. Updates are identified as authentic if the
1126same secret key was used to sign the update.
1127
1128@node Advertisements
1129@subsubsection Advertisements
1130
1131Advertisements are used to notify other users about the existence of a
1132namespace. Advertisements are propagated using the normal keyword
1133search. When an advertisement is received (in response to a search),
1134the namespace is added to the list of namespaces available in the
1135namespace-search dialogs of gnunet-fs-gtk and printed by
1136@code{gnunet-identity}. Whenever a namespace is created, an
1137appropriate advertisement can be generated. The default keyword for
1138the advertising of namespaces is "namespace".
1139
1140
1141@node Anonymity level
1142@subsubsection Anonymity level
1143
1144The anonymity level determines how hard it should be for an adversary to
1145determine the identity of the publisher or the searcher/downloader. An
1146anonymity level of zero means that anonymity is not required. The default
1147anonymity level of "1" means that anonymous routing is desired, but no
1148particular amount of cover traffic is necessary. A powerful adversary
1149might thus still be able to deduce the origin of the traffic using
1150traffic analysis. Specifying higher anonymity levels increases the
1151amount of cover traffic required.
1152
1153The specific numeric value (for anonymity levels above 1) is simple:
1154Given an anonymity level L (above 1), each request FS makes on your
1155behalf must be hidden in L-1 equivalent requests of cover traffic
1156(traffic your peer routes for others) in the same time-period. The
1157time-period is twice the average delay by which GNUnet artificially
1158delays traffic.
1159
1160While higher anonymity levels may offer better privacy, they can also
1161significantly hurt performance.
1162
1163
1164@node Content Priority
1165@subsubsection Content Priority
1166
1167Depending on the peer's configuration, GNUnet peers migrate content
1168between peers. Content in this sense are individual blocks of a file,
1169not necessarily entire files. When peers run out of space (due to
1170local publishing operations or due to migration of content from other
1171peers), blocks sometimes need to be discarded. GNUnet first always
1172discards expired blocks (typically, blocks are published with an
1173expiration of about two years in the future; this is another option).
1174If there is still not enough space, GNUnet discards the blocks with the
1175lowest priority. The priority of a block is decided by its popularity
1176(in terms of requests from peers we trust) and, in case of blocks
1177published locally, the base-priority that was specified by the user
1178when the block was published initially.
1179
1180
1181@node Replication
1182@subsubsection Replication
1183
1184When peers migrate content to other systems, the replication level
1185of a block is used to decide which blocks need to be migrated most
1186urgently. GNUnet will always push the block with the highest
1187replication level into the network, and then decrement the replication
1188level by one. If all blocks reach replication level zero, the
1189selection is simply random.
1190
1191
1192@node Namespace Management
1193@subsection Namespace Management
1194
1195The @code{gnunet-identity} tool can be used to create egos.
1196By default, @code{gnunet-identity --display} simply
1197lists all locally available egos.
1198
1199
1200@menu
1201* Creating Egos::
1202* Deleting Egos::
1203@end menu
1204
1205@node Creating Egos
1206@subsubsection Creating Egos
1207
1208With the @command{--create=NICK} option it can also be used to create a new
1209ego. An ego is the virtual identity of the entity in control of a
1210namespace or GNS zone. Anyone can create any number of egos. The
1211provided NICK name automatically corresponds to a GNU Name System
1212domain name. Thus, henceforth name resolution for any name ending in
1213``.NICK'' will use the NICK's zone. You should avoid using NICKs that
1214collide with well-known DNS names.
1215
1216Currently, the IDENTITY subsystem supports two types of identity keys:
1217ECDSA and EdDSA. By default, ECDSA identities are creates with ECDSA keys.
1218In order to create an identity with EdDSA keys, you can use the
1219@command{--eddsa} flag.
1220
1221@node Deleting Egos
1222@subsubsection Deleting Egos
1223
1224With the @command{-D NICK} option egos can be deleted. Once the ego
1225has been deleted it is impossible to add content to the corresponding
1226namespace or zone. However, the existing GNS zone data is currently
1227not dropped. This may change in the future.
1228
1229Deleting the pseudonym does not make the namespace or any content in
1230it unavailable.
1231
1232@node File-Sharing URIs
1233@subsection File-Sharing URIs
1234
1235
1236GNUnet (currently) uses four different types of URIs for
1237file-sharing. They all begin with "gnunet://fs/".
1238This section describes the four different URI types in detail.
1239
1240For FS URIs empty KEYWORDs are not allowed. Quotes are allowed to
1241denote whitespace between words. Keywords must contain a balanced
1242number of double quotes. Doubles quotes can not be used in the actual
1243keywords. This means that the string '""foo bar""' will be turned
1244into two OR-ed keywords 'foo' and 'bar', not into '"foo bar"'.
1245
1246@menu
1247* Encoding of hash values in URIs::
1248* Content Hash Key (chk)::
1249* Location identifiers (loc)::
1250* Keyword queries (ksk)::
1251* Namespace content (sks)::
1252@end menu
1253
1254@node Encoding of hash values in URIs
1255@subsubsection Encoding of hash values in URIs
1256
1257
1258Most URIs include some hash values. Hashes are encoded using
1259base32hex (RFC 2938).
1260
1261@cindex chk-uri
1262@node Content Hash Key (chk)
1263@subsubsection Content Hash Key (chk)
1264
1265
1266A chk-URI is used to (uniquely) identify a file or directory
1267and to allow peers to download the file. Files are stored in
1268GNUnet as a tree of encrypted blocks.
1269The chk-URI thus contains the information to download and decrypt
1270those blocks. A chk-URI has the format
1271"gnunet://fs/chk/KEYHASH.QUERYHASH.SIZE". Here, "SIZE"
1272is the size of the file (which allows a peer to determine the
1273shape of the tree), KEYHASH is the key used to decrypt the file
1274(also the hash of the plaintext of the top block) and QUERYHASH
1275is the query used to request the top-level block (also the hash
1276of the encrypted block).
1277
1278@cindex loc-uri
1279@node Location identifiers (loc)
1280@subsubsection Location identifiers (loc)
1281
1282
1283For non-anonymous file-sharing, loc-URIs are used to specify which
1284peer is offering the data (in addition to specifying all of the
1285data from a chk-URI). Location identifiers include a digital
1286signature of the peer to affirm that the peer is truly the
1287origin of the data. The format is
1288"gnunet://fs/loc/KEYHASH.QUERYHASH.SIZE.PEER.SIG.EXPTIME".
1289Here, "PEER" is the public key of the peer (in GNUnet format in
1290base32hex), SIG is the RSA signature (in GNUnet format in
1291base32hex) and EXPTIME specifies when the signature expires
1292(in milliseconds after 1970).
1293
1294@cindex ksk-uri
1295@node Keyword queries (ksk)
1296@subsubsection Keyword queries (ksk)
1297
1298
1299A keyword-URI is used to specify that the desired operation
1300is the search using a particular keyword. The format is simply
1301"gnunet://fs/ksk/KEYWORD". Non-ASCII characters can be specified
1302using the typical URI-encoding (using hex values) from HTTP.
1303"+" can be used to specify multiple keywords (which are then
1304logically "OR"-ed in the search, results matching both keywords
1305are given a higher rank): "gnunet://fs/ksk/KEYWORD1+KEYWORD2".
1306ksk-URIs must not begin or end with the plus ('+') character.
1307Furthermore they must not contain '++'.
1308
1309@cindex sks-uri
1310@node Namespace content (sks)
1311@subsubsection Namespace content (sks)
1312
1313
1314@b{Please note that the text in this subsection is outdated and needs}
1315@b{to be rewritten for version 0.10!}
1316@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1317
1318Namespaces are sets of files that have been approved by some (usually
1319pseudonymous) user --- typically by that user publishing all of the
1320files together. A file can be in many namespaces. A file is in a
1321namespace if the owner of the ego (aka the namespace's private key)
1322signs the CHK of the file cryptographically. An SKS-URI is used to
1323search a namespace. The result is a block containing meta data,
1324the CHK and the namespace owner's signature. The format of a sks-URI
1325is "gnunet://fs/sks/NAMESPACE/IDENTIFIER". Here, "NAMESPACE"
1326is the public key for the namespace. "IDENTIFIER" is a freely
1327chosen keyword (or password!). A commonly used identifier is
1328"root" which by convention refers to some kind of index or other
1329entry point into the namespace.
1330
1331@node GTK User Interface
1332@subsection GTK User Interface
1333This chapter describes first steps for file-sharing with GNUnet.
1334To start, you should launch @command{gnunet-fs-gtk}.
1335
1336As we want to be sure that the network contains the data that we are
1337looking for for testing, we need to begin by publishing a file.
1338
1339@menu
1340* gtk-Publishing::
1341* gtk-Searching::
1342* gtk-Downloading::
1343@end menu
1344
1345@node gtk-Publishing
1346@subsubsection Publishing
1347
1348
1349To publish a file, select "File Sharing" in the menu bar just below the
1350"Statistics" icon, and then select "Publish" from the menu.
1351
1352Afterwards, the following publishing dialog will appear:
1353
1354@image{images/gnunet-gtk-0-10-fs-publish,5in,,The gnunet-fs-gtk publishing dialog}
1355
1356In this dialog, select the "Add File" button. This will open a
1357file selection dialog:
1358
1359@image{images/gnunet-gtk-0-10-fs-publish-select,5in,,Dialog to select the file to publish (looks may differ for other Gtk+ versions)}
1360
1361Now, you should select a file from your computer to be published on
1362GNUnet. To see more of GNUnet's features later, you should pick a
1363PNG or JPEG file this time. You can leave all of the other options
1364in the dialog unchanged. Confirm your selection by pressing the "OK"
1365button in the bottom right corner. Now, you will briefly see a
1366"Messages..." dialog pop up, but most likely it will be too short for
1367you to really read anything. That dialog is showing you progress
1368information as GNUnet takes a first look at the selected file(s).
1369For a normal image, this is virtually instant, but if you later
1370import a larger directory you might be interested in the progress dialog
1371and potential errors that might be encountered during processing.
1372After the progress dialog automatically disappears, your file
1373should now appear in the publishing dialog:
1374
1375@image{images/gnunet-gtk-0-10-fs-publish-with-file,5in,,Publishing dialog with file added}
1376
1377Now, select the file (by clicking on the file name) and then click
1378the "Edit" button. This will open the editing dialog:
1379
1380@image{images/gnunet-gtk-0-10-fs-publish-editing,5in,,Editing meta data of a file to be published}
1381
1382In this dialog, you can see many details about your file. In the
1383top left area, you can see meta data extracted about the file,
1384such as the original filename, the mimetype and the size of the image.
1385In the top right, you should see a preview for the image
1386(if GNU libextractor was installed correctly with the
1387respective plugins). Note that if you do not see a preview, this
1388is not a disaster, but you might still want to install more of
1389GNU libextractor in the future. In the bottom left, the dialog contains
1390a list of keywords. These are the keywords under which the file will be
1391made available. The initial list will be based on the extracted meta data.
1392Additional publishing options are in the right bottom corner. We will
1393now add an additional keyword to the list of keywords. This is done by
1394entering the keyword above the keyword list between the label "Keyword"
1395and the "Add keyword" button. Enter "test" and select "Add keyword".
1396Note that the keyword will appear at the bottom of the existing keyword
1397list, so you might have to scroll down to see it. Afterwards, push the
1398"OK" button at the bottom right of the dialog.
1399
1400You should now be back at the "Publish content on GNUnet" dialog. Select
1401"Execute" in the bottom right to close the dialog and publish your file
1402on GNUnet! Afterwards, you should see the main dialog with a new area
1403showing the list of published files (or ongoing publishing operations
1404with progress indicators).
1405
1406@node gtk-Searching
1407@subsubsection Searching
1408
1409
1410Below the menu bar, there are four entry widges labeled "Namespace",
1411"Keywords", "Anonymity" and "Mime-type" (from left to right). These
1412widgets are used to control searching for files in GNUnet. Between the
1413"Keywords" and "Anonymity" widgets, there is also a big "Search" button,
1414which is used to initiate the search. We will ignore the "Namespace",
1415"Anonymity" and "Mime-type" options in this tutorial, please leave them
1416empty. Instead, simply enter "test" under "Keywords" and press "Search".
1417Afterwards, you should immediately see a new tab labeled after your
1418search term, followed by the (current) number of search
1419results --- "(15)" in our screenshot. Note that your results may
1420vary depending on what other users may have shared and how your
1421peer is connected.
1422
1423You can now select one of the search results. Once you do this,
1424additional information about the result should be displayed on the
1425right. If available, a preview image should appear on the top right.
1426Meta data describing the file will be listed at the bottom right.
1427
1428Once a file is selected, at the bottom of the search result list
1429a little area for downloading appears.
1430
1431@node gtk-Downloading
1432@subsubsection Downloading
1433
1434
1435In the downloading area, you can select the target directory (default is
1436"Downloads") and specify the desired filename (by default the filename it
1437taken from the meta data of the published file). Additionally, you can
1438specify if the download should be anonymous and (for directories) if
1439the download should be recursive. In most cases, you can simply start
1440the download with the "Download!" button.
1441
1442Once you selected download, the progress of the download will be
1443displayed with the search result. You may need to resize the result
1444list or scroll to the right. The "Status" column shows the current
1445status of the download, and "Progress" how much has been completed.
1446When you close the search tab (by clicking on the "X" button next to
1447the "test" label), ongoing and completed downloads are not aborted
1448but moved to a special "*" tab.
1449
1450You can remove completed downloads from the "*" tab by clicking the
1451cleanup button next to the "*". You can also abort downloads by right
1452clicking on the respective download and selecting "Abort download"
1453from the menu.
1454
1455That's it, you now know the basics for file-sharing with GNUnet!
1456
1457
1458@node The GNU Name System
1459@section The GNU Name System
1460
1461
1462
1463The GNU Name System (GNS) is secure and decentralized naming system.
1464It allows its users to register names as @dfn{top-level domains} (TLDs) and
1465resolve other namespaces within their TLDs.
1466
1467GNS is designed to provide:
1468@itemize @bullet
1469@item Censorship resistance
1470@item Query privacy
1471@item Secure name resolution
1472@item Compatibility with DNS
1473@end itemize
1474
1475For the initial configuration and population of your
1476GNS installation, please follow the GNS setup instructions.
1477The remainder of this chapter will provide some background on GNS
1478and then describe how to use GNS in more detail.
1479
1480Unlike DNS, GNS does not rely on central root zones or authorities.
1481Instead any user administers their own root and can can create arbitrary
1482name value mappings. Furthermore users can delegate resolution to other
1483users' zones just like DNS NS records do. Zones are uniquely identified
1484via public keys and resource records are signed using the corresponding
1485public key. Delegation to another user's zone is done using special PKEY
1486records and petnames. A petname is a name that can be freely chosen by
1487the user. This results in non-unique name-value mappings as
1488@code{@uref{http://www.bob.gnu/, www.bob.gnu}} to one user might be
1489@code{@uref{http://www.friend.gnu/, www.friend.gnu}} for someone else.
1490
1491
1492@menu
1493* Creating a Zone::
1494* Maintaining your own Zones::
1495* Obtaining your Zone Key::
1496* Adding Links to Other Zones::
1497* Using Public Keys as Top Level Domains::
1498* Resource Records in GNS::
1499* Synchronizing with legacy DNS::
1500* Migrating an existing DNS zone into GNS::
1501@end menu
1502
1503
1504@node Creating a Zone
1505@subsection Creating a Zone
1506
1507To use GNS, you probably should create at least one zone of your own.
1508You can create any number of zones using the gnunet-identity tool
1509using:
1510
1511@example
1512$ gnunet-identity --create="myzone"
1513@end example
1514
1515Henceforth, on your system you control the TLD ``myzone''.
1516
1517All of your zones can be listed (displayed) using the
1518@command{gnunet-identity} command line tool as well:
1519
1520@example
1521$ gnunet-identity --display
1522@end example
1523
1524@node Maintaining your own Zones
1525@subsection Maintaining your own Zones
1526
1527@noindent
1528Now you can add (or edit, or remove) records in your GNS zone using the
1529@command{gnunet-namestore-gtk} GUI or using the @command{gnunet-namestore}
1530command-line tool.
1531In either case, your records will be stored in an SQL database under
1532control of the @command{gnunet-service-namestore}.
1533Note that if multiple users use one peer, the namestore database will
1534include the combined records of all users.
1535However, users will not be able to see each other's records
1536if they are marked as private.
1537
1538To provide a short example for editing your own zone, suppose you
1539have your own web server with the IP @code{1.2.3.4}. Then you can put an
1540@code{A} record (@code{A} records in DNS are for IPv4 IP addresses)
1541into your local zone ``myzone'' using the command:
1542
1543@example
1544$ gnunet-namestore -z myzone -a -n www -t A -V 1.2.3.4 -e never
1545@end example
1546
1547@noindent
1548Afterwards, you will be able to access your webpage under "www.myzone"
1549(assuming your webserver does not use virtual hosting, if it does,
1550please read up on setting up the GNS proxy).
1551
1552Similar commands will work for other types of DNS and GNS records,
1553the syntax largely depending on the type of the record.
1554Naturally, most users may find editing the zones using the
1555@command{gnunet-namestore-gtk} GUI to be easier.
1556
1557@node Obtaining your Zone Key
1558@subsection Obtaining your Zone Key
1559
1560Each zone in GNS has a public-private key. Usually, gnunet-namestore and
1561gnunet-setup will access your private key as necessary, so you do not
1562have to worry about those. What is important is your public key
1563(or rather, the hash of your public key), as you will likely want to
1564give it to others so that they can securely link to you.
1565
1566You can usually get the hash of your public key using
1567
1568@example
1569$ gnunet-identity -d $options | grep myzone | awk '@{print $3@}'
1570@end example
1571
1572@noindent
1573For example, the output might be something like:
1574
1575@example
1576DC3SEECJORPHQNVRH965A6N74B1M37S721IG4RBQ15PJLLPJKUE0
1577@end example
1578
1579@noindent
1580Alternatively, you can obtain a QR code with your zone key AND your
1581pseudonym from gnunet-namestore-gtk. The QR code is displayed in the
1582main window and can be stored to disk using the ``Save as'' button
1583next to the image.
1584
1585@node Adding Links to Other Zones
1586@subsection Adding Links to Other Zones
1587
1588
1589A central operation in GNS is the ability to securely delegate to
1590other zones. Basically, by adding a delegation you make all of the
1591names from the other zone available to yourself. This section
1592describes how to create delegations.
1593
1594Suppose you have a friend who you call 'bob' who also uses GNS.
1595You can then delegate resolution of names to Bob's zone by adding
1596a PKEY record to their local zone:
1597
1598@example
1599$ gnunet-namestore -a -n bob --type PKEY -V XXXX -e never -Z myzone
1600@end example
1601
1602@noindent
1603Note that ``XXXX'' in the command above must be replaced with the hash
1604of Bob's public key (the output your friend obtained using the
1605@command{gnunet-identity} command from the previous section and told
1606you, for example by giving you a business card containing this
1607information as a QR code).
1608
1609Assuming Bob has an ``A'' record for their website under the name of
1610``www'' in his zone, you can then access Bob's website under
1611``www.bob.myzone'' --- as well as any (public) GNS record that Bob has
1612in their zone by replacing www with the respective name of the
1613record in Bob's zone.
1614
1615@c themselves? themself?
1616Furthermore, if Bob has themselves a (public) delegation to Carol's
1617zone under "carol", you can access Carol's records under
1618``NAME.carol.bob.myzone'' (where ``NAME'' is the name of Carol's
1619record you want to access).
1620
1621
1622@node Using Public Keys as Top Level Domains
1623@subsection Using Public Keys as Top Level Domains
1624
1625
1626GNS also assumes responsibility for any name that uses in a
1627well-formed public key for the TLD. Names ending this way are then
1628resolved by querying the respective zone. Such public key TLDs are
1629expected to be used under rare circumstances where globally unique
1630names are required, and for integration with legacy systems.
1631
1632@node Resource Records in GNS
1633@subsection Resource Records in GNS
1634
1635
1636GNS supports the majority of the DNS records as defined in
1637@uref{http://www.ietf.org/rfc/rfc1035.txt, RFC 1035}. Additionally,
1638GNS defines some new record types the are unique to the GNS system.
1639For example, GNS-specific resource records are used to give petnames
1640for zone delegation, revoke zone keys and provide some compatibility
1641features.
1642
1643For some DNS records, GNS does extended processing to increase their
1644usefulness in GNS. In particular, GNS introduces special names
1645referred to as "zone relative names". Zone relative names are allowed
1646in some resource record types (for example, in NS and CNAME records)
1647and can also be used in links on webpages. Zone relative names end
1648in ".+" which indicates that the name needs to be resolved relative
1649to the current authoritative zone. The extended processing of those
1650names will expand the ".+" with the correct delegation chain to the
1651authoritative zone (replacing ".+" with the name of the location
1652where the name was encountered) and hence generate a
1653valid GNS name.
1654
1655The GNS currently supports the record types as defined in
1656@uref{https://git.gnunet.org/gana.git/tree/gnu-name-system-record-types/registry.rec, GANA}.
1657In addition, GNS supports DNS record types, such as A, AAAA or TXT.
1658
1659For a complete description of the records, please refer to the specification
1660at @uref{https://lsd.gnunet.org/lsd0001, LSD0001}.
1661
1662In the following, we discuss GNS records with specific behaviour or special
1663handling of DNS records.
1664
1665@menu
1666* NICK::
1667* PKEY::
1668* BOX::
1669* LEHO::
1670* VPN::
1671* REDIRECT::
1672* GNS2DNS::
1673* TOMBSTONE::
1674* SOA SRV PTR and MX::
1675@end menu
1676
1677@node NICK
1678@subsubsection NICK
1679
1680A NICK record is used to give a zone a name. With a NICK record, you
1681can essentially specify how you would like to be called. GNS expects
1682this record under the empty label ``@@'' in the zone's database
1683(NAMESTORE); however, it will then automatically be copied into each
1684record set, so that clients never need to do a separate lookup to
1685discover the NICK record. Also, users do not usually have to worry
1686about setting the NICK record: it is automatically set to the local
1687name of the TLD.
1688
1689@b{Example}@
1690
1691@example
1692Name: @@; RRType: NICK; Value: bob
1693@end example
1694
1695@noindent
1696This record in Bob's zone will tell other users that this zone wants
1697to be referred to as 'bob'. Note that nobody is obliged to call Bob's
1698zone 'bob' in their own zones. It can be seen as a
1699recommendation ("Please call this zone 'bob'").
1700
1701@node PKEY
1702@subsubsection PKEY
1703
1704PKEY records are used to add delegation to other users' zones and
1705give those zones a petname.
1706
1707@b{Example}@
1708
1709Let Bob's zone be identified by the hash "ABC012". Bob is your friend
1710so you want to give them the petname "friend". Then you add the
1711following record to your zone:
1712
1713@example
1714Name: friend; RRType: PKEY; Value: ABC012;
1715@end example
1716
1717@noindent
1718This will allow you to resolve records in bob's zone
1719under "*.friend.gnu".
1720
1721@node BOX
1722@subsubsection BOX
1723
1724BOX records are there to integrate information from TLSA or
1725SRV records under the main label. In DNS, TLSA and SRV records
1726use special names of the form @code{_port._proto.(label.)*tld} to
1727indicate the port number and protocol (like TCP or UDP) for which
1728the TLSA or SRV record is valid. This causes various problems, and
1729is elegantly solved in GNS by integrating the protocol and port
1730numbers together with the respective value into a "BOX" record.
1731Note that in the GUI, you do not get to edit BOX records directly
1732right now --- the GUI will provide the illusion of directly
1733editing the TLSA and SRV records, even though they internally
1734are BOXed up.
1735
1736@node LEHO
1737@subsubsection LEHO
1738
1739The LEgacy HOstname of a server. Some webservers expect a specific
1740hostname to provide a service (virtual hosting). Also SSL
1741certificates usually contain DNS names. To provide the expected
1742legacy DNS name for a server, the LEHO record can be used.
1743To mitigate the just mentioned issues the GNS proxy has to be used.
1744The GNS proxy will use the LEHO information to apply the necessary
1745transformations.
1746
1747@node VPN
1748@subsubsection VPN
1749
1750GNS allows easy access to services provided by the GNUnet Virtual Public
1751Network. When the GNS resolver encounters a VPN record it will contact
1752the VPN service to try and allocate an IPv4/v6 address (if the queries
1753record type is an IP address) that can be used to contact the service.
1754
1755@b{Example}@
1756
1757I want to provide access to the VPN service "web.gnu." on port 80 on peer
1758ABC012:@
1759Name: www; RRType: VPN; Value: 80 ABC012 web.gnu.
1760
1761The peer ABC012 is configured to provide an exit point for the service
1762"web.gnu." on port 80 to it's server running locally on port 8080 by
1763having the following lines in the @file{gnunet.conf} configuration file:
1764
1765@example
1766[web.gnunet.]
1767TCP_REDIRECTS = 80:localhost4:8080
1768@end example
1769
1770@node REDIRECT
1771@subsubsection REDIRECT
1772
1773As specified in LSD0001 whenever a REDIRECT is encountered the query
1774needs to be restarted with the specified name. A REDIRECT
1775can either be:
1776
1777@itemize @bullet
1778@item A zone relative name,
1779@item A zkey name or
1780@item A DNS name (in which case resolution will continue outside
1781of GNS with the systems DNS resolver)
1782@end itemize
1783
1784@node GNS2DNS
1785@subsubsection GNS2DNS
1786
1787GNS can delegate authority to a legacy DNS zone. For this, the
1788name of the DNS nameserver and the name of the DNS zone are
1789specified in a GNS2DNS record.
1790
1791@b{Example}
1792
1793@example
1794Name: pet; RRType: GNS2DNS; Value: gnunet.org@@a.ns.joker.com
1795@end example
1796
1797@noindent
1798Any query to @code{pet.gnu} will then be delegated to the DNS server at
1799@code{a.ns.joker.com}. For example,
1800@code{@uref{http://www.pet.gnu/, www.pet.gnu}} will result in a DNS query
1801for @code{@uref{http://www.gnunet.org/, www.gnunet.org}} to the server
1802at @code{a.ns.joker.com}. Delegation to DNS via NS records in GNS can
1803be useful if you do not want to start resolution in the DNS root zone
1804(due to issues such as censorship or availability).
1805
1806Note that you would typically want to use a relative name for the
1807nameserver, like so:
1808
1809@example
1810Name: pet; RRType: GNS2DNS; Value: gnunet.org@@ns-joker.+@
1811
1812Name: ns-joker; RRType: A; Value: 184.172.157.218
1813@end example
1814
1815@noindent
1816This way, you can avoid involving the DNS hierarchy in the resolution of
1817@code{a.ns.joker.com}. In the example above, the problem may not be
1818obvious as the nameserver for "gnunet.org" is in the ".com" zone.
1819However, imagine the nameserver was "ns.gnunet.org". In this case,
1820delegating to "ns.gnunet.org" would mean that despite using GNS,
1821censorship in the DNS ".org" zone would still be effective.
1822
1823@node TOMBSTONE
1824@subsubsection TOMBSTONE
1825
1826The GNUnet GNS implementation uses the TOMBSTONE record to ensure
1827ciphertext indistinguishability for published records.
1828It must be ensured that when relative expiration times are decreased, the
1829expiration time of the next record block MUST be after the last published block.
1830A similar issue arises if the record set under a label is deleted and reused
1831later.
1832
1833The creation and maintenance of the TOMBSTONE record is done automatically.
1834You do not need to mind it yourself and can safely ignore any TOMBSTONE
1835blocks you may see when investigating your zone(s).
1836TOMBSTONE records are always private and will never be published.
1837
1838@node SOA SRV PTR and MX
1839@subsubsection SOA SRV PTR and MX
1840
1841The domain names in those records can, again, be either
1842
1843@itemize @bullet
1844@item A zone relative name,
1845@item A zkey name or
1846@item A DNS name
1847@end itemize
1848
1849The resolver will expand the zone relative name if possible.
1850Note that when using MX records within GNS, the target mail
1851server might still refuse to accept e-mails to the resulting
1852domain as the name might not match. GNS-enabled mail clients
1853should use the ZKEY zone as the destination hostname and
1854GNS-enabled mail servers should be configured to accept
1855e-mails to the ZKEY-zones of all local users.
1856
1857To add a SOA record via the gnunet-namestore command line
1858tool use the following syntax for the value option. Choose
1859the other options according to your preference, however in
1860this example we will use a relative expiry, add the record
1861under the label @ and add the records to the zone bar
1862which already exists:
1863
1864@example
1865$ gnunet-namestore -a -n @ -t SOA -z bar -e 3600s -V \
1866> "rname=$PRIMARY_NS \
1867> mname=$CONTACT_MAIL \
1868> $SERIAL,$REFRESH,$RETRY,$EXPIRY,$MINIMUM_TTL"
1869@end example
1870
1871The above command filled in with values looks like this:
1872@example
1873$ gnunet-namestore -a -n @ -t SOA -z bar -e 3600s -V \
1874> "rname=ns1.bar \
1875> mname=root.bar \
1876> 2019081701,3600,1800,86400,7200"
1877@end example
1878
1879MX records use a similar syntax which is outlined in the
1880example below. $SERVER is a domain name as mentioned above.
1881@example
1882$ gnunet-namestore -a -n mail -t MX -z bar -e 3600s -V \
1883> "$PRIORITY,$SERVER"
1884@end example
1885
1886With the values substituted this is an example of a working
1887command:
1888@example
1889$ gnunet-namestore -a -n mail -t MX -z bar -e 3600s -V \
1890> "10,mail.bar"
1891@end example
1892
1893@node Synchronizing with legacy DNS
1894@subsection Synchronizing with legacy DNS
1895
1896If you want to support GNS but the master database for a zone
1897is only available and maintained in DNS, GNUnet includes the
1898@command{gnunet-zoneimport} tool to monitor a DNS zone and
1899automatically import records into GNS. Today, the tool does
1900not yet support DNS AF(X)R, as we initially used it on the
1901``.fr'' zone which does not allow us to perform a DNS zone
1902transfer. Instead, @command{gnunet-zoneimport} reads a list
1903of DNS domain names from @code{stdin}, issues DNS queries for
1904each, converts the obtained records (if possible) and stores
1905the result in the namestore.
1906
1907@image{images/gns,6in,, picture of DNS-GNS data flow}
1908
1909The zonemaster service then takes the records from the namestore,
1910publishes them into the DHT which makes the result available to the
1911GNS resolver. In the GNS configuration, non-local zones can be
1912configured to be intercepted by specifying ``.tld = PUBLICKEY'' in the
1913configuration file in the ``[gns]'' section.
1914
1915Note that the namestore by default also populates the namecache.
1916This pre-population is cryptographically expensive. Thus, on
1917systems that only serve to import a large (millions of records)
1918DNS zone and that do not have a local gns service in use, it
1919is thus advisable to disable the namecache by setting the
1920option ``DISABLE'' to ``YES'' in section ``[namecache]''.
1921
1922@node Migrating an existing DNS zone into GNS
1923@subsection Migrating an existing DNS zone into GNS
1924
1925Ascension is a tool to migrate existing DNS zones into GNS.
1926
1927@xref{Migrating existing DNS zones into GNS}, for installation instructions and
1928further information about Ascension.
1929
1930Compared to the gnunet-zoneimport tool it strictly uses AXFR or IXFR depending
1931on whether or not there exists a SOA record for the zone. If that is the case it
1932will take the serial as a reference point and request the zone. The server will
1933either answer the IXFR request with a correct incremental zone or with the
1934entire zone, which depends on the server configuration.
1935
1936After installing the tool according to the README file you have the following
1937options:
1938
1939@example
1940Ascension
1941Usage:
1942 ascension <domain> [-d] [-p] [-s] [--minimum-ttl=<ttl>] \
1943 [--dry-run]
1944 ascension <domain> <port> [-d] [-p] [-s] \
1945 [--minimum-ttl=<ttl>] [--dry-run]
1946 ascension <domain> -n <transferns> [-d] [-p] \
1947 [-s] [--minimum-ttl=<ttl>] [--dry-run]
1948 ascension <domain> -n <transferns> <port> [-d] \
1949 [-p] [-s] [--minimum-ttl=<ttl>] [--dry-run]
1950 ascension -p | --public
1951 ascension -d | --debug
1952 ascension -s | --standalone
1953 ascension -h | --help
1954 ascension -v | --version
1955
1956Options:
1957 <domain> Domain to migrate
1958 <port> Port for zone transfer
1959 <transferns> DNS Server that does the zone transfer
1960 --minimum-ttl=<ttl> Minimum TTL for records to migrate \
1961 [default: 3600]
1962 --dry-run Only try if a zone transfer is allowed
1963 -p --public Make records public on the DHT
1964 -s --standalone Run ascension once
1965 -d --debug Enable debugging
1966 -h --help Show this screen.
1967 -v --version Show version.
1968@end example
1969
1970Before you can migrate any zone though, you need to start a local GNUnet peer:
1971@example
1972$ gnunet-arm -s
1973@end example
1974
1975To migrate the Syrian top level domain - one of the few top level domains that
1976support zone transfers - into GNS use the following command:
1977
1978@example
1979$ ascension sy. -n ns1.tld.sy. -p
1980@end example
1981
1982The -p flag will tell GNS to put these records on the DHT so that other users
1983may resolve these records by using the public key of the zone.
1984
1985Once the zone is migrated, Ascension will output a message telling you, that it
1986will refresh the zone after the time has elapsed. You can resolve the names in
1987the zone directly using GNS or if you want to use it with your browser, check
1988out the GNS manual section. @ref{Configuring the GNU Name System}. To resolve
1989the records from another system you need the respective zones PKEY. To get the
1990zones public key, you can run the following command:
1991
1992@example
1993$ gnunet-identity -dqe sy
1994@end example
1995
1996Where "sy" is the name of the zone you want to migrate.
1997
1998You can share the PKEY of the zone with your friends. They can then resolve
1999records in the zone by doing a lookup replacing the zone label with your PKEY:
2000
2001@example
2002$ gnunet-gns -t SOA -u "$PKEY"
2003@end example
2004
2005The program will continue to run as a daemon and update once the refresh time
2006specified in the zones SOA record has elapsed.
2007
2008DNSCurve style records are supported in the latest release and they are added
2009as a PKEY record to be referred to the respective GNS public key. Key
2010distribution is still a problem but provided someone else has a public key
2011under a given label it can be looked up.
2012
2013There is an unofficial Debian package called python3-ascension that adds a
2014system user ascension and runs a GNUnet peer in the background.
2015
2016Ascension-bind is also an unofficial Debian package that on installation checks
2017for running DNS zones and whether or not they are transferable using DNS zone
2018transfer (AXFR). It asks the administrator which zones to migrate into GNS and
2019installs a systemd unit file to keep the zone up to date. If you want to
2020migrate different zones you might want to check the unit file from the package
2021as a guide.
2022
2023@node reclaimID Identity Provider
2024@section reclaimID Identity Provider
2025
2026The re:claimID Identity Provider (IdP) is a decentralized IdP service.
2027It allows its users to manage and authorize third parties to access
2028their identity attributes such as email or shipping addresses.
2029
2030It basically mimics the concepts of centralized IdPs, such as those
2031offered by Google or Facebook.
2032Like other IdPs, reclaimID features an (optional) OpenID Connect
20331.0-compliant protocol layer that can be used for websites to
2034integrate reclaimID as an Identity Provider with little effort.
2035
2036@menu
2037* Managing Attributes::
2038* Managing Credentials::
2039* Sharing Attributes with Third Parties::
2040* Revoking Authorizations of Third Parties::
2041* OpenID Connect::
2042* Providing Third Party Attestation::
2043@end menu
2044
2045@node Managing Attributes
2046@subsection Managing Attributes
2047
2048Before adding attributes to an identity, you must first create an ego:
2049
2050@example
2051$ gnunet-identity --create="user"
2052@end example
2053
2054Henceforth, you can manage a new user profile of the user ``user''.
2055
2056To add an email address to your user profile, simply use the @command{gnunet-reclaim} command line tool::
2057
2058@example
2059$ gnunet-reclaim -e "user" -a "email" -V "username@@example.gnunet"
2060@end example
2061
2062All of your attributes can be listed using the @command{gnunet-reclaim}
2063command line tool as well:
2064
2065@example
2066$ gnunet-reclaim -e "user" -D
2067@end example
2068
2069Currently, and by default, attribute values are interpreted as plain text.
2070In the future there might be more value types such as X.509 certificate credentials.
2071
2072@node Managing Credentials
2073@subsection Managing Credentials
2074
2075Attribute values may reference a claim in a third party attested credential.
2076Such a credential can have a variety of formats such as JSON-Web-Tokens or
2077X.509 certificates.
2078Currently, reclaimID only supports JSON-Web-Token credentials.
2079
2080To add a credential to your user profile, invoke the @command{gnunet-reclaim} command line tool as follows:
2081
2082@example
2083$ gnunet-reclaim -e "user"\
2084 --credential-name="email"\
2085 --credential-type="JWT"\
2086 --value="ey..."
2087@end example
2088
2089All of your credentials can be listed using the @command{gnunet-reclaim}
2090command line tool as well:
2091
2092@example
2093$ gnunet-reclaim -e "user" --credentials
2094@end example
2095
2096In order to add an attribe backed by a credential, specify the attribute
2097value as the claim name in the credential to reference along with the credential
2098ID:
2099
2100@example
2101$ gnunet-reclaim -e "user"\
2102 --add="email"\
2103 --value="verified_email"\
2104 --credential-id="<CREDENTIAL_ID>"
2105@end example
2106
2107
2108@node Sharing Attributes with Third Parties
2109@subsection Sharing Attributes with Third Parties
2110
2111If you want to allow a third party such as a website or friend to access to your attributes (or a subset thereof) execute:
2112
2113@example
2114$ TICKET=$(gnunet-reclaim -e "user"\
2115 -r "$RP_KEY"\
2116 -i "attribute1,attribute2,...")
2117@end example
2118
2119The command will return a "ticket" string.
2120You must give $TICKET to the requesting third party.
2121
2122$RP_KEY is the public key of the third party and "attribute1,attribute2,..." is a comma-separated list of attribute names, such as "email,name,...", that you want to share.
2123
2124The third party may retrieve the key in string format for use in the above
2125call using "gnunet-identity":
2126
2127@example
2128$ RP_KEY=$(gnunet-identity -d | grep "relyingparty" | awk '@{print $3@}')
2129@end example
2130
2131The third party can then retrieve your shared identity attributes using:
2132
2133@example
2134$ gnunet-reclaim -e "relyingparty" -C "ticket"
2135@end example
2136
2137Where "relyingparty" is the name for the identity behind $RP_KEY that the
2138requesting party is using.
2139This will retrieve and list the shared identity attributes.
2140The above command will also work if the user is currently offline since the attributes are retrieved from GNS.
2141Further, $TICKET can be re-used later to retrieve up-to-date attributes in case "friend" has changed the value(s). For instance, because his email address changed.
2142
2143To list all given authorizations (tickets) you can execute:
2144@example
2145$ gnunet-reclaim -e "user" -T
2146@end example
2147
2148@node Revoking Authorizations of Third Parties
2149@subsection Revoking Authorizations of Third Parties
2150
2151If you want to revoke the access of a third party to your attributes you can execute:
2152
2153@example
2154$ gnunet-reclaim -e "user" -R $TICKET
2155@end example
2156
2157This will prevent the third party from accessing the attribute in the future.
2158Please note that if the third party has previously accessed the attribute, there is not way in which the system could have prevented the thiry party from storing the data.
2159As such, only access to updated data in the future can be revoked.
2160This behaviour is _exactly the same_ as with other IdPs.
2161
2162@node OpenID Connect
2163@subsection OpenID Connect
2164
2165There is an @uref{OpenID Connect, https://openid.net/specs/openid-connect-core-1_0.html} API for use with re:claimID.
2166However, its use is quite complicated to setup.
2167
2168@example
2169https://api.reclaim/openid/authorize
2170http://localhost:7776/openid/token
2171http://localhost:7776/openid/userinfo
2172http://localhost:7776/openid/login
2173@end example
2174
2175The token endpoint is protected using HTTP basic authentication.
2176You can authenticate using any username and the password configured under:
2177
2178@example
2179$ gnunet-config -s reclaim-rest-plugin -o OIDC_CLIENT_SECRET
2180@end example
2181
2182The authorize endpoint is protected using a Cookie which can be obtained through
2183a request against the login endpoint.
2184This functionality is meant to be used in the context of the OpenID Connect authorization
2185flow to collect user consent interactively.
2186Without a Cookie, the authorize endpoint redirects to a URI configured under:
2187
2188@example
2189$ gnunet-config -s reclaim-rest-plugin -o ADDRESS
2190@end example
2191
2192The token endpoint is protected using OAuth2 and expects the grant
2193which is retrieved from the authorization endpoint according to the standard.
2194
2195The userinfo endpoint is protected using OAuth2 and expects a bearer access
2196token which is retrieved from a token request.
2197
2198In order to make use of OpenID Connect flows as a user, you need to install
2199the browser plugin:
2200
2201@itemize @bullet
2202@item @uref{https://addons.mozilla.org/addon/reclaimid/, Firefox Add-on}
2203@item @uref{https://chrome.google.com/webstore/detail/reclaimid/jiogompmdejcnacmlnjhnaicgkefcfll, Chrome Web Store}
2204@end itemize
2205
2206In order to create and register an OpenID Connect client as a relying party,
2207you need to execute the following steps:
2208
2209@example
2210$ gnunet-identity -C <client_name>
2211$ gnunet-namestore -z <client_name> -a -n "@@" -t RECLAIM_OIDC_REDIRECT -V <redirect_uri> -e 1d -p
2212$ gnunet-namestore -z <client_name> -a -n "@@" -t RECLAIM_OIDC_CLIENT -V "My OIDC Client" -e 1d -p
2213@end example
2214
2215The "client_id" for use in OpenID Connect is the public key of the client as
2216displayed using:
2217@example
2218$ gnunet-identity -d grep "relyingparty" | awk '@{print $3@}'
2219@end example
2220
2221The RECLAIM_OIDC_REDIRECT record contains your website redirect URI.
2222You may use any globally unique DNS or GNS URI.
2223The RECLAIM_OIDC_CLIENT record represents the client description which whill
2224be displayed to users in an authorization request.
2225
2226Any website or relying party must use the authorization endpoint
2227@uref{https://api.reclaim/openid/authorize} in its authorization redirects, e.g.
2228
2229@example
2230<a href="https://api.reclaim/openid/authorize?client_id=<PKEY>\
2231 &scope=openid email\
2232 &redirect_uri=<redirect_uri>\
2233 &nonce=<random>">Login</a>
2234@end example
2235
2236This will direct the user's browser onto his local reclaimID instance.
2237After giving consent, you will be provided with the OpenID Connect authorization
2238code according to the specifications at your provided redirect URI.
2239
2240The ID Tokens issues by the token endpoints are signed using HS512 with the
2241shared secret configured under:
2242
2243@example
2244$ gnunet-config -s reclaim-rest-plugin -o JWT_SECRET
2245@end example
2246
2247The authorization code flow optionally supports @uref{https://tools.ietf.org/html/rfc7636, Proof Key for Code Exchange}.
2248If PKCE is used, the client does not need to authenticate against the token
2249endpoint.
2250
2251@node Providing Third Party Attestation
2252@subsection Providing Third Party Attestation
2253
2254If you are running an identity provider (IdP) service you may be able to
2255support providing credentials for re:claimID users.
2256IdPs can issue JWT credentials as long as they support OpenID Connect and
2257@uref{https://openid.net/specs/openid-connect-discovery-1_0.html,OpenID Connect Discovery}.
2258
2259In order to allow users to import attributes through the re:claimID user interface,
2260you need to register the following public OAuth2/OIDC client:
2261
2262@itemize @bullet
2263@item client_id: reclaimid
2264@item client_secret: none
2265@item redirect_uri: https://ui.reclaim (The URI of the re:claimID webextension)
2266@item grant_type: authorization_code with PKCE (@uref{https://tools.ietf.org/html/rfc7636, RFC7636})
2267@item scopes: all you want to offer.
2268@item id_token: JWT
2269@end itemize
2270
2271When your users add an attribute with name "email" which supports webfinger
2272discovery they will be prompted with the option to retrieve the OpenID Connect
2273ID Token through the user interface.
2274
2275@node Using the Virtual Public Network
2276@section Using the Virtual Public Network
2277
2278@menu
2279* Setting up an Exit node::
2280* Fedora and the Firewall::
2281* Setting up VPN node for protocol translation and tunneling::
2282@end menu
2283
2284Using the GNUnet Virtual Public Network (VPN) application you can
2285tunnel IP traffic over GNUnet. Moreover, the VPN comes
2286with built-in protocol translation and DNS-ALG support, enabling
2287IPv4-to-IPv6 protocol translation (in both directions).
2288This chapter documents how to use the GNUnet VPN.
2289
2290The first thing to note about the GNUnet VPN is that it is a public
2291network. All participating peers can participate and there is no
2292secret key to control access. So unlike common virtual private
2293networks, the GNUnet VPN is not useful as a means to provide a
2294"private" network abstraction over the Internet. The GNUnet VPN
2295is a virtual network in the sense that it is an overlay over the
2296Internet, using its own routing mechanisms and can also use an
2297internal addressing scheme. The GNUnet VPN is an Internet
2298underlay --- TCP/IP applications run on top of it.
2299
2300The VPN is currently only supported on GNU/Linux systems.
2301Support for operating systems that support TUN (such as FreeBSD)
2302should be easy to add (or might not even require any coding at
2303all --- we just did not test this so far). Support for other
2304operating systems would require re-writing the code to create virtual
2305network interfaces and to intercept DNS requests.
2306
2307The VPN does not provide good anonymity. While requests are routed
2308over the GNUnet network, other peers can directly see the source
2309and destination of each (encapsulated) IP packet. Finally, if you
2310use the VPN to access Internet services, the peer sending the
2311request to the Internet will be able to observe and even alter
2312the IP traffic. We will discuss additional security implications
2313of using the VPN later in this chapter.
2314
2315@node Setting up an Exit node
2316@subsection Setting up an Exit node
2317
2318Any useful operation with the VPN requires the existence of an exit
2319node in the GNUnet Peer-to-Peer network. Exit functionality can only
2320be enabled on peers that have regular Internet access. If you want
2321to play around with the VPN or support the network, we encourage
2322you to setup exit nodes. This chapter documents how to setup an
2323exit node.
2324
2325There are four types of exit functions an exit node can provide,
2326and using the GNUnet VPN to access the Internet will only work
2327nicely if the first three types are provided somewhere in
2328the network. The four exit functions are:
2329
2330@itemize @bullet
2331@item DNS: allow other peers to use your DNS resolver
2332@item IPv4: allow other peers to access your IPv4 Internet connection
2333@item IPv6: allow other peers to access your IPv6 Internet connection
2334@item Local service: allow other peers to access a specific TCP or
2335UDP service your peer is providing
2336@end itemize
2337
2338By enabling "exit" in gnunet-setup and checking the respective boxes
2339in the "exit" tab, you can easily choose which of the above exit
2340functions you want to support.
2341
2342Note, however, that by supporting the first three functions you will
2343allow arbitrary other GNUnet users to access the Internet via your
2344system. This is somewhat similar to running a Tor exit node. The
2345Torproject has a nice article about what to consider if you want
2346to do this here. We believe that generally running a DNS exit node
2347is completely harmless.
2348
2349The exit node configuration does currently not allow you to restrict the
2350Internet traffic that leaves your system. In particular, you cannot
2351exclude SMTP traffic (or block port 25) or limit to HTTP traffic using
2352the GNUnet configuration. However, you can use your host firewall to
2353restrict outbound connections from the virtual tunnel interface. This
2354is highly recommended. In the future, we plan to offer a wider range
2355of configuration options for exit nodes.
2356
2357Note that by running an exit node GNUnet will configure your kernel
2358to perform IP-forwarding (for IPv6) and NAT (for IPv4) so that the
2359traffic from the virtual interface can be routed to the Internet.
2360In order to provide an IPv6-exit, you need to have a subnet routed
2361to your host's external network interface and assign a subrange of
2362that subnet to the GNUnet exit's TUN interface.
2363
2364When running a local service, you should make sure that the local
2365service is (also) bound to the IP address of your EXIT interface
2366(e.g. 169.254.86.1). It will NOT work if your local service is
2367just bound to loopback. You may also want to create a "VPN" record
2368in your zone of the GNU Name System to make it easy for others to
2369access your service via a name instead of just the full service
2370descriptor. Note that the identifier you assign the service can
2371serve as a passphrase or shared secret, clients connecting to the
2372service must somehow learn the service's name. VPN records in the
2373GNU Name System can make this easier.
2374
2375@node Fedora and the Firewall
2376@subsection Fedora and the Firewall
2377
2378
2379When using an exit node on Fedora 15, the standard firewall can
2380create trouble even when not really exiting the local system!
2381For IPv4, the standard rules seem fine. However, for IPv6 the
2382standard rules prohibit traffic from the network range of the
2383virtual interface created by the exit daemon to the local IPv6
2384address of the same interface (which is essentially loopback
2385traffic, so you might suspect that a standard firewall would
2386leave this traffic alone). However, as somehow for IPv6 the
2387traffic is not recognized as originating from the local
2388system (and as the connection is not already "established"),
2389the firewall drops the traffic. You should still get ICMPv6
2390packets back, but that's obviously not very useful.
2391
2392Possible ways to fix this include disabling the firewall (do you
2393have a good reason for having it on?) or disabling the firewall
2394at least for the GNUnet exit interface (or the respective
2395IPv4/IPv6 address range). The best way to diagnose these kinds
2396of problems in general involves setting the firewall to REJECT
2397instead of DROP and to watch the traffic using wireshark
2398(or tcpdump) to see if ICMP messages are generated when running
2399some tests that should work.
2400
2401@node Setting up VPN node for protocol translation and tunneling
2402@subsection Setting up VPN node for protocol translation and tunneling
2403
2404
2405The GNUnet VPN/PT subsystem enables you to tunnel IP traffic over the
2406VPN to an exit node, from where it can then be forwarded to the
2407Internet. This section documents how to setup VPN/PT on a node.
2408Note that you can enable both the VPN and an exit on the same peer.
2409In this case, IP traffic from your system may enter your peer's VPN
2410and leave your peer's exit. This can be useful as a means to do
2411protocol translation. For example, you might have an application that
2412supports only IPv4 but needs to access an IPv6-only site. In this case,
2413GNUnet would perform 4to6 protocol translation between the VPN (IPv4)
2414and the Exit (IPv6). Similarly, 6to4 protocol translation is also
2415possible. However, the primary use for GNUnet would be to access
2416an Internet service running with an IP version that is not supported
2417by your ISP. In this case, your IP traffic would be routed via GNUnet
2418to a peer that has access to the Internet with the desired IP version.
2419
2420Setting up an entry node into the GNUnet VPN primarily requires you
2421to enable the "VPN/PT" option in "gnunet-setup". This will launch the
2422"gnunet-service-vpn", "gnunet-service-dns" and "gnunet-daemon-pt"
2423processes. The "gnunet-service-vpn" will create a virtual interface
2424which will be used as the target for your IP traffic that enters the
2425VPN. Additionally, a second virtual interface will be created by
2426the "gnunet-service-dns" for your DNS traffic. You will then need to
2427specify which traffic you want to tunnel over GNUnet. If your ISP only
2428provides you with IPv4 or IPv6-access, you may choose to tunnel the
2429other IP protocol over the GNUnet VPN. If you do not have an ISP
2430(and are connected to other GNUnet peers via WLAN), you can also
2431choose to tunnel all IP traffic over GNUnet. This might also provide
2432you with some anonymity. After you enable the respective options
2433and restart your peer, your Internet traffic should be tunneled
2434over the GNUnet VPN.
2435
2436The GNUnet VPN uses DNS-ALG to hijack your IP traffic. Whenever an
2437application resolves a hostname (like 'gnunet.org'), the
2438"gnunet-daemon-pt" will instruct the "gnunet-service-dns" to intercept
2439the request (possibly route it over GNUnet as well) and replace the
2440normal answer with an IP in the range of the VPN's interface.
2441"gnunet-daemon-pt" will then tell "gnunet-service-vpn" to forward all
2442traffic it receives on the TUN interface via the VPN to the original
2443destination.
2444
2445For applications that do not use DNS, you can also manually create
2446such a mapping using the gnunet-vpn command-line tool. Here, you
2447specify the desired address family of the result (e.g. "-4"), and the
2448intended target IP on the Internet (e.g. "-i 131.159.74.67") and
2449"gnunet-vpn" will tell you which IP address in the range of your
2450VPN tunnel was mapped.
2451
2452@command{gnunet-vpn} can also be used to access "internal" services
2453offered by GNUnet nodes. So if you happen to know a peer and a
2454service offered by that peer, you can create an IP tunnel to
2455that peer by specifying the peer's identity, service name and
2456protocol (--tcp or --udp) and you will again receive an IP address
2457that will terminate at the respective peer's service.
2458
2459@node Using the GNUnet Messenger
2460@section Using the GNUnet Messenger
2461
2462The GNUnet Messenger subsystem allows decentralized message-based
2463communication inside of so called rooms. Each room can be relayed by
2464a variable amount of peers. Every member of a room has the possibility
2465to relay the room on its own peer. A peer allows any amount of members
2466to join a room. The amount of members in a room is not restricted.
2467
2468Messages in a room will be distributed between all peers relaying the
2469room or being internally (in context of the messenger service) connected
2470to a relaying peer. All received or sent messages will be stored on any
2471peer locally which is relaying the respective room or is internally
2472connected to such a relaying peer.
2473
2474The Messenger service is built on the CADET subsystem to make internal
2475connections between peers using a reliable and encrypted transmission.
2476Additionally the service uses a discrete padding to few different sizes.
2477So kinds of messages and potential content can't be identified by the
2478size of traffic from any attacker being unable to break the encryption
2479of the transmission layer.
2480
2481Another feature is additional end-to-end encryption for selected messages
2482which uses the public key of another member (the receiver) to encrypt
2483the message. Therefore it is ensured that only the selected member can
2484read its content. This will also use additional padding.
2485
2486@menu
2487* Current state::
2488* Entering a room::
2489* Opening a room::
2490* Messaging in a room::
2491* Private messaging::
2492@end menu
2493
2494@node Current state
2495@subsection Current state
2496
2497Currently there is only a simplistic CLI application available to use the
2498messenger service. You can use this application with the
2499@command{gnunet-messenger} command.
2500
2501This application was designed for testing purposes and it does not provide
2502full functionality in the current state. It is planned to replace this CLI
2503application in later stages with a fully featured one using a client-side
2504library designed for messenger applications.
2505
2506@node Entering a room
2507@subsection Entering a room
2508
2509You can enter any room by its ROOMKEY and any PEERIDENTITY of a relaying
2510peer. Optionally you can provide any IDENTITY which can represent a local
2511ego by its name.
2512
2513@example
2514$ gnunet-messenger [-e IDENTITY] -d PEERIDENTITY -r ROOMKEY
2515@end example
2516
2517A PEERIDENTITY gets entered in encoded form. You can get your own peer ID by
2518using the @command{gnunet-peerinfo} command:
2519
2520@example
2521$ gnunet-peerinfo -s
2522@end example
2523
2524A ROOMKEY gets entered in readable text form. The service will then hash the
2525entered ROOMKEY and use the result as shared secret for transmission through
2526the CADET submodule. You can also optionally leave out the '-r' parameter and
2527the ROOMKEY to use the zeroed hash instead.
2528
2529If no IDENTITY is provided you will not send any name to others, you will be
2530referred as "anonymous" instead and use the anonymous ego. If you provide any
2531IDENTITY a matching ego will be used to sign your messages. If there is no
2532matching ego you will use the anonymous ego instead. The provided IDENTITY will
2533be distributed as your name for the service in any case.
2534
2535@node Opening a room
2536@subsection Opening a room
2537
2538You can open any room in a similar way to entering it. You just have to leave
2539out the '-d' parameter and the PEERIDENTITY of the relaying peer.
2540
2541@example
2542$ gnunet-messenger [-e IDENTITY] -r ROOMKEY
2543@end example
2544
2545Providing ROOMKEY and IDENTITY is identical to entering a room. Opening a room
2546will also make your peer to a relay of this room. So others can enter the room
2547through your peer if they have the required ROOMKEY and your peer ID.
2548
2549If you want to use the zeroed hash as shared secret key for the room you can
2550also leave it out as well:
2551
2552@example
2553$ gnunet-messenger
2554@end example
2555
2556@node Messaging in a room
2557@subsection Messaging in a room
2558
2559Once joined a room by entering it or opening it you can write text-based
2560messages which will be distributed between all internally conntected peers. All
2561sent messages will be displayed in the same way as received messages.
2562
2563This relates to the internal handling of sent and received messages being mostly
2564identical on application layer. Every handled message will be represented
2565visually depending on its kind, content and sender. A sender can usually be
2566identified by the encoded member ID or their name.
2567
2568@example
2569[17X37K] * 'anonymous' says: "hey"
2570@end example
2571
2572@node Private messaging
2573@subsection Private messaging
2574
2575As referred in the introduction the service allows sending private messages with
2576additional end-to-end encryption. These messages will be visually represented
2577by messages of the kind 'PRIVATE' in case they can't be decrypted with your used
2578ego. Members who can't decrypt the message can potentially only identify its
2579sender but they can't identify its receiver.
2580
2581@example
2582[17X37K] ~ message: PRIVATE
2583@end example
2584
2585If they can be decrypted they will appear as their secret message instead
2586but marked visually.
2587
2588@example
2589[17X37K] ** 'anonymous' says: "hey"
2590@end example
2591
2592Currently you can only activate sending such encrypted text messages instead of
2593usual text messages by adding the '-p' parameter:
2594
2595@example
2596$ gnunet-messenger [-e IDENTITY] -d PEERIDENTITY -r ROOMKEY -p
2597@end example
2598
2599Notice that you can only send such encrypted messages to members who use an ego
2600which is not publicly known as the anonymous ego to ensure transparency. If
2601any user could decrypt these messages they would not be private. So as receiver
2602of such messages the IDENTITY is required and it has to match a local ego.
2603