Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Christian Hesse <list@eworm.de>
Cc: Christian Hesse <mail@eworm.de>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH 1/1] make the systemd unit example more general
Date: Thu, 8 Dec 2016 13:48:13 +0100	[thread overview]
Message-ID: <CAHmME9pXPHPZwFy4JLQZLbOjinFnPJ+JcP1mPR=+PvAMLYmoLA@mail.gmail.com> (raw)
In-Reply-To: <20161208123343.54f162d7@leda>

On Thu, Dec 8, 2016 at 12:33 PM, Christian Hesse <list@eworm.de> wrote:
> "Jason A. Donenfeld" <Jason@zx2c4.com> on Thu, 2016/12/08 12:18:
>> I like this, but two questions.
>>
>> 1. Why did you get rid of the ExecStop config saving line?
>
> I do not like units altering configuration. If you want to save configuration
> on stop create a second unit with correct dependencies an ordering that
> writes the configuration.

That's fair. Want to submit a v2, then, with a shutdown unit too?
(By the way, please prefix the commit message with "contrib: ".)

> Not sure about that. :-p At least I left it in examples directory. ;)
>
> In first place this is a RFC. Nevertheless we should polish things a bit and
> provide a usable systemd unit.

Alright then. By the way, there's some work upstream with systemd to
include this in systemd-networkd, which would probably be the "more
correct" way of doing it. But I guess a unit would nonetheless be
useful for folks who don't use systemd-networkd.

>
> I still do not like to have two files that hold the settings... But no idea
> how to get rid of that in a clean way. Having shell code in a systemd unit is
> even worse...

Yea, it's not nice. There's some additional logic: adding allowed-ips
to routes for the device, if the allowed-ips aren't already included
in the device's address prefix route.

I've thought about just adding this to `wg(8)` itself, and letting it
be specified in the config file. This would indeed be _nice_, but it
still seems like the wrong place to be doing these things. Maybe it'd
be useful to have an extra shell-script in contrib called wg-config.sh
that takes a device name, a `wg(8)`, config file, a list of IPs given
by --address=, a list of additional routes given by --route=, and the
ability to disable auto-route-from-allowed-ips-adding via
--no-auto-routes. Maybe I'll code this up myself -- it should only
take a few minutes to do...

  reply	other threads:[~2016-12-08 12:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08  9:12 Christian Hesse
2016-12-08 11:18 ` Jason A. Donenfeld
2016-12-08 11:33   ` Christian Hesse
2016-12-08 12:48     ` Jason A. Donenfeld [this message]
2016-12-08 15:15       ` Jason A. Donenfeld
2016-12-08 13:09 Anonymous Anonymous

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHmME9pXPHPZwFy4JLQZLbOjinFnPJ+JcP1mPR=+PvAMLYmoLA@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=list@eworm.de \
    --cc=mail@eworm.de \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).