From 4c17993ce76c6f1883e6854d826eafd4c33c1594 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 17 Jan 2021 17:31:06 +0300 Subject: [PATCH] stdin/stdout formatting --- doc/cfg.texi | 8 ++++---- doc/cmds.texi | 33 +++++++++++++++++---------------- doc/comparison.texi | 2 +- doc/integration.texi | 2 +- doc/news.ru.texi | 7 ++++--- doc/news.texi | 11 ++++++----- ports/nncp/Makefile | 3 ++- 7 files changed, 35 insertions(+), 31 deletions(-) diff --git a/doc/cfg.texi b/doc/cfg.texi index f918385..3e0b882 100644 --- a/doc/cfg.texi +++ b/doc/cfg.texi @@ -142,7 +142,7 @@ 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 node can queue some handle execution with providing additional command line -arguments and the body fed to command's stdin. +arguments and the body fed to command's @code{stdin}. @verb{|sendmail: ["/usr/sbin/sendmail", "-t"]|} handle, when called by @verb{|echo hello world | nncp-exec OURNODE sendmail ARG0 ARG1 ARG2|} @@ -190,9 +190,9 @@ human-readable name of the address. For direct TCP connections use @verb{|host:port|} format, pointing to @ref{nncp-daemon}'s listening instance. Also you can pipe connection through the external command using @verb{#|some command#} format. @code{/bin/sh -c "some command"} -will start and its stdin/stdout used as a connection. May be omitted if -either no direct connection exists, or @ref{nncp-call} is used with -forced address specifying. +will start and its @code{stdin}/@code{stdout} used as a connection. May +be omitted if either no direct connection exists, or @ref{nncp-call} is +used with forced address specifying. @anchor{CfgXxRate} @item rxrate/txrate diff --git a/doc/cmds.texi b/doc/cmds.texi index 575807a..8ead341 100644 --- a/doc/cmds.texi +++ b/doc/cmds.texi @@ -53,10 +53,10 @@ $ nncp-bundle [options] -rx [-check] [-dryrun] [NODE ...] < ... With @option{-tx} option, this command creates @ref{Bundles, bundle} of @ref{Encrypted, encrypted packets} from the spool directory and writes -it to stdout. +it to @code{stdout}. -With @option{-rx} option, this command takes bundle from stdin and -copies all found packets for our node to the spool directory. Pay +With @option{-rx} option, this command takes bundle from @code{stdin} +and copies all found packets for our node to the spool directory. Pay 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} @@ -73,7 +73,7 @@ When packets are sent through the stream, they are still kept in the spool directory, because there is no assurance that they are transferred to the media (media (CD-ROM, tape drive, raw hard drive) can end). If you want to forcefully delete them (after they are successfully flushed -to stdout) anyway, use @option{-delete} option. +to @code{stdout}) anyway, use @option{-delete} option. But you can verify produced stream after, by digesting it by yourself with @option{-rx} and @option{-delete} options -- in that mode, stream @@ -219,8 +219,8 @@ $ nncp-cfgnew [options] [-nocomments] > new.hjson @end example Generate new node configuration: private keys, example configuration -file and print it to stdout. You must use this command when you setup -the new node. @option{-nocomments} will create configuration file +file and print it to @code{stdout}. You must use this command when you +setup the new node. @option{-nocomments} will create configuration file without descriptive huge comments -- useful for advanced users. Pay attention that private keys generation consumes an entropy from your @@ -255,9 +255,10 @@ can handle. @option{-bind} option specifies @option{addr:port} it must bind to and listen. It could be run as @command{inetd} service, by specifying -@option{-inetd} option. Pay attention that because it uses stdin/stdout, -it can not effectively work with IO timeouts and connection closing can -propagate up to 5 minutes in practice. Example inetd-entry: +@option{-inetd} option. Pay attention that because it uses +@code{stdin}/@code{stdout}, it can not effectively work with IO timeouts +and connection closing can propagate up to 5 minutes in practice. +Example inetd-entry: @verbatim uucp stream tcp6 nowait nncpuser /usr/local/bin/nncp-daemon nncp-daemon -quiet -inetd @@ -326,9 +327,9 @@ This command queues file in @ref{Spool, spool} directory immediately 2 GiB file will create 2 GiB outbound encrypted packet. If @file{SRC} equals to @file{-}, then create an encrypted temporary -file and copy everything taken from stdin to it and use for outbound +file and copy everything taken from @code{stdin} to it and use for outbound packet creation. Pay attention that if you want to send 1 GiB of data -taken from stdin, then you have to have more than 2 GiB of disk space +taken from @code{stdin}, then you have to have more than 2 GiB of disk space for that temporary file and resulting encrypted packet. You can control where temporary file will be stored using @env{TMPDIR} environment variable. Encryption is performed in AEAD mode with @@ -402,7 +403,7 @@ Sender: 2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ @end example If you specify @option{-dump} option and provide an @ref{Encrypted, -encrypted} packet, then it will verify and decrypt it to stdout. +encrypted} packet, then it will verify and decrypt it to @code{stdout}. Encrypted packets contain @ref{Plain, plain} ones, that also can be fed to @command{nncp-pkt}: @@ -461,10 +462,10 @@ If @option{-keep} option is specified, then no @file{.nncp.meta}/@file{.nncp.chunkXXX} files are deleted during reassembly process. -@option{-stdout} option outputs reassembled file to stdout, instead of -saving to temporary file with renaming after. This could be useful for -reassembling on separate filesystem to lower fragmentation effect, -and/or separate storage device for higher performance. +@option{-stdout} option outputs reassembled file to @code{stdout}, +instead of saving to temporary file with renaming after. This could be +useful for reassembling on separate filesystem to lower fragmentation +effect, and/or separate storage device for higher performance. @option{-dump} option prints meta-file contents in human-friendly form. It is useful mainly for debugging purposes. For example: diff --git a/doc/comparison.texi b/doc/comparison.texi index 1cb3664..7bf4e53 100644 --- a/doc/comparison.texi +++ b/doc/comparison.texi @@ -120,7 +120,7 @@ comparable commands of UUCP and NNCP, just for the interest: @item Receive connection (pipe, daemon, etc) @tab @command{uucico} (@option{-l} or similar) @tab @command{nncp-daemon} -@item Request remote execution, stdin piped in +@item Request remote execution, @code{stdin} piped in @tab @command{uux} @tab @command{nncp-exec} @item Copy file to remote machine diff --git a/doc/integration.texi b/doc/integration.texi index c9b3a71..3359a3a 100644 --- a/doc/integration.texi +++ b/doc/integration.texi @@ -243,7 +243,7 @@ exec: @{ @} @end example -The -bS option is what tells Exim to receive BSMTP on stdin. +The -bS option is what tells Exim to receive BSMTP on @code{stdin}. 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 nncp user, diff --git a/doc/news.ru.texi b/doc/news.ru.texi index c4ce41d..111645e 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -446,9 +446,10 @@ HKDF-BLAKE2b-256 KDF алгоритм заменён на BLAKE2Xb XOF. Ещё @item @command{nncp-bundle} команда может создавать потоки зашифрованных -пакетов или потреблять их. Это полезно когда речь идёт о stdin/stdout -методах передачи (например запись на CD-ROM без создания промежуточного -подготовленного ISO образа или работа с ленточными накопителями). +пакетов или потреблять их. Это полезно когда речь идёт о +@code{stdin}/@code{stdout} методах передачи (например запись на CD-ROM +без создания промежуточного подготовленного ISO образа или работа с +ленточными накопителями). @item @command{nncp-toss} команда может создавать @file{.seen} файлы, diff --git a/doc/news.texi b/doc/news.texi index a24704f..e8744e4 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -435,9 +435,10 @@ are not supported. @item @command{nncp-bundle} command can either create stream of encrypted -packets, or digest it. It is useful when dealing with stdin/stdout based -transmission methods (like writing to CD-ROM without intermediate -prepared ISO image and working with tape drives). +packets, or digest it. It is useful when dealing with +@code{stdin}/@code{stdout} based transmission methods (like writing to +CD-ROM without intermediate prepared ISO image and working with tape +drives). @item @command{nncp-toss} is able to create @file{.seen} files preventing @@ -499,8 +500,8 @@ option for unchunked transfer was not in KiBs, but in bytes. @itemize @item -Ability to feed @command{nncp-file} from stdin, that uses an encrypted -temporary file for that. +Ability to feed @command{nncp-file} from @code{stdin}, that uses an +encrypted temporary file for that. @item Chunked files transmission appeared with corresponding diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile index 792703f..b846f49 100644 --- a/ports/nncp/Makefile +++ b/ports/nncp/Makefile @@ -1,7 +1,7 @@ # $FreeBSD: $ PORTNAME= nncp -DISTVERSION= 5.4.0 +DISTVERSION= 5.5.1 CATEGORIES= net MASTER_SITES= http://www.nncpgo.org/download/ @@ -16,6 +16,7 @@ USES= go:no_targets tar:xz USE_RC_SUBR= nncp-caller nncp-daemon nncp-toss MAKE_ARGS= INFODIR=${STAGEDIR}${PREFIX}/${INFO_PATH} +MAKE_ENV= ${GO_ENV} INSTALL_TARGET= install-strip SUB_FILES= pkg-message pkg-install pkg-deinstall -- 2.44.0