From patchwork Tue Nov 2 06:59:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Csepp X-Patchwork-Id: 34210 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0D69527BBE3; Tue, 2 Nov 2021 07:00:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DCDBF27BBE1 for ; Tue, 2 Nov 2021 07:00:37 +0000 (GMT) Received: from localhost ([::1]:49678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhnme-0001wR-SZ for patchwork@mira.cbaines.net; Tue, 02 Nov 2021 03:00:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhnm7-0001tr-5Q for guix-patches@gnu.org; Tue, 02 Nov 2021 03:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53315) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhnm6-0004w0-Om for guix-patches@gnu.org; Tue, 02 Nov 2021 03:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mhnm6-0005LB-Lg for guix-patches@gnu.org; Tue, 02 Nov 2021 03:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51565] PATCH: Update Yggdrasil to new protocol (important breaking changes) Resent-From: raingloom Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Nov 2021 07:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51565 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 51565@debbugs.gnu.org X-Debbugs-Original-To: Guix Patches Received: via spool by submit@debbugs.gnu.org id=B.163583637620462 (code B ref -1); Tue, 02 Nov 2021 07:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Nov 2021 06:59:36 +0000 Received: from localhost ([127.0.0.1]:36628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhnlf-0005Jx-5j for submit@debbugs.gnu.org; Tue, 02 Nov 2021 02:59:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:50944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhnla-0005Jl-D8 for submit@debbugs.gnu.org; Tue, 02 Nov 2021 02:59:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhnla-0001ea-5N for guix-patches@gnu.org; Tue, 02 Nov 2021 02:59:30 -0400 Received: from mx1.riseup.net ([198.252.153.129]:36842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhnlV-0004rK-T1 for guix-patches@gnu.org; Tue, 02 Nov 2021 02:59:29 -0400 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4Hk13Z3TGKzDyTq for ; Mon, 1 Nov 2021 23:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1635836362; bh=/4AhoChfEdH0VSTfMkRCHuUNR3aNSyz25JZfnsWTCU8=; h=Date:From:To:Subject:From; b=CU45tVKm75tDxUQ6Jz9OVCdrKqkvlW4H0yLMTx0luZdydwPv4ZzanZc9loQEDMfVJ hrjDaDZpcP05NJFD523AFGxCmfUg/anrtKr+6WcsyP5ntUF9Z2vYPjbaMNeY/2/2FX 4yGWYwR9v3DLmtu70W7G6b9QhybpDsLcSuGtSkyo= X-Riseup-User-ID: A9D76A513137455B2C5118E02B4B4DE5B12F7D3768EB9285832695B2104B9499 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4Hk13Y5ygdz5vkM for ; Mon, 1 Nov 2021 23:59:21 -0700 (PDT) Date: Tue, 2 Nov 2021 06:59:17 +0000 From: raingloom Message-ID: <20211102065917.082a2e55@riseup.net> MIME-Version: 1.0 Received-SPF: pass client-ip=198.252.153.129; envelope-from=raingloom@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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. From 73c240e5bb2310a1c66978a0f1b08fc5450b7b3c Mon Sep 17 00:00:00 2001 From: raingloom 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