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