Bug 257301 - net/yggdrasil: Update to 0.4.0
Summary: net/yggdrasil: Update to 0.4.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Li-Wen Hsu
URL: https://github.com/yggdrasil-network/...
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2021-07-20 21:48 UTC by David Hoppenbrouwers
Modified: 2021-11-16 19:37 UTC (History)
3 users (show)

See Also:
freebsd: maintainer-feedback+


Attachments
Update to 0.4.0 (13.12 KB, patch)
2021-07-20 21:48 UTC, David Hoppenbrouwers
no flags Details | Diff
Update to 0.4.0 (12.55 KB, patch)
2021-08-17 16:03 UTC, David Hoppenbrouwers
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Hoppenbrouwers 2021-07-20 21:48:00 UTC
Created attachment 226573 [details]
Update to 0.4.0
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-21 01:28:40 UTC
^Triage: 

 - maintainer-feedback flag (+) not required unless requested (?) first
 - Please set the maintainer-approval attachment flag (to +) on patches for ports you maintain to signify approval

   Attachment -> Details -> maintainer-approval [+]

 - If there is a changelog or release notes URL available for this version, please add it to the URL field
Comment 2 David Hoppenbrouwers 2021-08-17 15:59:38 UTC
Comment on attachment 226573 [details]
Update to 0.4.0

diff -ruN /tmp/yggpatch/Makefile ./Makefile
--- /tmp/yggpatch/Makefile	2021-07-20 23:35:07.077365000 +0200
+++ ./Makefile	2021-07-20 23:37:27.401902000 +0200
@@ -1,6 +1,8 @@
+# $FreeBSD: head/net/yggdrasil/Makefile 551857 2020-10-10 06:37:36Z lbartoletti $
+
 PORTNAME=	yggdrasil
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.3.16
+DISTVERSION=	0.4.0
 CATEGORIES=	net
 
 MAINTAINER=	freebsd@neilalexander.dev
@@ -14,30 +16,32 @@
 GH_ACCOUNT=	yggdrasil-network
 GH_PROJECT=	yggdrasil-go
 GH_TUPLE=	\
+		Arceliar:ironwood:6ad55cae5031:arceliar_ironwood/vendor/github.com/Arceliar/ironwood \
 		Arceliar:phony:dde1a8dca979:arceliar_phony/vendor/github.com/Arceliar/phony \
-		VividCortex:ewma:v1.1.1:vividcortex_ewma/vendor/github.com/VividCortex/ewma \
-		cheggaaa:pb:v3.0.6:cheggaaa_pb_v3/vendor/github.com/cheggaaa/pb \
-		fatih:color:v1.10.0:fatih_color/vendor/github.com/fatih/color \
-		golang:crypto:5ea612d1eb83:golang_crypto/vendor/golang.org/x/crypto \
-		golang:net:e18ecbb05110:golang_net/vendor/golang.org/x/net \
-		golang:sys:8fe3ee5dd75b:golang_sys/vendor/golang.org/x/sys \
-		golang:text:8f690f22cf1c:golang_text/vendor/golang.org/x/text \
-		gologme:log:4e5d8ccb38e8:gologme_log/vendor/github.com/gologme/log \
+		VividCortex:ewma:v1.2.0:vividcortex_ewma/vendor/github.com/VividCortex/ewma \
+		cheggaaa:pb:v3.0.8:cheggaaa_pb_v3/vendor/github.com/cheggaaa/pb \
+		fatih:color:v1.12.0:fatih_color/vendor/github.com/fatih/color \
+		golang:crypto:c07d793c2f9a:golang_crypto/vendor/golang.org/x/crypto \
+		golang:net:84b48f89b13b:golang_net/vendor/golang.org/x/net \
+		golang:sys:a4fc73990273:golang_sys/vendor/golang.org/x/sys \
+		golang:text:5c7c50ebbd4f:golang_text/vendor/golang.org/x/text \
+		gologme:log:v1.2.0:gologme_log/vendor/github.com/gologme/log \
 		hashicorp:go-syslog:v1.0.0:hashicorp_go_syslog/vendor/github.com/hashicorp/go-syslog \
 		hjson:hjson-go:v3.1.0:hjson_hjson_go/vendor/github.com/hjson/hjson-go \
