doc/man/Makefile: rename section7 leftover to new name
[oweals/gnunet.git] / doc / man / gnunet-publish.1
1 .TH GNUNET-PUBLISH "1" "November 16, 2015" "GNUnet"
2 .SH NAME
3 gnunet\-publish \- a command line interface for publishing new content into GNUnet
4 .SH SYNOPSIS
5 .B gnunet\-publish
6 [\fIOPTIONS\fR] FILENAME
7 .SH DESCRIPTION
8 .PP
9 In order to share files with other GNUnet users, the files must first
10 be made available to GNUnet.
11 GNUnet does not automatically share all files from a certain directory
12 (however, you can do this with the gnunet\-auto\-share tool).
13 In fact, even files that are downloaded are not automatically shared.
14 .PP
15 In order to start sharing files, the files must be added either using
16 gnunet\-publish or a graphical interface such as gnunet\-fs\-gtk.
17 The command line tool gnunet\-publish is more useful if many files are
18 supposed to be added.
19 gnunet\-publish can automatically publish batches of files,
20 recursively publish directories, create directories that can be
21 browsed within GNUnet and publish file lists in a namespace.
22 When run on a directory, gnunet\-publish will always recursively
23 publish all of the files in the directory.
24 .PP
25 gnunet\-publish can automatically extract keywords from the files that
26 are shared.
27 Users that want to download files from GNUnet use keywords to search
28 for the appropriate content.
29 You can disable keyword extraction with the \-D option.
30 You can manually add keywords using the \-k option.
31 The keywords are case\-sensitive.
32 .PP
33 In addition to searching for files by keyword, GNUnet allows
34 organizing files into directories.
35 With directories, the user only needs to find the directory in order
36 to be able to download any of the files listed in the directory.
37 Directories can contain pointers to other directories.
38 .PP
39 With gnunet\-publish, it is easy to create new directories
40 simultaneously when adding the files.
41 Simply pass the name of a directory instead of a file.
42 .PP
43 Since keywords can be spammed (any user can add any content under any
44 keyword), GNUnet supports namespaces.
45 A namespace is a subset of the searchspace into which only the holder
46 of a certain pseudonym can add content.
47 Any GNUnet user can create any number of pseudonyms using
48 \fBgnunet\-pseudonym\fR.  Pseudonyms are stored in the user's GNUnet
49 directory.
50 While pseudonyms are locally identified with an arbitrary string that
51 the user selects when the pseudonym is created, the namespace is
52 globally known only under the hash of the public key of the pseudonym.
53 Since only the owner of the pseudonym can add content to the
54 namespace, it is impossible for other users to pollute the namespace.
55 gnunet\-publish automatically publishes the top\-directory (or the
56 only file if only one file is specified) into the namespace if a
57 pseudonym is specified.
58 .PP
59 It is possible to update content in GNUnet if that content was placed
60 and obtained from a particular namespace.
61 Updates are only possible for content in namespaces since this is the
62 only way to assure that a malicious party can not supply counterfeited
63 updates.
64 Note that an update with GNUnet does not make the old content
65 unavailable, GNUnet merely allows the publisher to point users to more
66 recent versions.
67 You can use the \-N option to specify the future identifier of an
68 update.
69 When using this option, a GNUnet client that finds the current (\-t)
70 identifier will automatically begin a search for the update (\-N)
71 identifier.
72 If you later publish an update under the (\-N) identifier, both
73 results will be given to the user.
74 .PP
75 You can use automatic meta\-data extraction (based on libextractor) or
76 the command\-line option \-m to specify meta-data.
77 For the \-m option you need to use the form keyword\-type:value.
78 For example, use "\-m os:Linux" to specify that the operating system
79 is Linux.
80 Common meta\-data types are "author", "title" , "mimetype",
81 "filename", "language", "subject" and "keywords".
82 A full list can be obtained from the extract tool using the option
83 \-\-list.
84 The meta\-data is used to help users in searching for files on the
85 network.
86 The keywords are case\-sensitive.
87 .PP
88 GNUnet supports two styles of publishing files on the network.
89 Publishing a file means that a copy of the file is made in the local
90 (!) database of the node.
91 Indexing a file means that an index is added to the local (!)
92 database with symbolic links to the file itself.
93 The links will use the SHA-512 hash of the entire file as the
94 filename.
95 Indexing is generally significantly more efficient and the default
96 choice.
97 However, indexing only works if the indexed file can be read (using
98 the same absolute path) by gnunet-service-fs.
99 If this is not the case, indexing will fail (and gnunet\-publish will
100 automatically revert to publishing instead).
101 Regardless of which method is used to publish the file, the file will
102 be slowly (depending on how often it is requested and on how much
103 bandwidth is available) dispersed into the network.
104 If you publish or index a file and then leave the network, it will
105 almost always NOT be available anymore.
106 .PP
107 \fB\-c \fIFILENAME\fR, \fB\-\-config=FILENAME\fR
108 Use alternate config file (if this option is not specified, the
109 default is ~/.config/gnunet.conf).
110 .TP
111 \fB\-D\fR, \fB\-\-disable\-extractor\fR
112 Disable use of GNU libextractor for finding additional keywords and
113 metadata.
114 .TP
115 \fB\-d\fR, \fB\-\-disable\-creation\-time\fR
116 Disable use of creation time timestamp in metadata.
117 Useful to make created directories deterministic and to avoid leaking
118 information about the time at which a file was made available.
119 .TP
120 \fB\-e\fR, \fB\-\-extract\fR
121 Print the list of keywords that will be used for each file given the
122 current options.
123 Do not perform any indexing or publishing.
124 .TP
125 \fB\-h\fR, \fB\-\-help\fR
126 Print a brief help page with all the options.
127 .TP
128 \fB\-k \fIKEYWORD\fR, \fB\-\-key=KEYWORD\fR
129 Additional key to index the content with (to add multiple keys,
130 specify multiple times).
131 Each additional key is case\-sensitive.
132 Can be specified multiple times.
133 The keyword is only applied to the top\-level file or directory.
134 .TP
135 \fB\-L \fILOGLEVEL\fR, \fB\-\-loglevel=\fILOGLEVEL\fR
136 Change the loglevel.
137 Possible values for LOGLEVEL are ERROR, WARNING, INFO and DEBUG.
138 .TP
139 \fB\-m \fITYPE:VALUE\fR, \fB\-\-meta=\fITYPE:VALUE\fR
140 For the main file (or directory), set the metadata of the given TYPE
141 to the given VALUE.
142 Note that this will not add the respective VALUE to the set of
143 keywords under which the file can be found.
144 .TP
145 \fB\-n\fR, \fB\-\-noindex\fR
146 Executive summary: You probably don't need it.
147 Do not index, full publishing.
148 Note that directories, information for keyword search, namespace
149 search and indexing data are always published (even without this
150 option).
151 With this option, every block of the actual files is stored in
152 encrypted form in the block database of the local peer.
153 While this adds security if the local node is compromised (the
154 adversary snags your machine), it is significantly less efficient
155 compared to on\-demand encryption and is definitely not recommended
156 for large files.
157 .TP
158 \fB\-N \fIID\fR, \fB\-\-next=\fIID\fR
159 Specifies the next identifier of a future version of the file to be
160 published under the same pseudonym.
161 This option is only valid together with the \-P option.
162 This option can be used to specify what the identifier of an updated
163 version will look like.
164 Note that specifying \-i and \-N without \-t is not allowed.
165 .TP
166 \fB\-p \fIPRIORITY\fR, \fB\-\-prio=\fIPRIORITY\fR
167 Executive summary: You probably don't need it.
168 Set the priority of the published content (default: 365).
169 If the local database is full, GNUnet will discard the content with
170 the lowest ranking.
171 Note that ranks change over time depending on popularity.
172 The default should be high enough to preserve the locally published
173 content in favor of content that migrates from other peers.
174 .TP
175 \fB\-P \fINAME\fR, \fB\-\-pseudonym=\fINAME\fR
176 For the top\-level directory or file, places the file into the
177 namespace identified by the pseudonym NAME.
178 NAME must be a valid pseudonym managed by gnunet\-identity.
179 .TP
180 \fB\-r \fILEVEL\fR, \fB\-\-replication=\fILEVEL\fR
181 Set the desired replication level.
182 If CONTENT_PUSHING is set to YES, GNUnet will push each block (for the
183 file) LEVEL times to other peers before doing normal "random"
184 replication of all content.
185 This option can be used to push some content out into the network
186 harder.
187 Note that pushing content LEVEL times into the network does not
188 guarantee that there will actually be LEVEL replicas.
189 .TP
190 \fB\-s\fR, \fB\-\-simulate-only\fR
191 When this option is used, gnunet\-publish will not actually publish
192 the file but just simulate what would be done.
193 This can be used to compute the GNUnet URI for a file without actually
194 sharing it.
195 .TP
196 \fB\-t \fIID\fR, \fB\-\-this=\fIID\fR
197 Specifies the identifier under which the file is to be published under
198 a pseudonym.
199 This option is only valid together with the\ \-P option.
200 .TP
201 \fB\-u \fIURI\fR, \fB\-\-uri=\fIURI\fR
202 This option can be used to specify the URI of a file instead of a
203 filename (this is the only case where the otherwise mandatory filename
204 argument must be omitted).
205 Instead of publishing a file or directory and using the corresponding
206 URI, gnunet\-publish will use this URI and perform the selected
207 namespace or keyword operations.
208 This can be used to add additional keywords to a file that has already
209 been shared or to add files to a namespace for which the URI is known
210 but the content is not locally available.
211 .TP
212 \fB\-v\fR, \fB\-\-version\fR
213 Print the version number.
214 .TP
215 \fB\-V\fR, \fB\-\-verbose\fR
216 Be verbose.
217 Using this option causes gnunet\-publish to print progress information
218 and at the end the file identification that can be used to download
219 the file from GNUnet.
220 .SH SETTING ANONYMITY LEVEL
221 The \fB\-a\fR option can be used to specify additional anonymity
222 constraints.
223 If set to 0, GNUnet will publish the file non-anonymously and in fact
224 sign the advertisement for the file using your peer's private key.
225 This will allow other users to download the file as fast as possible,
226 including using non-anonymous methods (DHT, direct transfer).
227 If you set it to 1 (default), you use the standard anonymous routing
228 algorithm (which does not explicitly leak your identity).
229 However, a powerful adversary may still be able to perform traffic
230 analysis (statistics) to over time infer data about your identity.
231 You can gain better privacy by specifying a higher level of anonymity,
232 which increases the amount of cover traffic your own traffic will get,
233 at the expense of performance.
234 Note that regardless of the anonymity level you choose, peers that
235 cache content in the network always use anonymity level 1.
236 .PP
237 The definition of the ANONYMITY LEVEL is the following.
238 0 means no anonymity is required.
239 Otherwise a value of 'v' means that 1 out of v bytes of "anonymous"
240 traffic can be from the local user, leaving 'v-1' bytes of cover
241 traffic per byte on the wire.
242 Thus, if GNUnet routes n bytes of messages from foreign peers (using
243 anonymous routing), it may originate n/(v-1) bytes of data in the same
244 time\-period.
245 The time\-period is twice the average delay that GNUnet defers
246 forwarded queries.
247 .PP
248 The default is 1 and this should be fine for most users.
249 Also notice that if you choose very large values, you may end up
250 having no throughput at all, especially if many of your fellow
251 GNUnet\-peers all do the same.
252 .SH EXAMPLES
253 .PP
254 \fBBasic examples\fR
255 .TP
256 gnunet\-publish COPYING
257 Index a file COPYING
258 .TP
259 gnunet\-publish \-n COPYING
260 Publish a file COPYING
261 .TP
262 gnunet\-publish \-k gpl \-k test COPYING
263 Index a file COPYING with the keywords \fBgpl\fR and \fBtest\fR
264 .TP
265 gnunet\-publish \-m "description:GNU License" \-k gpl \-k test \-m "mimetype:text/plain" COPYING
266 Index a file COPYING with description "GNU License", mime-type
267 "text/plain" and keywords \fBgpl\fR and \fBtest\fR
268 .PP
269 \fBUsing directories\fR
270 .TP
271 mkdir gnu ; mv COPYING AUTHORS gnu/ ; gnunet\-publish \-k test \-k gnu \-D gnu/
272 Index the files COPYING and AUTHORS with keyword \fBtest\fR and build
273 a directory containing the two files.  Make the directory itself
274 available under keyword \fBgnu\fR and disable keyword extraction using
275 libextractor
276 .TP
277 gnunet\-publish \-n \-m "description:Kitten collection" \-k kittens kittendir/
278 Neatly publish an image gallery in \fBkittendir/\fR and its subdirs
279 with keyword \fBkittens\fR for the directory but no keywords for the
280 individual files or subdirs (\-n).
281 Force description for all files.
282 .PP
283 \fBSecure publishing with namespaces\fR
284 .TP
285 gnunet\-publish \-P RIAA-2 \-t gpl COPYING
286 Publish file COPYING with pseudonym RIAA-2 (\-P) and with identifier
287 \fBgpl\fR (\-t) and no updates
288 .TP
289 gnunet\-publish \-P RIAA-2 \-t MUSIC \-N VIDEOS /home/ogg
290 Recursively index /home/ogg and build a matching directory
291 structure. Publish the top\-level directory into the namespace under
292 the pseudonym RIAA\-2 (\-P) under identifier 'MUSIC' (\-t) and promise
293 to provide an update with identifier 'VIDEOS' (\-N):
294 .TP
295 gnunet\-publish \-nV /var/lib/mysql
296 Recursively publish (\-n) /var/lib/mysql and build a matching
297 directory structure, but disable the use of libextractor to extract
298 keywords (\-n).
299 Print the file identifiers (\-V) that can be used to retrieve the
300 files.
301 This will store a copy of the MySQL database in GNUnet but without
302 adding any keywords to search for it.
303 Thus only people that have been told the secret file identifiers
304 printed with the \-V option can retrieve the (secret?) files:
305 .TP
306 gnunet\-publish \-P MPAA-1 \-t root \-N next noise.mp3
307 Create a namespace entry 'root' in namespace MPAA-1 and announce that
308 the next update will be called 'next':
309 .TP
310 gnunet\-publish \-P MPAA-1 \-t next noise_updated.mp3
311 Update the previous entry, do not allow any future updates:
312 .SH FILES
313 .TP
314 ~/.config/gnunet.conf
315 GNUnet configuration file
316 .SH BUGS
317 Report bugs to <https://gnunet.org/bugs/> or by sending electronic
318 mail to <gnunet\-developers@gnu.org>
319 .SH SEE ALSO
320 \fBgnunet\-auto\-share\fP(1)
321 \fBgnunet\-fs\-gtk\fP(1)
322 \fBgnunet\-search\fP(1)
323 \fBgnunet\-download\fP(1)
324 \fBgnunet.conf\fP(5)
325 \fBextract\fP(1)
326 \fBgnunet\-identity\fP(1)
327 .PP
328 The full documentation for
329 .B gnunet
330 is maintained as a Texinfo manual.
331 If the
332 .B info
333 and
334 .B gnunet
335 programs are properly installed at your site, the command
336 .IP
337 .B info gnunet
338 .PP
339 should give you access to the complete handbook,
340 .IP
341 .B info gnunet-c-tutorial
342 .PP
343 will give you access to a tutorial for developers.
344 .PP
345 Depending on your installation, this information is also
346 available in
347 \fBgnunet\fP(7) and \fBgnunet-c-tutorial\fP(7).