unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#51565] PATCH: Update Yggdrasil to new protocol (important breaking changes)
@ 2021-11-02  6:59 raingloom
  2021-11-15 14:10 ` pukkamustard
  2021-12-01 16:04 ` bug#51565: " Ricardo Wurmus
  0 siblings, 2 replies; 9+ messages in thread
From: raingloom @ 2021-11-02  6:59 UTC (permalink / raw)
  To: 51565

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

This is way overdue.

Credit for the packaging work:
https://github.com/bqv/rc/blob/live/rc/packages/yggdrasil.scm

It did need some more work though. The Go importer leaves a few things
to be desired, but that's for another thread.

Anyways, I tested it and it works. System service could be restarted
after a reconfigure without any issues.

Please apply this soon, because nodes running the outdated versions
can't connect to ones running this new version, due to breaking
protocol changes.

[-- Attachment #2: 0001-gnu-Add-go-github-com-vividcortex-ewma.patch --]
[-- Type: text/x-patch, Size: 1531 bytes --]

From 8150cb42022a91764223f52b991c512ba310ffaf Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:36:37 +0000
Subject: [PATCH 1/7] gnu: Add go-github-com-vividcortex-ewma.

* gnu/packages/golang.scm (go-github-com-vividcortex-ewma): New variable.
---
 gnu/packages/golang.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cc2a4ebc16..84e7387408 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8839,3 +8839,24 @@ (define-public go-gopkg-in-djherbis-times-v1
     (description
      "Provides a platform-independent way to get atime, mtime, ctime and btime for files.")
     (license license:expat)))
+
+(define-public go-github-com-vividcortex-ewma
+  (package
+    (name "go-github-com-vividcortex-ewma")
+    (version "1.2.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/VividCortex/ewma")
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "0whx516l9nm4n41spagb605ry7kfnz1qha96mcshnfjlahhnnylq"))))
+    (build-system go-build-system)
+    (arguments '(#:import-path "github.com/VividCortex/ewma"))
+    (home-page "https://github.com/VividCortex/ewma")
+    (synopsis "EWMA")
+    (description
+      "Package ewma implements exponentially weighted moving averages.")
+    (license license:expat)))
-- 
2.33.1


[-- Attachment #3: 0002-gnu-Add-go-github-com-rivo-uniseg.patch --]
[-- Type: text/x-patch, Size: 1614 bytes --]

From 7e220e450fa368a44584047b586800ce212efd8e Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:37:11 +0000
Subject: [PATCH 2/7] gnu: Add go-github-com-rivo-uniseg.

* gnu/packages/golang.scm (go-github-com-rivo-uniseg): New variable.
---
 gnu/packages/golang.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 84e7387408..90ba03b0b9 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8860,3 +8860,26 @@ (define-public go-github-com-vividcortex-ewma
     (description
       "Package ewma implements exponentially weighted moving averages.")
     (license license:expat)))
+
+(define-public go-github-com-rivo-uniseg
+  (package
+    (name "go-github-com-rivo-uniseg")
+    (version "0.2.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/rivo/uniseg")
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "0j7h22vfmjj562vr8gpsyrkrwp1pq9ayh5fylv24skxb467g9f0q"))))
+    (build-system go-build-system)
+    (arguments '(#:import-path "github.com/rivo/uniseg"))
+    (home-page "https://github.com/rivo/uniseg")
+    (synopsis "Unicode Text Segmentation for Go")
+    (description
+      "Package uniseg implements Unicode Text Segmentation according to Unicode
+Standard Annex #29 (@url{http://unicode.org/reports/tr29/,http://unicode.org/reports/tr29/}).
+")
+    (license license:expat)))
-- 
2.33.1


