summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Froehlich <decke@FreeBSD.org>2020-03-30 19:15:32 +0000
committerBernhard Froehlich <decke@FreeBSD.org>2020-03-30 19:15:32 +0000
commitfc03a6d789a2717a46c466af4e84cbb9763bf951 (patch)
tree043bfd8d0d824eaed90a0bbbe9e484d1d03dc1f3
parentdevel/xeus: Update 0.23.9 -> 0.23.10 (diff)
net/wireguard: Introduce general wireguard_env parameter for environment
variables which affect wg-quick or the userspace implementation (eg. wireguard-go). The syntax in rc.conf is: wireguard_env="VAR=val VAR2=val2" As a reference wg-quick uses these environment variables WG_QUICK_USERSPACE_IMPLEMENTATION and wireguard-go LOG_LEVEL WG_TUN_FD WG_UAPI_FD WG_PROCESS_FOREGROUND Submitted by: J.R. Oldroyd <fbsd@opal.com>
Notes
Notes: svn path=/head/; revision=529908
-rw-r--r--net/wireguard/Makefile1
-rw-r--r--net/wireguard/files/wireguard.in10
2 files changed, 5 insertions, 6 deletions
diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile
index 2337d4514b0c..475b5081ddf0 100644
--- a/net/wireguard/Makefile
+++ b/net/wireguard/Makefile
@@ -2,6 +2,7 @@
PORTNAME= wireguard
PORTVERSION= 1.0.20200319
+PORTREVISION= 1
CATEGORIES= net net-vpn
MASTER_SITES= https://git.zx2c4.com/wireguard-tools/snapshot/
DISTNAME= wireguard-tools-${PORTVERSION}
diff --git a/net/wireguard/files/wireguard.in b/net/wireguard/files/wireguard.in
index 000d41a3b8a3..32e08a8ab13c 100644
--- a/net/wireguard/files/wireguard.in
+++ b/net/wireguard/files/wireguard.in
@@ -12,10 +12,8 @@
# wireguard_interfaces (str): List of interfaces to bring up/down
# on start/stop. (eg: "wg0 wg1")
# (default: "")
-# wireguard_impl (str): Wireguard userspace implementation
-# (default: "wireguard-go")
-# Possible choices:
-# wireguard-go, boringtun
+# wireguard_env (str): Environment variables for the userspace
+# implementation. (eg: "LOG_LEVEL=debug")
. /etc/rc.subr
@@ -27,7 +25,7 @@ stop_cmd="${name}_stop"
wireguard_start()
{
- export WG_QUICK_USERSPACE_IMPLEMENTATION=${wireguard_impl}
+ ${wireguard_env:+eval export $wireguard_env}
for interface in ${wireguard_interfaces}; do
%%PREFIX%%/bin/wg-quick up ${interface}
@@ -45,6 +43,6 @@ load_rc_config $name
: ${wireguard_enable="NO"}
: ${wireguard_interfaces=""}
-: ${wireguard_impl="wireguard-go"}
+: ${wireguard_env=""}
run_rc_command "$1"