X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcmd%2Fnncp-cfgnew%2Fmain.go;h=798f31cdb534f0e893ba495211df0611c3d136b5;hb=561313b1994a8fadac5152bbdc7a980881fd93e0;hp=c7bb14ef571d2653141a4d7abd0f8672495974bb;hpb=46a831419b4b0ba458283ba705abfcc100f41242;p=nncp.git diff --git a/src/cmd/nncp-cfgnew/main.go b/src/cmd/nncp-cfgnew/main.go index c7bb14e..798f31c 100644 --- a/src/cmd/nncp-cfgnew/main.go +++ b/src/cmd/nncp-cfgnew/main.go @@ -1,6 +1,6 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2019 Sergey Matveev +Copyright (C) 2016-2021 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 @@ -82,16 +82,16 @@ func main() { nncp.DefaultSpoolPath, nncp.DefaultLogPath, nodeOur.Id.String(), - nncp.ToBase32(nodeOur.ExchPub[:]), - nncp.ToBase32(nodeOur.ExchPrv[:]), - nncp.ToBase32(nodeOur.SignPub[:]), - nncp.ToBase32(nodeOur.SignPrv[:]), - nncp.ToBase32(nodeOur.NoisePub[:]), - nncp.ToBase32(nodeOur.NoisePrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.ExchPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.ExchPrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.SignPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.SignPrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.NoisePrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.NoisePub[:]), nodeOur.Id.String(), - nncp.ToBase32(nodeOur.ExchPub[:]), - nncp.ToBase32(nodeOur.SignPub[:]), - nncp.ToBase32(nodeOur.NoisePub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.ExchPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.SignPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.NoisePub[:]), nncp.DefaultSendmailPath, ) } else { @@ -102,6 +102,8 @@ func main() { log: %s # Enforce specified umask usage # umask: "022" + # Omit progress showing by default + # noprogress: true # Enable notification email sending # notify: { @@ -113,6 +115,19 @@ func main() { # from: nncp@localhost # to: user+freq@example.com # } + # # Send some exec commands execution notifications + # exec: { + # # bob neighbour's "somehandle" notification + # bob.somehandle: { + # from: nncp+bob@localhost + # to: user+somehandle@example.com + # } + # # Any neighboor's "anotherhandle" + # *.anotherhandle: { + # from: nncp@localhost + # to: user+anotherhandle@example.com + # } + # } # } self: { @@ -148,66 +163,80 @@ func main() { # noisepub: UBM5K...VI42A # # # He is allowed to send email - # exec: {sendmail: ["/usr/sbin/sendmail"]} + # # exec: {sendmail: ["%s"]} # # # Allow incoming files saving in that directory - # incoming: "/home/alice/incoming" + # # incoming: "/home/alice/incoming" # # # Transitional nodes path - # via: ["bob", "eve"] + # # via: ["bob", "eve"] # # # Inactivity timeout when session with remote peer should be terminated - # onlinedeadline: 1800 + # # onlinedeadline: 1800 # # # Maximal online session lifetime - # maxonlinetime: 3600 + # # maxonlinetime: 3600 # - # # Allow freqing from that directory - # freq: "/home/bob/pub" - # # Send freqed files with chunks - # freqchunked: 1024 - # # Send freqed files with minumal chunk size - # freqminsize: 2048 + # # If neither freq section, nor freq.path exist, then no freqing allowed + # # freq: { + # # # Allow freqing from that directory + # # path: "/home/bob/pub" + # # # Send freqed files with chunks + # # # chunked: 1024 + # # # Send freqed files with minumal chunk size + # # # minsize: 2048 + # # # Maximal allowable freqing file size + # # # maxsize: 4096 + # # } # # # Set maximal packets per second receive and transmit rates - # rxrate: 10 - # txrate: 20 + # # rxrate: 10 + # # txrate: 20 # # # Address aliases - # addrs: { - # lan: "[fe80::1234%%igb0]:5400" - # internet: alice.com:3389 - # } + # # addrs: { + # # lan: "[fe80::1234%%igb0]:5400" + # # internet: alice.com:3389 + # # } # # # Calls configuration - # calls: [ - # { - # cron: "*/2 * * * *" - # onlinedeadline: 1800 - # maxonlinetime: 1750 - # nice: PRIORITY+10 - # rxrate: 10 - # txrate: 20 - # xx: rx - # addr: lan - # }, - # ] + # # calls: [ + # # { + # # cron: "*/2 * * * *" + # # onlinedeadline: 1800 + # # maxonlinetime: 1750 + # # nice: PRIORITY+10 + # # rxrate: 10 + # # txrate: 20 + # # xx: rx + # # addr: lan + # # when-tx-exists: true + # # + # # autotoss: false + # # autotoss-doseen: true + # # autotoss-nofile: true + # # autotoss-nofreq: true + # # autotoss-noexec: true + # # autotoss-notrns: true + # # }, + # # ] # } } }`, nncp.DefaultSpoolPath, nncp.DefaultLogPath, nodeOur.Id.String(), - nncp.ToBase32(nodeOur.ExchPub[:]), - nncp.ToBase32(nodeOur.ExchPrv[:]), - nncp.ToBase32(nodeOur.SignPub[:]), - nncp.ToBase32(nodeOur.SignPrv[:]), - nncp.ToBase32(nodeOur.NoisePub[:]), - nncp.ToBase32(nodeOur.NoisePrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.ExchPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.ExchPrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.SignPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.SignPrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.NoisePrv[:]), + nncp.Base32Codec.EncodeToString(nodeOur.NoisePub[:]), nodeOur.Id.String(), - nncp.ToBase32(nodeOur.ExchPub[:]), - nncp.ToBase32(nodeOur.SignPub[:]), - nncp.ToBase32(nodeOur.NoisePub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.ExchPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.SignPub[:]), + nncp.Base32Codec.EncodeToString(nodeOur.NoisePub[:]), + nncp.DefaultSendmailPath, nncp.DefaultSendmailPath, ) }