View | Details | Raw Unified | Return to bug 257301 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 257301