aboutsummaryrefslogtreecommitdiff
path: root/doc/man/gnunet-search.1
blob: 3145842a4c6752734fb1ea79a031d361d3927a43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
.\" This file is part of GNUnet.
.\" Copyright (C) 2001-2019 GNUnet e.V.
.\"
.\" Permission is granted to copy, distribute and/or modify this document
.\" under the terms of the GNU Free Documentation License, Version 1.3 or
.\" any later version published by the Free Software Foundation; with no
.\" Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
.\" copy of the license is included in the file
.\" FDL-1.3.
.\"
.\" A copy of the license is also available from the Free Software
.\" Foundation Web site at http://www.gnu.org/licenses/fdl.html}.
.\"
.\" Alternately, this document is also available under the General
.\" Public License, version 3 or later, as published by the Free Software
.\" Foundation.  A copy of the license is included in the file
.\" GPL3.
.\"
.\" A copy of the license is also available from the Free Software
.\" Foundation Web site at http://www.gnu.org/licenses/gpl.html
.\"
.\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later
.\"
.Dd February 12, 2022
.Dt GNUNET-SEARCH 1
.Os
.Sh NAME
.Nm gnunet-search
.Nd a command line interface to search for content on GNUnet
.Sh SYNOPSIS
.Nm
.Op Fl a Ar LEVEL | Fl -anonymity= Ns Ar LEVEL
.Op Fl b | -bookmark-only
.Op Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME
.Op Fl F Ar FORMAT | Fl -dir-printf= Ns Ar FORMAT
.Op Fl f Ar FORMAT | Fl -printf= Ns Ar FORMAT
.Op Fl h | -help
.Op Fl i Ar FORMAT | Fl -iter-printf= Ns Ar FORMAT
.Op Fl L Ar LOGLEVEL | Fl -loglevel= Ns Ar LOGLEVEL
.Op Fl l Ar FILENAME | Fl -logfile= Ns Ar FILENAME
.Op Fl o Ar FILENAME | Fl -output= Ns Ar FILENAME
.Op Fl n | -no-network
.Op Fl N Ar VALUE | Fl -results= Ns Ar VALUE
.Op Fl s | -silent
.Op Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY
.Op Fl v | -version
.Op Fl V | -verbose
.Ao KEYWORD Ac Ao +KEYWORD Ac | Ao Ar URI Ac Ao Ar +URI Ac
.Sh DESCRIPTION
Search for content on GNUnet.
The keywords are case-sensitive.
.Nm
can be used both for a search in the global namespace as well as for searching a private subspace.
The options are as follows:
.Bl -tag -width indent
.It Fl a Ar LEVEL | Fl -anonymity= Ns Ar LEVEL
This option can be used to specify additional anonymity constraints.
The default is 1.
If set to 0, GNUnet will publish the file non-anonymously and in fact sign the advertisement for the file using your peer's private key.
This will allow other users to download the file as fast as possible, including using non-anonymous methods (discovery via DHT and CADET transfer).
If you set it to 1 (default), you use the standard anonymous routing algorithm (which does not explicitly leak your identity).
However, a powerful adversary may still be able to perform traffic analysis (statistics) to over time discovery your identity.
You can gain better privacy by specifying a higher level of anonymity (using values above 1).
This tells FS that it must hide your own requests in equivalent-looking cover traffic.
This should confound an adversaries traffic analysis, increasing the time and effort it would take to discover your identity.
However, it also can significantly reduce performance, as your requests will be delayed until sufficient cover traffic is available.
The specific numeric value (for anonymity levels above 1) is simple:
Given an anonymity level L (above 1), each request FS makes on your behalf must be hidden in L-1 equivalent requests of cover traffic (traffic your peer routes for others) in the same time-period.
The time-period is twice the average delay by which GNUnet artificially delays traffic.
Note that regardless of the anonymity level you choose, peers that cache content in the network always use anonymity level 1.
.It Fl b | -bookmark-only
Do not search, print only the URI that points to the search with the given keywords.
.It Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME
Use the configuration file
.Ar FILENAME
(default:
.Pa ~/.config/gnunet.conf Ns
).
.It Fl F Ar FORMAT | Fl -dir-printf= Ns Ar FORMAT
Write the search results for directories according to
.Ar FORMAT Ns
\&. The directives supported here are identical to those supported in the
.Fl -printf
argument (please refer to it for more information). If missing,
.Fl -dir-printf
defaults to
.Fl -printf Ns
\&. If
.Fl -printf
is missing too
.Fl -dir-printf
defaults to
.Ql #%n:\engnunet-download -o Qo %f Qc -R %u\en\en Ns
\&.
.It Fl f Ar FORMAT | Fl -printf= Ns Ar FORMAT
Write the search results according to
.Ar FORMAT Ns
, in which
.Ql \e
and
.Ql %
directives are interpreted as follows:
.Bl -tag -width indent
.It Li \e\e
a literal backslash
.No ( Ql \e Ns )
.It Li \ea
an alarm bell
.It Li \eb
a backspace
.It Li \ee
an escape
.It Li \ef
a form feed
.It Li \en
a newline
.It Li \er
a carriage return
.It Li \et
a horizontal tab
.It Li \ev
a vertical tab
.It Li \e0
an ASCII NUL.
.It Li \eN...
the character whose ASCII code is N..., expressed in octal digits
.It Li \exX...
the character whose ASCII code is X..., expressed in hexadecimal digits
.Pp
.El
.Sy Note:
The
.Ql \e
character followed by any other character not listed above is treated as an ordinary character, so both characters are printed.
.Bl -tag -width indent
.It Li %%
a percent sign
.It Li %a
the complete list of all the printable metadata properties available, displayed according to the
.Fl -iter-printf
argument; this specifier optionally supports metatype filtering via hash sign
.No (e.g.
.Ql %2#a
prints all embedded file names, if present - see libextractor's metatypes for the complete list of numerical identifiers)
.It Li %f
the file's name
.It Li %j
the first printable metadata property available, displayed according to the
.Fl -iter-printf
argument; this specifier optionally supports metatype filtering via hash sign
.No (e.g.
.Ql %5#j
prints a book title, if present); see libextractor's metatypes for the complete list of numerical identifiers)
.It Li %l
the file name's length
.It Li %m
the file's mime type
.It Li %n
the search result number
.It Li %s
the file's size in bytes
.It Li %u
the file's URI
.El
.Pp
.Sy Note:
The
.Ql %
character followed by any other character not listed above is treated as an ordinary character, so both characters are printed.
.Pp
If missing,
.Fl -printf
defaults to
.Ql #%n:\engnunet-download -o Qo %f Qc %u\en\en Ns
\&.
.It Fl h | -help
Print the help page.
.It Fl i Ar FORMAT | Fl -iter-printf= Ns Ar FORMAT
When the
.Ql %a
or
.Ql %j
format specifiers appear in
.Fl -printf
or
.Fl -dir-printf Ns
, list each metadata property according to
.Ar FORMAT Ns
, in which the
.Ql \e
directives are interpreted as in
.Fl -printf
and
.Fl -dir-printf Ns
, while the
.Ql %
directives are interpreted as follows:
.Bl -tag -width indent
.It Li %%
a percent sign
.It Li %p
the property's content
.It Li %l
the property content's length in bytes
.It Li %i
the property type's unique identifier
.It Li %n
the property number
.It Li %t
the property type (available only if compiled with libextractor)
.It Li %w
the name of the plugin that provided the information
.El
.Pp
.Sy Note:
The
.Ql %
character followed by any other character not listed above is treated as an ordinary character, so both characters are printed.
.Pp
If missing,
.Fl -iter-printf
defaults to
.Ql \& \& %t: %p\en
or
.Ql \& \& MetaType #%i: %p\en Ns
, depending on whether the program was compiled with libextractor or not.
.It Fl L Ar LOGLEVEL | Fl -loglevel= Ns Ar LOGLEVEL
Change the loglevel.
Possible values for
.Ar LOGLEVEL
are ERROR, WARNING, INFO and DEBUG.
.It Fl l Ar FILENAME | Fl -logfile= Ns Ar FILENAME
Write logs to
.Ar FILENAME .
.It Fl o Ar FILENAME | Fl -output= Ns Ar FILENAME
Writes a GNUnet directory containing all of the search results to
.Ar FILENAME
.No (e.g.
.Ql gnunet-search --output=commons.gnd commons Ns
).
.It Fl n | -no-network
Only search locally, do not forward requests to other peers.
.It Fl N Ar VALUE | Fl -results= Ns Ar VALUE
Automatically terminate the search after receiving
.Ar VALUE
results.
.It Fl s | -silent
Enable silent mode and do not print any result (the
.Fl -output
argument is required).
.It Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY
Automatically timeout search after
.Ar DELAY .
The value given must be a number followed by a space and a time unit, for example
.Qo 500 ms Qc . Note that the quotes are required on the shell. Without a unit it defaults to microseconds (1000000 = 1 second).
If 0 or omitted the search runs until gnunet-search is aborted with CTRL-C.
.It Fl v | -version
print the version number
.It Fl V | -verbose
append
.Ql %a\en
to the default
.Fl -printf
and
.Fl -dir-printf
arguments \[u2013] ignored when these are provided by the user
.El
.Pp
It is possible to run
.Nm gnunet-search
with an URI instead of a keyword.
The URI can have the format for a namespace search or for a keyword search.
For a namespace search, the format is
.Pp
.Dl gnunet://fs/sks/NAMESPACE/IDENTIFIER
.Pp
For a keyword search, use
.Pp
.Dl gnunet://fs/ksk/KEYWORD[+KEYWORD]*
.Pp
If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly.
.sp
If multiple keywords are passed,
.Nm gnunet-search
will look for content matching any of the keywords.
The
.Ql +
prefix makes a keyword mandatory.
.Sh FILES
.Pa ~/.config/gnunet.conf
GNUnet configuration file; specifies the default value for the timeout
.Sh EXAMPLES
Example 1:
.Pp
.Dl $ gnunet-search 'Das Kapital'
.Pp
searches for content matching the keyword
.Dq Das Kapital Ns
.
.Pp
Example 2:
.Pp
.Dl $ gnunet-search Das Kapital
.Pp
searches for content matching either keyword
.Dq Das
or keyword
.Dq Kapital Ns
.
.Pp
Example 3:
.Pp
.Dl $ gnunet-search +Das +Kapital
.Pp
searches for content matching both mandatory keywords
.Dq Das
and
.Dq Kapital Ns
.
.sp
Search results are printed by
.Nm gnunet-search
like this:
.Pp
.ad l
        gnunet-download -o "COPYING" gnunet://fs/chk/HASH1.HASH2.SIZE
.Pp
          Description: The GNU General Public License
          Mime-type: text/plain
          ...
.ad b
.Pp
The first line contains the command to run to download the file.
The suggested filename in the example is
.Ql COPYING Ns
\&. The GNUnet URI consists of the key and query hash of the file and finally the size of the file.
If the
.Fl -verbose
option was provided, after the command to download the file, GNUnet will print metadata about the file as advertised in the search result.
The metadata here is the description
.No ( Ns
.Dq The GNU General Public License Ns
) and the mime-type
.No ( Ns
.Dq text-plain Ns
).
See the options for
.Xr gnunet-publish 1
on how to supply metadata by hand.
.Pp
The
.Fl -printf
.No ( Ns
.Fl f Ns
),
.Fl -dir-printf
.No ( Ns
.Fl F Ns
) and
.Fl -iter-printf
.No ( Ns
.Fl i Ns
) arguments offer powerful tools for manipulating the output printed. For instance,
.Pp
Example 4:
.Pp
.ad l
        $ gnunet-search -f '%f (%s bytes)\en' commons
.Pp
will print a simple list of the results that match the
.Dq commons
keyword, with only the file name and the size printed, without any URI. Or, for instance,
.Pp
Example 5:
.Pp
.ad l
        #!/bin/sh
        {
          printf '<list>'
          gnunet-search -f '
          <file uri="%u">
            <filename len="%l">%f</filename>
            <size>%s</size>
            <mimetype>%m</mimetype>
            <result_id>%n</result_id>
            <metadata>%a
            </metadata>
          </file>' \e
            -i '
              <property tid="%i" type="%t">
                <content len="%l">%p</content>
                <property_id>%n</property_id>
                <provided_by>%w</provided_by>
              </property>' \e
            -t '2 s' commons
          printf '\en</list>\en'
        } > commons.xml
.Pp
will run for two seconds and then create a file named
.Pa commons.xml Ns
, containing the search results that match the
.Dq commons
keyword in XML format.
.Sh SEE ALSO
.Xr gnunet-download 1 ,
.Xr gnunet-fs-gtk 1 ,
.Xr gnunet-publish 1 ,
.Xr gnunet.conf 5
.sp
The full documentation for GNUnet is maintained as a Texinfo manual.
If the
.Xr info 1
and gnunet packages are properly installed at your site, the command
.Pp
.Dl info gnunet
.Pp
should give you access to the complete handbook,
.Pp
.Dl info gnunet-c-tutorial
.Pp
will give you access to a tutorial for developers.
.sp
Depending on your installation, this information is also available in
.Xr gnunet 7 and
.Xr gnunet-c-tutorial 7 .
.\".Sh HISTORY
.\"gnunet-search first appeared in GNUnet 0.9.6.
.\".Sh AUTHORS
.Sh BUGS
Report bugs by using
.Lk https://bugs.gnunet.org
or by sending electronic mail to
.Aq Mt gnunet-developers@gnu.org .