diff --git a/net/yggdrasil/Makefile b/net/yggdrasil/Makefile index c44d6665a462..243ef2d07eb3 100644 --- a/net/yggdrasil/Makefile +++ b/net/yggdrasil/Makefile @@ -1,29 +1,28 @@ PORTNAME= yggdrasil DISTVERSIONPREFIX= v -DISTVERSION= 0.5.1 -PORTREVISION= 1 +DISTVERSION= 0.5.5 CATEGORIES= net MAINTAINER= freebsd@neilalexander.dev COMMENT= Experimental end-to-end encrypted self-arranging IPv6 network WWW= https://yggdrasil-network.github.io/ LICENSE= LGPL3 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules go:1.20 GO_MODULE= github.com/yggdrasil-network/yggdrasil-go 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} \ " PLIST_FILES= bin/yggdrasil \ bin/yggdrasilctl USE_RC_SUBR= yggdrasil .include diff --git a/net/yggdrasil/distinfo b/net/yggdrasil/distinfo index ff1b99e241e5..66fbc4b7217a 100644 --- a/net/yggdrasil/distinfo +++ b/net/yggdrasil/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1698509866 -SHA256 (go/net_yggdrasil/yggdrasil-v0.5.1/v0.5.1.mod) = 2039923698dd8b3f3a5a73a46bb57cd5e4b322edc9737923a193ecfee90add9e -SIZE (go/net_yggdrasil/yggdrasil-v0.5.1/v0.5.1.mod) = 1762 -SHA256 (go/net_yggdrasil/yggdrasil-v0.5.1/v0.5.1.zip) = ab082d066fbd825d0ea97a6bfafdc80084ed220060e11c44db7880fa5723088c -SIZE (go/net_yggdrasil/yggdrasil-v0.5.1/v0.5.1.zip) = 151253 +TIMESTAMP = 1706632678 +SHA256 (go/net_yggdrasil/yggdrasil-v0.5.5/v0.5.5.mod) = 63a943ca619c9809973b438d52c45ddfd5ed0bda28c5610e49a367ef4c3570bf +SIZE (go/net_yggdrasil/yggdrasil-v0.5.5/v0.5.5.mod) = 1762 +SHA256 (go/net_yggdrasil/yggdrasil-v0.5.5/v0.5.5.zip) = de089a6e0b8b61edb0e40cf931b2efe93867e6afefa60e60e0c4d1363399f4b3 +SIZE (go/net_yggdrasil/yggdrasil-v0.5.5/v0.5.5.zip) = 153660 diff --git a/net/yggdrasil/files/yggdrasil.in b/net/yggdrasil/files/yggdrasil.in index ce90db39e73c..503408f0b151 100644 --- a/net/yggdrasil/files/yggdrasil.in +++ b/net/yggdrasil/files/yggdrasil.in @@ -1,63 +1,64 @@ #!/bin/sh # # Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin -# Then copy this script into /etc/rc.d/yggdrasil +# Then copy this script into /usr/local/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 +# 2. sysrc yggdrasil_enable=YES # 3. service yggdrasil start # # PROVIDE: yggdrasil -# REQUIRE: networking +# REQUIRE: NETWORKING # KEYWORD: . /etc/rc.subr name="yggdrasil" rcvar="yggdrasil_enable" start_cmd="${name}_start" stop_cmd="${name}_stop" +yggdrasil_command="%%PREFIX%%/bin/yggdrasil" pidfile="/var/run/yggdrasil/${name}.pid" command="/usr/sbin/daemon" -command_args="-P ${pidfile} -r -f ${yggdrasil_command}" +command_args="-P ${pidfile} -r -S -m 3 -s info -T yggdrasil ${yggdrasil_command}" yggdrasil_start() { test ! -x %%PREFIX%%/bin/yggdrasil && ( logger -s -t yggdrasil "Warning: %%PREFIX%%/bin/yggdrasil is missing or not executable" logger -s -t yggdrasil "Copy the yggdrasil binary into %%PREFIX%%/bin and then chmod +x %%PREFIX%%/bin/yggdrasil" return 1 ) test ! -f %%PREFIX%%/etc/yggdrasil.conf && ( logger -s -t yggdrasil "Generating new configuration file into %%PREFIX%%/etc/yggdrasil.conf" %%PREFIX%%/bin/yggdrasil -genconf > %%PREFIX%%/etc/yggdrasil.conf ) mkdir -p /var/run/yggdrasil logger -s -t yggdrasil "Starting yggdrasil" - ${command} ${command_args} %%PREFIX%%/bin/yggdrasil -useconffile %%PREFIX%%/etc/yggdrasil.conf \ + ${command} ${command_args} -useconffile %%PREFIX%%/etc/yggdrasil.conf \ 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 : ${yggdrasil_enable:=no} run_rc_command "$1"