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