gnunet-publish.1 16 KB

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