-		kardianos:minwinsvc:cad6b2b879b0:kardianos_minwinsvc/vendor/github.com/kardianos/minwinsvc \
-		mattn:go-colorable:v0.1.2:mattn_go_colorable/vendor/github.com/mattn/go-colorable \
-		mattn:go-isatty:v0.0.10:mattn_go_isatty/vendor/github.com/mattn/go-isatty \
-		mattn:go-runewidth:v0.0.7:mattn_go_runewidth/vendor/github.com/mattn/go-runewidth \
-		mitchellh:mapstructure:v1.1.2:mitchellh_mapstructure/vendor/github.com/mitchellh/mapstructure \
-		vishvananda:netlink:v1.0.0:vishvananda_netlink/vendor/github.com/vishvananda/netlink \
-		vishvananda:netns:7109fa855b0f:vishvananda_netns/vendor/github.com/vishvananda/netns \
-		wireguard:wireguard-go:v0.0.20200320:wireguard_wireguard_go/vendor/golang.zx2c4.com/wireguard \
-		WireGuard:wireguard-windows:v0.1.0:wireguard_wireguard_windows/vendor/golang.zx2c4.com/wireguard/windows
-USE_RC_SUBR=	yggdrasil
+		kardianos:minwinsvc:v1.0.0:kardianos_minwinsvc/vendor/github.com/kardianos/minwinsvc \
+		mattn:go-colorable:v0.1.8:mattn_go_colorable/vendor/github.com/mattn/go-colorable \
+		mattn:go-isatty:v0.0.13:mattn_go_isatty/vendor/github.com/mattn/go-isatty \
+		mattn:go-runewidth:v0.0.13:mattn_go_runewidth/vendor/github.com/mattn/go-runewidth \
+		mitchellh:mapstructure:v1.4.1:mitchellh_mapstructure/vendor/github.com/mitchellh/mapstructure \
+		rivo:uniseg:v0.2.0:rivo_uniseg/vendor/github.com/rivo/uniseg \
+		vishvananda:netlink:v1.1.0:vishvananda_netlink/vendor/github.com/vishvananda/netlink \
+		vishvananda:netns:2eb08e3e575f:vishvananda_netns/vendor/github.com/vishvananda/netns \
+		wireguard:wireguard-go:f9b48a961cd2:wireguard_wireguard_go/vendor/golang.zx2c4.com/wireguard \
 
+
 GO_TARGET=	./cmd/yggdrasil \
 		./cmd/yggdrasilctl
+
 GO_BUILDFLAGS=	-ldflags="-s -w \
 		-X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=${PORTNAME} \
 		-X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=${PORTVERSION} \
@@ -45,5 +49,7 @@
 
 PLIST_FILES=	bin/yggdrasil \
 		bin/yggdrasilctl
+
+USE_RC_SUBR=	yggdrasil
 
 .include <bsd.port.mk>
