wireguard-go: custom socket dir through environment variable

Svet Bajlekov tomatoman at gmail.com
Tue Nov 27 01:15:45 CET 2018

In the userspace implementation, would there be any interest in making the
socket directory (/var/run/wireguard) customizable via an environment

My use case for this is that I'd like to install and use WireGuard as a
snapcraft package*, and the respective confinement restricts access to
/var/run. Either way, having the ability to customize the path seems like
sensible functionality.

The code change itself is of course pretty simple. I had a go at it here (
where an optional WG_SOCKET_DIR variable is introduced - and what I did
works, though I have to admit that it's the first time I've ever written
anything in go, so what I did is pretty ugly. Therefore I figured I'd reach
out on this mailing list rather than submit a pull request.

Thanks, and keep up the great project!

*Yes, I understand that running the userspace implementation in Linux is
not exactly ideal. I'm doing it on devices where I can't install kernel
modules, and where squeezing out performance is not that important.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20181127/1f81bcf9/attachment-0001.html>

More information about the WireGuard mailing list