bin/cmd.list | 1 + doc/about.texi | 13 +++++++++++++ doc/admin.texi | 26 +++++++++++++++++++------- doc/building.texi | 48 +++++++++++++++++++++++++++++++++++++++++++++--- doc/bundles.texi | 30 ++++++++++++++++++------------ doc/call.texi | 27 ++++++++++++++++++++------- doc/cfg/areas.texi | 2 ++ doc/cfg/dir.texi | 8 +++++--- doc/cfg/general.texi | 25 ++++++++++++++++++++++--- doc/cfg/index.texi | 8 +++++++- doc/cfg/neigh.texi | 22 +++++++++++++++++----- doc/cfg/notify.texi | 3 +++ doc/cfg/self.texi | 10 +++++++++- doc/chunked.texi | 8 ++++++-- doc/cmd/index.texi | 17 ++++++++++++++++- doc/cmd/nncp-ack.texi | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/cmd/nncp-bundle.texi | 11 ++++++----- doc/cmd/nncp-call.texi | 17 +++++++++-------- doc/cmd/nncp-caller.texi | 3 ++- doc/cmd/nncp-cfgdir.texi | 1 + doc/cmd/nncp-cfgenc.texi | 1 + doc/cmd/nncp-cfgmin.texi | 7 +++++-- doc/cmd/nncp-cfgnew.texi | 1 + doc/cmd/nncp-check.texi | 1 + doc/cmd/nncp-cronexpr.texi | 1 + doc/cmd/nncp-daemon.texi | 7 ++++--- doc/cmd/nncp-exec.texi | 4 ++++ doc/cmd/nncp-file.texi | 1 + doc/cmd/nncp-freq.texi | 1 + doc/cmd/nncp-hash.texi | 1 + doc/cmd/nncp-log.texi | 1 + doc/cmd/nncp-pkt.texi | 3 ++- doc/cmd/nncp-reass.texi | 1 + doc/cmd/nncp-rm.texi | 3 ++- doc/cmd/nncp-stat.texi | 1 + doc/cmd/nncp-toss.texi | 10 ++++++---- doc/cmd/nncp-trns.texi | 1 + doc/cmd/nncp-xfer.texi | 9 +++++---- doc/comparison.ru.texi | 44 ++++++++++++++++++++++---------------------- doc/comparison.texi | 80 ++++++++++++++++++++++++++++++++--------------------- doc/contacts.texi | 4 ++++ doc/cronexpr.texi | 15 ++++++++------- doc/download.texi | 11 +++++++++++ doc/eblob.texi | 5 +++++ doc/index.texi | 8 ++++++++ doc/indices.texi | 14 ++++++++++++++ doc/install.texi | 32 +++++++++++++++++++++++++++++--- doc/integration/bittorrent.texi | 3 +++ doc/integration/download.texi | 3 +++ doc/integration/exim.texi | 8 ++++++-- doc/integration/feeds.texi | 23 ++++++++++++++++++++++- doc/integration/freqindex.texi | 1 + doc/integration/git.texi | 2 ++ doc/integration/index.texi | 1 + doc/integration/multimedia.texi | 13 ++++++++----- doc/integration/postfix.texi | 28 ++++++++++++++++++---------- doc/integration/ppp.texi | 15 +++++++++------ doc/integration/warc.texi | 3 +++ doc/integrity.texi | 6 ++++++ doc/log.texi | 8 ++++++-- doc/mcd.texi | 11 +++++++---- doc/mirrors.texi | 10 +++++++++- doc/mth.texi | 4 ++++ doc/multicast.texi | 9 ++++++--- doc/news.ru.texi | 37 ++++++++++++++++++++++++++++++++----- doc/news.texi | 36 +++++++++++++++++++++++++++++++----- doc/niceness.texi | 13 ++++++++++--- doc/pkt/area.texi | 1 + doc/pkt/encrypted.texi | 3 +++ doc/pkt/index.texi | 2 ++ doc/pkt/plain.texi | 15 +++++++++++++++ doc/sources.texi | 8 +++++++- doc/sp.texi | 12 ++++++++++++ doc/spool.texi | 29 +++++++++++++++++++---------- doc/thanks.texi | 1 + doc/usecases.ru/airgap.texi | 5 ++--- doc/usecases.ru/caller.texi | 3 ++- doc/usecases.ru/mail.texi | 2 +- doc/usecases.ru/nolink.texi | 7 +++++-- doc/usecases.ru/pop.texi | 7 ++++--- doc/usecases.ru/spy.texi | 10 +++++----- doc/usecases/airgap.texi | 5 +++-- doc/usecases/caller.texi | 5 ++--- doc/usecases/index.texi | 1 + doc/usecases/mail.texi | 2 +- doc/usecases/nolink.texi | 9 +++++++-- doc/usecases/pop.texi | 15 +++++++++------ doc/usecases/qos.texi | 3 +++ doc/usecases/satellite.texi | 1 + doc/usecases/spy.texi | 5 +++-- doc/usecases/unreliable.texi | 1 + doc/workflow.texi | 51 ++++++++++++++++++++++++++++++++------------------- doc/yggdrasil.texi | 30 +++++++++++++++++++----------- makedist.sh | 3 ++- ports/nncp/Makefile | 2 +- ports/nncp/pkg-plist | 1 + src/call.go | 4 ++-- src/cfg.go | 1 + src/cmd/nncp-ack/main.go | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/cmd/nncp-bundle/main.go | 6 ++++-- src/cmd/nncp-call/main.go | 2 ++ src/cmd/nncp-caller/main.go | 2 ++ src/cmd/nncp-daemon/main.go | 3 +++ src/cmd/nncp-pkt/main.go | 4 ++++ src/cmd/nncp-reass/main.go | 6 ++++-- src/cmd/nncp-toss/main.go | 9 +++++---- src/cmd/nncp-xfer/main.go | 37 +++++++++++++++++++++++++------------ src/go.mod | 11 ++++++----- src/go.sum | 24 ++++++++++++++---------- src/nncp.go | 2 +- src/pkt.go | 1 + src/sp.go | 21 +++++++++++++-------- src/tmp.go | 17 ++++++++++++++--- src/toss.go | 92 +++++++++++++++++++++++++++++++++++++++++++---------- src/toss_test.go | 20 ++++++++++---------- src/tx.go | 46 +++++++++++++++++++++++++++++++++++++++++----- diff --git a/bin/cmd.list b/bin/cmd.list index a568233aafd93dde168adaa0a8347e75fef031b08ba91ad7b25f26fff1d50baf..61e6a3207c8fb51200785929ea4cd54c330cc5df25365f5574655dd7e8863e1e 100644 --- a/bin/cmd.list +++ b/bin/cmd.list @@ -1,3 +1,4 @@ +nncp-ack nncp-bundle nncp-call nncp-caller diff --git a/doc/about.texi b/doc/about.texi index bba27b07786c9251156d431fa40ac5979d09be559595fa3fce853248066dc2bb..52ba48d946c9c3a8333e4ce157a4f799e1ef63337cb791fdf951eeec5828948b 100644 --- a/doc/about.texi +++ b/doc/about.texi @@ -1,8 +1,18 @@ +@cindex about @strong{NNCP} (Node to Node copy) is a collection of utilities simplifying secure store-and-forward files, mail and command exchanging. See also this page @ref{Об утилитах, on russian}. +@cindex F2F +@cindex friend-to-friend +@cindex E2E +@cindex end-to-end +@cindex darknet +@cindex DTN +@cindex delay tolerant +@cindex dead drop +@cindex onion encryption This utilities are intended to help build up small size (dozens of nodes) ad-hoc @url{https://en.wikipedia.org/wiki/Friend-to-friend, friend-to-friend} (F2F) statically routed @@ -28,6 +38,9 @@ transmission exists. Look for possible @ref{Use cases, use cases}! +@cindex GPL +@cindex free software +@cindex licence NNCP is @url{https://www.gnu.org/philosophy/pragmatic.html, copylefted} @url{https://www.gnu.org/philosophy/free-sw.html, free software} licenced under @url{https://www.gnu.org/licenses/gpl-3.0.html, GNU GPLv3}. diff --git a/doc/admin.texi b/doc/admin.texi index 6da2fada2199ea9741c063ebfdff537c6792d897a46f27941bb6e7d90fec7ad1..fa73fa241105e4cbe90d3dbd9bc8687f3f0db7626f7252730c577f08beb24890 100644 --- a/doc/admin.texi +++ b/doc/admin.texi @@ -1,4 +1,5 @@ @node Administration +@cindex administration @unnumbered Administration NNCP uses following files/directories you should be aware of: @@ -22,13 +23,16 @@ possibly they also require cleanup if they are completely lost. It can contain @file{.nock} files: fully downloaded, but still not checksummed. Can be checksummed (with @file{.nock} extension removing) - with @command{nncp-check -nock}. + with @command{@ref{nncp-check} -nock}. Also it can contain @file{seen/} and @file{hdr/} subdirectories, that should be cleaned too from time to time. - All of that cleaning tasks can be done with @ref{nncp-rm} utility. + All of that cleaning tasks can be done with @command{@ref{nncp-rm}} utility. + @cindex shared spool + @cindex setgid + @pindex umask @anchor{Shared spool} If you want to share single spool directory with multiple grouped Unix users, then you can @command{setgid} it and assure that umask @@ -47,6 +51,7 @@ @item @ref{Log} file, for example @file{/var/spool/nncp/log}. It should be rotated. Choose you own preferable way to do it. + @pindex newsyslog Example @url{https://www.newsyslog.org/manual.html, newsyslog}'s entry: @example /var/spool/nncp/log 644 7 100 * BCYN @@ -54,17 +59,21 @@ @end example @item Optional @ref{CfgIncoming, incoming} directories where uploaded - files are stored. Probably you want to run @ref{nncp-reass} from - time to time to reassemble all chunked uploads. Example crontab + files are stored. Probably you want to run @command{@ref{nncp-reass}} + from time to time to reassemble all chunked uploads. Example crontab entry: @example */1 * * * * nncp-reass -all -noprogress @end example +@pindex daemontools +@pindex supervise +@pindex multilog @item - Possibly long running @ref{nncp-daemon}, @ref{nncp-caller}, - @ref{nncp-toss}, @ref{nncp-check} daemons. As all software, they can + Possibly long running @command{@ref{nncp-daemon}}, + @command{@ref{nncp-caller}}, @command{@ref{nncp-toss}}, + @command{@ref{nncp-check}} daemons. As all software, they can fail and you should place them under some supervisor control. For example you can use @url{http://cr.yp.to/daemontools.html, @@ -90,14 +99,17 @@ # chmod -R 755 /var/service/.nncp-toss # mv /var/service/.nncp-toss /var/service/nncp-toss @end example +@pindex inetd @item - @ref{nncp-daemon} can also be run as + @command{@ref{nncp-daemon}} can also be run as @url{https://en.wikipedia.org/wiki/Inetd, inetd} service on UUCP's port: @example uucp stream tcp6 nowait nncpuser /usr/local/bin/nncp-daemon nncp-daemon -quiet -ucspi @end example +@cindex UCSPI +@pindex tcpserver @item Or it can be also run as a @command{daemontools} daemon under @url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP}. In the example diff --git a/doc/building.texi b/doc/building.texi index 528dd5653a43168cf9ccc42848677de81dfb1d642c56855e924c71a1e2afd5c0..d677c1b52e361b18c2e53015e45f698878fdd5cf4384ad073b5897af1da41b06 100644 --- a/doc/building.texi +++ b/doc/building.texi @@ -1,4 +1,5 @@ @node Build-instructions +@cindex building @section Build instructions Make sure that Go is installed. For example to install it from packages: @@ -19,12 +20,19 @@ $ cd nncp-@value{VERSION} $ redo all @end example +@pindex info After that you should get various @command{bin/nncp-*} binaries and @command{bin/hjson-cli} command (only for your convenience, not necessary installation). For example, documentation for @command{nncp-bundle} command can be get with @command{info doc/nncp.info -n nncp-bundle}. +@pindex redo +@pindex apenwarr/redo +@pindex apenwarr/do +@pindex redo-c +@pindex baredo +@pindex goredo It uses @url{http://cr.yp.to/redo.html, redo} build system for that examples. You can use one of its various implementations, or at least minimalistic POSIX shell @command{contrib/do} (just replace @@ -35,13 +43,46 @@ @url{https://redo.readthedocs.io/, apenwarr/redo} (@code{contrib/do} is from that project), @url{https://github.com/leahneukirchen/redo-c, redo-c}, @url{https://github.com/gotroyb127/baredo, baredo}. -There is @command{install} target respecting @env{$DESTDIR}. It will -install binaries and info-documentation: +@vindex PREFIX +@vindex DESTDIR +@vindex GO +@vindex MAKEINFO +@vindex PLANTUML +@vindex PREFIX +@vindex SENDMAIL +@vindex CFGPATH +@vindex SPOOLPATH +@vindex LOGPATH +@vindex BINDIR +@vindex INFODIR +@vindex DOCDIR +@file{config} file contains some environment variables that are +respected during installation: +@env{$PREFIX}, +@env{$DESTDIR}, +@env{$GO}, +@env{$MAKEINFO}, +@env{$PLANTUML}, +@env{$PREFIX}, +@env{$SENDMAIL}, +@env{$CFGPATH}, +@env{$SPOOLPATH}, +@env{$LOGPATH}, +@env{$BINDIR}, +@env{$INFODIR}, +@env{$DOCDIR}. + +There is @command{install} target for binaries and info-documentation +installation: @example # PREFIX=/usr/local redo install @end example +@vindex nofsnotify +@cindex kqueue +@cindex epoll +@vindex GO_CFLAGS NNCP depends on @code{github.com/fsnotify/fsnotify} library, that is solely relies on OS-specific mechanisms. There is possibility that you have either broken or unsupported ones. You can still build NNCP with @@ -49,7 +90,8 @@ @code{-tags nofsnotify} build option, to skip @code{fsnotify} library usage at all: @example -$ GO_CFLAGS="-tags nofsnotify" redo ... +$ GO_CFLAGS="-tags nofsnotify" redo @dots{} @end example +@vindex noyggdrasil You can also disable Yggdrasil support with @code{-tags noyggdrasil}. diff --git a/doc/bundles.texi b/doc/bundles.texi index 8ded7fd2d229f180dea380e649eb098b67d0e2beeae953e98a67440dbe422d1c..90fcf3561f7f98be52294cb7f3c786a745940f6935534c3e9a203f6b966d4f52 100644 --- a/doc/bundles.texi +++ b/doc/bundles.texi @@ -1,17 +1,20 @@ @node Bundles +@cindex bundles +@cindex tapes +@cindex streaming media @unnumbered Bundles -Usual @ref{nncp-xfer} command requires filesystem it can operate on. -That presumes random access media storage usage, like hard drives, USB -flash drives and similar. But media like CD-ROM and especially tape -drives are sequential by nature. You can prepare intermediate directory -for recording to CD-ROM disc/tape, but that requires additional storage -and is inconvenient. +Usual @command{@ref{nncp-xfer}} command requires filesystem it can +operate on. That presumes random access media storage usage, like hard +drives, USB flash drives and similar. But media like CD-ROM and +especially tape drives are sequential by nature. You can prepare +intermediate directory for recording to CD-ROM disc/tape, but that +requires additional storage and is inconvenient. -Bundles, created with @ref{nncp-bundle} command are convenient -alternative to ordinary @command{nncp-xfer}. Bundle is just a collection -of @ref{Encrypted, encrypted packets}, stream of packets. It could be -sequentially streamed for recording and digested back. +Bundles, created with @command{@ref{nncp-bundle}} command are convenient +alternative to ordinary @command{@ref{nncp-xfer}}. Bundle is just a +collection of @ref{Encrypted, encrypted packets}, stream of packets. It +could be sequentially streamed for recording and digested back. @itemize @@ -48,8 +51,11 @@ can contain mix of various recipients. @end itemize +@pindex pax +@pindex tar Technically bundle is valid POSIX.1-2001 @url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_01, pax archive} with directory/files hierarchy identical to that is used in -@ref{nncp-xfer}: @file{NNCP/RECIPIENT/SENDER/PACKET}. So bundle can also -be created by manual tar-ing of @command{nncp-xfer} resulting directory. +@command{@ref{nncp-xfer}}: @file{NNCP/RECIPIENT/SENDER/PACKET}. +So bundle can also be created by manual tar-ing of +@command{@ref{nncp-xfer}} resulting directory. diff --git a/doc/call.texi b/doc/call.texi index e2e3d241106f645fd0ab7192fcf25b03efac05738a1425e0ad0e1a41cdbfe776..8b1a8e02404f6d429112b47eabb8b142b4eb8cd0bfe1cf14b9ac0595eeb768c1 100644 --- a/doc/call.texi +++ b/doc/call.texi @@ -1,7 +1,9 @@ @node Call +@cindex call +@vindex calls @unnumbered Call configuration -Call is a rule when and how node can be called by @ref{nncp-caller}. +Call is a rule when and how node can be called by @command{@ref{nncp-caller}}. Example list of call structures: @@ -51,17 +53,23 @@ It contains the following fields (only @emph{cron} is required): @table @emph +@vindex cron @item cron @include cronexpr.texi +@vindex nice @item nice Optional. Use that @ref{Niceness, niceness} during the call (255 is used otherwise). +@vindex xx +@vindex rx +@vindex tx @item xx Optional. Either @verb{|rx|} or @verb{|tx|}. Tells only to either to receive or to transmit data during that call. +@vindex addr @item addr Optional. Call only that address, instead of trying all from @ref{CfgAddrs, @emph{addrs}} configuration option. It can be either key @@ -79,11 +87,13 @@ @item maxonlinetime Optional. Override @ref{CfgMaxOnlineTime, @emph{maxonlinetime}} configuration option when calling. +@vindex autotoss @item autotoss, -doseen, -nofile, -nofreq, -noexec, -notrns Optionally enable auto tossing: run tosser on node's spool every second during the call. You can control either are @file{seen/} files must be created, or skip any kind of packet processing. +@vindex when-tx-exists @item when-tx-exists Call only if packets for sending exists. The check of outbound packets existence is performed @strong{every} time we are going to make a call, @@ -91,16 +101,19 @@ but @emph{when-tx-exists} does not influence @emph{cron}. When @emph{cron} configuration decides that it is time to make a call, with @emph{when-tx-exists} option it checks packets existence first. +@vindex nock @anchor{CfgNoCK} @item nock NoCK (no-checksumming) tells not to do checksumming of received files, -assuming that it will be done for example with @ref{nncp-check} command -later. That can help minimizing time spent online, because HDD won't do -simultaneous reading of the data for checksumming and writing of the -received one, but just sequential writing of the file. Pay attention -that you have to make a call to remote node after checksumming is done, -to send notification about successful packet reception. +assuming that it will be done for example with +@command{@ref{nncp-check}} command later. That can help minimizing time +spent online, because HDD won't do simultaneous reading of the data for +checksumming and writing of the received one, but just sequential +writing of the file. Pay attention that you have to make a call to +remote node after checksumming is done, to send notification about +successful packet reception. +@vindex mcd-ignore @anchor{CfgMCDIgnore} @item mcd-ignore Ignore @ref{MCD} announcements: do not add MCD addresses for possible diff --git a/doc/cfg/areas.texi b/doc/cfg/areas.texi index 96a6e60a7d2483eb72623d2c617a9838f836a6e43f61d8a324871004b53cd207..94eeaf2d1349b84904cab831aeacff737471416e6a4cd5078b98c499b2b5f25f 100644 --- a/doc/cfg/areas.texi +++ b/doc/cfg/areas.texi @@ -1,4 +1,5 @@ @node CfgAreas +@vindex areas @section Configuration areas options @ref{Multicast} areas configuration only used with multicast packets. @@ -36,6 +37,7 @@ The only required field is the @code{id}. You can not process multicast packets that has unknown area identification. +@vindex subs @code{subs} contains a list of recipients you must relay incoming multicast packet on. diff --git a/doc/cfg/dir.texi b/doc/cfg/dir.texi index 4e9939fc0a4c760ed31495016d43ffb02e069ed176849df2f53462e6456be2fc..29b90dbf0fc53fa1372ba5abadbc11c58fa59399279140bc387d5048401203e0 100644 --- a/doc/cfg/dir.texi +++ b/doc/cfg/dir.texi @@ -1,9 +1,10 @@ @node Configuration directory +@cindex configuration directory @section Configuration directory Optionally you can convert configuration file to the directory layout -with @ref{nncp-cfgdir} command. And vice versa too, of course loosing -the comment lines. Directory layout can looks like that: +with @command{@ref{nncp-cfgdir}} command. And vice versa too, of course +loosing the comment lines. Directory layout can looks like that: @example nncp-cfg-dir @@ -95,8 +96,9 @@ Your @option{-cfg} and @env{$NNCPCFG} could point to that directory, instead of @file{.hjson} file. It will be transparently converted to internal JSON representation. However it can not be encrypted with the -@ref{nncp-cfgenc}. +@command{@ref{nncp-cfgenc}}. +@cindex private keys That layout should be much more machine friendly and scriptable. Each string parameters is stored as a single line plain text file. String arrays are newline-separated plain text files. Dictionaries are diff --git a/doc/cfg/general.texi b/doc/cfg/general.texi index bf50c7535c6b880856e0e3ef7e444d114c05d71162b42cc119bdeda12e278007..a3f1400142fde277081e13814cb3e13f65df01b5d2ea164c981df3aab711a137 100644 --- a/doc/cfg/general.texi +++ b/doc/cfg/general.texi @@ -1,4 +1,5 @@ @node CfgGeneral +@cindex general configuration options @section Configuration general options Those options are in the root of configuration dictionary. @@ -26,8 +27,13 @@ } @end verbatim @table @code + +@vindex spool @item spool Absolute path to the @ref{Spool, spool} directory. + +@vindex log +@vindex FD log file descriptor @item log Either: @itemize @@ -35,36 +41,49 @@ @item absolute path to the @ref{Log, log} file @item @code{FD:XXX}, where @code{XXX} is a decimal file descriptor to write records too @end itemize + +@vindex umask @item umask Will force all invoked commands to override their umask to specified octal mask. Useful for using with @ref{Shared spool, shared spool directories}. + +@vindex noprogress @item noprogress When enabled, disables progress showing for many commands by default. You can always force its showing with @option{-progress} command line option anyway. + +@vindex nohdr @anchor{CfgNoHdr} @item nohdr @strong{nohdr} option disables @ref{HdrFile, @file{hdr/}} files usage. + @end table And optional @ref{MCD, MultiCast Discovery} options: @table @code + +@vindex mcd-listen @anchor{CfgMCDListen} @item mcd-listen Specifies list of network interfaces regular expression -@ref{nncp-caller} will listen for incoming @ref{MCD} announcements. +@command{@ref{nncp-caller}} will listen for incoming @ref{MCD} announcements. + +@vindex mcd-send @anchor{CfgMCDSend} @item mcd-send Specifies list of network interfaces regular expressions, and intervals -in seconds, where @ref{nncp-daemon} will send @ref{MCD} announcements. +in seconds, where @command{@ref{nncp-daemon}} will send @ref{MCD} announcements. + @end table +@cindex yggdrasil aliases @anchor{CfgYggdrasilAliases} Optional @ref{Yggdrasil}-related aliases are used for convenience and keeping private keys away being used directly in command line. Each @code{PUB}, @code{PRV}, @code{PEER}, @code{BIND} value in -@ref{nncp-daemon}'s @option{-yggdrasil} and in @code{yggdrasil:} +@command{@ref{nncp-daemon}}'s @option{-yggdrasil} and in @code{yggdrasil:} addresses is replaced with alias value. Moreover each entry in list of @code{PUB}s, @code{PEER}s and @code{BIND} can be an alias too. Pay attention, that all aliases ending with @code{prv} will be saved with diff --git a/doc/cfg/index.texi b/doc/cfg/index.texi index 7fd71d72c999a99349fe968f909b4216411667b8e731c4b6268de1c6a320c868..0a4775805686af8659704c5ad3cd815baf7b4ed3607e70c25541a2115c01822b 100644 --- a/doc/cfg/index.texi +++ b/doc/cfg/index.texi @@ -1,9 +1,11 @@ @node Configuration +@cindex configuration file @unnumbered Configuration file +@cindex Hjson NNCP uses single file configuration file in @url{https://hjson.org/, Hjson} format (see also section about @ref{Configuration directory, -directory layout}) . Initially it is created with @ref{nncp-cfgnew} +directory layout}) . Initially it is created with @command{@ref{nncp-cfgnew}} command and at minimum it can look like this: @verbatim @@ -30,6 +32,10 @@ } } @end verbatim +@cindex JSON +@pindex hjson-cli +@pindex gojq +@pindex gjo Do not forget that Hjson can be safely converted to JSON and vice versa (loosing formatting and comments of course). By default @command{hjson-cli} utility from @code{github.com/hjson/hjson-go} is diff --git a/doc/cfg/neigh.texi b/doc/cfg/neigh.texi index 54d3628a74413d85d2803e3185a61b51a7c3f58bbd68ca696a16d792df5530c7..4f0005aacb9687846665dc9833617326a16a9f454013693508709d2d883d1af2 100644 --- a/doc/cfg/neigh.texi +++ b/doc/cfg/neigh.texi @@ -1,6 +1,8 @@ @node CfgNeigh +@cindex neighbour configuration options @section Configuration neighbour options +@vindex neigh @strong{neigh} section contains all known neighbours information. It always has @strong{self} neighbour that is copy of our node's public data (public keys). It is useful for copy-paste sharing with your @@ -65,8 +67,10 @@ @item noisepub If present, then node can be online called using @ref{Sync, synchronization protocol}. Contains authentication public key. +@vindex exec +@pindex sendmail @anchor{CfgExec} - @item exec +@item exec Dictionary consisting of handles and corresponding command line arguments. In example above there are @command{sendmail} handles, @command{warcer}, @command{wgeter} and @command{flag} one. Remote @@ -87,11 +91,13 @@ feeding @verb{|hello world\n|} to that started @command{sendmail} process. +@vindex incoming @anchor{CfgIncoming} @item incoming Full path to directory where all file uploads will be saved. May be omitted to forbid file uploading on that node. +@vindex freq @anchor{CfgFreq} @item freq @table @code @@ -108,6 +114,7 @@ If set, then apply @ref{OptMinSize, -minsize} option during file transmission. @end table +@vindex via @anchor{CfgVia} @item via An array of node identifiers that will be used as a relay to that @@ -116,11 +123,12 @@ current node by transitioning through @code{foo} and then @code{bar} nodes. May be omitted if direct connection exists and no relaying is required. +@vindex addrs @anchor{CfgAddrs} @item addrs Dictionary containing known network addresses of the node. Each key is human-readable name of the address. For direct TCP connections - use @verb{|host:port|} format, pointing to @ref{nncp-daemon}'s + use @verb{|host:port|} format, pointing to @command{@ref{nncp-daemon}}'s listening instance. Also you can pipe connection through the external command using @@ -128,12 +136,14 @@ @verb{#|some command#} format. @code{/bin/sh -c "some command"} will start and its @code{stdin}/@code{stdout} used as a connection. To use @ref{Yggdrasil} network for connectivity, use - @verb{|yggdrasil:PUB;PRV;PEER[,...]|} format, read about + @code{yggdrasil:PUB;PRV;PEER[,@dots{}]} format, read about @ref{CfgYggdrasilAliases, possible aliases} usage. May be omitted if either no direct connection exists, or - @ref{nncp-call} is used with forced address specifying. + @command{@ref{nncp-call}} is used with forced address specifying. +@vindex rxrate +@vindex txrate @anchor{CfgXxRate} @item rxrate/txrate If greater than zero, then at most *rate packets per second will be @@ -141,6 +151,7 @@ sent/received after the handshake. It could be used as crude bandwidth traffic shaper: each packet has at most 64 KiB payload size. If omitted -- no rate limits. +@vindex onlinedeadline @anchor{CfgOnlineDeadline} @item onlinedeadline Online connection deadline of nodes inactivity in seconds. It is the @@ -151,6 +162,7 @@ values to keep connection alive (to reduce handshake overhead and delays), wait for appearing packets ready to send and notifying remote side about their appearance. +@vindex maxonlinetime @anchor{CfgMaxOnlineTime} @item maxonlinetime If greater than zero, then it is maximal time of single connection. @@ -159,6 +171,6 @@ @anchor{CfgCalls} @item calls List of @ref{Call, call configuration}s. - Can be omitted if @ref{nncp-caller} won't be used to call that node. + Can be omitted if @command{@ref{nncp-caller}} won't be used to call that node. @end table diff --git a/doc/cfg/notify.texi b/doc/cfg/notify.texi index f88ac1615d7fec2e3044f62947c13cae40fab6414d782d3280b22550f27f5f3f..b08d87ffe27f4a47fb5f11bca68de20f1066682c5de12442ecdcf947c5e762d6 100644 --- a/doc/cfg/notify.texi +++ b/doc/cfg/notify.texi @@ -1,4 +1,7 @@ @node CfgNotify +@cindex email notification +@cindex notification configuration options +@cindex logging handles @section Configuration notification options That section controls what notifications are enabled and how must be diff --git a/doc/cfg/self.texi b/doc/cfg/self.texi index 7d9ca29e6a8d768f475550b7fa31e5c2413ba22e0db1f030bc92baac47150e4e..0d56e2c9f2311d0d4dbf2979668c8634890f37788d2f17b3dbffff0c279648d6 100644 --- a/doc/cfg/self.texi +++ b/doc/cfg/self.texi @@ -1,10 +1,18 @@ @node CfgSelf +@cindex self-node configuration keypairs @section Configuration self-node keypairs @strong{self} section contains our node's private keypairs. +@vindex ExchPrv +@vindex ExchPub +@vindex SignPrv +@vindex SignPub @strong{exch*} and @strong{sign*} are used during @ref{Encrypted, encrypted} packet creation. +@vindex NoisePrv +@vindex NoisePub @strong{noise*} are used during @ref{Sync, synchronization protocol} -working in @ref{nncp-call}, @ref{nncp-caller}, @ref{nncp-daemon}. +working in @command{@ref{nncp-call}}, @command{@ref{nncp-caller}}, +@command{@ref{nncp-daemon}}. diff --git a/doc/chunked.texi b/doc/chunked.texi index 5019c02504e2e4e2631bb448bd2b8d9f5a973b321f08324f6898105a11d46b84..5de278f1622bbee74319688f0b324dbf11efeef5c63b174d6ab7980a9438ccdb 100644 --- a/doc/chunked.texi +++ b/doc/chunked.texi @@ -1,4 +1,5 @@ @node Chunked +@cindex chunked @unnumbered Chunked files There is ability to transfer huge files with dividing them into smaller @@ -10,9 +11,11 @@ than huge file's size. You can transfer those chunks on different storage devices, and/or at different time, reassembling the whole packet on the destination node. -Splitting is done with @ref{nncp-file, nncp-file -chunked} command and -reassembling with @ref{nncp-reass} command. +Splitting is done with @command{@ref{nncp-file} -chunked} command and +reassembling with @command{@ref{nncp-reass}} command. +@vindex .nncp.meta +@vindex .nncp.chunk Chunked @file{FILE} produces @file{FILE.nncp.meta}, @file{FILE.nncp.chunk0}, @file{FILE.nncp.chunk1}, @dots{} files. All @file{.nncp.chunkXXX} can be concatenated together to produce original @@ -44,6 +47,7 @@ variable length array of 32 byte fixed length opaque data @tab @ref{MTH} checksum of each chunk @end multitable +@cindex ZFS recordsize @anchor{ChunkedZFS} It is strongly advisable to reassemble incoming chunked files on @url{https://en.wikipedia.org/wiki/ZFS, ZFS} dataset with deduplication diff --git a/doc/cmd/index.texi b/doc/cmd/index.texi index cfb5156c56efa0b7b43446de63d68dc7aacb014613a712ad457ed90f0e2d0be9..0b8f30360136a1c4df93d5a704045d7f7520df5d9662a0fa8cba21c066b8acde 100644 --- a/doc/cmd/index.texi +++ b/doc/cmd/index.texi @@ -1,9 +1,11 @@ @node Commands +@cindex commands @unnumbered Commands Nearly all commands have the following common options: @table @option +@vindex NNCPCFG @item -cfg Path to configuration file. May be overridden by @env{$NNCPCFG} environment variable. If file file is an encrypted @ref{EBlob, @@ -24,16 +26,18 @@ @item -via Override @ref{CfgVia, via} configuration option for destination node. Specified nodes must be separated with comma: @verb{|NODE1,NODE2|}. With @verb{|-via -|} you can disable relaying at all. +@vindex NNCPSPOOL @item -spool Override path to spool directory. May be specified by @env{$NNCPSPOOL} environment variable. +@vindex NNCPLOG @item -log Override path to logfile. May be specified by @env{$NNCPLOG} environment variable. @item -quiet Print only errors, omit simple informational messages. In any case those messages are logged, so you can reread them using - @ref{nncp-log} command. + @command{@ref{nncp-log}} command. @item -progress, -noprogress Either force progress showing, or disable it. @item -version @@ -42,6 +46,15 @@ @item -warranty Print warranty information (no warranty). @end table +@vindex TMPDIR +All commands respect @env{$TMPDIR} environment variable. + +@vindex NNCPNOSYNC +If you set @env{$NNCPNOSYNC=1}, then all @code{fsync} operations will be +skipped. That is dangerous option, but if there there are abilities to +rollback possibly corrupted state to some stable snapshot, then disabled +@code{fsync} can give considerable increase in performance. + @menu Configuration file commands @@ -56,6 +69,7 @@ * nncp-file:: * nncp-exec:: * nncp-freq:: * nncp-trns:: +* nncp-ack:: Packets sharing commands @@ -92,6 +106,7 @@ @include cmd/nncp-file.texi @include cmd/nncp-exec.texi @include cmd/nncp-freq.texi @include cmd/nncp-trns.texi +@include cmd/nncp-ack.texi @include cmd/nncp-xfer.texi @include cmd/nncp-bundle.texi @include cmd/nncp-toss.texi diff --git a/doc/cmd/nncp-ack.texi b/doc/cmd/nncp-ack.texi new file mode 100644 index 0000000000000000000000000000000000000000..45dcb9bada403d6a052584ca6c34811c3d841d63a06d691c5eaec6ed71e27921 --- /dev/null +++ b/doc/cmd/nncp-ack.texi @@ -0,0 +1,63 @@ +@node nncp-ack +@cindex packet acknowledgement +@pindex nncp-ack +@section nncp-ack + +@example +$ nncp-ack [options] -all +$ nncp-ack [options] -node NODE[,@dots{}] +$ nncp-ack [options] -node NODE -pkt PKT +@end example + +Send acknowledgement of successful @option{PKT} (Base32-encoded hash) +packet receipt from @option{NODE} node. If no @option{-pkt} is +specified, then acknowledge all packet in node's @code{rx} outbound +spool. If @option{-all} is specified, then do that for all nodes. + +General workflow with acknowledgement is following, assuming that +Alice has some outbound packets for Bob: + +@itemize + +@item Transfer encrypted packets, without deleting them locally: + +@example +alice$ nncp-xfer -keep -tx -node bob /mnt/shared +@end example + +@item On Bob's side retrieve those packets: + +@example +bob$ nncp-xfer -rx /mnt/shared +@end example + +That will also check if copied packets checksum is not mismatched. + +@item Create ACK packets of received ones: + +@example +bob$ nncp-ack -node alice +@end example + +@item Send those newly created packets back to Alice: + +@example +bob$ nncp-xfer -tx /mnt/shared +@end example + +@item Get those acknowledgement packets and @ref{nncp-toss, toss} them: + +@example +alice$ nncp-xfer -rx /mnt/shared +alice$ nncp-toss +@end example + +Each ACK packet will remove kept corresponding outbound packets, because +Bob explicitly confirmed their receipt. + +@end itemize + +Similarly you can use it with @command{@ref{nncp-bundle}}, but do not +forget that by default it does not do checksumming of the packets, so +you should either use its @option{-check} option, or run +@command{@ref{nncp-check}} after. diff --git a/doc/cmd/nncp-bundle.texi b/doc/cmd/nncp-bundle.texi index 7820f41fab1e0be2666db5c768c7075e03f38f3d77fee8beea41fb738c9ce9b4..ee26b90cc411c2b19bcc891db3709027a31cc052570a47da91d08d0fc13916d1 100644 --- a/doc/cmd/nncp-bundle.texi +++ b/doc/cmd/nncp-bundle.texi @@ -1,10 +1,11 @@ @node nncp-bundle +@pindex nncp-bundle @section nncp-bundle @example -$ nncp-bundle [options] -tx [-delete] NODE [NODE @dots{}] > ... -$ nncp-bundle [options] -rx -delete [-dryrun] [NODE @dots{}] < ... -$ nncp-bundle [options] -rx [-check] [-dryrun] [NODE @dots{}] < ... +$ nncp-bundle [options] -tx [-delete] NODE [NODE @dots{}] > @dots{} +$ nncp-bundle [options] -rx -delete [-dryrun] [NODE @dots{}] < @dots{} +$ nncp-bundle [options] -rx [-check] [-dryrun] [NODE @dots{}] < @dots{} @end example With @option{-tx} option, this command creates @ref{Bundles, bundle} of @@ -17,8 +18,8 @@ attention that @strong{no} integrity checking is done by default. Modern tape drives could easily provide too much throughput your CPU won't be able to verify on the fly. So if you won't @ref{nncp-toss, toss} received packets at the place, it is advisable either to run -@ref{nncp-check} utility for packets integrity verification, or to use -@option{-check} option to enable on the fly integrity check. +@command{@ref{nncp-check}} utility for packets integrity verification, +or to use @option{-check} option to enable on the fly integrity check. You can specify multiple @option{NODE} arguments, telling for what nodes you want to create the stream, or take it from. If no nodes are diff --git a/doc/cmd/nncp-call.texi b/doc/cmd/nncp-call.texi index 850d2d4fd450e66107ddebf2de5c55b0de1cec44da928554b5ccb296ef51f94f..a39e1823309043a67b1151c5ad3cfeda36bd9e88cb1935031cffe196fb7fb294 100644 --- a/doc/cmd/nncp-call.texi +++ b/doc/cmd/nncp-call.texi @@ -1,4 +1,5 @@ @node nncp-call +@pindex nncp-call @section nncp-call @example @@ -43,10 +44,10 @@ not specify the exact one, then all will be tried until the first success. Optionally you can force @option{FORCEADDR} address usage, instead of addresses taken from configuration file. You can specify @verb{|host:port|}, @verb{#|some command#} and -@verb{|yggdrasil:PUB;PRV;PEER[,...]|} formats. +@code{yggdrasil:PUB;PRV;PEER[,@dots{}]} formats. If you specify @option{-ucspi} option, then it is assumed that you run -@command{nncp-call} command under some UCSPI-TCP compatible utility, +@command{@ref{nncp-call}} command under some UCSPI-TCP compatible utility, that provides read/write channels through 6/7 file descriptors. @option{-mcd-wait} options tells to wait up to specified number of @@ -55,7 +56,7 @@ the packet is received, initiate a call. @option{-autotoss} option runs tosser on node's spool every second during the call. All @option{-autotoss-*} options is the same as in -@ref{nncp-toss} command. +@command{@ref{nncp-toss}} command. Partly downloaded packets are stored in @file{.part} files. By default all downloaded files are sequentially checksummed in the background, @@ -64,8 +65,8 @@ option is set, then no checksumming is done, renaming fully downloaded files to @file{.nock} extension. Pay attention that checksumming can be time consuming and connection could be lost during that check, so remote node won't be notified that the file is finished. If you run -@ref{nncp-check, @command{nncp-check -nock}}, that will checksum files -and strip the @file{.nock} extension, then repeated call to remote node -will notify about packet's completion. Also it will be notified if -@ref{nncp-toss, tossing} created @file{seen/} file. -Read @ref{CfgNoCK, more} about @option{-nock} option. +@command{@ref{nncp-check} -nock}, that will checksum files and strip the +@file{.nock} extension, then repeated call to remote node will notify about +packet's completion. Also it will be notified if @ref{nncp-toss, tossing} +created @file{seen/} file. Read @ref{CfgNoCK, more} about @option{-nock} +option. diff --git a/doc/cmd/nncp-caller.texi b/doc/cmd/nncp-caller.texi index 8c5efc05aaf665e00eafdb125d5d736de18841b9aad2eb2e9262f87e14f68093..0d456ee83f7bd53b2829f2e53c3c136396980237ae91254533c33bd5e9c81fca 100644 --- a/doc/cmd/nncp-caller.texi +++ b/doc/cmd/nncp-caller.texi @@ -1,4 +1,5 @@ @node nncp-caller +@pindex nncp-caller @section nncp-caller @example @@ -12,4 +13,4 @@ Optional number of @option{NODE}s tells to ignore other ones. Otherwise all nodes with specified @emph{calls} configuration field will be called. -Look at @ref{nncp-call} for more information. +Look at @command{@ref{nncp-call}} for more information. diff --git a/doc/cmd/nncp-cfgdir.texi b/doc/cmd/nncp-cfgdir.texi index 54eab0ae26c5401e8429c6291a0c62ad09ef0850c0616ed6f57e34787072a9d4..b6892fd4856d378dc4a68eb1f451a4db4abdad92831efc6d50dae245b372d4a9 100644 --- a/doc/cmd/nncp-cfgdir.texi +++ b/doc/cmd/nncp-cfgdir.texi @@ -1,4 +1,5 @@ @node nncp-cfgdir +@pindex nncp-cfgdir @section nncp-cfgdir @example diff --git a/doc/cmd/nncp-cfgenc.texi b/doc/cmd/nncp-cfgenc.texi index 285be3e5a8c2931c0c86be173fd513e2110c4f111246b7c49345eee824e98276..be3e66f7eb316c5c3589178f77315dbb8f2460def3233dcb803842701dc17f3e 100644 --- a/doc/cmd/nncp-cfgenc.texi +++ b/doc/cmd/nncp-cfgenc.texi @@ -1,4 +1,5 @@ @node nncp-cfgenc +@pindex nncp-cfgenc @section nncp-cfgenc @example diff --git a/doc/cmd/nncp-cfgmin.texi b/doc/cmd/nncp-cfgmin.texi index 743d07e9d43dd50af5ad45b0c515a13ad0420a59612ef9d50366786835cee419..9b69ed9733d7166ed4bed19c7faaf063426c0bd3ce418f1439a74390bb77fae2 100644 --- a/doc/cmd/nncp-cfgmin.texi +++ b/doc/cmd/nncp-cfgmin.texi @@ -1,4 +1,7 @@ @node nncp-cfgmin +@cindex stripped configuration +@cindex minimized configuration +@pindex nncp-cfgmin @section nncp-cfgmin @example @@ -7,5 +10,5 @@ @end example Print out stripped configuration version: only path to @ref{Spool, spool}, path to log file, neighbours public keys are stayed. This is -useful mainly for usage with @ref{nncp-xfer} that has to know only -neighbours, without private keys involving. +useful mainly for usage with @command{@ref{nncp-xfer}} that has to know +only neighbours, without private keys involving. diff --git a/doc/cmd/nncp-cfgnew.texi b/doc/cmd/nncp-cfgnew.texi index 4803fa3b98b8ac20eeb4a0293a8a140758114cc79cbdda1f564ab1a0b878b044..34ce65d11b3d66165e3c0a8eb6a6b244505308c004a104bfe27165ee89c9ad04 100644 --- a/doc/cmd/nncp-cfgnew.texi +++ b/doc/cmd/nncp-cfgnew.texi @@ -1,4 +1,5 @@ @node nncp-cfgnew +@pindex nncp-cfgnew @section nncp-cfgnew @example diff --git a/doc/cmd/nncp-check.texi b/doc/cmd/nncp-check.texi index 490466950f1fcfd3402bc06d5caa2883962ba860e62f9aeb629d69a0493613fe..428e9242d0f2248f659c2019e7a437e61d791d038f5c10f17be28dfd0de8d2ec 100644 --- a/doc/cmd/nncp-check.texi +++ b/doc/cmd/nncp-check.texi @@ -1,4 +1,5 @@ @node nncp-check +@pindex nncp-check @section nncp-check @example diff --git a/doc/cmd/nncp-cronexpr.texi b/doc/cmd/nncp-cronexpr.texi index a7b538263efa9b7142b2009ee9695de3302423c0c0006b441995d4d4a7365b12..993679dcfc832f409ce582df3f0d625b8756acc00b4e82a3df2d9213659a9a7f 100644 --- a/doc/cmd/nncp-cronexpr.texi +++ b/doc/cmd/nncp-cronexpr.texi @@ -1,4 +1,5 @@ @node nncp-cronexpr +@pindex nncp-cronexpr @section nncp-cronexpr @example diff --git a/doc/cmd/nncp-daemon.texi b/doc/cmd/nncp-daemon.texi index 072132faae6bd7bc8926838969343a1e20925117c2970347c15a1acbabbde9e3..712e4b35d7c321cf70c1aae2ae9fa35e6932240a01a3780e4e170eaceaddbcdb 100644 --- a/doc/cmd/nncp-daemon.texi +++ b/doc/cmd/nncp-daemon.texi @@ -1,4 +1,5 @@ @node nncp-daemon +@pindex nncp-daemon @section nncp-daemon @example @@ -10,8 +11,8 @@ @end example Start listening TCP daemon, wait for incoming connections and run @ref{Sync, synchronization protocol} with each of them. You can run -@ref{nncp-toss} utility in background to process inbound packets from -time to time. +@command{@ref{nncp-toss}} utility in background to process inbound +packets from time to time. @option{-maxconn} option specifies how many simultaneous clients daemon can handle. @option{-bind} option specifies @option{addr:port} it must @@ -36,7 +37,7 @@ @end verbatim @option{-autotoss} option runs tosser on node's spool every second during the call. All @option{-autotoss-*} options is the same as in -@ref{nncp-toss} command. +@command{@ref{nncp-toss}} command. Read @ref{CfgNoCK, more} about @option{-nock} option. diff --git a/doc/cmd/nncp-exec.texi b/doc/cmd/nncp-exec.texi index e81e03f6eeb1de9ee47af5d1dcd93c522b68f118130db1a96a8c5d033e26cead..f1938e2e672882388b289bcf92a0c3e668388cad2646500afeec96dc0384c1a5 100644 --- a/doc/cmd/nncp-exec.texi +++ b/doc/cmd/nncp-exec.texi @@ -1,4 +1,5 @@ @node nncp-exec +@pindex nncp-exec @section nncp-exec @example @@ -22,6 +23,9 @@ appender: ["/bin/sh", "-c", "cat >> /append"] } @end verbatim +@vindex NNCP_SELF +@vindex NNCP_SENDER +@vindex NNCP_NICE then executing @verb{|echo My message | nncp-exec -replynice 123 REMOTE sendmail root@localhost|} will lead to execution of: diff --git a/doc/cmd/nncp-file.texi b/doc/cmd/nncp-file.texi index bc7774d74082332fe69d8cd4a058c5ab0fb59e09763796647d976edc5dc4d1e3..0aabe7d0f9109193779c58a1537d602a91648da64c3197409811863db2b00095 100644 --- a/doc/cmd/nncp-file.texi +++ b/doc/cmd/nncp-file.texi @@ -1,4 +1,5 @@ @node nncp-file +@pindex nncp-file @section nncp-file @example diff --git a/doc/cmd/nncp-freq.texi b/doc/cmd/nncp-freq.texi index 83f13bb540ee6319d0fbdd2864cb32d829d7e75d8f06fec1731be05772d305da..cb114b99316148af6fcd948a588b5b9ac0a6df6bffa1f6f79a086b9cb0cc47d9 100644 --- a/doc/cmd/nncp-freq.texi +++ b/doc/cmd/nncp-freq.texi @@ -1,4 +1,5 @@ @node nncp-freq +@pindex nncp-freq @section nncp-freq @example diff --git a/doc/cmd/nncp-hash.texi b/doc/cmd/nncp-hash.texi index 509ef821339ee2f4421046764fd24215dae71e8e21406be01ecec1b45a1323a7..ad83ba54f99487f89bf288bf4ed6ec54a38865ff06a16a44c2708893714cc596 100644 --- a/doc/cmd/nncp-hash.texi +++ b/doc/cmd/nncp-hash.texi @@ -1,4 +1,5 @@ @node nncp-hash +@pindex nncp-hash @section nncp-hash @example diff --git a/doc/cmd/nncp-log.texi b/doc/cmd/nncp-log.texi index 58ad07b5b88bf293234a6577c2779b709428cfff632cafcad085ae6b37684b2d..8700f58b81925cc81aafa5e760d22bfa3a3c8136555ded178098ba0077cbeb5e 100644 --- a/doc/cmd/nncp-log.texi +++ b/doc/cmd/nncp-log.texi @@ -1,4 +1,5 @@ @node nncp-log +@pindex nncp-log @section nncp-log @example diff --git a/doc/cmd/nncp-pkt.texi b/doc/cmd/nncp-pkt.texi index 4b717e7ea590824b0688fa356f49bb707169483a71a64e939acb9bc4076143a7..49bc83295da8167dcd2cf5f111450dd596827643093107e33a916559c7a14fc2 100644 --- a/doc/cmd/nncp-pkt.texi +++ b/doc/cmd/nncp-pkt.texi @@ -1,4 +1,5 @@ @node nncp-pkt +@pindex nncp-pkt @section nncp-pkt @example @@ -20,7 +21,7 @@ @option{-dump} option outputs plain packet's payload (if it is file transmission, then it will be the file itself as an example). If it is an encrypted packet, then it will be decrypted first, outputing the -included plain packet, that can be fed to @command{nncp-pkt} again: +included plain packet, that can be fed to @command{@ref{nncp-pkt}} again: @example Packet type: plain diff --git a/doc/cmd/nncp-reass.texi b/doc/cmd/nncp-reass.texi index 7cfa57253cda06cd5fead6b44020602e0b8c66b53128087554cb77f3b043954d..04024f3f16ee1245286c957751f086ce5360a447bc7526dd908e5948cc7de981 100644 --- a/doc/cmd/nncp-reass.texi +++ b/doc/cmd/nncp-reass.texi @@ -1,4 +1,5 @@ @node nncp-reass +@pindex nncp-reass @section nncp-reass @example diff --git a/doc/cmd/nncp-rm.texi b/doc/cmd/nncp-rm.texi index 6f433ec08dbd92363bd3c508d8cd283cbe8a4be83a562f4598a247e71bba526b..3ba5dd0eb9c774ad1b677c5ea5dbb523625aafd543dc16a2b437d4ee34772f48 100644 --- a/doc/cmd/nncp-rm.texi +++ b/doc/cmd/nncp-rm.texi @@ -1,4 +1,5 @@ @node nncp-rm +@pindex nncp-rm @section nncp-rm @example @@ -19,7 +20,7 @@ @itemize @item If @option{-tmp} option is specified, then it will delete all temporary files in @file{spool/tmp} directory. Files may stay in it when -commands like @ref{nncp-file} fail for some reason. +commands like @command{@ref{nncp-file}} fail for some reason. @item If @option{-lock} option is specified, then all @file{.lock} files will be deleted in your spool directory. diff --git a/doc/cmd/nncp-stat.texi b/doc/cmd/nncp-stat.texi index 31350aaef9c0a5fed44ed73f681e499d69274a2a423efe496b14dd7ef87d3c49..060f6feda61d77b409b9b985c2f3f69563133f7aa49877a869fc4e19af448f6e 100644 --- a/doc/cmd/nncp-stat.texi +++ b/doc/cmd/nncp-stat.texi @@ -1,4 +1,5 @@ @node nncp-stat +@pindex nncp-stat @section nncp-stat @example diff --git a/doc/cmd/nncp-toss.texi b/doc/cmd/nncp-toss.texi index f5550fc993b01dc6da0a0a6143fc1598bba83db96fa3cd48e83e54dca2bcd1cc..9a7b7369b0046bac35cd02385ce7af1fbc5967004ff20ae603b10837df5bcf08 100644 --- a/doc/cmd/nncp-toss.texi +++ b/doc/cmd/nncp-toss.texi @@ -1,4 +1,5 @@ @node nncp-toss +@pindex nncp-toss @section nncp-toss @example @@ -23,10 +24,11 @@ @option{INT} seconds in an infinite loop. That can be useful when running this command as a daemon. @option{-seen} option creates empty @file{seen/XXX} file after -successful tossing of @file{XXX} packet. @ref{nncp-xfer}, -@ref{nncp-bundle}, @ref{nncp-daemon} and @ref{nncp-call} commands skip -inbound packets that has been already seen, processed and tossed. This -is helpful to prevent duplicates. +successful tossing of @file{XXX} packet. @command{@ref{nncp-xfer}}, +@command{@ref{nncp-bundle}}, @command{@ref{nncp-daemon}} and +@command{@ref{nncp-call}} commands skip inbound packets that has been +already seen, processed and tossed. This is helpful to prevent +duplicates. @option{-nofile}, @option{-nofreq}, @option{-noexec}, @option{-notrns}, @option{-noarea} options allow disabling any kind of packet types processing. diff --git a/doc/cmd/nncp-trns.texi b/doc/cmd/nncp-trns.texi index 855052a0d6b77a46e4bd5f10abef76b7e21c619290ba651fecc6fb48d745b4a7..41d6b4b77d97e56b6b0355f9b87c32883b6da1bbc83775265596541560df2b4f 100644 --- a/doc/cmd/nncp-trns.texi +++ b/doc/cmd/nncp-trns.texi @@ -1,4 +1,5 @@ @node nncp-trns +@pindex nncp-trns @section nncp-trns @example diff --git a/doc/cmd/nncp-xfer.texi b/doc/cmd/nncp-xfer.texi index bcbacb81ec0e3afa0b73eb20cb21c6c6b0ed7de34cd21a8ecb978674cb128103..860a031e351cc3aafc6c887819b16a810d296abb7fcf81508d3bf02d62bfcfc8 100644 --- a/doc/cmd/nncp-xfer.texi +++ b/doc/cmd/nncp-xfer.texi @@ -1,4 +1,5 @@ @node nncp-xfer +@pindex nncp-xfer @section nncp-xfer @example @@ -20,12 +21,12 @@ @option{-rx} option tells only to move inbound packets addressed to us. @option{-tx} option tells exactly the opposite: move only outbound packets. -@ref{nncp-cfgmin} could be useful for creating stripped minimalistic -configuration file version without any private keys. +@command{@ref{nncp-cfgmin}} could be useful for creating stripped +minimalistic configuration file version without any private keys. @file{DIR} directory has the following structure: @file{RECIPIENT/SENDER/PACKET}, where @file{RECIPIENT} is Base32 encoded destination node, @file{SENDER} is Base32 encoded sender node. -Also look for @ref{nncp-bundle}, especially if you deal with CD-ROM and -tape drives. +Also look for @command{@ref{nncp-bundle}}, especially if you deal with +CD-ROM and tape drives. diff --git a/doc/comparison.ru.texi b/doc/comparison.ru.texi index 581e29adce3eedc1619a51de6ac069d22a76fbeda29837f7f24a5575e9e0087f..800e16e5d0e74e7bc92830341c32ff0135404c55425edd1867bf3a365257defe 100644 --- a/doc/comparison.ru.texi +++ b/doc/comparison.ru.texi @@ -10,28 +10,28 @@ @multitable @columnfractions 0.40 0.15 0.15 0.15 0.15 @headitem @tab UUCP @tab FTN @tab NNCP @tab SMTP -@item Простота настройки @tab Средне @tab Сложно @tab Легко @tab Сложно -@item Передача почты @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} -@item Передача новостей @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Передача файлов @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Мультвещательная передача @tab Нет @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Разбиение файлов на части @tab Нет @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Удалённое исполнение команд @tab @strong{Да} @tab Нет @tab @strong{Да} @tab Нет -@item Возобновляемое скачивание @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Приоритезация пакетов @tab @strong{Да} @tab Нет @tab @strong{Да} @tab Нет -@item Сжатие почты @tab Нет @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Интеграция с SMTP @tab @strong{Да} @tab Нет @tab @strong{Да} @tab N/A -@item Push/poll модель @tab @strong{Обе} @tab @strong{Обе} @tab @strong{Обе} @tab Push -@item DTN @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет -@item Предполагаемый размер сети @tab Дюжины @tab Глобально @tab Дюжины @tab Глобально -@item Маршрутизация @tab Ручное/статичное @tab Федеративное @tab Ручное/статичное @tab Федеративное -@item Поддержка телефонной сети @tab @strong{Да} @tab @strong{Да} @tab Возможно @tab Нет -@item Анонимные участники @tab @strong{Да} @tab Нет @tab Нет @tab @strong{Да} -@item Аутентификация участников @tab PAP @tab PAP/CHAP @tab публичный ключ @tab Нет -@item Шифрование пакетов @tab Нет @tab Нет @tab @strong{Да} @tab Нет -@item Приватность метаданных @tab Нет @tab Нет @tab @strong{Да} @tab Нет -@item Проверка целостности пакетов @tab Нет @tab Нет @tab @strong{Да} @tab Нет -@item Дружелюбность к флоппинету @tab Нет @tab Частично @tab @strong{Да} @tab Нет +@item Простота настройки @tab Средне @tab Сложно @tab Легко @tab Сложно +@item Передача почты @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} +@item Передача новостей @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Передача файлов @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Мультвещательная передача @tab Нет @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Разбиение файлов на части @tab Нет @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Удалённое исполнение команд @tab @strong{Да} @tab Нет @tab @strong{Да} @tab Нет +@item Возобновляемое скачивание @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Приоритезация пакетов @tab @strong{Да} @tab Нет @tab @strong{Да} @tab Нет +@item Сжатие почты @tab Нет @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Интеграция с SMTP @tab @strong{Да} @tab Нет @tab @strong{Да} @tab N/A +@item Push/poll модель @tab @strong{Обе} @tab @strong{Обе} @tab @strong{Обе} @tab Push +@item DTN @tab @strong{Да} @tab @strong{Да} @tab @strong{Да} @tab Нет +@item Предполагаемый размер сети @tab Дюжины @tab Глобально @tab Дюжины @tab Глобально +@item Маршрутизация @tab Ручное/статичное @tab Федеративное @tab Ручное/статичное @tab Федеративное +@item Поддержка телефонной сети @tab @strong{Да} @tab @strong{Да} @tab Возможно @tab Нет +@item Анонимные участники @tab @strong{Да} @tab Нет @tab Нет @tab @strong{Да} +@item Аутентификация участников @tab PAP @tab PAP/CHAP @tab публичный ключ @tab Нет +@item Шифрование пакетов @tab Нет @tab Нет @tab @strong{Да} @tab Нет +@item Приватность метаданных @tab Нет @tab Нет @tab @strong{Да} @tab Нет +@item Проверка целостности пакетов @tab Нет @tab Нет @tab @strong{Да} @tab Нет +@item Дружелюбность к флоппинету @tab Нет @tab Частично @tab @strong{Да} @tab Нет @end multitable diff --git a/doc/comparison.texi b/doc/comparison.texi index ef602194c3a3d72e431b28bb67c25053cc95444dfc194bbe503b6b2ecbfda769..734db0e2bf4b53c4604b64acaa08c003a4a8bf86153b85316ced05df1db40785 100644 --- a/doc/comparison.texi +++ b/doc/comparison.texi @@ -1,36 +1,41 @@ @node Comparison +@cindex comparison +@cindex SMTP +@cindex FTN +@cindex FidoNet +@cindex UUCP @unnumbered Comparison with existing solutions Here is comparison with @url{https://en.wikipedia.org/wiki/UUCP, UUCP} -(Unix to Unix copy), FTN (@url{https://en.wikipedia.org/wiki/FidoNet, -FidoNet} Technology Networks) and @url{https://en.wikipedia.org/wiki/SMTP, SMTP} +(Unix to Unix copy), FTN (@url{https://en.wikipedia.org/wiki/FidoNet, FidoNet} +Technology Networks) and @url{https://en.wikipedia.org/wiki/SMTP, SMTP} (because it is also store-and-forward solution). @multitable @columnfractions 0.40 0.15 0.15 0.15 0.15 @headitem @tab UUCP @tab FTN @tab NNCP @tab SMTP -@item Ease of setup @tab Medium @tab Hard @tab Easy @tab Hard -@item Mail transmission @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} -@item News transmission @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No -@item File transmission @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No -@item Multicast transmission @tab No @tab @strong{Yes} @tab @strong{Yes} @tab No -@item Chunked files @tab No @tab @strong{Yes} @tab @strong{Yes} @tab No -@item Remote command execution @tab @strong{Yes} @tab No @tab @strong{Yes} @tab No -@item Resumable downloads @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No -@item Packets prioritizing @tab @strong{Yes} @tab No @tab @strong{Yes} @tab No -@item Mail compression @tab No @tab @strong{Yes} @tab @strong{Yes} @tab No -@item SMTP integration @tab @strong{Yes} @tab No @tab @strong{Yes} @tab N/A -@item Push/poll @tab @strong{Both} @tab @strong{Both} @tab @strong{Both} @tab Push -@item DTN @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No -@item Intended network size @tab Dozens @tab Global @tab Dozens @tab Global -@item Routing @tab Manual/static @tab Federated @tab Manual/static @tab Federated -@item PSTN support @tab @strong{Yes} @tab @strong{Yes} @tab Possible @tab No -@item Anonymous peers @tab @strong{Yes} @tab No @tab No @tab @strong{Yes} -@item Peers authentication @tab PAP @tab PAP/CHAP @tab public-key @tab No -@item Packets encryption @tab No @tab No @tab @strong{Yes} @tab No -@item Metadata privacy @tab No @tab No @tab @strong{Yes} @tab No -@item Packets integrity check @tab No @tab No @tab @strong{Yes} @tab No -@item Sneakernet friendliness @tab No @tab Partially @tab @strong{Yes} @tab No +@item Ease of setup @tab Medium @tab Hard @tab Easy @tab Hard +@item Mail transmission @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} +@item News transmission @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No +@item File transmission @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No +@item Multicast transmission @tab No @tab @strong{Yes} @tab @strong{Yes} @tab No +@item Chunked files @tab No @tab @strong{Yes} @tab @strong{Yes} @tab No +@item Remote command execution @tab @strong{Yes} @tab No @tab @strong{Yes} @tab No +@item Resumable downloads @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No +@item Packets prioritizing @tab @strong{Yes} @tab No @tab @strong{Yes} @tab No +@item Mail compression @tab No @tab @strong{Yes} @tab @strong{Yes} @tab No +@item SMTP integration @tab @strong{Yes} @tab No @tab @strong{Yes} @tab N/A +@item Push/poll @tab @strong{Both} @tab @strong{Both} @tab @strong{Both} @tab Push +@item DTN @tab @strong{Yes} @tab @strong{Yes} @tab @strong{Yes} @tab No +@item Intended network size @tab Dozens @tab Global @tab Dozens @tab Global +@item Routing @tab Manual/static @tab Federated @tab Manual/static @tab Federated +@item PSTN support @tab @strong{Yes} @tab @strong{Yes} @tab Possible @tab No +@item Anonymous peers @tab @strong{Yes} @tab No @tab No @tab @strong{Yes} +@item Peers authentication @tab PAP @tab PAP/CHAP @tab public-key @tab No +@item Packets encryption @tab No @tab No @tab @strong{Yes} @tab No +@item Metadata privacy @tab No @tab No @tab @strong{Yes} @tab No +@item Packets integrity check @tab No @tab No @tab @strong{Yes} @tab No +@item Sneakernet friendliness @tab No @tab Partially @tab @strong{Yes} @tab No @end multitable @@ -87,6 +92,7 @@ @item Routing UUCP and NNCP does not known nothing about routing. You have to explicitly tell how to send (what hops to use) packets to each node. +@cindex PSTN @item PSTN support UUCP and FidoNet always have been working with modems out-of-box. Only many years later they gained support for working over TCP/IP @@ -94,11 +100,15 @@ connections. SMTP works only over TCP/IP. NNCP currently has only TCP daemon, but nothing prohibits using of another 8-bit aware online transport. +@cindex anonymity +@cindex Sybil attack @item Anonymous peers NNCP and FTN are friend-to-friend networks exclusively. This is very secure and mitigates many possible man-in-the-middle (MitM) and @url{https://en.wikipedia.org/wiki/Sybil_attack, Sybil} attacks. +@cindex sneakernet +@cindex floppynet @item Sneakernet friendliness No one, except NNCP, supports data exchanging via removable storages likes flash drives, CD-ROMs, tapes and hard drives out-of-box. It @@ -108,6 +118,7 @@ requires more manual work to do so. @end table +@cindex UUCP commands Also there is @url{https://changelog.complete.org/archives/10165-asynchronous-email-exim-over-nncp-or-uucp, copy of} comparable commands of UUCP and NNCP, just for the interest: @@ -115,29 +126,34 @@ @multitable @columnfractions 0.5 0.25 0.25 @headitem Purpose @tab UUCP @tab NNCP +@pindex uucico +@pindex uupoll +@pindex uux +@pindex uucp +@pindex uuxqt @item Connect to remote system @tab @command{uucico -s}, @command{uupoll} - @tab @command{nncp-call}, @command{nncp-caller} + @tab @command{@ref{nncp-call}}, @command{nncp-caller} @item Receive connection (pipe, daemon, etc) @tab @command{uucico} (@option{-l} or similar) - @tab @command{nncp-daemon} + @tab @command{@ref{nncp-daemon}} @item Request remote execution, @code{stdin} piped in @tab @command{uux} - @tab @command{nncp-exec} + @tab @command{@ref{nncp-exec}} @item Copy file to remote machine @tab @command{uucp} - @tab @command{nncp-file} + @tab @command{@ref{nncp-file}} @item Copy file from remote machine @tab @command{uucp} - @tab @command{nncp-freq} + @tab @command{@ref{nncp-freq}} @item Process received requests @tab @command{uuxqt} - @tab @command{nncp-toss} + @tab @command{@ref{nncp-toss}} @item Move outbound requests to dir (for USB stick, airgap, etc) @tab N/A - @tab @command{nncp-xfer} + @tab @command{@ref{nncp-xfer}} @item Create streaming package of outbound requests @tab N/A - @tab @command{nncp-bundle} + @tab @command{@ref{nncp-bundle}} @end multitable diff --git a/doc/contacts.texi b/doc/contacts.texi index d5f25adb74662a72482ca77eac0d4f86119b491fea55d3e65c5b953be72e2a5e..3dc1a060e0066a30beeb5c4192f352ce660db176bc7c1e781ec14975833529b3 100644 --- a/doc/contacts.texi +++ b/doc/contacts.texi @@ -1,4 +1,8 @@ @node Contacts +@cindex contacts +@cindex maillist +@cindex IRC +@cindex Matrix @unnumbered Contacts Please send questions regarding the use of NNCP, bug reports and patches to diff --git a/doc/cronexpr.texi b/doc/cronexpr.texi index 710625f2522dd120a42ec3002509a292d2fedb143f55790ae12e3ed5f323e8ae..c94046be51e32000bd73b9addb32699ae18fdf5bece1ae0c0f0d849c52fdc2de 100644 --- a/doc/cronexpr.texi +++ b/doc/cronexpr.texi @@ -1,3 +1,4 @@ +@cindex cron @anchor{CronExpr} This is copy-pasted documentation from @code{github.com/gorhill/cronexpr} library used there. @@ -5,13 +6,13 @@ @multitable @columnfractions .2 .1 .2 .5 @headitem Field name @tab Mandatory? @tab Allowed values @tab Allowed special characters -@item Seconds @tab No @tab 0-59 @tab @verb{|* / , -|} -@item Minutes @tab Yes @tab 0-59 @tab @verb{|* / , -|} -@item Hours @tab Yes @tab 0-23 @tab @verb{|* / , -|} -@item Day of month @tab Yes @tab 1-31 @tab @verb{|* / , - L W|} -@item Month @tab Yes @tab 1-12 or JAN-DEC @tab @verb{|* / , -|} -@item Day of week @tab Yes @tab 0-6 or SUN-SAT @tab @verb{|* / , - L #|} -@item Year @tab No @tab 1970–2099 @tab @verb{|* / , -|} +@item Seconds @tab No @tab 0-59 @tab @verb{|* / , -|} +@item Minutes @tab Yes @tab 0-59 @tab @verb{|* / , -|} +@item Hours @tab Yes @tab 0-23 @tab @verb{|* / , -|} +@item Day of month @tab Yes @tab 1-31 @tab @verb{|* / , - L W|} +@item Month @tab Yes @tab 1-12 or JAN-DEC @tab @verb{|* / , -|} +@item Day of week @tab Yes @tab 0-6 or SUN-SAT @tab @verb{|* / , - L #|} +@item Year @tab No @tab 1970-2099 @tab @verb{|* / , -|} @end multitable diff --git a/doc/download.texi b/doc/download.texi index 063771c91d431bbacefa10d33aa65f58b1aa37b1a31af39c4552a0abd32490c6..c28fd8ac34894df1e182f7f2bb13ff0b12b0c6ad783430d737336567e1f748cc 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -1,4 +1,8 @@ @node Tarballs +@cindex tarball +@cindex dependency +@cindex licencing +@cindex download @section Prepared tarballs You can obtain releases source code prepared tarballs from the links below. @@ -44,6 +48,13 @@ @end multitable @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {meta4 link sig} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @headitem Version @tab Date @tab Size @tab Tarball @tab SHA256 checksum + +@item @ref{Release 8_5_0, 8.5.0} @tab 2022-01-26 @tab 1685 KiB +@tab + @url{download/nncp-8.5.0.tar.xz.meta4, meta4} + @url{download/nncp-8.5.0.tar.xz, link} + @url{download/nncp-8.5.0.tar.xz.sig, sig} +@tab @code{E8850D27 70C4FA74 5CF9B9A9 0CEEE5D6 05E50FA5 031A0813 49844C15 3E7BBFF4} @item @ref{Release 8_4_0, 8.4.0} @tab 2022-01-25 @tab 1683 KiB @tab diff --git a/doc/eblob.texi b/doc/eblob.texi index 058e78e921454d722a33a533506cd9aee32477f1abcbac145d9278850aaf1ab2..8f524b51960e033b3de2ac9c3c81a88a9d2b6ae10a73836cfb24ea01ef5038b7 100644 --- a/doc/eblob.texi +++ b/doc/eblob.texi @@ -1,4 +1,6 @@ @node EBlob +@cindex eblob +@cindex encrypted configuration @unnumbered EBlob format EBlob is an encrypted blob (binary large object, in the terms of @@ -20,6 +22,9 @@ (highly random) characters, but passphrase is (very) long string of low-entropy characters. Low-entropy text is much more easier to remember, and its length provides pretty enough entropy as a result. +@cindex password +@cindex balloon +@cindex Argon2 Password strengthening function is applied to that passphrase to mitigate brute-force and dictionary attacks on it. Here, @url{https://crypto.stanford.edu/balloon/, Balloon} memory-hard password diff --git a/doc/index.texi b/doc/index.texi index ada76142934f1136746281c2bba0d7dd4e49992bb41d6f770f3b974a8a9ddd48..3e08f0fa8670e180afe8d8797bba8cca4469c69bdff2c7116028e434ee11b093 100644 --- a/doc/index.texi +++ b/doc/index.texi @@ -17,15 +17,21 @@ @end quotation @end copying @node Top +@c dummy cindex, to pass through the current info's bug, which can skip +@c the first index entry during searching +@cindex 0 @top NNCP +@cindex Pedro @verbatiminclude pedro.txt @include about.texi +@cindex articles There are also articles about its usage outside this website: @itemize +@item @url{https://www.complete.org/nncp/, Various related articles} by John Goerzen @item @url{https://habr.com/en/post/330712/, NNCP: лечение online- и цензуро- зависимости store-and-forward методом} (on russian) @item @url{https://changelog.complete.org/archives/tag/nncp, Series of descriptive articles} by John Goerzen @item @url{https://www.youtube.com/watch?v=0i3r63pnyHM, Presentation of NNCP on Internet Freedom Conference 2019} (on russian) @@ -60,6 +66,7 @@ * Yggdrasil support: Yggdrasil * EBlob format: EBlob * Mirrors:: * Thanks:: +* Indices:: * Contacts and feedback: Contacts * Copying conditions: Copying @end menu @@ -89,6 +96,7 @@ @include yggdrasil.texi @include eblob.texi @include mirrors.texi @include thanks.texi +@include indices.texi @include contacts.texi @node Copying diff --git a/doc/indices.texi b/doc/indices.texi new file mode 100644 index 0000000000000000000000000000000000000000..163db07b70d7f18f709b2f94023c6d2177e1139cd0291de36cf811068ee4deb9 --- /dev/null +++ b/doc/indices.texi @@ -0,0 +1,14 @@ +@node Indices +@unnumbered Indices + +@node Concepts Index +@section Concepts Index +@printindex cp + +@node Programs Index +@section Programs Index +@printindex pg + +@node Variables Index +@section Variables Index +@printindex vr diff --git a/doc/install.texi b/doc/install.texi index 4608f0fa965c1a905d1d0dac03b161a1f5a2559674c84023a8a96c298d449f2e..d7aaf33755af5a251063d6a5ef9b6e3e9fdb63678ac01f7f2648c18bf90b1cb1 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -1,19 +1,45 @@ @node Installation +@cindex installation +@cindex packages +@cindex distributions @unnumbered Installation Possibly NNCP package already exists for your distribution: @itemize -@item @url{https://www.freshports.org/net/nncp/, FreeBSD ports} + +@cindex Arch Linux +@cindex AUR +@item Arch Linux @url{https://aur.archlinux.org/packages/nncp, AUR} + +@cindex Debian +@item @url{https://tracker.debian.org/pkg/nncp, Debian packages} + +@cindex DragonFly @item @url{https://github.com/DragonFlyBSD/DPorts/tree/master/net/nncp, DragonFly BSD ports} + +@cindex FreeBSD +@item @url{https://www.freshports.org/net/nncp/, FreeBSD ports} + +@cindex Guix +@item GNU @url{https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/uucp.scm, Guix} + +@cindex NetBSD +@item @url{https://pkgsrc.se/wip/nncp, NetBSD package} + +@cindex NixOS @item @url{https://github.com/NixOS/nixpkgs/tree/master/pkgs/tools/misc/nncp, NixOS packages} + +@cindex Void Linux @item @url{https://github.com/void-linux/void-packages/blob/master/srcpkgs/nncp/template, Void Linux} -@item @url{https://tracker.debian.org/pkg/nncp, Debian packages} @end itemize +@cindex POSIX NNCP should run on any POSIX-compatible operating system. -NNCP is written on @url{https://golang.org/, Go} programming language +@pindex go +@pindex texinfo +NNCP is written on @url{https://go.dev/, Go} programming language and you have to install Go compiler 1.13+ version. @url{http://cr.yp.to/redo.html, redo} build system is recommended for convenience. @url{https://www.gnu.org/software/texinfo/, Texinfo} is diff --git a/doc/integration/bittorrent.texi b/doc/integration/bittorrent.texi index a5c3649e395562cd7d11f66b644931d246ad5edd735bf6f15c5be16ad8ede051..9a621fcd710ec132d7e20242da3e80d04fb1e70e7a2d9a0460ff05368891d588 100644 --- a/doc/integration/bittorrent.texi +++ b/doc/integration/bittorrent.texi @@ -1,4 +1,5 @@ @node BitTorrent +@cindex BitTorrent integration @section BitTorrent and huge files If dealing with @ref{Git}, @ref{Feeds, web feeds} and @ref{Multimedia, @@ -6,6 +7,7 @@ multimedia} goes relatively fast, then BitTorrent and huge files consumes much time. You can not wait for downloads finish, but want to queue them after. +@pindex aria2 @url{http://aria2.github.io/, aria2} multi-protocol download utility could be used for solving that issue conveniently. It supports HTTP, HTTPS, FTP, SFTP and BitTorrent protocols, together with @@ -15,6 +17,7 @@ URIs, Web-seeding, selective downloads, LPD. @command{aria2} can accelerate HTTP*/*FTP downloads by segmented multiple parallel connections. +@pindex aria2-downloaded.sh You can queue you files after they are completely downloaded. @file{aria2-downloaded.sh} contents: diff --git a/doc/integration/download.texi b/doc/integration/download.texi index 01f817d5a521b9b55571f2fe8a19aef1b19ee7dc43fd8499fa2906e05614cb0a..92ef8e217d22ba4cc20f98fcfe7a2d64d70e418682a760bd81b200b131b230e6 100644 --- a/doc/integration/download.texi +++ b/doc/integration/download.texi @@ -1,4 +1,7 @@ @node DownloadService +@cindex download service +@pindex warcer.sh +@pindex wgeter.sh @section Downloading service Previous sections tell about manual downloading and sending results to diff --git a/doc/integration/exim.texi b/doc/integration/exim.texi index 1bd963d71e3ad21a638685466e965ffe37462b0717ca553d23a513e743c894f8..c4a87c451717c362f0c3580d048c6ad3e8378a72fc0210f1c07f5cf8c781a4b0 100644 --- a/doc/integration/exim.texi +++ b/doc/integration/exim.texi @@ -1,4 +1,5 @@ @node Exim +@cindex Exim integration @section Integration with Exim This section is unaltered copy-paste of @@ -17,6 +18,8 @@ eventual delivery (over the Internet, LAN, whatever). This is fairly simple in Exim. +@pindex bsmtp +@pindex rmail We actually have two choices for how to do this: @command{bsmtp} or @command{rmail} mode. bsmtp (batch SMTP) is the more modern way, and is essentially a derivative of SMTP that explicitly can be queued @@ -58,8 +61,8 @@ return_path = REMOTE_SMTP_RETURN_PATH .endif @end example -This is pretty straightforward. We pipe to @command{nncp-exec}, run it -as the nncp user. @command{nncp-exec} sends it to a target node and runs +This is pretty straightforward. We pipe to @command{@ref{nncp-exec}}, run it +as the nncp user. @command{@ref{nncp-exec}} sends it to a target node and runs whatever that node has called @command{rsmtp} (the command to receive bsmtp data). When the target node processes the request, it will run the configured command and pipe the data in to it. @@ -96,6 +99,7 @@ @end example The @option{-bS} option is what tells Exim to receive BSMTP on @code{stdin}. +@vindex MAIN_TRUSTED_USERS Now, you need to tell Exim that nncp is a trusted user (able to set From headers arbitrarily). Assuming you are running NNCP as the @code{nncp} user, then add @code{MAIN_TRUSTED_USERS = nncp} to a file such as diff --git a/doc/integration/feeds.texi b/doc/integration/feeds.texi index 2aa9afef0e6a7453ce997087830fc70daef72a77e27114867f92659edb023f71..4dc6764241ab116f17a94265ef26001c1fe4b921a86f173e0af78f8f26a2c641 100644 --- a/doc/integration/feeds.texi +++ b/doc/integration/feeds.texi @@ -1,6 +1,10 @@ @node Feeds +@cindex Web feeds integration +@cindex RSS feeds integration +@cindex Atom feeds integration @section Integration with Web feeds +@pindex r2e RSS and Atom feeds could be collected using @url{https://github.com/wking/rss2email, rss2email} program. It converts all incoming feed entries to email messages. Read about how to integrate @@ -18,7 +22,7 @@ and add feeds you want to retrieve: @example -$ r2e add http://www.git.cypherpunks.ru/?p=nncp.git;a=atom +$ r2e add http://www.nncpgo.org/download/releases.atom @end example and run the process: @@ -26,3 +30,20 @@ @example $ r2e run @end example + +@pindex feeder +But it is more flexible and advisable to use use +@url{https://www.feeder.stargrave.org/, feeder} (NNCP's author creation) +that also transforms feed entries to Maildir email messages. Incoming +entries are placed in @file{new/} Maildir directories, so you can easily +send all of them: + +@example +% tar cf - **/new/*(.) | zstdmt | nncp-file - remote.node:feeds-`date -Iseconds`.tar.zst +% feeder/dir/contrib/feeds-oldenize.zsh +@end example + +Unlike @command{r2e}, @command{feeder} has also +@url{http://www.feeder.stargrave.org/Enclosures.html, enclosures} and +@url{http://www.feeder.stargrave.org/WARCs.html, WARCs} downloading +capabilities, that are also stored as a files on the disk. diff --git a/doc/integration/freqindex.texi b/doc/integration/freqindex.texi index 6a1dfbf3f838603384b73993afbf8d9c061bf002972dc95c8900f3a4bf6cb805..952cf36ca23072b6a1876296c07e1167db268c08f8ac6dd4f232d66fb4bc0f38 100644 --- a/doc/integration/freqindex.texi +++ b/doc/integration/freqindex.texi @@ -1,4 +1,5 @@ @node FreqIndex +@cindex index files @section Index files for freqing In many cases you do not know exact files list on remote machine you diff --git a/doc/integration/git.texi b/doc/integration/git.texi index a5f3aa3c292188259d3d9bb90546e75a93bd524ebf54bef90586ddd7c7389b32..ffc8d23948ea2b1421dbfe2ab8e4934d0aa0f0ad3f33e5a5f06f91784a5e22ac 100644 --- a/doc/integration/git.texi +++ b/doc/integration/git.texi @@ -1,4 +1,6 @@ @node Git +@cindex git integration +@pindex git-bundle @section Integration with Git @url{https://git-scm.com/, Git} version control system already has all diff --git a/doc/integration/index.texi b/doc/integration/index.texi index bb77a7280d45f19f2f10d752fafb84cccaad63dc688901a108a1c4756a632114..9b8698e9b5a052cc56bf5f689d782723d1f89ed8fa0f69b780ea50ed89876eed 100644 --- a/doc/integration/index.texi +++ b/doc/integration/index.texi @@ -1,4 +1,5 @@ @node Integration +@cindex integration with existing software @unnumbered Integration with existing software Here is some examples of how you can solve popular tasks with NNCP, diff --git a/doc/integration/multimedia.texi b/doc/integration/multimedia.texi index dbef85873dac9b28d7f261f6c8a35db8a38741d19f7e0b9f63dc98432b162d8f..142edc0974300d6b2395be2b8408e5d316c40611338309443068cb095dc8f8b2 100644 --- a/doc/integration/multimedia.texi +++ b/doc/integration/multimedia.texi @@ -1,16 +1,19 @@ @node Multimedia +@cindex multimedia integration +@cindex pindex youtube-dl +@cindex pindex yt-dlp +@cindex cindex YouTube @section Integration with multimedia streaming Many video and audio streams could be downloaded using -@url{http://yt-dl.org/, youtube-dl} program. -@url{https://rg3.github.io/youtube-dl/supportedsites.html, Look} how +@url{https://github.com/yt-dlp/yt-dlp, yt-dlp} program. +@url{https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md, Look} how many of them are supported, including @emph{Dailymotion}, @emph{Vimeo} and @emph{YouTube}. -When you multimedia becomes an ordinary file, you can transfer it easily. +When your multimedia becomes an ordinary file, you can transfer it easily. @example -$ youtube-dl \ - --exec 'nncp-file @{@} remote.node:' \ +$ yt-dlp --exec 'nncp-file @{@} remote.node:' \ 'https://www.youtube.com/watch?list=PLd2Cw8x5CytxPAEBwzilrhQUHt_UN10FJ' @end example diff --git a/doc/integration/postfix.texi b/doc/integration/postfix.texi index dbcdf6defff01ee0fc551bffe92da0c2de79a17cbe7f9485c25075370cf120a1..43cc09a7bda0413c26a34b4d94bacd29dbe4ecce5f72f9c2fd3dea79f84429ab 100644 --- a/doc/integration/postfix.texi +++ b/doc/integration/postfix.texi @@ -1,4 +1,6 @@ @node Postfix +@cindex Postfix integration +@pindex postfix @section Integration with Postfix This section is taken from @url{http://www.postfix.org/UUCP_README.html, @@ -12,9 +14,9 @@ mail to a LAN that is connected via NNCP. @itemize -@item You need an @ref{nncp-exec} program that extracts the sender -address from mail that arrives via NNCP, and that feeds the mail into -the Postfix @command{sendmail} command. +@item You need an @command{@ref{nncp-exec}} program that extracts the +sender address from mail that arrives via NNCP, and that feeds the mail +into the Postfix @command{sendmail} command. @item Define a @command{pipe(8)} based mail delivery transport for delivery via NNCP: @@ -24,13 +26,16 @@ nncp unix - n n - - pipe flags=Rqhu user=nncp argv=nncp-exec -quiet $nexthop sendmail $recipient @end example -This runs the @command{nncp-exec} command to place outgoing mail into +This runs the @command{@ref{nncp-exec}} command to place outgoing mail into the NNCP queue after replacing @var{$nexthop} by the receiving NNCP node and after replacing @var{$recipient} by the recipients. The -@command{pipe(8)} delivery agent executes the @command{nncp-exec} +@command{pipe(8)} delivery agent executes the @command{@ref{nncp-exec}} command without assistance from the shell, so there are no problems with shell meta characters in command-line parameters. +@pindex sendmail.sh +@vindex Return-Path +@pindex reformail Pay attention to @code{flags}, containing @code{R}, telling Postfix to include @code{Return-Path:} header. Otherwise that envelope sender information may be lost. Possibly you will also need somehow to @@ -42,6 +47,9 @@ extract with: @verbatiminclude sendmail.sh +@vindex From_ +@cindex mbox +@pindex maildrop Also pay attention that @command{maildrop} does not like @code{From_} mbox-style header, so you possibly want: @@ -92,9 +100,9 @@ Here is how to relay mail from a LAN via NNCP to the Internet. @itemize -@item You need an @ref{nncp-exec} program that extracts the sender -address from mail that arrives via NNCP, and that feeds the mail into -the Postfix @command{sendmail} command. +@item You need an @command{@ref{nncp-exec}} program that extracts the +sender address from mail that arrives via NNCP, and that feeds the mail +into the Postfix @command{sendmail} command. @item Specify that all remote mail must be sent via the @command{nncp} mail transport to your NNCP gateway host, say, @emph{nncp-gateway}: @@ -121,10 +129,10 @@ nncp unix - n n - - pipe flags=Fqhu user=nncp argv=nncp-exec -quiet $nexthop sendmail $recipient @end example -This runs the @command{nncp-exec} command to place outgoing mail into +This runs the @command{@ref{nncp-exec}} command to place outgoing mail into the NNCP queue. It substitutes the hostname (@emph{nncp-gateway}, or whatever you specified) and the recipients before execution of the -command. The @command{nncp-exec} command is executed without assistance +command. The @command{@ref{nncp-exec}} command is executed without assistance from the shell, so there are no problems with shell meta characters. @item Execute the command @command{postfix reload} to make the changes diff --git a/doc/integration/ppp.texi b/doc/integration/ppp.texi index dbae6145019155e17094d5a7e2eed8227b2a468a523f3e971246af50561ab598..f33f60978eb0ed81dccf127ae5426e27ac856c93a4304eba0341127a0dd48cc2 100644 --- a/doc/integration/ppp.texi +++ b/doc/integration/ppp.texi @@ -1,12 +1,15 @@ @node PPP +@cindex PPP +@cindex serial link +@cindex serial connection @section Serial connection -It is not trivial to run online @command{nncp-daemon}, -@command{nncp-call} and @command{nncp-caller} commands over the serial -link, because it is link without built-in error detection. For efficient -usage you have to use some kind of window-sliding error correction -protocol, like Kermit, ZMODEM, UUCP's g-protocol and similar well known -ones. +It is not trivial to run online @command{@ref{nncp-daemon}}, +@command{@ref{nncp-call}} and @command{@ref{nncp-caller}} commands over +the serial link, because it is link without built-in error detection. +For efficient usage you have to use some kind of window-sliding error +correction protocol, like Kermit, ZMODEM, UUCP's g-protocol and similar +well known ones. However TCP is already satisfying and existing protocol for the same purposes. So it would be more easier to bring up the IP interconnection diff --git a/doc/integration/warc.texi b/doc/integration/warc.texi index a92ca5fc13824601c39687c0cf61e20a0ad9089067bfefd14a3d423e22e0ca82..98bcba5c4a5a1d6eee6c7a0f4355ebcd10dfc963cfc7efaff6a26929251d1118 100644 --- a/doc/integration/warc.texi +++ b/doc/integration/warc.texi @@ -1,4 +1,6 @@ @node WARCs +@cindex WARC +@pindex wget @section Integration with Web pages Simple HTML web page can be downloaded very easily for sending and @@ -62,6 +64,7 @@ [--no-warc-compression] [--warc-max-size=XXX] \ [@dots{}] http://www.example.com/ @end example +@pindex tofuproxy That command will create @file{www.example.com-XXX.warc} web archive. It could produce specialized segmented @url{https://en.wikipedia.org/wiki/Gzip, gzip} and diff --git a/doc/integrity.texi b/doc/integrity.texi index a0884eb9184d356929686b3ae53c052708220ee4ce6d7c5cbeed750daa979ccd..1c52ab08eb983cd6e691a33dbdb8d800fd5a71e55a4dd72dadc159d72d2c8542 100644 --- a/doc/integrity.texi +++ b/doc/integrity.texi @@ -1,4 +1,10 @@ @node Integrity +@cindex integrity check +@cindex authenticity check +@cindex OpenPGP +@cindex gpg +@cindex GnuPG +@cindex WKD @section Tarballs integrity check You @strong{have to} check downloaded archives integrity and verify diff --git a/doc/log.texi b/doc/log.texi index d1281d703031fffb922b69e1ce920fe421496fe4b9dc3765753b513c2323c25e..a9a4cb579902e086f7896e05120c15b30184e25bffe244b21a39155d76891f51 100644 --- a/doc/log.texi +++ b/doc/log.texi @@ -1,10 +1,14 @@ @node Log +@cindex log format +@cindex logging +@cindex recfile +@pindex recutils @unnumbered Log format Log is a plaintext file consisting of @url{https://www.gnu.org/software/recutils/, recfile} records. It can be -read by human, but it is better to use either @ref{nncp-log}, or -@command{recutils} utilities for selecting and formatting the required +read by human, but it is better to use either @command{@ref{nncp-log}}, +or @command{recutils} utilities for selecting and formatting the required fields. Two example records from it: diff --git a/doc/mcd.texi b/doc/mcd.texi index db206270fb30a24755e15237f4e70e9987f0afce983dcda6895db83d5e0b48be..7221d813bf81a83c177fe535a059b54a01b3f2552f1126e02c23fa884d9e6dbe 100644 --- a/doc/mcd.texi +++ b/doc/mcd.texi @@ -1,4 +1,6 @@ @node MCD +@cindex MCD +@cindex multicast discovery @unnumbered MultiCast Discovery MCD is an addition to online @ref{Sync, synchronization protocol}, that @@ -7,10 +9,11 @@ in local area network. It is very simple: @itemize @item - @ref{nncp-daemon} sends multicast messages about its presence from - time to time. See @ref{CfgMCDSend, mcd-send} configuration option. + @command{@ref{nncp-daemon}} sends multicast messages about its + presence from time to time. See @ref{CfgMCDSend, mcd-send} + configuration option. @item - When @ref{nncp-caller} sees them, it adds them as the most + When @command{@ref{nncp-caller}} sees them, it adds them as the most preferred addresses to already known ones. If MCD address announcement was not refreshed after two minutes -- it is removed. See @ref{CfgMCDListen, mcd-listen} and @@ -30,5 +33,5 @@ identifier of the node. It is sent as UDP packet on IPv6 @strong{@verb{|ff02::4e4e:4350|}} (hexadecimal ASCII @verb{|NNCP|}) multicast address and @strong{5400} port. Operating system will use IPv6 link-local address as a source one, with the port taken from -@command{nncp-daemon}'s @option{-bind} option. That way, IP packet +@command{@ref{nncp-daemon}}'s @option{-bind} option. That way, IP packet itself will carry the link-scope reachable address of the daemon. diff --git a/doc/mirrors.texi b/doc/mirrors.texi index 393d2e3e8d111a8be8c3dcffc82195dc052bf11903979128a133e89ddc81eaa9..305d20a7b32ad6b374d7861aec7920452bbaa21277b457b44d4623dd40f05764 100644 --- a/doc/mirrors.texi +++ b/doc/mirrors.texi @@ -1,4 +1,5 @@ @node Mirrors +@cindex mirror @unnumbered Mirrors Main NNCP website is hosted on two geographically distant servers @@ -7,8 +8,11 @@ connectivity is provided by Hurricane Electric tunnel broker. Only one of those servers supports TLS and another just proxies the traffic to it. So TLS-capable version has less availability. +@cindex DANE +@cindex DNSCurve +@cindex ca.cypherpunks.ru It can be authenticated with -@url{http://ca.cypherpunks.ru/, ca.cypherpunks.ru} certificate, through the +@url{http://www.ca.cypherpunks.ru/, ca.cypherpunks.ru} certificate, through the @url{https://datatracker.ietf.org/doc/html/rfc6698, DANE} record, that in turn can be authenticated with @url{https://dnscurve.org/, DNSCurve}-secured @@ -18,8 +22,12 @@ signed with @code{CF60 E89A 5923 1E76 E263 6422 AE1A 8109 E498 57EF} @url{https://en.wikipedia.org/wiki/OpenPGP, OpenPGP} @url{http://www.stargrave.org/Contacts.html, public key}. +Also there is @url{https://yggdrasil-network.github.io/, Yggdrasil} +accessible address: @url{http://y.www.nncpgo.org/}. + @table @asis +@cindex quux.org @item @url{https://nncp.mirrors.quux.org/} Its creation @url{http://lists.cypherpunks.ru/archive/nncp-devel/2108/0310.html, announcement}. diff --git a/doc/mth.texi b/doc/mth.texi index 2da755a85ec65019aadf5a4799d0b54fed5a85ac348e63d01e6f38f42f631749..8ecc36b059d4bec939ad653f618bcf6ec44b8e85530e13ee8c944d386085e154 100644 --- a/doc/mth.texi +++ b/doc/mth.texi @@ -1,4 +1,8 @@ @node MTH +@cindex MTH +@cindex hashing +@cindex merkle tree +@cindex BLAKE3 @unnumbered Merkle Tree Hashing NNCP uses @url{https://github.com/BLAKE3-team/BLAKE3, BLAKE3} hash diff --git a/doc/multicast.texi b/doc/multicast.texi index 182c8c1ea18b62afda55e07956282bd253316ace43f9f9e41d3fce36997d27d9..2fcb6fd65d977a4880936d53fa816f6a585c0b20c1e6a2bf64c43919b0d0801a 100644 --- a/doc/multicast.texi +++ b/doc/multicast.texi @@ -1,4 +1,5 @@ @node Multicast +@cindex multicast area @unnumbered Multicast areas NNCP has ability to multicast packets: send single packet to multiple @@ -10,7 +11,8 @@ @anchor{Area} Each multicast group is identified by so-called @strong{area}. Area consists of private/public Curve25519 keypairs for @ref{Encrypted area, packets encryption}, identity (BLAKE2b-256 hash of the public key) and -possible subscribers. Areas are created with @ref{nncp-cfgnew} command. +possible subscribers. Areas are created with @command{@ref{nncp-cfgnew}} +command. You can make either file or exec transmissions to the areas. Those ordinary file/exec packets are double wrapped in: @@ -23,6 +25,7 @@ @item area packet, containing area's identity, telling that tossing node can should it to the subscribers further @end itemize +@vindex MsgHash Area's message identity (@code{MsgHash}) is the hash of the encrypted packet header. Because the area packet, containing the encrypted packet, is relayed as-is without any modifications, that area message's hash @@ -106,13 +109,13 @@ @end example @enumerate @item -@command{nncp-file} creates an encrypted packet with area packet and +@command{@ref{nncp-file}} creates an encrypted packet with area packet and encrypted packet inside it, with our own @code{self} node as a recipient (in the @file{SPOOL/SELF/tx} directory). It also creates the @file{SPOOL/SELF/area/AREA/MsgHash} file. @item -@command{nncp-toss} sees @file{tx/} file and "opens" it, applying the +@command{@ref{nncp-toss}} sees @file{tx/} file and "opens" it, applying the area message tossing procedure as described above. That will create outgoing packets in @file{SPOOL/nodeB/tx} and @file{SPOOL/nodeD/tx} directories with @file{SPOOL/nodeB/area/AREA/MsgHash} diff --git a/doc/news.ru.texi b/doc/news.ru.texi index ba4b0a2f91efe9b0dd14dbc96e560622d52f9e1ea192e8882389ddd1f8305f23..e63d321bfff4c6752f0387b1813362cb876dd5e5c29e74b243eb28b5783b382d 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,33 @@ @node Новости @section Новости +@node Релиз 8.6.0 +@subsection Релиз 8.6.0 +@itemize + +@item +@command{nncp-xfer} проверяет сходится ли контрольная сумма +скопированного локально пакета и исходного. + +@item +@command{nncp-call} имеет плохой код возврата если в очередях на приём и +отправку остаются незаконченные задания. + +@item +Появилась @command{nncp-ack} команда, которая отправляет явное +подтверждение доставки пакета (ACK пакет). Это подтверждение удаляет +упомянутый пакет из исходящего spool-а. + +@item +Появилась возможность отключения @code{fsync} операции +@env{$NNCPNOSYNC=1} переменной окружения. + +@item +Добавлены разнообразные индексы в документации, что должно помочь при +поиске в ней. + +@end itemize + @node Релиз 8.5.0 @subsection Релиз 8.5.0 @itemize @@ -61,7 +88,7 @@ вместо голого μTP транспортного протокола, делая возможным работу в качестве обычного TCP сервера внутри overlay сети. @item -Конфигурационные строки Yggdrasil вида @code{prv;bind1,bind2;pub...} +Конфигурационные строки Yggdrasil вида @code{prv;bind1,bind2;pub@dots{}} заменены на URL-подобные (@code{yggdrasils://PRV?bind=BIND1&bind=BIND2&pub=PUB}). @item @@ -303,7 +330,7 @@ @subsection Релиз 7.1.1 @itemize @item -Исправлено падение при fsync директорий после создания @file{.seen} файлов. +Исправлено падение при @code{fsync} директорий после создания @file{.seen} файлов. @end itemize @@ -717,7 +744,7 @@ публичный ключ Noise были поменяны местами, что приводило к невозможности online аутентификации нод. @item -Явная синхронизация (fsync) директорий для гарантированного +Явная синхронизация (@code{fsync}) директорий для гарантированного переименования файлов. @end itemize @@ -927,8 +954,8 @@ @command{nncp-exec}. Вместо вызова @verb{|nncp-mail NODE RECIPIENT|} нужно использовать @verb{|nncp-exec NODE sendmail RECIPIENT|}. @item @option{sendmail} опция конфигурационного файла заменена на более гибкую - @option{exec}. @verb{|sendmail: [...]|} нужно заменить на @verb{|exec: - sendmail: [...]|}. + @option{exec}. @code{sendmail: [@dots{}]} нужно заменить на + @code{exec: sendmail: [@dots{}]}. @end itemize @item diff --git a/doc/news.texi b/doc/news.texi index 01ee4aaf8d1888a8bbb9342c54f91517a6c183a1c7b35cfcba1ff5d862485a55..97e0e6f717285a323edd5239bd1b6d4aa9456509b97bd8b76ce131893d639e45 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -1,8 +1,34 @@ @node News +@cindex news @unnumbered News See also this page @ref{Новости, on russian}. +@node Release 8_6_0 +@section Release 8.6.0 +@itemize + +@item +@command{nncp-xfer} checks if locally copied packet's checksum differs +from the source's one. + +@item +@command{nncp-call} has bad return code if its queues contain unfinished jobs. + +@item +@command{nncp-ack} command appeared, that sends explicit packet receipt +acknowledgement (ACK packet). That acknowledgement deletes referenced +packet from the outbound spool. + +@item +Ability to turn @code{fsync} operation off using @env{$NNCPNOSYNC=1} +environment variable. + +@item +Added various indices in documentation, that should help searching in it. + +@end itemize + @node Release 8_5_0 @section Release 8.5.0 @itemize @@ -62,7 +88,7 @@ transport protocol, making it able to work as an ordinary TCP server inside overlay network. @item -Yggdrasil's @code{prv;bind1,bind2;pub...}-like configuration strings are +Yggdrasil's @code{prv;bind1,bind2;pub@dots{}}-like configuration strings are replaced with URL-like ones (@code{yggdrasils://PRV?bind=BIND1&bind=BIND2&pub=PUB}). @item @@ -297,7 +323,7 @@ @section Release 7.1.1 @itemize @item -Fixed failing directories fsync after @file{.seen} file creation. +Fixed failing directories @code{fsync} after @file{.seen} file creation. @end itemize @@ -699,7 +725,7 @@ Bugfix: private and public Noise keys were swapped in newly created configuration files, that lead to inability to authenticate online peers. @item -Explicit directories fsync-ing for guaranteed files renaming. +Explicit directories @code{fsync}-ing for guaranteed files renaming. @end itemize @@ -901,8 +927,8 @@ @command{nncp-exec}. Instead of @verb{|nncp-mail NODE RECIPIENT|} you must use @verb{|nncp-exec NODE sendmail RECIPIENT|}. @item @option{sendmail} configuration file option is replaced with - @option{exec}. @verb{|sendmail: [...]|} must be replaced with - @verb{|exec: sendmail: [...]|}. + @option{exec}. @code{sendmail: [@dots{}]} must be replaced with + @code{exec: sendmail: [@dots{}]}. @end itemize @item diff --git a/doc/niceness.texi b/doc/niceness.texi index cb87939fc9d735db85616b3e8ebff16af9a0ac23dfab00670fddb9384fef5fe9..63a4e330742a49ee79367473e0e9a9e69c4bef903c9cac3b34fe8033d3f0702f 100644 --- a/doc/niceness.texi +++ b/doc/niceness.texi @@ -1,4 +1,6 @@ @node Niceness +@cindex niceness +@cindex priority @unnumbered Niceness Each transmitted packet has niceness level, as Unix has @command{nice} @@ -10,20 +12,25 @@ Send big files with higher nice level! That will guarantee you that higher priority packets, like mail messages, will pass first, even when lower priority packet was already been partially downloaded. -There are default niceness levels built-in for @ref{nncp-exec}, -@ref{nncp-file} and @ref{nncp-freq} commands. But pay attention that it -can give information about underlying payload to the adversary! +There are default niceness levels built-in for +@command{@ref{nncp-exec}}, @command{@ref{nncp-file}} and +@command{@ref{nncp-freq}} commands. But pay attention that it can give +information about underlying payload to the adversary! There are 1-255 niceness levels. They could be specified either as integer, or using aliases with delta modifiers: @table @emph +@vindex FLASH @item FLASH (F) Urgent priority. +@vindex PRIORITY @item PRIORITY (P) High priority. Command execution/mail use that priority by default. +@vindex NORMAL @item NORMAL (N) Normal priority. File requests use that priority by default. +@vindex BULK @item BULK (B) Bundles shipped on a "least effort" basis. File transmission use that priority by default. diff --git a/doc/pkt/area.texi b/doc/pkt/area.texi index 07d267cef91db255079a1cbd18f3a46df09105cfa6d1f86bab2b812edadb7d91..d76a92288945dc637cc82b92866538f0e273063bd075f7e455a59d302c4e26b7 100644 --- a/doc/pkt/area.texi +++ b/doc/pkt/area.texi @@ -1,4 +1,5 @@ @node Encrypted area +@cindex encrypted area packet @section Encrypted area packet @ref{Multicast} area messages contains the encrypted packet, that is diff --git a/doc/pkt/encrypted.texi b/doc/pkt/encrypted.texi index 828f500ec55cfd88b933b398fe8fa4c6870ef8c2965b5208fc56ec2fe83661d7..f8dd9d7c19cdc60111c955ec1a4994cc3cfe1da1ff109ddda642043638a017f0 100644 --- a/doc/pkt/encrypted.texi +++ b/doc/pkt/encrypted.texi @@ -1,4 +1,7 @@ @node Encrypted +@cindex encrypted packet +@cindex AEAD +@cindex ChaCha20-Poly1305 @section Encrypted packet Encrypted packets are the only files found in spools, in exchangeable diff --git a/doc/pkt/index.texi b/doc/pkt/index.texi index 863e4c0a1d8012472be3fdd70a0a60a7cbfe319f22ee8cc6968aad78b8606078..452014695ddab814a988cecfb9857f9481f2c5954b4ce676b9086f22380652e4 100644 --- a/doc/pkt/index.texi +++ b/doc/pkt/index.texi @@ -1,4 +1,6 @@ @node Packet +@cindex packet format +@cindex XDR @unnumbered Packet format All packets are diff --git a/doc/pkt/plain.texi b/doc/pkt/plain.texi index 952d52ee790a464f4cff2117b30589dd7326e5362e62ad5ce72e5e33121cd24e..ee69037a19fdfe1eef1ec32cdeaffa0654159ae9fb354d65e9c67b76c6957e40 100644 --- a/doc/pkt/plain.texi +++ b/doc/pkt/plain.texi @@ -1,4 +1,5 @@ @node Plain +@cindex plain packet @section Plain packet Plain packet contains either the whole file, or file request (freq), or @@ -27,6 +28,7 @@ @item exec (compressed exec) @item trns (transition) @item exec-fat (uncompressed exec) @item area (@ref{Multicast, multicast} area message) + @item ack (receipt acknowledgement) @end enumerate @item Niceness @tab unsigned integer @tab @@ -43,6 +45,7 @@ @item UTF-8 encoded source path for file request @item UTF-8 encoded, zero byte separated, exec's arguments @item Node's id the transition packet must be relayed on @item Multicast area's id + @item Packet's id (its @ref{MTH} hash) @end itemize @end multitable @@ -61,6 +64,7 @@ @item Optionally @url{https://facebook.github.io/zstd/, Zstandard} compressed exec body @item Whole encrypted packet we need to relay on @item Multicast area message wrap with another encrypted packet inside +@item Nothing, if it is acknowledgement packet @end itemize Also depending on packet's type, niceness level means: @@ -140,5 +144,16 @@ \ / PATHLEN @end example See also @ref{Encrypted area, encrypted area packet}. + +@item ack +@example + +------- PATH --------+ + / \ ++-------------------------+ +| PKT ID | 0x00 ... 0x00 | ++-------------------------+ + \ / + PATHLEN +@end example @end table diff --git a/doc/sources.texi b/doc/sources.texi index ac69a6464941779764c205391a7fbb2be74531296b4288d0b0c3c038150e4f3e..6dce0c4110a615c564efd2380669303070a506d7a3546cd80b32bd243def3eb9 100644 --- a/doc/sources.texi +++ b/doc/sources.texi @@ -1,4 +1,7 @@ @node Sources +@cindex sources +@cindex source code +@cindex git @section Development source code Development source code contains the latest version of the code. It may @@ -10,4 +13,7 @@ @example $ git clone --branch develop git://git.cypherpunks.ru/nncp.git nncp @end example -You can also use @url{https://git.cypherpunks.ru/nncp.git}. +You can also use +@url{https://git.cypherpunks.ru/nncp.git}, +@url{http://git.cypherpunks.ru/nncp.git}, +@url{http://y.git.cypherpunks.ru/nncp.git} URLs instead. diff --git a/doc/sp.texi b/doc/sp.texi index 754080055772a2fc4701866765b824544ca89262bbe32f426ce352b48bc45337..acf01ccf8264421452c7671b93d1004f5843057a05de9be66859fc703434b95d 100644 --- a/doc/sp.texi +++ b/doc/sp.texi @@ -1,10 +1,14 @@ @node Sync +@cindex sync protocol +@cindex online protocol +@cindex synchronization @unnumbered Synchronization protocol So-called synchronization protocol (SP) is used in current TCP daemon's implementation. It is used for synchronizing @ref{Spool, spool} directory contents between two nodes. +@cindex XMODEM It is aimed to be very simple and effective. It uses reliable transport like TCP connections. It must be effective both on single-duplex and full-duplex links: for example satellites have very high throughput but @@ -12,11 +16,13 @@ high-delay links, so acknowledging of each received packet, like @url{https://en.wikipedia.org/wiki/XMODEM, XMODEM} does, causes unacceptable performance degradation. +@vindex NNCPDEADLINE Internally it uses various timeouts and deadlines. One of them used extensively is 10 seconds default deadline timeout. You can override it with @env{$NNCPDEADLINE} environment variable, that could be useful with very high delay links. +@cindex Noise-IK SP works on top of @url{http://noiseprotocol.org/noise.html#interactive-patterns, @code{Noise_IK_25519_ChaChaPoly_BLAKE2b}} protocol. Each Noise packet @@ -54,6 +60,7 @@ just an unsigned integer telling what body structure follows. @table @emph +@cindex HALT payload @item HALT Stop file transmission, empty sending queue on the remote side. Actually @emph{HALT} packet does not have any body, only the header @@ -66,6 +73,7 @@ | HALT | +------+ @end verbatim +@cindex PING payload @item PING Dummy packet only used for determining workability of the connection. @@ -75,6 +83,7 @@ | PING | +------+ @end verbatim +@cindex INFO payload @item INFO Information about the file we have for transmission. @@ -97,6 +106,7 @@ 32-byte, fixed length opaque data @tab Unique file identifier, its checksum @end multitable +@cindex FREQ payload @item FREQ File transmission request. Ask remote side to queue the file for transmission. @@ -117,6 +127,7 @@ unsigned hyper integer @tab Offset from which remote side must transmit the file @end multitable +@cindex FILE payload @item FILE Chunk of file. @@ -139,6 +150,7 @@ variable length opaque data @tab Chunk of file itself @end multitable +@cindex DONE payload @item DONE Signal remote side that we have successfully downloaded the file. diff --git a/doc/spool.texi b/doc/spool.texi index 78964071cddec16935cb31ec5a0f2fa77c93ef6f3795fb046d1aded4c56f9b2d..3847c71f8bca156abef5274e9f3f658a8a1ddd7c722e01c43618f3791691601c 100644 --- a/doc/spool.texi +++ b/doc/spool.texi @@ -1,4 +1,5 @@ @node Spool +@cindex spool directory @unnumbered Spool directory Spool directory holds @ref{Encrypted, encrypted packets} received from @@ -18,6 +19,7 @@ @end example @table @file +@cindex tmp directory @item tmp directory contains various temporary files that under normal circumstances are renamed to necessary files inside other directories. @@ -27,10 +29,13 @@ @item 2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ is an example Base32-encoded neighbour identifier. +@cindex rx directory +@cindex tx directory @item rx, tx directories are for incoming and outgoing encrypted packets. @file{rx} contains currently unfinished, non-checked, unprocessed, etc packets. +@cindex lock files @item toss.lock, rx.lock, tx.lock Lock files. Only single process can work with @file{rx}/@file{tx} directories at once. @@ -40,39 +45,43 @@ is an example @ref{Encrypted, encrypted packet}. Its filename is Base32 encoded @ref{MTH} hash of the whole contents. It can be integrity checked anytime. +@cindex part files @item LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ.part is an example @strong{partly} received file. It can appear only when online transfer is used. Its filename is sent by remote side and until file is fully downloaded -- it plays no role. +@cindex nock files @item LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ.nock non-checksummed (NoCK) @strong{fully} received file. Its checksum is -verified against its filename either by @ref{nncp-check}, or by working -online daemons. If it is correct, then its extension is trimmed. +verified against its filename either by @command{@ref{nncp-check}}, or +by working online daemons. If it is correct, then its extension is trimmed. +@cindex seen files @item seen/LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ -@ref{nncp-toss} utility can be invoked with @option{-seen} option, -leading to creation of @file{seen/} files, telling that the file with -specified hash has already been processed before. It could be useful -when there are use-cases where multiple ways of packets transfer +@command{@ref{nncp-toss}} utility can be invoked with @option{-seen} +option, leading to creation of @file{seen/} files, telling that the file +with specified hash has already been processed before. It could be +useful when there are use-cases where multiple ways of packets transfer available and there is possibility of duplicates reception. You have to manually remove them, when you do not need them (probably because they are expired). +@cindex hdr files @anchor{HdrFile} @item hdr/LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ If no @ref{CfgNoHdr, nohdr} option is enabled in configuration file, then @file{hdr/} files are automatically created for every ordinary (fully received and checksummed) packet. It literally contains just the header of the corresponding packet. It will be automatically created -even during simple @ref{nncp-stat} call. On filesystems with big -blocksize (ZFS for example) it can greatly help listing the packets in -directories, because it prevents unnecessary read-amplification. On +even during simple @command{@ref{nncp-stat}} call. On filesystems with +big blocksize (ZFS for example) it can greatly help listing the packets +in directories, because it prevents unnecessary read-amplification. On other filesystems probably it won't help at all, or even harm performance. There is a hack: you can create more dense @file{hdr/} allocation by -removing all @file{hdr/} files and then running @command{nncp-stat}, +removing all @file{hdr/} files and then running @command{@ref{nncp-stat}}, that will recreate them. In many cases many @file{hdr/} files will be allocated more or less linearly on the disk, decreasing listing time even more. diff --git a/doc/thanks.texi b/doc/thanks.texi index 13d355da2555feb33e656927e7485468508703d09b0bdf689826d13b4bbd6aab..a2efe4668b5405901d06d02a89f680bfdfe3f612ead34957562747e5dd9d29d0 100644 --- a/doc/thanks.texi +++ b/doc/thanks.texi @@ -1,4 +1,5 @@ @node Thanks +@cindex thanks @unnumbered Thanks There are people deserving to be thanked for helping this project: diff --git a/doc/usecases.ru/airgap.texi b/doc/usecases.ru/airgap.texi index 02de4406421f5e650437548e8090bc20dd9c0916f00cdc94d829400c810ce081..8196f489b64b6946a01cbd817b2355adf2eecb0b73923dc06825ce488570da95 100644 --- a/doc/usecases.ru/airgap.texi +++ b/doc/usecases.ru/airgap.texi @@ -37,7 +37,7 @@ доступен через online соединение, используя @emph{lan} адрес. @emph{bob-airgap} доступен путём посылки промежуточного ретранслируемого пакета через узел @emph{bob}. -Любая команда типа @command{nncp-file myfile bob-airgap:} автоматически +Любая команда типа @command{@ref{nncp-file} myfile bob-airgap:} автоматически создаст инкапсулированный пакет: один непосредственно для целевой точки, а другой несущий его для промежуточного узла. @@ -45,5 +45,4 @@ Имейте в виду, что узел-ретранслятор ничего не знает о внутреннем пакете, кроме его полного размера и приоритета. Все промежуточные пакеты тоже зашифрованы: используя хорошо известную технологию @url{https://ru.wikipedia.org/wiki/%D0%9B%D1%83%D0%BA%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%B0%D1%80%D1%88%D1%80%D1%83%D1%82%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F, -луковой маршрутизации}. @emph{bob} не может прочитать пакеты -@emph{bob-airgap}. +луковичного шифрования}. @emph{bob} не может прочитать пакеты @emph{bob-airgap}. diff --git a/doc/usecases.ru/caller.texi b/doc/usecases.ru/caller.texi index 3a6909fba423b9c628e8e1f674ff76b360a1001a41d829bad46c53da2c3ff7d5..51a11153a7958804db3cc4069718d325536377696b2992115725a84ae05c8510 100644 --- a/doc/usecases.ru/caller.texi +++ b/doc/usecases.ru/caller.texi @@ -8,7 +8,8 @@ изредка проходить высокоприоритетной почте в любое время. А также вы хотите проходить любому трафику когда узел доступен через ЛВС (LAN). Вы легко можете настроить ваши предпочтения в @ref{Call, настройках -звонков} для @ref{nncp-caller} команды, используемой при online связи. +звонков} для @command{@ref{nncp-caller}} команды, используемой при +online связи. @verbatim neigh: { diff --git a/doc/usecases.ru/mail.texi b/doc/usecases.ru/mail.texi index ec5a360dc0bc97419a49547fd90224da8dd7e93fae04ad36ed2cda39e4b34ff2..bc75e417ce52420ef45701439fc8a0791e491f121f56efaa66ff74870162bdfa 100644 --- a/doc/usecases.ru/mail.texi +++ b/doc/usecases.ru/mail.texi @@ -19,7 +19,7 @@ @url{https://ru.wikipedia.org/wiki/KISS_(%D0%BF%D1%80%D0%B8%D0%BD%D1%86%D0%B8%D0%BF), KISS}! Просто скажите вашим обоим Postfix/Exim-ам (на сервере и ноутбуке) -отправлять сообщения через NNCP (@ref{nncp-exec}) на заданный узел. +отправлять сообщения через NNCP (@command{@ref{nncp-exec}}) на заданный узел. Более подробно читайте для Postfix @ref{Postfix, здесь}, а для Exim @ref{Exim, здесь}. Вся почта будет сохранятся в NNCP @ref{Spool, спуле}, который после обмена данных и распаковки вызовет локальный diff --git a/doc/usecases.ru/nolink.texi b/doc/usecases.ru/nolink.texi index a351320abdc4de5c5cdf3082227fd471f854212529f464bbcc2acdcb7a726fed..d805b3765f8ae42d3a926252144e60464d88e1683caeb7156c0ccd53e092c2cc 100644 --- a/doc/usecases.ru/nolink.texi +++ b/doc/usecases.ru/nolink.texi @@ -8,7 +8,7 @@ передачи пакетов другим узлам. Представьте, что вы послали два файла узлу @emph{bob}. Вставьте USB устройство (SD гораздо предпочтительнее!) хранения, подмонтируйте и -запустите @ref{nncp-xfer}: +запустите @command{@ref{nncp-xfer}}: @example $ nncp-xfer -node bob /media/usbstick @@ -35,5 +35,8 @@ $ nncp-xfer /media/usbstick @end example чтобы найти все пакеты относящиеся к их узлу и локально скопируют для -дальнейшей обработки. @command{nncp-xfer} это единственная команда +дальнейшей обработки. @command{@ref{nncp-xfer}} это единственная команда используемая с переносными устройствами хранения. + +Вы также можете опционально использовать явное подтверждение приёма +пакетов, как описано в @command{@ref{nncp-ack}}. diff --git a/doc/usecases.ru/pop.texi b/doc/usecases.ru/pop.texi index 9080d96a1120fc4219ecdd9642ba8277b52d294e33151c5aa5eaf883da9d42f7..6ac37d9925387007087aa794b8c814052e619dee7708d38379e7d9706799af31 100644 --- a/doc/usecases.ru/pop.texi +++ b/doc/usecases.ru/pop.texi @@ -1,9 +1,10 @@ @node UsecasePOPRU @subsection Легковесная и быстрая замена POP3/IMAP4 -@ref{nncp-daemon} может быть соединён с @ref{nncp-caller} длительное -время -- он создаёт TCP соединение на многие часы. Когда SMTP сервер -получает письмо, то вызывает @ref{nncp-exec} для создания исходящего +@command{@ref{nncp-daemon}} может быть соединён с +@command{@ref{nncp-caller}} длительное время -- он создаёт TCP +соединение на многие часы. Когда SMTP сервер получает письмо, то +вызывает @command{@ref{nncp-exec}} для создания исходящего зашифрованного пакета. Демон ежесекундно проверяет исходящую директорию и сразу же посылает оповещение о недоставленных пакетах противоположной стороне, которая сразу же их может скачать. diff --git a/doc/usecases.ru/spy.texi b/doc/usecases.ru/spy.texi index da19b852ab6ac8b9cf4951fee5ab83a33f53bbb93d872286b1a3aa66ad6b8929..6fc71b580a6d7ad0ce77c0678686490049e0f375a2b0e55c95e68b266afdda33 100644 --- a/doc/usecases.ru/spy.texi +++ b/doc/usecases.ru/spy.texi @@ -30,10 +30,10 @@ так плохо, потому что вы не носите с собой приватные ключи (ведь так?), вы не "распаковываете" эти пакеты сразу же на том же самом устройстве. Распаковка (чтение этих зашифрованных пакетов с извлечением переданных файлов и почтовых сообщений) может и должна бы быть произведена на -отдельном компьютере (@ref{nncp-cfgmin} команда может помочь с созданием -конфигурационного файла без приватных ключей для этой цели). +отдельном компьютере (@command{@ref{nncp-cfgmin}} команда может помочь с +созданием конфигурационного файла без приватных ключей для этой цели). Если вы действительно хотите взять с собой приватные ключи, то -@ref{nncp-cfgenc} команда способна зашифровать ваш конфигурационный -файл. Парольная фраза вами введённая усиливается функцией нагружающей и -центральный процессор и память. +@command{@ref{nncp-cfgenc}} команда способна зашифровать ваш +конфигурационный файл. Парольная фраза вами введённая усиливается +функцией нагружающей и центральный процессор и память. diff --git a/doc/usecases/airgap.texi b/doc/usecases/airgap.texi index 7a99189f8cce47656f57a7de54ec4f0c8676fa0bcbcd878c79e80fa4717a10f4..7fac0e6a16ea910a1e4ac19d8728a361dc04f158916c81e68f59e64c372ef4fe 100644 --- a/doc/usecases/airgap.texi +++ b/doc/usecases/airgap.texi @@ -1,4 +1,5 @@ @node UsecaseAirgap +@cindex air-gap @section Highly secure isolated air-gap computers If you worry much about security, then air-gapped computer could be the @@ -35,11 +36,11 @@ reached via online connection using @emph{lan} address. @emph{bob-airgap} can be reached by sending intermediate relay packet through the @emph{bob}. -Any command like @command{nncp-file myfile bob-airgap:} will +Any command like @command{@ref{nncp-file} myfile bob-airgap:} will automatically create an encapsulated packet: one for the destination endpoint, and other carrying it for intermediate relaying node. Pay attention that relaying node knows nothing about the packet inside, but just its size and priority. Transition packets are encrypted too: using well-known @url{https://en.wikipedia.org/wiki/Onion_routing, onion -routing} technology. @emph{bob} can not read @emph{bob-airgap}'s packets. +encryption} technology. @emph{bob} can not read @emph{bob-airgap}'s packets. diff --git a/doc/usecases/caller.texi b/doc/usecases/caller.texi index 6a35c12225cec0d0f745e08d359e9f741f37c68eb7dcd4549ebb4f20e885b7a8..73031adb30dd885724ee6a59af16f46fc36d0bda2b3ce921e71a3a8deac91d8a 100644 --- a/doc/usecases/caller.texi +++ b/doc/usecases/caller.texi @@ -7,9 +7,8 @@ files at that time, but keep high priority email infrequently passing through in anytime. Also you wish to pass any kind of traffic when the node is available through the LAN. -You can easily set your preferences in @ref{Call, call -configurations} for @ref{nncp-caller} command used in online -communications. +You can easily set your preferences in @ref{Call, call configurations} +for @command{@ref{nncp-caller}} command used in online communications. @verbatim neigh: { diff --git a/doc/usecases/index.texi b/doc/usecases/index.texi index 839d341834b2c6144a217bb9b5f85bf694909e112e0ad9d39357e7b4147a3d0f..f24881588d8958862adc81620540aedef011a4e5f96c76e75130fd28d9736a6d 100644 --- a/doc/usecases/index.texi +++ b/doc/usecases/index.texi @@ -1,4 +1,5 @@ @node Use cases +@cindex use cases @unnumbered Use cases See also this page @ref{Сценарии, on russian}. diff --git a/doc/usecases/mail.texi b/doc/usecases/mail.texi index 9fc5330d3ffb62c376162fb3c2e605ab3818175dec810dce595f75ffe6c8f6da..2806fbc85438e204da740744080c599200d3a9819fb57e31c39d939384e9b784 100644 --- a/doc/usecases/mail.texi +++ b/doc/usecases/mail.texi @@ -17,7 +17,7 @@ overcomplicated and bloated for the simple task. Not an option. @url{https://en.wikipedia.org/wiki/KISS_principle, KISS}! Just tell both of your Postfix/Exim (on the server and notebook) to drop -email as a mail via NNCP (@ref{nncp-exec}) to specified node. +email as a mail via NNCP (@command{@ref{nncp-exec}}) to specified node. More information for Postfix is @ref{Postfix, here} and for Exim is @ref{Exim, here}. All mail will be stored in NNCP @ref{Spool, spool}, diff --git a/doc/usecases/nolink.texi b/doc/usecases/nolink.texi index 6b93867ab4ff5627e6472d325936ba4ce1411e02ffc63c0d3fc0293d734aa9a5..cd10c86793ea1c899f5938a6390e0f73cb337e0ab844a4cdb02600cf03ac32d2 100644 --- a/doc/usecases/nolink.texi +++ b/doc/usecases/nolink.texi @@ -1,4 +1,6 @@ @node UsecaseNoLink +@cindex extreme environments +@cindex lack of link @section Extreme terrestrial environments, no link This is some kind of too slow link. Offline delivery methods is the only @@ -6,7 +8,7 @@ choice. Just send files as shown in previous section, but use removable media for transferring packets to other nodes. Assume that you send two files to @emph{bob} node. Insert USB storage -device (SD is preferable!), mount it and run @ref{nncp-xfer}: +device (SD is preferable!), mount it and run @command{@ref{nncp-xfer}}: @example $ nncp-xfer -node bob /media/usbstick @@ -32,5 +34,8 @@ $ nncp-xfer /media/usbstick @end example to find all packets related to their node and copy them locally for -further processing. @command{nncp-xfer} is the only command used with +further processing. @command{@ref{nncp-xfer}} is the only command used with removable devices. + +You can also optionally wait for explicit packets receipt +acknowledgement as described in @command{@ref{nncp-ack}}. diff --git a/doc/usecases/pop.texi b/doc/usecases/pop.texi index efb30fb1723c795a781e005adb5f73e477f4fd23984c24338305ce83be33fc1e..2f513c849fe85eceece0a0194e4c4579d9116a52d5534a6072470d368626ca91 100644 --- a/doc/usecases/pop.texi +++ b/doc/usecases/pop.texi @@ -1,12 +1,15 @@ @node UsecasePOP +@cindex POP3 replacement +@cindex IMAP4 replacement @section Lightweight fast POP3/IMAP4 replacement -@ref{nncp-daemon} can be connected with @ref{nncp-caller} for a long -time -- it can create TCP connection that lasts for many hours. When -SMTP server receives mail, it will call @ref{nncp-exec} creating an -outbound encrypted packet. Daemon checks outbound directory each second -and immediately sends notification about undelivered packets to remote -side, that also downloads it at once. +@command{@ref{nncp-daemon}} can be connected with +@command{@ref{nncp-caller}} for a long time -- it can create TCP +connection that lasts for many hours. When SMTP server receives mail, it +will call @command{@ref{nncp-exec}} creating an outbound encrypted +packet. Daemon checks outbound directory each second and immediately +sends notification about undelivered packets to remote side, that also +downloads it at once. There are only dozens of bytes notifying about incoming packets, dozens of bytes telling to download those packets. Mail packets are compressed diff --git a/doc/usecases/qos.texi b/doc/usecases/qos.texi index 6a4dcef0c4ec893291f80b5c839983bea0ad131c74e3bf0488cff2a91af20d0e..53d595c5e31a04b18c609473db0c6e0e3d81912fd0a1d7aba5401ba884344d2c 100644 --- a/doc/usecases/qos.texi +++ b/doc/usecases/qos.texi @@ -1,4 +1,7 @@ @node UsecaseQoS +@cindex expensive link +@cindex slow link +@cindex bad QoS @section Slow/expensive link for high-volume data, bad QoS Assume that you can give your relatively cheap 2 TiB removable hard diff --git a/doc/usecases/satellite.texi b/doc/usecases/satellite.texi index 1bc949d9de539a8982e06c3cc4e24f2db68e204e9d9c9adf658607bc147e222b..e1c956579f11c278be736ca3b0380d69258b12f575959568800a5c4d2cbca9cc 100644 --- a/doc/usecases/satellite.texi +++ b/doc/usecases/satellite.texi @@ -1,4 +1,5 @@ @node UsecaseSatelliteLinks +@cindex satellite link @section Satellite links Satellite links have @strong{very} high delays together with high diff --git a/doc/usecases/spy.texi b/doc/usecases/spy.texi index a801ab45ae0f57d920a77214cc9ca50f1184e4aad0323262087e8ea07e098623..6cf65a1ebbbb2eafe1e09670af66aaa51e33aed4c9c8f93b48b4d46b370e02d5 100644 --- a/doc/usecases/spy.texi +++ b/doc/usecases/spy.texi @@ -1,4 +1,5 @@ @node UsecaseSpy +@cindex reconnaissance, spying, intelligence, covert operations @section Reconnaissance, spying, intelligence, covert agents Those guys know how Internet is a dangerous place incompatible with @@ -26,9 +27,9 @@ and so on -- it is not so bad, because you are not carrying private keys with it (don't you?), you do not "toss" those packets immediately on the same device. Tossing (reading those encrypted packets and extracting transferred files and mail messages) could and should be done on a -separate computer (@ref{nncp-cfgmin} command could help creating +separate computer (@command{@ref{nncp-cfgmin}} command could help creating configuration file without private keys for that purpose). -If you really want to carry your private keys, then @ref{nncp-cfgenc} +If you really want to carry your private keys, then @command{@ref{nncp-cfgenc}} command will be able to encrypt your configuration file. Passphrase you enter is strengthened with both CPU and memory hard function. diff --git a/doc/usecases/unreliable.texi b/doc/usecases/unreliable.texi index 241f5bc4d13c9f1c861dbf73f284503c1113cc9fee96d38878ac36d98d94708f..37de996c77ff5359e3953242777069d44b5547d6d7180d399200a62bc307da04 100644 --- a/doc/usecases/unreliable.texi +++ b/doc/usecases/unreliable.texi @@ -1,4 +1,5 @@ @node UsecaseUnreliable +@cindex unreliable link @section Unreliable/expensive communication link Assume that you have got slow modem/radio/cellular link that frequently diff --git a/doc/workflow.texi b/doc/workflow.texi index d87db92a8e708a52ea3e6fa6c3250c53daa5b77cfbc0cf08ecd49d287eacffd9..ea1ccdfe397b679b7a202028205bf3fbaaac6d93a4f603413296205b184d6f9b 100644 --- a/doc/workflow.texi +++ b/doc/workflow.texi @@ -1,44 +1,57 @@ @node Workflow +@cindex workflow @unnumbered Workflow NNCP consists of several utilities. As a rule you will have the following workflow: @enumerate -@item Run @ref{nncp-cfgnew} on each node to create an initial + +@item Run @command{@ref{nncp-cfgnew}} on each node to create an initial @ref{Configuration, configuration} file. + @item Tune it up and set at least @ref{Spool, spool} and log paths. + @item Share your public keys and reachability addressees with your neighbours. Add their keys to your configuration file and do any other required configuration about their reachability, permissions of file or freq transmission. -@item Use @ref{nncp-file}, @ref{nncp-freq}, @ref{nncp-exec} -(look @ref{Postfix, how} Postfix and @ref{Exim, how} Exim SMTP servers -could be configured) commands to queue file, freq and exec -transmissions. Repeat as many times any time as you wish. + +@item Use @command{@ref{nncp-file}}, @command{@ref{nncp-freq}}, +@command{@ref{nncp-exec}} (look @ref{Postfix, how} Postfix and +@ref{Exim, how} Exim SMTP servers could be configured) commands to queue +file, freq and exec transmissions. Repeat as many times any time as you +wish. + @item Depending on connection methods, either: @itemize - @item run @ref{nncp-daemon} to accept remotely initiated connections - to your node - @item run either @ref{nncp-call} or @ref{nncp-caller} to initiate - connection to required nodes from time to time - @item use @ref{nncp-xfer} with removable storage devices for copying - packets to/from other nodes - @item use @ref{nncp-bundle} with either sequential storage devices - or broadcasting transmissions for copying packets + @item run @command{@ref{nncp-daemon}} to accept remotely initiated + connections to your node + @item run either @command{@ref{nncp-call}} or + @command{@ref{nncp-caller}} to initiate connection to required nodes + from time to time + @item use @command{@ref{nncp-xfer}} with removable storage devices + for copying packets to/from other nodes + @item use @command{@ref{nncp-bundle}} with either sequential storage + devices or broadcasting transmissions for copying packets @end itemize + @item After successful packet exchanging (or just simply from time to -time), run @ref{nncp-toss} for tossing (decrypting and processing) all -inbound queues to receive exec messages, files, file requests and relay -transition packets to other nodes. +time), run @command{@ref{nncp-toss}} for tossing (decrypting and +processing) all inbound queues to receive exec messages, files, file +requests and relay transition packets to other nodes. + +@item Optionally do not forget about explicit receipt acknowledgement +ability with @command{@ref{nncp-ack}}. + @end enumerate @itemize @item If you wish to encrypt your configuration file containing your -private keys, then use @ref{nncp-cfgenc} utility. You can always use an -encrypted config without decrypting it in temporary memory file. +private keys, then use @command{@ref{nncp-cfgenc}} utility. You can +always use an encrypted config without decrypting it in temporary memory file. @item If you wish to strip off any private keys from your config, then -use @ref{nncp-cfgmin} utility. It will be useful for transferring +use @command{@ref{nncp-cfgmin}} utility. It will be useful for transferring messages with offline methods, but tossing them later on the machine with private keys. @end itemize diff --git a/doc/yggdrasil.texi b/doc/yggdrasil.texi index a90e02f4222cb351dbdf6226cd4887695a2c07201411a947e76e96dc85c4b280..b5eafd5efcf970490ca2ecf247bc953317c103d0d8221a55131c35facdaf8b78 100644 --- a/doc/yggdrasil.texi +++ b/doc/yggdrasil.texi @@ -1,4 +1,5 @@ @node Yggdrasil +@cindex yggdrasil @unnumbered Yggdrasil support NNCP is able to act as a node of @@ -15,31 +16,34 @@ system's network stack, that would require use of some kind full-featured TUN network interface, there is pure Go built-in stack, responsible for IPv6 and TCP protocols support. You do not need to think about network interfaces, addressing and firewall setup at all: -@ref{nncp-daemon} acts as Yggdrasil IPv6 reachable host, listening on -single TCP port. You can reach it using ordinary non-Yggdrasil capable -version of @ref{nncp-call}, calling corresponding 200::/7 IPv6 address -through native Yggdrasil daemon created TUN interface. -@ref{nncp-daemon}, @ref{nncp-call}* can freely peer with Yggdrasil -nodes, reusing existing infrastructure. +@command{@ref{nncp-daemon}} acts as Yggdrasil IPv6 reachable host, +listening on single TCP port. You can reach it using ordinary +non-Yggdrasil capable version of @command{@ref{nncp-call}}, calling +corresponding 200::/7 IPv6 address through native Yggdrasil daemon +created TUN interface. @command{@ref{nncp-daemon}}, +@command{@ref{nncp-call}}* can freely peer with Yggdrasil nodes, reusing +existing infrastructure. Only minor modifications were done to current NNCP's tools: @itemize -@item @ref{nncp-daemon} has @option{-yggdrasil yggdrasils://} option, -making it also as a Yggdrasil listener network node. It can +@cindex yggdrasils schema +@item @command{@ref{nncp-daemon}} has @option{-yggdrasil yggdrasils://} +option, making it also as a Yggdrasil listener network node. It can automatically connect to other peers and participate in routing. It does not have to answer NNCP's online protocol requests at all and just can be some intermediate routing point in the whole mesh network. -@item @ref{nncp-call}/@ref{nncp-caller} commands understand +@cindex yggdrasilc schema +@item @command{@ref{nncp-call}}/@command{@ref{nncp-caller}} commands understand @code{yggdrasilc://} addresses, pointing to the desired Yggdrasil's public key (that also acts as the destination host's address). Yggdrasil background goroutine is automatically started, connecting to the specified Yggdrasil entrypoints, calling remote NNCP node and initiating NNCP's native @ref{Sync, online protocol} handshake on top of that. -@item @ref{nncp-cfgnew} is able to generate ed25519 keypair. +@item @command{@ref{nncp-cfgnew}} is able to generate ed25519 keypair. @item @ref{CfgYggdrasilAliases, Configuration file} optionally contains @code{yggdrasil-aliases} map. @@ -63,25 +67,29 @@ You should share that public key with other NNCP peers. @item -Start @ref{nncp-daemon} listening on Yggdrasil's incoming connections. +Start @command{@ref{nncp-daemon}} listening on Yggdrasil's incoming connections. You have to specify: @itemize +@vindex PrivateKey @item Your private key (generated above). Yggdrasil's @code{PrivateKey} analogue. @item Optional non-default port you will listen on Yggdrasil's IPv6 address. +@vindex Listen @item Optional list of bind addresses, used for peering between the nodes. Yggdrasil's @code{Listen} analogue. +@vindex Peers @item Optional list of peer addresses you should connect to. Yggdrasil's @code{Peers} analogue. +@vindex AllowedPublicKeys @item Optional list of allowed peer public keys, allowed for incoming peering connections from. Yggdrasil's @code{AllowedPublicKeys} analogue. diff --git a/makedist.sh b/makedist.sh index f7772c8adaa230359917176c0b2d8624fd2c6d704b094019b03cc87d50fbb67d..b165d846dc6562155dba97bb6243d565f7724d871684a663a79ba797dfaf8053 100755 --- a/makedist.sh +++ b/makedist.sh @@ -69,7 +69,7 @@ @documentencoding UTF-8 @settitle NEWS @node News @unnumbered News -`sed -n '5,$p' < doc/news.texi` +`sed -n '6,$p' < doc/news.texi` @bye EOF mkinfo --output NEWS $texi @@ -128,6 +128,7 @@ gpg --enarmor < "$tarball".sig | sed "/^Comment:/d ; s/ARMORED FILE/SIGNATURE/" > "$tarball".asc meta4-create -file "$tarball" -mtime "$tarball" -sig "$tarball".asc \ http://www.nncpgo.org/download/"$tarball" \ + http://y.www.nncpgo.org/download/"$tarball" \ https://nncp.mirrors.quux.org/download/"$tarball" > "$tarball".meta4 size=$(( $(stat -f %z $tarball) / 1024 )) diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile index e0de38eff635ec6d95dffcf0181487f4b4cfc4228eade7952436921f54618a7a..d09bcec54cc2a5d89cb9336d734e7a53873aed36ed08c6acd503853b9404b8d5 100644 --- a/ports/nncp/Makefile +++ b/ports/nncp/Makefile @@ -1,5 +1,5 @@ PORTNAME= nncp -DISTVERSION= 7.6.0 +DISTVERSION= 8.6.0 CATEGORIES= net MASTER_SITES= http://www.nncpgo.org/download/ diff --git a/ports/nncp/pkg-plist b/ports/nncp/pkg-plist index 5fc8185be80f0974f9d51e3d6bd3482a210f38dddb3ef4ac6e7e6e6d642ef774..870d907478f49b702bbbb66457df6ddd4b98e6ee6e6d8526464f9fcc9af17d82 100644 --- a/ports/nncp/pkg-plist +++ b/ports/nncp/pkg-plist @@ -1,3 +1,4 @@ +bin/nncp-ack bin/nncp-bundle bin/nncp-call bin/nncp-caller diff --git a/src/call.go b/src/call.go index 8e52a438eac7554a6635413e994a69d077a56a3597ab5aa685ecc732fd1c7394..0f452f053fac6e866f9dc0f0565adbf85c1c8b9a5b9d5a346e9e5f022abc5aea 100644 --- a/src/call.go +++ b/src/call.go @@ -50,6 +50,7 @@ AutoTossNoFreq bool AutoTossNoExec bool AutoTossNoTrns bool AutoTossNoArea bool + AutoTossNoACK bool } func (ctx *Ctx) CallNode( @@ -116,7 +117,7 @@ if err = state.StartI(conn); err == nil { ctx.LogI("call-started", les, func(les LEs) string { return fmt.Sprintf("Connection to %s (%s)", node.Name, addr) }) - state.Wait() + isGood = state.Wait() ctx.LogI("call-finished", append( les, LE{"Duration", int64(state.Duration.Seconds())}, @@ -137,7 +138,6 @@ humanize.IBytes(uint64(state.TxBytes)), humanize.IBytes(uint64(state.TxSpeed)), ) }) - isGood = true conn.Close() break } else { diff --git a/src/cfg.go b/src/cfg.go index 8378853ac2ec807e754867165569aaf4759b95b56f09f9735ba024fd934de967..7457cf5b0ef576ef47634e2ad6597fdc1c63144f7f952dd23123efeada2e141a 100644 --- a/src/cfg.go +++ b/src/cfg.go @@ -38,6 +38,7 @@ const ( CfgPathEnv = "NNCPCFG" CfgSpoolEnv = "NNCPSPOOL" CfgLogEnv = "NNCPLOG" + CfgNoSync = "NNCPNOSYNC" ) var ( diff --git a/src/cmd/nncp-ack/main.go b/src/cmd/nncp-ack/main.go new file mode 100644 index 0000000000000000000000000000000000000000..bc1388f383ccaca27f158deb8b91348f5a9db811146fde3098db845d4d685d41 --- /dev/null +++ b/src/cmd/nncp-ack/main.go @@ -0,0 +1,138 @@ +/* +NNCP -- Node to Node copy, utilities for store-and-forward data exchange +Copyright (C) 2016-2022 Sergey Matveev + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Send packet receipt acknowledgement via NNCP. +package main + +import ( + "flag" + "fmt" + "log" + "os" + "path/filepath" + "strings" + + "go.cypherpunks.ru/nncp/v8" +) + +func usage() { + fmt.Fprintf(os.Stderr, nncp.UsageHeader()) + fmt.Fprintf(os.Stderr, "nncp-ack -- send packet receipt acknowledgement\n\n") + fmt.Fprintf(os.Stderr, "Usage: %s [options] -all\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s -node NODE[,...]\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s -node NODE -pkt PKT\n", os.Args[0]) + fmt.Fprintln(os.Stderr, "Options:") + flag.PrintDefaults() +} + +func main() { + var ( + cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file") + niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq), "Outbound packet niceness") + minSizeRaw = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB") + viaOverride = flag.String("via", "", "Override Via path to destination node (ignored with -all)") + spoolPath = flag.String("spool", "", "Override path to spool") + logPath = flag.String("log", "", "Override path to logfile") + doAll = flag.Bool("all", false, "ACK all rx packet for all nodes") + nodesRaw = flag.String("node", "", "ACK rx packets for that node") + pktRaw = flag.String("pkt", "", "ACK only that packet") + quiet = flag.Bool("quiet", false, "Print only errors") + showPrgrs = flag.Bool("progress", false, "Force progress showing") + omitPrgrs = flag.Bool("noprogress", false, "Omit progress showing") + debug = flag.Bool("debug", false, "Print debug messages") + version = flag.Bool("version", false, "Print version information") + warranty = flag.Bool("warranty", false, "Print warranty information") + ) + log.SetFlags(log.Lshortfile) + flag.Usage = usage + flag.Parse() + if *warranty { + fmt.Println(nncp.Warranty) + return + } + if *version { + fmt.Println(nncp.VersionGet()) + return + } + nice, err := nncp.NicenessParse(*niceRaw) + if err != nil { + log.Fatalln(err) + } + + ctx, err := nncp.CtxFromCmdline( + *cfgPath, + *spoolPath, + *logPath, + *quiet, + *showPrgrs, + *omitPrgrs, + *debug, + ) + if err != nil { + log.Fatalln("Error during initialization:", err) + } + if ctx.Self == nil { + log.Fatalln("Config lacks private keys") + } + + ctx.Umask() + minSize := int64(*minSizeRaw) * 1024 + + var nodes []*nncp.Node + if *nodesRaw != "" { + for _, nodeRaw := range strings.Split(*nodesRaw, ",") { + node, err := ctx.FindNode(nodeRaw) + if err != nil { + log.Fatalln("Invalid -node specified:", err) + } + nodes = append(nodes, node) + } + } + if *doAll { + if len(nodes) != 0 { + usage() + os.Exit(1) + } + for _, node := range ctx.Neigh { + nodes = append(nodes, node) + } + } else if len(nodes) == 0 { + usage() + os.Exit(1) + } + + if *pktRaw != "" { + if len(nodes) != 1 { + usage() + os.Exit(1) + } + nncp.ViaOverride(*viaOverride, ctx, nodes[0]) + if err = ctx.TxACK(nodes[0], nice, *pktRaw, minSize); err != nil { + log.Fatalln(err) + } + return + } + + for _, node := range nodes { + for job := range ctx.Jobs(node.Id, nncp.TRx) { + pktName := filepath.Base(job.Path) + if err = ctx.TxACK(node, nice, pktName, minSize); err != nil { + log.Fatalln(err) + } + } + } +} diff --git a/src/cmd/nncp-bundle/main.go b/src/cmd/nncp-bundle/main.go index 1749c215d0ea3ad75a13ef5a720471030601b1ed66164c71b854432d128038d4..2a30dd3cf128f3a2c33a5ca9a4fb59af048f8247d4819cbbee0d028e5de6d76a 100644 --- a/src/cmd/nncp-bundle/main.go +++ b/src/cmd/nncp-bundle/main.go @@ -483,8 +483,10 @@ } if err = bufTmp.Flush(); err != nil { log.Fatalln("Error during flushing:", err) } - if err = tmp.Sync(); err != nil { - log.Fatalln("Error during syncing:", err) + if !nncp.NoSync { + if err = tmp.Sync(); err != nil { + log.Fatalln("Error during syncing:", err) + } } if err = tmp.Close(); err != nil { log.Fatalln("Error during closing:", err) diff --git a/src/cmd/nncp-call/main.go b/src/cmd/nncp-call/main.go index 75e003416c6e20781ba0f1025e3e0013452da5fbeb89fb7b9da47850ba15d0a0..bf5038cac3d8d13c4a4480a125af511d7ac422fa62d88827d4d03ed34da2fddc 100644 --- a/src/cmd/nncp-call/main.go +++ b/src/cmd/nncp-call/main.go @@ -71,6 +71,7 @@ autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing") autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing") autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing") autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing") + autoTossNoACK = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing") ) log.SetFlags(log.Lshortfile) flag.Usage = usage @@ -217,6 +218,7 @@ *autoTossNoFreq, *autoTossNoExec, *autoTossNoTrns, *autoTossNoArea, + *autoTossNoACK, ) } diff --git a/src/cmd/nncp-caller/main.go b/src/cmd/nncp-caller/main.go index 8319f4eba451165fa07985a48c2793657faf20046ba229dd744b275d2a1c5ce5..667c55a0785b9cefbbc7efe54f08db9d6d4f418e55395e3a6524899f49f5287a 100644 --- a/src/cmd/nncp-caller/main.go +++ b/src/cmd/nncp-caller/main.go @@ -59,6 +59,7 @@ autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing") autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing") autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing") autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing") + autoTossNoACK = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing") ) log.SetFlags(log.Lshortfile) flag.Usage = usage @@ -219,6 +220,7 @@ call.AutoTossNoFreq || *autoTossNoFreq, call.AutoTossNoExec || *autoTossNoExec, call.AutoTossNoTrns || *autoTossNoTrns, call.AutoTossNoArea || *autoTossNoArea, + call.AutoTossNoACK || *autoTossNoACK, ) } diff --git a/src/cmd/nncp-daemon/main.go b/src/cmd/nncp-daemon/main.go index 95ab9b06ddb2628b7133b167ef8169f4d52a6fbb99ea53e7cab376b9bc930fae..50bf4017ef9ec1363269c4e92465f35c5c7d2a569b8d829e62ebc0cbdcae441d 100644 --- a/src/cmd/nncp-daemon/main.go +++ b/src/cmd/nncp-daemon/main.go @@ -158,6 +158,7 @@ autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing") autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing") autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing") autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing") + autoTossNoACK = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing") ) log.SetFlags(log.Lshortfile) flag.Usage = usage @@ -217,6 +218,7 @@ *autoTossNoFreq, *autoTossNoExec, *autoTossNoTrns, *autoTossNoArea, + *autoTossNoACK, ) } <-nodeIdC // call completion @@ -303,6 +305,7 @@ *autoTossNoFreq, *autoTossNoExec, *autoTossNoTrns, *autoTossNoArea, + *autoTossNoACK, ) } <-nodeIdC // call completion diff --git a/src/cmd/nncp-pkt/main.go b/src/cmd/nncp-pkt/main.go index fcc4d7351411d8e4ffcd81e18616f0dba3ce8670610537728f7ba3d6ae40f142..f37ca6acb63e9135e820324519b70a2288d31e12428d2b8866ef92921f1a3f88 100644 --- a/src/cmd/nncp-pkt/main.go +++ b/src/cmd/nncp-pkt/main.go @@ -74,6 +74,8 @@ case nncp.PktTypeExecFat: payloadType = "exec uncompressed" case nncp.PktTypeArea: payloadType = "area" + case nncp.PktTypeACK: + payloadType = "acknowledgement" } var path string switch pkt.Type { @@ -92,6 +94,8 @@ path = nncp.Base32Codec.EncodeToString(pkt.Path[:pkt.PathLen]) if areaId, err := nncp.AreaIdFromString(path); err == nil { path = fmt.Sprintf("%s (%s)", path, ctx.AreaName(areaId)) } + case nncp.PktTypeACK: + path = nncp.Base32Codec.EncodeToString(pkt.Path[:pkt.PathLen]) default: path = string(pkt.Path[:pkt.PathLen]) } diff --git a/src/cmd/nncp-reass/main.go b/src/cmd/nncp-reass/main.go index 0da6636afe1d6356e017059356e0971d9206544ba1c16faa6dc709d036775d33..c4d32a11344ed48c80168a5230c161ebbf04fa112f158fb02bbf795cf98dcf86 100644 --- a/src/cmd/nncp-reass/main.go +++ b/src/cmd/nncp-reass/main.go @@ -237,8 +237,10 @@ if err = dstW.Flush(); err != nil { log.Fatalln("Can not flush:", err) } if tmp != nil { - if err = tmp.Sync(); err != nil { - log.Fatalln("Can not sync:", err) + if !nncp.NoSync { + if err = tmp.Sync(); err != nil { + log.Fatalln("Can not sync:", err) + } } if err = tmp.Close(); err != nil { log.Fatalln("Can not close:", err) diff --git a/src/cmd/nncp-toss/main.go b/src/cmd/nncp-toss/main.go index 58f14be45d752c402d55bf911ba324e9ed9c74d2b6c4d421d2322f5e52b236f9..b3beb8885d8a2c1c4eac6c5e0b7b51a4492cd3a92ae5c65857361c5405b2c9ab 100644 --- a/src/cmd/nncp-toss/main.go +++ b/src/cmd/nncp-toss/main.go @@ -49,6 +49,7 @@ noFreq = flag.Bool("nofreq", false, "Do not process \"freq\" packets") noExec = flag.Bool("noexec", false, "Do not process \"exec\" packets") noTrns = flag.Bool("notrns", false, "Do not process \"transitional\" packets") noArea = flag.Bool("noarea", false, "Do not process \"area\" packets") + noACK = flag.Bool("noack", false, "Do not process \"ack\" packets") spoolPath = flag.String("spool", "", "Override path to spool") logPath = flag.String("log", "", "Override path to logfile") quiet = flag.Bool("quiet", false, "Print only errors") @@ -110,14 +111,14 @@ isBad = ctx.Toss( node.Id, nncp.TRx, nice, - *dryRun, *doSeen, *noFile, *noFreq, *noExec, *noTrns, *noArea, + *dryRun, *doSeen, *noFile, *noFreq, *noExec, *noTrns, *noArea, *noACK, ) || isBad if nodeId == *ctx.SelfId { isBad = ctx.Toss( node.Id, nncp.TTx, nice, - *dryRun, false, true, true, true, true, *noArea, + *dryRun, false, true, true, true, true, *noArea, *noACK, ) || isBad } } @@ -150,14 +151,14 @@ ctx.Toss( nodeId, nncp.TRx, nice, - *dryRun, *doSeen, *noFile, *noFreq, *noExec, *noTrns, *noArea, + *dryRun, *doSeen, *noFile, *noFreq, *noExec, *noTrns, *noArea, *noACK, ) if *nodeId == *ctx.SelfId { ctx.Toss( nodeId, nncp.TTx, nice, - *dryRun, false, true, true, true, true, *noArea, + *dryRun, false, true, true, true, true, *noArea, *noACK, ) } } diff --git a/src/cmd/nncp-xfer/main.go b/src/cmd/nncp-xfer/main.go index 4db974d8edc667e9f8dec7b4f260659d877b4a080b9ba14241cbb8fc1b0661e4..cb68836df5235d4a5aab7bf7220b55d9e0e33e0320efdac57168d5fb4dbb5c18 100644 --- a/src/cmd/nncp-xfer/main.go +++ b/src/cmd/nncp-xfer/main.go @@ -266,7 +266,7 @@ ctx.LogE("xfer-rx", les, errors.New("is not enough space"), logMsg) fd.Close() continue } - if _, err = fd.Seek(0, 0); err != nil { + if _, err = fd.Seek(0, io.SeekStart); err != nil { log.Fatalln(err) } tmp, err := ctx.NewTmpFileWHash() @@ -284,7 +284,7 @@ ctx.LogE("xfer-rx", les, err, logMsg) w.CloseWithError(err) } }() - if _, err = nncp.CopyProgressed( + _, err = nncp.CopyProgressed( tmp.W, r, "Rx", append( les, @@ -292,13 +292,24 @@ nncp.LE{K: "Pkt", V: filename}, nncp.LE{K: "FullSize", V: fiInt.Size()}, ), ctx.ShowPrgrs, - ); err != nil { + ) + fd.Close() + if err != nil { + ctx.LogE("xfer-rx", les, err, logMsg) + tmp.Cancel() + isBad = true + continue + } + if err = tmp.W.Flush(); err != nil { ctx.LogE("xfer-rx", les, err, logMsg) + tmp.Cancel() isBad = true + continue } - fd.Close() - if isBad { + if tmp.Checksum() != fiInt.Name() { + ctx.LogE("xfer-rx", les, errors.New("checksum mismatch"), logMsg) tmp.Cancel() + isBad = true continue } if err = tmp.Commit(filepath.Join( @@ -477,13 +488,15 @@ }) isBad = true continue } - if err = tmp.Sync(); err != nil { - tmp.Close() - ctx.LogE("xfer-tx-sync", les, err, func(les nncp.LEs) string { - return logMsg(les) + ": syncing" - }) - isBad = true - continue + if !nncp.NoSync { + if err = tmp.Sync(); err != nil { + tmp.Close() + ctx.LogE("xfer-tx-sync", les, err, func(les nncp.LEs) string { + return logMsg(les) + ": syncing" + }) + isBad = true + continue + } } if err = tmp.Close(); err != nil { ctx.LogE("xfer-tx-close", les, err, func(les nncp.LEs) string { diff --git a/src/go.mod b/src/go.mod index de7bcad9aa04b41925ba4ce0376ef7223e3b7113e7bd6ad21f9edf6a4eb0dc96..e8c1e3fe2f39da944710df2f6c9f90ab829b439208e6bbc74d08e8477abffe63 100644 --- a/src/go.mod +++ b/src/go.mod @@ -10,17 +10,18 @@ github.com/gologme/log v1.3.0 github.com/google/btree v1.0.1 // indirect github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 github.com/hjson/hjson-go v3.1.0+incompatible - github.com/klauspost/compress v1.13.6 + github.com/klauspost/compress v1.14.4 + github.com/klauspost/cpuid/v2 v2.0.11 // indirect github.com/yggdrasil-network/yggdrasil-go v0.4.2 go.cypherpunks.ru/balloon v1.1.1 go.cypherpunks.ru/recfile v0.4.3 - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - golang.org/x/net v0.0.0-20210614182718-04defd469f4e - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e + golang.org/x/crypto v0.0.0-20220214200702-86341886e292 + golang.org/x/net v0.0.0-20220225172249-27dd8689420f + golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect inet.af/netstack v0.0.0-20211120045802-8aa80cf23d3c - lukechampine.com/blake3 v1.1.6 + lukechampine.com/blake3 v1.1.7 ) go 1.13 diff --git a/src/go.sum b/src/go.sum index 52a1a20f43b321337a1374ebf6fba4cb8e7a0c867f8568fdca68c39fc81a7ee9..920678091222df4fd43878404300e7de4ea28f8011be99a4ce9608c0ea823340 100644 --- a/src/go.sum +++ b/src/go.sum @@ -27,10 +27,11 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hjson/hjson-go v3.1.0+incompatible h1:DY/9yE8ey8Zv22bY+mHV1uk2yRy0h8tKhZ77hEdi0Aw= github.com/hjson/hjson-go v3.1.0+incompatible/go.mod h1:qsetwF8NlsTsOTwZTApNlTCerV+b2GjYRRcIk4JMFio= github.com/kardianos/minwinsvc v1.0.0/go.mod h1:Bgd0oc+D0Qo3bBytmNtyRKVlp85dAloLKhfxanPFFRc= -github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= +github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.11 h1:i2lw1Pm7Yi/4O6XCSyJWqEHI2MDw2FzUK6o/D21xn2A= +github.com/klauspost/cpuid/v2 v2.0.11/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -61,14 +62,15 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -85,8 +87,9 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210611083646-a4fc73990273/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 h1:nhht2DYV/Sn3qOayu8lM+cU1ii9sTLUeBQwQQfUHtrs= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= @@ -95,6 +98,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -105,5 +109,5 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= inet.af/netstack v0.0.0-20211120045802-8aa80cf23d3c h1:nr31qYr+91rWD8klUkPx3eGTZzumCC414UJG1QRKZTc= inet.af/netstack v0.0.0-20211120045802-8aa80cf23d3c/go.mod h1:KOJdAzQzMLKzwFEdOOnrnSrLIhaFVB+NQoME/e5wllA= -lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= -lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= +lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= diff --git a/src/nncp.go b/src/nncp.go index 214560c103889cbf5d9f35431f9a97704f64e1da8e9ac50b4e5cee4fdecb4852..db1e1afbc656a292e3b4364dafae4aafca90ba1dc2d16a14acf28f235a27f208 100644 --- a/src/nncp.go +++ b/src/nncp.go @@ -40,7 +40,7 @@ const Base32Encoded32Len = 52 var ( - Version string = "8.5.0" + Version string = "8.6.0" Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding) ) diff --git a/src/pkt.go b/src/pkt.go index 4af44a33a1e36b3b51dd0d4310f3d0e3e4d216146fd81438dfa7516bd57447bf..eb8c3efe43c155d3f619362e906918d3e810473e1f8cef05a9354e1cbc1be87e 100644 --- a/src/pkt.go +++ b/src/pkt.go @@ -44,6 +44,7 @@ PktTypeExec PktType = iota PktTypeTrns PktType = iota PktTypeExecFat PktType = iota PktTypeArea PktType = iota + PktTypeACK PktType = iota MaxPathSize = 1<<8 - 1 diff --git a/src/sp.go b/src/sp.go index d62f8bd5f05df421dee20cb02495e6463646a3606e5b693c8bae661f5a462649..133bb9e5d716a26d8e4bb8a850c69aef3f67ac5098643c6f141bd2cb81a95c4a 100644 --- a/src/sp.go +++ b/src/sp.go @@ -1114,7 +1114,7 @@ return nil } -func (state *SPState) Wait() { +func (state *SPState) Wait() bool { state.wg.Wait() close(state.payloads) close(state.pings) @@ -1130,12 +1130,15 @@ } if txDuration > 0 { state.TxSpeed = state.TxBytes / txDuration } + nothingLeft := len(state.queueTheir) == 0 for _, s := range state.fds { + nothingLeft = false s.fd.Close() } for pktName := range state.progressBars { ProgressKill(pktName) } + return nothingLeft } func (state *SPState) ProcessSP(payload []byte) ([][]byte, error) { @@ -1461,13 +1464,15 @@ humanize.IBytes(uint64(ourSize)), humanize.IBytes(uint64(fullsize)), ) } - err = fd.Sync() - if err != nil { - state.Ctx.LogE("sp-file-sync", lesp, err, func(les LEs) string { - return logMsg(les) + ": syncing" - }) - state.closeFd(filePathPart) - continue + if !NoSync { + err = fd.Sync() + if err != nil { + state.Ctx.LogE("sp-file-sync", lesp, err, func(les LEs) string { + return logMsg(les) + ": syncing" + }) + state.closeFd(filePathPart) + continue + } } if hasherAndOffset != nil { delete(state.fileHashers, filePath) diff --git a/src/tmp.go b/src/tmp.go index e1f791f0aefe2d78c50ef4000ea9d8211c55e4ab8d61d92335fa87135c1fe597..28d5660fc3b9d4b45dffa3d0b14cc0fcd4d4299f3064411d708849b271b3dc95 100644 --- a/src/tmp.go +++ b/src/tmp.go @@ -28,6 +28,12 @@ "strconv" "time" ) +var NoSync bool + +func init() { + NoSync = os.Getenv(CfgNoSync) != "" +} + func TempFile(dir, prefix string) (*os.File, error) { // Assume that probability of suffix collision is negligible suffix := strconv.FormatInt(time.Now().UnixNano()+int64(os.Getpid()), 16) @@ -77,6 +83,9 @@ os.Remove(tmp.Fd.Name()) } func DirSync(dirPath string) error { + if NoSync { + return nil + } fd, err := os.Open(dirPath) if err != nil { return err @@ -102,9 +111,11 @@ if err = tmp.W.Flush(); err != nil { tmp.Fd.Close() return err } - if err = tmp.Fd.Sync(); err != nil { - tmp.Fd.Close() - return err + if !NoSync { + if err = tmp.Fd.Sync(); err != nil { + tmp.Fd.Close() + return err + } } if err = tmp.Fd.Close(); err != nil { return err diff --git a/src/toss.go b/src/toss.go index efc320fa43832f2cda0339f26bf8e7c8cc972c574d3f3ab572b6710af1f97def..ae805e6e3688ce4d4739cc11d924bb4db0eb397625cf8a074e78b50d4e210e82 100644 --- a/src/toss.go +++ b/src/toss.go @@ -91,7 +91,7 @@ nice uint8, pktSize uint64, jobPath string, decompressor *zstd.Decoder, - dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea bool, + dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK bool, ) error { defer pipeR.Close() sendmail := ctx.Neigh[*ctx.SelfId].Exec["sendmail"] @@ -329,16 +329,18 @@ ) }) return err } - if err = tmp.Sync(); err != nil { - tmp.Close() - ctx.LogE("rx-sync", les, err, func(les LEs) string { - return fmt.Sprintf( - "Tossing file %s/%s (%s): %s: syncing", - sender.Name, pktName, - humanize.IBytes(pktSize), dst, - ) - }) - return err + if !NoSync { + if err = tmp.Sync(); err != nil { + tmp.Close() + ctx.LogE("rx-sync", les, err, func(les LEs) string { + return fmt.Sprintf( + "Tossing file %s/%s (%s): %s: syncing", + sender.Name, pktName, + humanize.IBytes(pktSize), dst, + ) + }) + return err + } } if err = tmp.Close(); err != nil { ctx.LogE("rx-close", les, err, func(les LEs) string { @@ -856,7 +858,7 @@ nice, uint64(pktSizeWithoutEnc(int64(pktSize))), "", decompressor, - dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, + dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK, ) }() _, _, _, err = PktEncRead( @@ -906,6 +908,64 @@ os.Remove(JobPath2Hdr(jobPath)) } } + case PktTypeACK: + if noACK { + return nil + } + hsh := Base32Codec.EncodeToString(pkt.Path[:MTHSize]) + les := append(les, LE{"Type", "ack"}, LE{"Pkt", hsh}) + logMsg := func(les LEs) string { + return fmt.Sprintf("Tossing ack %s/%s: %s", sender.Name, pktName, hsh) + } + ctx.LogD("rx-ack", les, logMsg) + pktPath := filepath.Join(ctx.Spool, sender.Id.String(), string(TTx), hsh) + if _, err := os.Stat(pktPath); err == nil { + if !dryRun { + if err = os.Remove(pktPath); err != nil { + ctx.LogE("rx-ack", les, err, func(les LEs) string { + return logMsg(les) + ": removing packet" + }) + return err + } + } + } else { + ctx.LogD("rx-ack", les, func(les LEs) string { + return logMsg(les) + ": already disappeared" + }) + } + if !dryRun && doSeen { + if err := ensureDir(filepath.Dir(jobPath), SeenDir); err != nil { + return err + } + if fd, err := os.Create(jobPath2Seen(jobPath)); err == nil { + fd.Close() + if err = DirSync(filepath.Dir(jobPath)); err != nil { + ctx.LogE("rx-dirsync", les, err, func(les LEs) string { + return fmt.Sprintf( + "Tossing file %s/%s (%s): %s: dirsyncing", + sender.Name, pktName, + humanize.IBytes(pktSize), + filepath.Base(jobPath), + ) + }) + return err + } + } + } + if !dryRun { + if err = os.Remove(jobPath); err != nil { + ctx.LogE("rx", les, err, func(les LEs) string { + return logMsg(les) + ": removing job" + }) + return err + } else if ctx.HdrUsage { + os.Remove(JobPath2Hdr(jobPath)) + } + } + ctx.LogI("rx", les, func(les LEs) string { + return fmt.Sprintf("Got ACK packet from %s of %s", sender.Name, hsh) + }) + default: err = errors.New("unknown type") ctx.LogE( @@ -926,7 +986,7 @@ func (ctx *Ctx) Toss( nodeId *NodeId, xx TRxTx, nice uint8, - dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea bool, + dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK bool, ) bool { dirLock, err := ctx.LockDir(nodeId, "toss") if err != nil { @@ -994,7 +1054,7 @@ job.PktEnc.Nice, uint64(pktSizeWithoutEnc(job.Size)), job.Path, decompressor, - dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, + dryRun, doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK, ) }() pipeWB := bufio.NewWriter(pipeW) @@ -1044,7 +1104,7 @@ func (ctx *Ctx) AutoToss( nodeId *NodeId, nice uint8, - doSeen, noFile, noFreq, noExec, noTrns, noArea bool, + doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK bool, ) (chan struct{}, chan bool) { dw, err := ctx.NewDirWatcher( filepath.Join(ctx.Spool, nodeId.String(), string(TRx)), @@ -1066,7 +1126,7 @@ return case <-dw.C: bad = !ctx.Toss( nodeId, TRx, nice, false, - doSeen, noFile, noFreq, noExec, noTrns, noArea) || bad + doSeen, noFile, noFreq, noExec, noTrns, noArea, noACK) || bad } } }() diff --git a/src/toss_test.go b/src/toss_test.go index 6a34b0e4f8f9ef8f56b48c4084ea2550f090a402bb20d809ce96b02dd0df47ef..e0d2fff283aac62b01cd7f051260a1716aa806da53a42388ca7c0a8930c40eca 100644 --- a/src/toss_test.go +++ b/src/toss_test.go @@ -113,14 +113,14 @@ if len(dirFiles(rxPath)) == 0 { continue } ctx.Toss(ctx.Self.Id, TRx, DefaultNiceExec-1, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(rxPath)) == 0 { return false } ctx.Neigh[*nodeOur.Id].Exec = make(map[string][]string) ctx.Neigh[*nodeOur.Id].Exec[handle] = []string{"/bin/sh", "-c", "false"} ctx.Toss(ctx.Self.Id, TRx, DefaultNiceExec, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(rxPath)) == 0 { return false } @@ -133,7 +133,7 @@ filepath.Join(spool, "mbox"), ), } ctx.Toss(ctx.Self.Id, TRx, DefaultNiceExec, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(rxPath)) != 0 { return false } @@ -220,13 +220,13 @@ } rxPath := filepath.Join(spool, ctx.Self.Id.String(), string(TRx)) os.Rename(filepath.Join(spool, ctx.Self.Id.String(), string(TTx)), rxPath) ctx.Toss(ctx.Self.Id, TRx, DefaultNiceFile, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(rxPath)) == 0 { return false } ctx.Neigh[*nodeOur.Id].Incoming = &incomingPath if ctx.Toss(ctx.Self.Id, TRx, DefaultNiceFile, - false, false, false, false, false, false, false) { + false, false, false, false, false, false, false, false) { return false } if len(dirFiles(rxPath)) != 0 { @@ -303,7 +303,7 @@ rxPath := filepath.Join(spool, ctx.Self.Id.String(), string(TRx)) os.Rename(filepath.Join(spool, ctx.Self.Id.String(), string(TTx)), rxPath) ctx.Neigh[*nodeOur.Id].Incoming = &incomingPath ctx.Toss(ctx.Self.Id, TRx, DefaultNiceFile, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) expected := make(map[string]struct{}) expected["samefile"] = struct{}{} for i := 0; i < files-1; i++ { @@ -379,13 +379,13 @@ txPath := filepath.Join(spool, ctx.Self.Id.String(), string(TTx)) os.Rename(txPath, rxPath) os.MkdirAll(txPath, os.FileMode(0700)) ctx.Toss(ctx.Self.Id, TRx, DefaultNiceFreq, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(txPath)) != 0 || len(dirFiles(rxPath)) == 0 { return false } ctx.Neigh[*nodeOur.Id].FreqPath = &spool ctx.Toss(ctx.Self.Id, TRx, DefaultNiceFreq, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(txPath)) != 0 || len(dirFiles(rxPath)) == 0 { return false } @@ -399,7 +399,7 @@ panic(err) } } ctx.Toss(ctx.Self.Id, TRx, DefaultNiceFreq, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(txPath)) == 0 || len(dirFiles(rxPath)) != 0 { return false } @@ -504,7 +504,7 @@ panic(err) } } ctx.Toss(ctx.Self.Id, TRx, 123, - false, false, false, false, false, false, false) + false, false, false, false, false, false, false, false) if len(dirFiles(rxPath)) != 0 { return false } diff --git a/src/tx.go b/src/tx.go index fe339de18d8f2af94ce7ba6ed8e7a4166add5666ff2023bc027586b41ba7bab1..60b8e404d5a8de783879941e0aa4f94d2e3436351b5eb8551e23727efefaca31 100644 --- a/src/tx.go +++ b/src/tx.go @@ -453,7 +453,7 @@ {"Size", finalSize}, } logMsg := func(les LEs) string { return fmt.Sprintf( - "File %s (%s) sent to %s:%s", + "File %s (%s) is sent to %s:%s", srcPath, humanize.IBytes(uint64(finalSize)), ctx.NodeName(node.Id), @@ -497,7 +497,7 @@ {"Size", size}, } logMsg := func(les LEs) string { return fmt.Sprintf( - "File %s (%s) sent to %s:%s", + "File %s (%s) is sent to %s:%s", srcPath, humanize.IBytes(uint64(size)), ctx.NodeName(node.Id), @@ -558,7 +558,7 @@ {"Size", metaPktSize}, } logMsg := func(les LEs) string { return fmt.Sprintf( - "File %s (%s) sent to %s:%s", + "File %s (%s) is sent to %s:%s", srcPath, humanize.IBytes(uint64(metaPktSize)), ctx.NodeName(node.Id), @@ -604,7 +604,7 @@ {"Dst", dstPath}, } logMsg := func(les LEs) string { return fmt.Sprintf( - "File request from %s:%s to %s sent", + "File request from %s:%s to %s is sent", ctx.NodeName(node.Id), srcPath, dstPath, ) @@ -675,7 +675,7 @@ {"Size", size}, } logMsg := func(les LEs) string { return fmt.Sprintf( - "Exec sent to %s@%s (%s)", + "Exec is sent to %s@%s (%s)", ctx.NodeName(node.Id), dst, humanize.IBytes(uint64(size)), ) } @@ -729,3 +729,39 @@ } os.Symlink(nodePath, filepath.Join(ctx.Spool, node.Name)) return err } + +func (ctx *Ctx) TxACK( + node *Node, + nice uint8, + hsh string, + minSize int64, +) error { + hshRaw, err := Base32Codec.DecodeString(hsh) + if err != nil { + return err + } + if len(hshRaw) != MTHSize { + return errors.New("Invalid packet id size") + } + pkt, err := NewPkt(PktTypeACK, nice, []byte(hshRaw)) + if err != nil { + return err + } + src := bytes.NewReader([]byte{}) + _, _, err = ctx.Tx(node, pkt, nice, 0, minSize, MaxFileSize, src, hsh, nil) + les := LEs{ + {"Type", "ack"}, + {"Node", node.Id}, + {"Nice", int(nice)}, + {"Pkt", hsh}, + } + logMsg := func(les LEs) string { + return fmt.Sprintf("ACK to %s of %s is sent", ctx.NodeName(node.Id), hsh) + } + if err == nil { + ctx.LogI("tx", les, logMsg) + } else { + ctx.LogE("tx", les, err, logMsg) + } + return err +}