From 697dfed1f9f5d2916889a81a7a64bd1158caf2d2 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 20 Dec 2022 15:34:50 +0100 Subject: Server: Implement forcing WireGuard selection through env --- internal/server/server.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/server/server.go') diff --git a/internal/server/server.go b/internal/server/server.go index 1637d35..9354883 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -244,6 +244,14 @@ func Config(server Server, wireguardSupport bool, preferTCP bool) (string, strin ovpn := p.supportsOpenVPN() wg := p.supportsWireguard() && wireguardSupport + // If we don't prefer TCP and this profile and client supports wireguard, + // we disable openvpn if the EDUVPN_PREFER_WG environment variable is set + // This is useful to force WireGuard if the profile supports both OpenVPN and WireGuard but the server still prefers OpenVPN + if !preferTCP && wg { + if os.Getenv("EDUVPN_PREFER_WG") == "1" { + ovpn = false + } + } switch { // The config supports wireguard and optionally openvpn -- cgit v1.2.3