X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=doc%2Fcfg.texi;h=2004073c98245043e085194be51f211399b17d1f;hb=0139e8deda4112d2c3dcd52e0ad72162e54caa03;hp=3483f11c53fb1eec2b821cc98f3ec7146943136c;hpb=ded811e9e4736ad182636fe7bf8221ac9a95e08b;p=nncp.git diff --git a/doc/cfg.texi b/doc/cfg.texi index 3483f11..2004073 100644 --- a/doc/cfg.texi +++ b/doc/cfg.texi @@ -1,57 +1,76 @@ @node Configuration @unnumbered Configuration file -Example YAML configuration file: +Example @url{https://hjson.org/, Hjson} configuration file: @verbatim -spool: /var/spool/nncp -log: /var/spool/nncp/log -notify: - file: - from: nncp@localhost - to: user+file@example.com - freq: - from: nncp@localhost - to: user+freq@example.com -self: - id: TIJQL...2NGIA - exchpub: CYVGQ...PSEWQ - exchprv: 65PUY...MPZ3Q - signpub: 2NMVC...CMH5Q - signprv: 555JD...RGD6Y - noiseprv: D62XU...NKYPA - noisepub: KIBKK...ESM7Q -neigh: - self: +{ + spool: /var/spool/nncp + log: /var/spool/nncp/log + notify: { + file: { + from: nncp@localhost + to: user+file@example.com + } + freq: { + from: nncp@localhost + to: user+freq@example.com + } + } + self: { id: TIJQL...2NGIA exchpub: CYVGQ...PSEWQ + exchprv: 65PUY...MPZ3Q signpub: 2NMVC...CMH5Q + signprv: 555JD...RGD6Y + noiseprv: D62XU...NKYPA noisepub: KIBKK...ESM7Q - sendmail: [/usr/sbin/sendmail] - alice: - id: XJZBK...65IJQ - exchpub: MJACJ...FAI6A - signpub: T4AFC...N2FRQ - noisepub: UBM5K...VI42A - sendmail: ["/bin/sh", "-c", "false"] - incoming: /home/alice/incoming - onlinedeadline: 1800 - maxonlinetime: 3600 - addrs: - lan: "[fe80::1234%igb0]:5400" - internet: alice.com:3389 - calls: - - - cron: "*/2 * * * *" - bob: - id: 2IZNP...UYGYA - exchpub: WFLMZ...B7NHA - signpub: GTGXG...IE3OA - sendmail: [/usr/sbin/sendmail] - freq: /home/bob/pub - freqchunked: 1024 - freqminsize: 2048 - via: [alice] + } + neigh: { + self: { + id: TIJQL...2NGIA + exchpub: CYVGQ...PSEWQ + signpub: 2NMVC...CMH5Q + noisepub: KIBKK...ESM7Q + exec: {sendmail: ["/usr/sbin/sendmail"]} + } + alice: { + id: "XJZBK...65IJQ" + exchpub: MJACJ...FAI6A + signpub: T4AFC...N2FRQ + noisepub: UBM5K...VI42A + exec: {flag: ["/usr/bin/touch", "-t"]} + incoming: "/home/alice/incoming" + onlinedeadline: 1800 + maxonlinetime: 3600 + addrs: { + lan: "[fe80::1234%igb0]:5400" + internet: alice.com:3389 + } + calls: [ + { + cron: "*/2 * * * *" + }, + ] + } + bob: { + id: 2IZNP...UYGYA + exchpub: WFLMZ...B7NHA + signpub: GTGXG...IE3OA + exec: { + sendmail: ["/usr/sbin/sendmail"] + warcer: ["/path/to/warcer.sh"] + wgeter: ["/path/to/wgeter.sh"] + } + freq: "/home/bob/pub" + freqchunked: 1024 + freqminsize: 2048 + via: ["alice"] + rxrate: 10 + txrate: 20 + } + } +} @end verbatim @strong{spool} field contains an absolute path to @ref{Spool, spool} @@ -62,9 +81,9 @@ log} file. @strong{notify} section contains notification settings for successfully tossed file and freq packets. Corresponding @strong{from} and @strong{to} fields will be substituted in notification email message. -@emph{neigh/self/sendmail} will be used as a local mailer. You can omit -either of those two @emph{from}/@emph{to} sections to omit corresponding -notifications, or the whole section at once. +@emph{neigh/self/exec/sendmail} will be used as a local mailer. You can +omit either of those two @emph{from}/@emph{to} sections to omit +corresponding notifications, or the whole section at once. @strong{self} section contains our node's private keypairs. @strong{exch*} and @strong{sign*} are used during @ref{Encrypted, @@ -85,13 +104,25 @@ node has the following fields: If present, then node can be online called using @ref{Sync, synchronization protocol}. Contains authentication public key. -@anchor{CfgSendmail} -@item sendmail -An array containing path to executable and its command line arguments -that is called for mail sending. If it is empty, then no mail processing -will be performed from that node. Sendmail command -@command{["/bin/foo", "bar"]} called the following way: -@command{NNCP_NICE=NICE NNCP_SENDER=NODEID /bin/foo bar RCPT1 RCPT2 ... < MSG}. +@anchor{CfgExec} +@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 node +can queue some handle execution with providing additional command line +arguments and the body fed to command's stdin. + +@verb{|sendmail: ["/usr/sbin/sendmail", "-t"]|} handle, when called by +@verb{|echo hello world | nncp-exec OURNODE sendmail ARG0 ARG1 ARG2|} +command, will execute: + +@verbatim +echo hello world | + NNCP_SELF=OURNODE \ + NNCP_SENDER=REMOTE \ + NNCP_NICE=64 \ + /usr/sbin/sendmail -t ARG0 ARG1 ARG2 +@end verbatim @anchor{CfgIncoming} @item incoming @@ -126,6 +157,13 @@ pairs pointing to @ref{nncp-daemon}'s listening instance. May be omitted if either no direct connection exists, or @ref{nncp-call} is used with forced address specifying. +@anchor{CfgXxRate} +@item rxrate/txrate +If greater than zero, then at most *rate packets per second will be +sent/received after the handshake. It could be used as crude bandwidth +traffic shaper: each packet has at most 64 KiB payload size. Could be +omitted at all -- no rate limits. + @anchor{CfgOnlineDeadline} @item onlinedeadline Online connection deadline of node inactivity in seconds. It is the time