diff -ruN /tmp/yggpatch/distinfo ./distinfo
--- /tmp/yggpatch/distinfo	2021-07-20 23:35:26.891494000 +0200
+++ ./distinfo	2021-07-20 23:02:20.568231000 +0200
@@ -1,43 +1,45 @@
-TIMESTAMP = 1617712629
-SHA256 (yggdrasil-network-yggdrasil-go-v0.3.16_GH0.tar.gz) = e03595b78906b171155aaa11c922be3418bd056f8547e4d9f5123b6047316eac
-SIZE (yggdrasil-network-yggdrasil-go-v0.3.16_GH0.tar.gz) = 166501
+TIMESTAMP = 1626814940
+SHA256 (yggdrasil-network-yggdrasil-go-v0.4.0_GH0.tar.gz) = 6ad762012ef1a73bfb718db4a23c5a0067e13939d0655221afc4c1f723736cbf
+SIZE (yggdrasil-network-yggdrasil-go-v0.4.0_GH0.tar.gz) = 89502
+SHA256 (Arceliar-ironwood-6ad55cae5031_GH0.tar.gz) = 3f09a5ba5572c0bd77fce4ceaa52c9c58c1c8fb3b0107c655aaaef754d266931
+SIZE (Arceliar-ironwood-6ad55cae5031_GH0.tar.gz) = 40400
 SHA256 (Arceliar-phony-dde1a8dca979_GH0.tar.gz) = bcc79621c9da979c1d357a29f1924d73c86c57c0e901652312d742cbc39e5962
 SIZE (Arceliar-phony-dde1a8dca979_GH0.tar.gz) = 11118
-SHA256 (VividCortex-ewma-v1.1.1_GH0.tar.gz) = 3b2d62412b7ba2726a379cc0ae557595c027dc8206d0ef98f13831281b8f2b85
-SIZE (VividCortex-ewma-v1.1.1_GH0.tar.gz) = 6042
-SHA256 (cheggaaa-pb-v3.0.6_GH0.tar.gz) = 64e8d89836cde14cb746a91bd6aa33f14ecd3e365231edb95b5223f736ef4da1
-SIZE (cheggaaa-pb-v3.0.6_GH0.tar.gz) = 31038
-SHA256 (fatih-color-v1.10.0_GH0.tar.gz) = a00342a7ffb8b119346dce56e152a111cbb9eab3970c429cc2ed4272aec2858e
-SIZE (fatih-color-v1.10.0_GH0.tar.gz) = 1267532
-SHA256 (golang-crypto-5ea612d1eb83_GH0.tar.gz) = ab4d88d6121195632d006705a950adebaf4fa99dd15ea0c508297a17c5d3277e
-SIZE (golang-crypto-5ea612d1eb83_GH0.tar.gz) = 1726242
-SHA256 (golang-net-e18ecbb05110_GH0.tar.gz) = c30374f6fd34c6b77d53224aa3ba7458e3773d7e6e4fa16d88fb05c7d05e0e89
-SIZE (golang-net-e18ecbb05110_GH0.tar.gz) = 1253124
-SHA256 (golang-sys-8fe3ee5dd75b_GH0.tar.gz) = 88091001fc7f8d89561f7ce6c28b9eafef82ddecebf8ab9cdaf27d76c18accdd
-SIZE (golang-sys-8fe3ee5dd75b_GH0.tar.gz) = 1216988
-SHA256 (golang-text-8f690f22cf1c_GH0.tar.gz) = 0d0d17d56d912e0625ebbf89fc5f88eb9d5429e56510de7ba40fd8ad50d2d7b0
-SIZE (golang-text-8f690f22cf1c_GH0.tar.gz) = 8355724
-SHA256 (gologme-log-4e5d8ccb38e8_GH0.tar.gz) = d5873e95bd5459d9a4813e7020236f15db01277ffba0abfc9f80c5bac7477157
-SIZE (gologme-log-4e5d8ccb38e8_GH0.tar.gz) = 5613
+SHA256 (VividCortex-ewma-v1.2.0_GH0.tar.gz) = 2f26521a9207b91dfbca3d28e5545bc11cb098888ecf3e9ba8e5936387b06a33
+SIZE (VividCortex-ewma-v1.2.0_GH0.tar.gz) = 6683
+SHA256 (cheggaaa-pb-v3.0.8_GH0.tar.gz) = 17cb166dfe931ccdf3742271442dcfb2b886099d3e32fb706e2c4752133b2910
+SIZE (cheggaaa-pb-v3.0.8_GH0.tar.gz) = 31487
+SHA256 (fatih-color-v1.12.0_GH0.tar.gz) = 8f4cef62c8aafdf7e7b3097e9f97c236bb31a47f2c939a54da92235c30ae9dcb
+SIZE (fatih-color-v1.12.0_GH0.tar.gz) = 10711
+SHA256 (golang-crypto-c07d793c2f9a_GH0.tar.gz) = bd1e0856c43287c6ebd20d59e2b4f2ffa91c5cc275dbb02bb2cfc822e6dc18a4
+SIZE (golang-crypto-c07d793c2f9a_GH0.tar.gz) = 1732023
+SHA256 (golang-net-84b48f89b13b_GH0.tar.gz) = 2937fbc6cdc2dfcf2db9a20bddd42cc0e18a433e0e7a3820af4e152ff0d2b584
+SIZE (golang-net-84b48f89b13b_GH0.tar.gz) = 1252079
+SHA256 (golang-sys-a4fc73990273_GH0.tar.gz) = a4fa3667e73a94fa8ce9f0fd85c38a6b993d7343dbe5212ba29f92b49c10afc0
+SIZE (golang-sys-a4fc73990273_GH0.tar.gz) = 1200476
+SHA256 (golang-text-5c7c50ebbd4f_GH0.tar.gz) = c060571a3ee810fa52e9d8965c1b57c1a5367fe6c7fb358117a971f982c7ef68
+SIZE (golang-text-5c7c50ebbd4f_GH0.tar.gz) = 8355892
+SHA256 (gologme-log-v1.2.0_GH0.tar.gz) = 06b94718ea898c01c176a8915ccd119d511ee41de388611d8e9afeb1a17bfff6
+SIZE (gologme-log-v1.2.0_GH0.tar.gz) = 5610
 SHA256 (hashicorp-go-syslog-v1.0.0_GH0.tar.gz) = be4bda814c068311ea8e185e2d108077f167897cfa868ada7f56d97a10f3d602
 SIZE (hashicorp-go-syslog-v1.0.0_GH0.tar.gz) = 4517
 SHA256 (hjson-hjson-go-v3.1.0_GH0.tar.gz) = 4a06364b44121e442e7c880aa1abb048e96ef23e685ef853aed9eedcb454f0ef
 SIZE (hjson-hjson-go-v3.1.0_GH0.tar.gz) = 25729