[-- Attachment #4: 0003-gnu-Add-go-github-com-mattn-go-runewidth.patch --]
[-- Type: text/x-patch, Size: 1647 bytes --]

From 819ee93b9775dc3cd50b8289d10ae6e16233a13e Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:37:17 +0000
Subject: [PATCH 3/7] gnu: Add go-github-com-mattn-go-runewidth.

* gnu/packages/golang.scm (go-github-com-mattn-go-runewidth): New variable.
---
 gnu/packages/golang.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 90ba03b0b9..34ca28998b 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8883,3 +8883,26 @@ (define-public go-github-com-rivo-uniseg
 Standard Annex #29 (@url{http://unicode.org/reports/tr29/,http://unicode.org/reports/tr29/}).
 ")
     (license license:expat)))
+
+(define-public go-github-com-mattn-go-runewidth
+  (package
+    (name "go-github-com-mattn-go-runewidth")
+    (version "0.0.13")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/mattn/go-runewidth")
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "1yir0f3wc5z5hnkwhvx5qb6nmpfb05zp2gvfjvna63s8kmla1rrn"))))
+    (build-system go-build-system)
+    (arguments '(#:import-path "github.com/mattn/go-runewidth"))
+    (propagated-inputs
+      `(("go-github-com-rivo-uniseg" ,go-github-com-rivo-uniseg)))
+    (home-page "https://github.com/mattn/go-runewidth")
+    (synopsis "go-runewidth")
+    (description
+      "This package provides functions to get fixed width of the character or string.")
+    (license license:expat)))
-- 
2.33.1


[-- Attachment #5: 0004-gnu-go-github-com-cheggaaa-pb-Update-to-3.0.8.patch --]
[-- Type: text/x-patch, Size: 2503 bytes --]

From b5e0bab1e54c472a3c8cbfd0c78023f022ec9ceb Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:45:47 +0000
Subject: [PATCH 4/7] gnu: go-github-com-cheggaaa-pb: Update to 3.0.8.

* gnu/packages/golang.scm (go-github-com-cheggaaa-pb): Update to 3.0.8.
---
 gnu/packages/golang.scm | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 34ca28998b..93085f6477 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -7948,7 +7948,7 @@ (define-public go-github-com-arceliar-phony
 (define-public go-github-com-cheggaaa-pb
   (package
     (name "go-github-com-cheggaaa-pb")
-    (version "3.0.4")
+    (version "3.0.8")
     (source
       (origin
        (method git-fetch)
@@ -7957,18 +7957,20 @@ (define-public go-github-com-cheggaaa-pb
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32
-         "0xhsv9yf3fz918ay6w0d87jnb3hk9vxvi16jk172kqq26x7jixd0"))))
+        (base32 "0d701s2niy39r650d1phjw19h4l27b1yfc2ih6s31f56b3zzqspx"))))
     (build-system go-build-system)
-    (arguments
-     '(#:import-path "github.com/cheggaaa/pb/"))
+    (arguments '(#:import-path "github.com/cheggaaa/pb/v3"
+                 ;; XXX: it does have tests but I'm not sure how to run them.
+                 ;; go-build-system is looking in the wrong directory.
+                 #:tests? #f))
     (propagated-inputs
-     `(("go-github-com-fatih-color" ,go-github-com-fatih-color)
+     `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
+       ("go-github-com-rivo-uniseg" ,go-github-com-rivo-uniseg)
+       ("go-github-com-mattn-go-runewidth" ,go-github-com-mattn-go-runewidth)
+       ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
        ("go-github-com-mattn-go-colorable" ,go-github-com-mattn-go-colorable)
-       ("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
-       ("go-golang-org-x-sys" ,go-golang-org-x-sys)))
-    (native-inputs
-     `(("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)))
+       ("go-github-com-fatih-color" ,go-github-com-fatih-color)
+       ("go-github-com-vividcortex-ewma" ,go-github-com-vividcortex-ewma)))
     (home-page "https://github.com/cheggaaa/pb/")
     (synopsis "Console progress bar for Go")
     (description "This package is a Go library that draws progress bars on
-- 
2.33.1


[-- Attachment #6: 0005-gnu-Rename-go-github-com-cheggaaa-pb-to-go-github-co.patch --]
[-- Type: text/x-patch, Size: 1035 bytes --]

From b3cc4ba59737a0729f4d962d614ea256771998c2 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:46:57 +0000
Subject: [PATCH 5/7] gnu: Rename go-github-com-cheggaaa-pb to
 go-github-com-cheggaaa-pb-v3.

* gnu/packages/golang.scm:
  (go-github-com-cheggaaa-pb): Rename variable.
  (go-github-com-cheggaaa-pb-v3): New variable.
---
 gnu/packages/golang.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 93085f6477..2ce5dc0d4d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -7945,9 +7945,9 @@ (define-public go-github-com-arceliar-phony
 inspired by the causal messaging system in the Pony programming language.")
       (license license:expat))))
 
-(define-public go-github-com-cheggaaa-pb
+(define-public go-github-com-cheggaaa-pb-v3
   (package
-    (name "go-github-com-cheggaaa-pb")
+    (name "go-github-com-cheggaaa-pb-v3")
     (version "3.0.8")
     (source
       (origin
-- 
2.33.1


[-- Attachment #7: 0006-gnu-Add-go-github-com-arceliar-ironwood.patch --]
[-- Type: text/x-patch, Size: 2358 bytes --]

From 84fe7cb50744c103ad7b922ab69f7c5232ffdad3 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:50:36 +0000
Subject: [PATCH 6/7] gnu: Add go-github-com-arceliar-ironwood.

* gnu/packages/golang.scm (go-github-com-arceliar-ironwood): New variable.
---
 gnu/packages/golang.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 2ce5dc0d4d..c9f6de878e 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8908,3 +8908,37 @@ (define-public go-github-com-mattn-go-runewidth
     (description
       "This package provides functions to get fixed width of the character or string.")
     (license license:expat)))
+
+(define-public go-github-com-arceliar-ironwood
+  (package
+    (name "go-github-com-arceliar-ironwood")
+    (version "0.0.0-20210912013146-c2bc55bb349c")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/Arceliar/ironwood")
+               (commit (go-version->git-ref version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32
+            "1dfkqnkfxwlwcsk8g9r1pv84lfzgn8r1vam13zlmk81cgan2r6fx"))))
+    (build-system go-build-system)
+    (arguments
+      '(#:import-path "github.com/Arceliar/ironwood"
+        #:tests? #f
+        #:phases
+        (modify-phases %standard-phases
+          ;; Source-only package
+          (delete 'build))))
+    (propagated-inputs
+      `(("go-golang-org-x-crypto"
+         ,go-golang-org-x-crypto)
+        ("go-github-com-arceliar-phony"
+         ,go-github-com-arceliar-phony)))
+    (home-page
+      "https://github.com/Arceliar/ironwood")
+    (synopsis "Ironwood")
+    (description
+      "Ironwood is a routing library with a @code{net.PacketConn}-compatible interface using @code{ed25519.PublicKey}s as addresses.  Basically, you use it when you want to communicate with some other nodes in a network, but you can't guarantee that you can directly connect to every node in that network.  It was written to test improvements to / replace the routing logic in @url{https://github.com/yggdrasil-network/yggdrasil-go,Yggdrasil}, but it may be useful for other network applications.")
+    (license license:mpl2.0)))
-- 
2.33.1


[-- Attachment #8: 0007-gnu-yggdrasil-Update-to-0.4.0.patch --]
[-- Type: text/x-patch, Size: 10625 bytes --]

From 73c240e5bb2310a1c66978a0f1b08fc5450b7b3c Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:51:10 +0000
Subject: [PATCH 7/7] gnu: yggdrasil: Update to 0.4.0.

* gnu/packages/patches/yggdrasil-extra-config.patch: Update patch.
* gnu/packages/networking.scm (yggdrasil): Update to 0.4.0.
[propagated-inputs]: Remove go-github-com-cheggaaa-pb; add go-golang-org-x-sys,
go-github-com-mattn-go-runewidth, go-github-com-mattn-go-isatty,
go-github-com-fatih-color, go-github-com-cheggaaa-pb-v3,
go-github-com-vividcortex-ewma, and go-github-com-arceliar-ironwood.
---
 gnu/packages/networking.scm                   | 55 +++++++++++++------
 .../patches/yggdrasil-extra-config.patch      | 53 ++++++++++--------
 2 files changed, 69 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 8ac3b0095e..d1a437e177 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -4086,7 +4086,7 @@ (define-public nbd
 (define-public yggdrasil
   (package
     (name "yggdrasil")
-    (version "0.3.16")
+    (version "0.4.0")
     (source
      (origin
        (method git-fetch)
@@ -4097,7 +4097,7 @@ (define-public yggdrasil
          (recursive? #t)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0vyd7a333hwn6j1lv1g9sicw74a4qk982bsi3cfdhjlv6hsjwmil"))
+        (base32 "0mmqw6w5a6ph49xd1yzb7i70xg466k9pi5sdvplhb66x68wipixh"))
        (patches (search-patches "yggdrasil-extra-config.patch"))))
     (build-system go-build-system)
     (arguments
@@ -4114,7 +4114,7 @@ (define-public yggdrasil
                           "go" "build" "-v" "-ldflags=-s -w"
                           (string-append
                            "github.com/yggdrasil-network/yggdrasil-go/cmd/" c)))
-                       (list "yggdrasil" "yggdrasilctl"))
+                       (list "yggdrasil" "yggdrasilctl" "genkeys"))
                       #t))
                   (replace 'install
                     (lambda* (#:key outputs #:allow-other-keys)
@@ -4125,7 +4125,7 @@ (define-public yggdrasil
                         (for-each
                          (lambda (f)
                            (install-file f bin))
-                         (list "yggdrasil" "yggdrasilctl"))
+                         (list "yggdrasil" "yggdrasilctl" "genkeys"))
                         (mkdir-p doc)
                         (copy-recursively
                          (string-append
@@ -4135,20 +4135,43 @@ (define-public yggdrasil
                       #t)))))
     ;; https://github.com/kardianos/minwinsvc is windows only
     (propagated-inputs
-     `(("go-github-com-arceliar-phony" ,go-github-com-arceliar-phony)
-       ("go-github-com-cheggaaa-pb" ,go-github-com-cheggaaa-pb)
-       ("go-github-com-gologme-log" ,go-github-com-gologme-log)
-       ("go-github-com-hashicorp-go-syslog" ,go-github-com-hashicorp-go-syslog)
-       ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
-       ("go-github-com-kardianos-minwinsvc" ,go-github-com-kardianos-minwinsvc)
+     `(;;("go-golang-zx2c4-com-wireguard-windows"
+       ;; ,go-golang-zx2c4-com-wireguard-windows)
+       ("go-golang-zx2c4-com-wireguard"
+        ,go-golang-zx2c4-com-wireguard)
+       ("go-golang-org-x-text" ,go-golang-org-x-text)
+       ("go-golang-org-x-sys" ,go-golang-org-x-sys)
+       ("go-golang-org-x-net" ,go-golang-org-x-net)
+       ("go-golang-org-x-crypto"
+        ,go-golang-org-x-crypto)
+       ("go-netns"
+        ,go-netns)
+       ("go-netlink"
+        ,go-netlink)
        ("go-github-com-mitchellh-mapstructure"
         ,go-github-com-mitchellh-mapstructure)
-       ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
-       ("go-golang-org-x-net" ,go-golang-org-x-net)
-       ("go-golang-org-x-text" ,go-golang-org-x-text)
-       ("go-golang-zx2c4-com-wireguard" ,go-golang-zx2c4-com-wireguard)
-       ("go-netlink" ,go-netlink)
-       ("go-netns" ,go-netns)))
+       ("go-github-com-mattn-go-runewidth"
+        ,go-github-com-mattn-go-runewidth)
+       ("go-github-com-mattn-go-isatty"
+        ,go-github-com-mattn-go-isatty)
+       ("go-github-com-kardianos-minwinsvc"
+        ,go-github-com-kardianos-minwinsvc)
+       ("go-github-com-hjson-hjson-go"
+        ,go-github-com-hjson-hjson-go)
+       ("go-github-com-hashicorp-go-syslog"
+        ,go-github-com-hashicorp-go-syslog)
+       ("go-github-com-gologme-log"
+        ,go-github-com-gologme-log)
+       ("go-github-com-fatih-color"
+        ,go-github-com-fatih-color)
+       ("go-github-com-cheggaaa-pb-v3"
+        ,go-github-com-cheggaaa-pb-v3)
+       ("go-github-com-vividcortex-ewma"
+        ,go-github-com-vividcortex-ewma)
+       ("go-github-com-arceliar-phony"
+        ,go-github-com-arceliar-phony)
+       ("go-github-com-arceliar-ironwood"
+        ,go-github-com-arceliar-ironwood)))
     (home-page "https://yggdrasil-network.github.io/blog.html")
     (synopsis
      "Experiment in scalable routing as an encrypted IPv6 overlay network")
diff --git a/gnu/packages/patches/yggdrasil-extra-config.patch b/gnu/packages/patches/yggdrasil-extra-config.patch
index c21ca29a84..46fd3f15fc 100644
--- a/gnu/packages/patches/yggdrasil-extra-config.patch
+++ b/gnu/packages/patches/yggdrasil-extra-config.patch
@@ -3,25 +3,25 @@ index 813e950..08d35cc 100644
 --- a/cmd/yggdrasil/main.go
 +++ b/cmd/yggdrasil/main.go
 @@ -40,11 +40,12 @@ type node struct {
- 	admin     module.Module // admin.AdminSocket
+ 	admin     *admin.AdminSocket
  }
  
--func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config.NodeConfig {
-+func readConfig(useconf *bool, useconffile *string, extraconffile *string, normaliseconf *bool) *config.NodeConfig {
+-func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf bool) *config.NodeConfig {
++func readConfig(log *log.Logger, useconf bool, useconffile string, extraconffile string, normaliseconf bool) *config.NodeConfig {
  	// Use a configuration file. If -useconf, the configuration will be read
  	// from stdin. If -useconffile, the configuration will be read from the
  	// filesystem.
  	var conf []byte
 +	var extraconf []byte
  	var err error
- 	if *useconffile != "" {
+ 	if useconffile != "" {
  		// Read the file from the filesystem
 @@ -56,6 +57,21 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
  	if err != nil {
  		panic(err)
  	}
-+	if *extraconffile != "" {
-+		extraconf, err = ioutil.ReadFile(*extraconffile);
++	if extraconffile != "" {
++		extraconf, err = ioutil.ReadFile(extraconffile);
 +	}
 +	if err != nil {
 +		panic(err)
@@ -30,7 +30,7 @@ index 813e950..08d35cc 100644
 +	// then parse the configuration we loaded above on top of it. The effect
 +	// of this is that any configuration item that is missing from the provided
 +	// configuration will use a sane default.
-+	cfg := config.GenerateConfig()
++	cfg := defaults.GenerateConfig()
 +	var confs [2][]byte
 +	confs[0]=conf
 +	confs[1]=extraconf
@@ -38,7 +38,7 @@ index 813e950..08d35cc 100644
  	// If there's a byte order mark - which Windows 10 is now incredibly fond of
  	// throwing everywhere when it's converting things into UTF-16 for the hell
  	// of it - remove it and decode back down into UTF-8. This is necessary
-@@ -69,11 +85,6 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
+@@ -69,11 +85,6 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf bool) *config
  			panic(err)
  		}
  	}
@@ -46,11 +46,11 @@ index 813e950..08d35cc 100644
 -	// then parse the configuration we loaded above on top of it. The effect
 -	// of this is that any configuration item that is missing from the provided
 -	// configuration will use a sane default.
--	cfg := config.GenerateConfig()
+-	cfg := defaults.GenerateConfig()
  	var dat map[string]interface{}
  	if err := hjson.Unmarshal(conf, &dat); err != nil {
  		panic(err)
-@@ -112,6 +123,7 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
+@@ -112,6 +123,7 @@ func readConfig(log *log.Logger, useconf *bool, useconffile *string, normaliseconf *bool) *config
  	if err = mapstructure.Decode(dat, &cfg); err != nil {
  		panic(err)
  	}
@@ -58,6 +58,14 @@ index 813e950..08d35cc 100644
  	return cfg
  }
  
+@@ -185,6 +197,7 @@ func main() {
+ 	genconf       bool
+ 	useconf       bool
+ 	useconffile   string
++	extraconffile string
+ 	normaliseconf bool
+ 	confjson      bool
+ 	autoconf      bool
 @@ -164,6 +176,7 @@ func main() {
  	genconf := flag.Bool("genconf", false, "print a new config to stdout")
  	useconf := flag.Bool("useconf", false, "read HJSON/JSON config from stdin")
@@ -66,21 +74,20 @@ index 813e950..08d35cc 100644
  	normaliseconf := flag.Bool("normaliseconf", false, "use in combination with either -useconf or -useconffile, outputs your configuration normalised")
  	confjson := flag.Bool("json", false, "print configuration from -genconf or -normaliseconf as JSON instead of HJSON")
  	autoconf := flag.Bool("autoconf", false, "automatic mode (dynamic IP, peer with IPv6 neighbors)")
+@@ -212,6 +225,7 @@ func main() {
+ 		genconf:       *genconf,
+ 		useconf:       *useconf,
+ 		useconffile:   *useconffile,
++		extraconffile: *extraconffile,
+ 		normaliseconf: *normaliseconf,
+ 		confjson:      *confjson,
+ 		autoconf:      *autoconf,
 @@ -187,7 +200,7 @@ func main() {
- 		cfg = config.GenerateConfig()
- 	case *useconffile != "" || *useconf:
+ 		cfg = defaults.GenerateConfig()
+ 	case args.useconffile != "" || args.useconf:
  		// Read the configuration from either stdin or from the filesystem
--		cfg = readConfig(useconf, useconffile, normaliseconf)
-+		cfg = readConfig(useconf, useconffile, extraconffile, normaliseconf)
+-		cfg = readConfig(logger, args.useconf, args.useconffile, args.normaliseconf)
++		cfg = readConfig(logger, args.useconf, args.useconffile, args.extraconffile, args.normaliseconf)
  		// If the -normaliseconf option was specified then remarshal the above
  		// configuration and print it back to stdout. This lets the user update
  		// their configuration file with newly mapped names (like above) or to
-@@ -332,7 +345,7 @@ func main() {
- 			goto exit
- 		case _ = <-r:
- 			if *useconffile != "" {
--				cfg = readConfig(useconf, useconffile, normaliseconf)
-+				cfg = readConfig(useconf, useconffile, extraconffile, normaliseconf)
- 				logger.Infoln("Reloading configuration from", *useconffile)
- 				n.core.UpdateConfig(cfg)
- 				n.tuntap.UpdateConfig(cfg)
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-12-02  9:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02  6:59 [bug#51565] PATCH: Update Yggdrasil to new protocol (important breaking changes) raingloom
2021-11-15 14:10 ` pukkamustard
2021-11-22 21:13   ` raingloom
2021-11-28 20:47     ` raingloom
2021-12-01 15:27     ` Ludovic Courtès
2021-12-01 16:03       ` raingloom
2021-12-02  9:15         ` Ludovic Courtès
2021-12-01 16:04 ` bug#51565: " Ricardo Wurmus
2021-12-02  9:16   ` [bug#51565] " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).