]> Cypherpunks.ru repositories - nncp.git/blob - doc/cmd/nncp-file.texi
24dafde0c554b486e35b44d52701a7226b9957fd
[nncp.git] / doc / cmd / nncp-file.texi
1 @node nncp-file
2 @section nncp-file
3
4 @example
5 $ nncp-file [options] [-chunked INT] SRC      NODE:[DST]
6 $ nncp-file [options] [-chunked INT] SRC area:AREA:[DST]
7 @end example
8
9 Send @file{SRC} file to remote @option{NODE}. @file{DST} specifies
10 destination file name in remote's @ref{CfgIncoming, incoming}
11 directory. If this file already exists there, then counter will be
12 appended to it.
13
14 This command queues file in @ref{Spool, spool} directory immediately
15 (through the temporary file of course) -- so pay attention that sending
16 2 GiB file will create 2 GiB outbound encrypted packet.
17
18 @anchor{StdinTmpFile}
19 If @file{SRC} equals to @file{-}, then create an encrypted temporary
20 file and copy everything taken from @code{stdin} to it and use for outbound
21 packet creation. Pay attention that if you want to send 1 GiB of data
22 taken from @code{stdin}, then you have to have more than 2 GiB of disk space
23 for that temporary file and resulting encrypted packet. You can control
24 temporary file location directory with @env{$TMPDIR} environment
25 variable. Encryption is performed in AEAD mode with
26 @url{https://cr.yp.to/chacha.html, ChaCha20}-@url{https://en.wikipedia.org/wiki/Poly1305, Poly1305}
27 algorithms. Data is divided on 128 KiB blocks. Each block is encrypted
28 with increasing nonce counter. File is deletes immediately after
29 creation, so even if program crashes -- disk space will be reclaimed, no
30 need in cleaning it up later.
31
32 If @file{SRC} points to directory, then
33 @url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_01, pax archive}
34 will be created on the fly with directory contents and destination
35 filename @file{.tar} appended. It @strong{won't} contain any entities
36 metainformation, but modification time with the names. UID/GID are set
37 to zero. Directories have 777 permissions, files have 666, for being
38 friendly with @command{umask}. Also each entity will have comment like
39 @verb{|Autogenerated by NNCP version X.Y.Z built with goXXX|}.
40
41 If @option{-chunked} is specified, then source file will be split
42 @ref{Chunked, on chunks}. @option{INT} is the desired chunk size in
43 KiBs. This mode is more CPU hungry. Pay attention that chunk is saved in
44 spool directory immediately and it is not deleted if any error occurs.
45 @option{-minsize} option is applied per each chunk. Do not forget about
46 @ref{ChunkedZFS, possible} ZFS deduplication issues. Zero
47 @option{-chunked} disables chunked transmission.
48
49 If @ref{CfgNotify, notification} is enabled on the remote side for
50 file transmissions, then it will sent simple letter after successful
51 file receiving.
52
53 If you use @option{area:AREA} instead of @option{NODE}, then
54 @ref{Multicast, multicast} packet will be sent to specified area. That
55 creates outgoing packet to the @strong{self} node, so you have to run
56 @ref{nncp-toss, tossing} to create outgoing packets to required subscribers.