-SHA256 (kardianos-minwinsvc-cad6b2b879b0_GH0.tar.gz) = 820c068dfee3306853cb6cc63becb96b9f972a14a97ad71df3332f98bc4866cb
-SIZE (kardianos-minwinsvc-cad6b2b879b0_GH0.tar.gz) = 1804
-SHA256 (mattn-go-colorable-v0.1.2_GH0.tar.gz) = a7189bd9005c571303b117261955ce53b0e2aa89fe415e2289659be343fe1651
-SIZE (mattn-go-colorable-v0.1.2_GH0.tar.gz) = 8518
-SHA256 (mattn-go-isatty-v0.0.10_GH0.tar.gz) = 55408e1afd78eaa112842ae2263e70703d5b5133feaa17fa477980a87a961fe7
-SIZE (mattn-go-isatty-v0.0.10_GH0.tar.gz) = 4465
-SHA256 (mattn-go-runewidth-v0.0.7_GH0.tar.gz) = 09270ddb93b2d77d4b3903bbadacbb3a3d4f0cce93c373fb21503840829d8697
-SIZE (mattn-go-runewidth-v0.0.7_GH0.tar.gz) = 16089
-SHA256 (mitchellh-mapstructure-v1.1.2_GH0.tar.gz) = 53fbc06b125ff1c9c73a4eb1764346932671a29c67a45a92e2ebc6855635069b
-SIZE (mitchellh-mapstructure-v1.1.2_GH0.tar.gz) = 20980
-SHA256 (vishvananda-netlink-v1.0.0_GH0.tar.gz) = a621be56e9a161eae72bc9f14849fef9a23076af87e6c0997d1cdf4208530a2a
-SIZE (vishvananda-netlink-v1.0.0_GH0.tar.gz) = 119941
-SHA256 (vishvananda-netns-7109fa855b0f_GH0.tar.gz) = c7b2eb08c983dfc2c2deeaec182e1cfd24fb5ff22f7448fc30f6a9480bbb9b3f
-SIZE (vishvananda-netns-7109fa855b0f_GH0.tar.gz) = 7868
-SHA256 (wireguard-wireguard-go-v0.0.20200320_GH0.tar.gz) = a40f5ca7c33b0d631c2777b992d7a398491bc4d72ed1e559a86055637a708844
-SIZE (wireguard-wireguard-go-v0.0.20200320_GH0.tar.gz) = 96760
-SHA256 (WireGuard-wireguard-windows-v0.1.0_GH0.tar.gz) = 92b9f99d06843ef49aef4b5798dc4531220c79b3c11d02d1f7ad4ffb2071e1aa
-SIZE (WireGuard-wireguard-windows-v0.1.0_GH0.tar.gz) = 191555
+SHA256 (kardianos-minwinsvc-v1.0.0_GH0.tar.gz) = 211be15df1ceceb865afed15eca304620f0e2f10014b8318639c723cad75e697
+SIZE (kardianos-minwinsvc-v1.0.0_GH0.tar.gz) = 2063
+SHA256 (mattn-go-colorable-v0.1.8_GH0.tar.gz) = 1027954f9abbe06b6e117e3047af70204dd0eb4f8c27fcd459fb2574b279755f
+SIZE (mattn-go-colorable-v0.1.8_GH0.tar.gz) = 9571
+SHA256 (mattn-go-isatty-v0.0.13_GH0.tar.gz) = d25318d3c4e174e1ffb5d90c9d3e6887cc050f76e403b7b3d6163f4338fac952
+SIZE (mattn-go-isatty-v0.0.13_GH0.tar.gz) = 4440
+SHA256 (mattn-go-runewidth-v0.0.13_GH0.tar.gz) = 9b2aeafa5d95a40b32067ba22accdf42cc83414ec5b433ea7de330791beaa196
+SIZE (mattn-go-runewidth-v0.0.13_GH0.tar.gz) = 17353
+SHA256 (mitchellh-mapstructure-v1.4.1_GH0.tar.gz) = d936baa5006f7dda1346aff863745a110981f7583a1184e93b9077fa52cd4048
+SIZE (mitchellh-mapstructure-v1.4.1_GH0.tar.gz) = 27826
+SHA256 (rivo-uniseg-v0.2.0_GH0.tar.gz) = 3ad738b5c9162ede110d75b23564b6e40e52dd9150ebbced402f4f70be106197
+SIZE (rivo-uniseg-v0.2.0_GH0.tar.gz) = 44036
+SHA256 (vishvananda-netlink-v1.1.0_GH0.tar.gz) = c72754916ac1551cea4e1f801d5b2c26c1476f11bd3130382a4a890822eb5929
+SIZE (vishvananda-netlink-v1.1.0_GH0.tar.gz) = 147026
+SHA256 (vishvananda-netns-2eb08e3e575f_GH0.tar.gz) = 049a592025d3b7011acb83f2c6074a75143d3d95f842526d10f0589155283f0c
+SIZE (vishvananda-netns-2eb08e3e575f_GH0.tar.gz) = 8579
+SHA256 (wireguard-wireguard-go-f9b48a961cd2_GH0.tar.gz) = 7a8a182a07b9e47e61531a3a73203ae28418ed1c0d822399c45f648813d0c655
+SIZE (wireguard-wireguard-go-f9b48a961cd2_GH0.tar.gz) = 126551
diff -ruN /tmp/yggpatch/files/yggdrasil.in ./files/yggdrasil.in
--- /tmp/yggpatch/files/yggdrasil.in	2021-07-20 23:34:40.070359000 +0200
+++ ./files/yggdrasil.in	2020-08-17 17:51:07.376865000 +0200
@@ -1,8 +1,15 @@
 #!/bin/sh
 #
+# Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin
+# Then copy this script into /etc/rc.d/yggdrasil
+# Finally, run:
+#   1. chmod +x /etc/rc.d/yggdrasil /usr/local/bin/{yggdrasil,yggdrasilctl}
+#   2. echo "yggdrasil_enable=yes" >> /etc/rc.d
+#   3. service yggdrasil start
+#
 # PROVIDE: yggdrasil
 # REQUIRE: networking
-# KEYWORD: shutdown
+# KEYWORD:
 
 . /etc/rc.subr
 
@@ -10,10 +17,11 @@
 rcvar="yggdrasil_enable"
 
 start_cmd="${name}_start"
+stop_cmd="${name}_stop"
 
 pidfile="/var/run/yggdrasil/${name}.pid"
 command="/usr/sbin/daemon"
-command_args="-P ${pidfile} -r"
+command_args="-P ${pidfile} -r -f ${yggdrasil_command}"
 
 yggdrasil_start()
 {
@@ -32,7 +40,21 @@
 
 	logger -s -t yggdrasil "Starting yggdrasil"
 	${command} ${command_args} %%PREFIX%%/bin/yggdrasil -useconffile %%PREFIX%%/etc/yggdrasil.conf \
-		-logto /var/log/yggdrasil.log
+		1>/var/log/yggdrasil.stdout.log \
+		2>/var/log/yggdrasil.stderr.log &
+}
+
+yggdrasil_stop()
+{
+	logger -s -t yggdrasil "Stopping yggdrasil"
+	test -f /var/run/yggdrasil/${name}.pid && kill -TERM $(cat /var/run/yggdrasil/${name}.pid)
+
+	tap_name="$(egrep '^[ \t]+IfName:' %%PREFIX%%/etc/yggdrasil.conf | sed 's/[ \t]*IfName:[ \t]*//')"
+
+	/sbin/ifconfig ${tap_name} >/dev/null 2>&1 && (
+		logger -s -t yggdrasil "Destroying ${tap_name} adapter"
+		/sbin/ifconfig ${tap_name} destroy || logger -s -t yggdrasil "Failed to destroy ${tap_name} adapter"
+	)
 }
 
 load_rc_config $name
Comment 3 David Hoppenbrouwers 2021-08-17 16:00:09 UTC
Apologies, I mean to update the attachment
Comment 4 David Hoppenbrouwers 2021-08-17 16:03:33 UTC
Created attachment 227285 [details]
Update to 0.4.0

There was an issue with the tap0 device not being destroyed when yggdrasil was stopped. This has been fixed.
Comment 5 Gian-Simon Purkert 2021-10-21 13:24:05 UTC
The patch works for me, any news?
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-11-16 19:37:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1606be25e295db22adc8e331ffec6f25774feca7

commit 1606be25e295db22adc8e331ffec6f25774feca7
Author:     David Hoppenbrouwers <david@salt-inc.org>
AuthorDate: 2021-11-16 19:35:53 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-11-16 19:35:53 +0000

    net/yggdrasil: Update to 0.4.0

    PR:             257301
    Approved by:    Neil Alexander <freebsd@neilalexander.dev> (maintainer)

 net/yggdrasil/Makefile           | 41 ++++++++++++----------
 net/yggdrasil/distinfo           | 76 +++++++++++++++++++++-------------------
 net/yggdrasil/files/yggdrasil.in | 28 +++++++++++++--
 3 files changed, 86 insertions(+), 59 deletions(-)