]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-cfgnew/main.go
MTH
[nncp.git] / src / cmd / nncp-cfgnew / main.go
index e2eac99d0c8affde1cdf17aae09de357ea858499..f9926010d3d7e5a68d4cda93286314832c7dd715 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2019 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
 
 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
@@ -21,9 +21,10 @@ package main
 import (
        "flag"
        "fmt"
+       "log"
        "os"
 
-       "go.cypherpunks.ru/nncp/v5"
+       "go.cypherpunks.ru/nncp/v7"
 )
 
 func usage() {
@@ -38,6 +39,7 @@ func main() {
                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 {
@@ -82,16 +84,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 +104,16 @@ func main() {
   log: %s
   # Enforce specified umask usage
   # umask: "022"
+  # Omit progress showing by default
+  # noprogress: true
+  # Do not use .hdr files
+  # nohdr: true
+
+  # MultiCast Discovery:
+  # List of interfaces where to listen for MCD announcements
+  # mcd-listen: ["em0", "igb1"]
+  # Interfaces and intervals (in seconds) where to send MCD announcements
+  # mcd-send: {em0: 60, igb1: 5}
 
   # Enable notification email sending
   # notify: {
@@ -208,6 +220,16 @@ func main() {
     #   #     txrate: 20
     #   #     xx: rx
     #   #     addr: lan
+    #   #     when-tx-exists: true
+    #   #     nock: true
+    #   #     mcd-ignore: true
+    #   #
+    #   #     autotoss: false
+    #   #     autotoss-doseen: true
+    #   #     autotoss-nofile: true
+    #   #     autotoss-nofreq: true
+    #   #     autotoss-noexec: true
+    #   #     autotoss-notrns: true
     #   #   },
     #   # ]
     # }
@@ -216,16 +238,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,
                        nncp.DefaultSendmailPath,
                )