security/netbird: Update 0.47.2 => 0.49.0
Changelogs: https://github.com/netbirdio/netbird/releases/tag/v0.48.0 https://github.com/netbirdio/netbird/releases/tag/v0.49.0 Parameterize "netbird" with "${PORTNAME}". PR: 287762
This commit is contained in:
committed by
Vladimir Druzenko
parent
ef09d1f0e4
commit
931ad393ed
@@ -1,6 +1,6 @@
|
||||
PORTNAME= netbird
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.47.2
|
||||
DISTVERSION= 0.49.0
|
||||
CATEGORIES= security net net-vpn
|
||||
|
||||
MAINTAINER= hakan.external@netbird.io
|
||||
@@ -16,15 +16,15 @@ NOT_FOR_ARCHS_REASON= "no 32-bit builds supported"
|
||||
RUN_DEPENDS= ca_root_nss>0:security/ca_root_nss
|
||||
|
||||
USES= go:modules
|
||||
USE_RC_SUBR= netbird
|
||||
USE_RC_SUBR= ${PORTNAME}
|
||||
|
||||
GO_MODULE= github.com/netbirdio/netbird
|
||||
GO_TARGET= ./client:netbird
|
||||
GO_TARGET= ./client:${PORTNAME}
|
||||
GO_BUILDFLAGS= -tags freebsd -o ${PORTNAME} -ldflags \
|
||||
"-s -w -X github.com/netbirdio/netbird/version.version=${DISTVERSION}"
|
||||
|
||||
WRKSRC= ${WRKDIR}/netbird-${DISTVERSION}
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
|
||||
|
||||
PLIST_FILES= bin/netbird
|
||||
PLIST_FILES= bin/${PORTNAME}
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
TIMESTAMP = 1749687672
|
||||
SHA256 (go/security_netbird/netbird-v0.47.2/v0.47.2.mod) = dd8e2b5f3ee570d2ef933101c6fb7bc5de05dae258f0c7ea7602e8db42238acb
|
||||
SIZE (go/security_netbird/netbird-v0.47.2/v0.47.2.mod) = 12507
|
||||
SHA256 (go/security_netbird/netbird-v0.47.2/v0.47.2.zip) = 8671becd05ff5437daa98b34e76819cd0908c1a040f49a369c9e26ed8cc64831
|
||||
SIZE (go/security_netbird/netbird-v0.47.2/v0.47.2.zip) = 2917482
|
||||
TIMESTAMP = 1750840361
|
||||
SHA256 (go/security_netbird/netbird-v0.49.0/v0.49.0.mod) = dd8e2b5f3ee570d2ef933101c6fb7bc5de05dae258f0c7ea7602e8db42238acb
|
||||
SIZE (go/security_netbird/netbird-v0.49.0/v0.49.0.mod) = 12507
|
||||
SHA256 (go/security_netbird/netbird-v0.49.0/v0.49.0.zip) = c1aa8b8749cdb1a471425ce5aac7d90e318e6f6280f51a8b72ca18ad241f7bfb
|
||||
SIZE (go/security_netbird/netbird-v0.49.0/v0.49.0.zip) = 2921705
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
# Default: 'info'
|
||||
# netbird_logfile (path): Path to the client log file.
|
||||
# Default: /var/log/netbird/client.log
|
||||
# netbird_env (str): Extra environment variables for the daemon, in KEY=VALUE format.
|
||||
# Default: 'IS_DAEMON=1'
|
||||
# netbird_tun_dev (str): Name of the TUN device used by Netbird for its VPN tunnel.
|
||||
# Default: wt0
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
@@ -32,11 +32,33 @@ load_rc_config "$name"
|
||||
: ${netbird_socket:="/var/run/netbird.sock"}
|
||||
: ${netbird_loglevel:="info"}
|
||||
: ${netbird_logfile:="/var/log/netbird/client.log"}
|
||||
: ${netbird_env:="IS_DAEMON=1"}
|
||||
: ${netbird_tun_dev:="wt0"}
|
||||
|
||||
pidfile="/var/run/${name}.pid"
|
||||
command="/usr/sbin/daemon"
|
||||
daemon_args="-P ${pidfile} -r -t \"${name}: daemon\""
|
||||
command_args="${daemon_args} %%PREFIX%%/bin/netbird service run --config ${netbird_config} --log-level ${netbird_loglevel} --daemon-addr unix://${netbird_socket} --log-file ${netbird_logfile}"
|
||||
start_precmd="${name}_start_precmd"
|
||||
stop_postcmd="${name}_stop_postcmd"
|
||||
|
||||
netbird_start_precmd() {
|
||||
logger -s -t netbird "Starting ${name}."
|
||||
# Check for orphaned netbird tunnel interface
|
||||
# And if it exists, then destroy it
|
||||
if /sbin/ifconfig ${netbird_tun_dev} >/dev/null 2>&1; then
|
||||
if ! /sbin/ifconfig ${netbird_tun_dev} | fgrep -qw PID; then
|
||||
logger -s -t netbird "Found orphaned tunnel interface ${netbird_tun_dev}, destroying"
|
||||
/sbin/ifconfig ${netbird_tun_dev} destroy
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
netbird_stop_postcmd() {
|
||||
if /sbin/ifconfig ${netbird_tun_dev} >/dev/null 2>&1; then
|
||||
logger -s -t netbird "Destroying tunnel interface ${netbird_tun_dev}"
|
||||
/sbin/ifconfig ${netbird_tun_dev} destroy || \
|
||||
logger -s -t netbird "Failed to destroy interface ${netbird_tun_dev}"
|
||||
fi
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
|
||||
Reference in New Issue
Block a user