Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Tore Anderson <tore@fud.no>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: "Tomcsanyi, Domonkos" <domi@tomcsanyi.net>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] Adding support for reloading configuration via systemd
Date: Tue, 28 Jul 2020 11:54:01 +0200	[thread overview]
Message-ID: <48a85c212bffaf7004c4934b1da5c4b02674a54c.camel@fud.no> (raw)
In-Reply-To: <CAHmME9qGX58JXCiw=Mr9=4qw=+-91etz8not91oJek-8qGrQPw@mail.gmail.com>

* Jason A. Donenfeld

> On Mon, Jul 27, 2020 at 10:04 PM Tore Anderson <tore@fud.no> wrote:
> > Absolutely, a 'wg syncconf' wrapper is unable to fully implement every
> > conceivable change to the wg-quick config file. That said, 99.9% of my
> > configuration changes are additions/removal of [Peer] sections that 'wg
> > syncconf' do handle perfectly. Being able to add and remove individual
> > VPN users without disrupting the traffic of other unrelated users is a
> > really big win for me. I would imagine this to ability be highly
> > desirable for most other VPN server operators as well – even for those
> > that do not use systemd.
> 
> But for people shell scripting, can't they just use `wg syncconf
> wgnet0 <(wg-quick strip wgnet0)`, so that it's explicit what's
> happening?

Of course they can, just as they can opt to not use wg-quick at all.

However, it would be better, in my opinion, if every user do not have
to re-invent the wheel in order to accomplish common tasks, which (I
assume) is the reason why wg-quick – «an extremely simple script for
easily bringing up a WireGuard interface, suitable for a few common use
cases», to quote its manual page – exists in the first place.

> I'm still pretty hesitant for the reasons I outlined in the previous
> email. If anything, it'd probably have to be "syncpeers", but even
> then, it wouldn't update the routing information that wg-quick(8)
> sometimes does.

Fair enough. If you do not want it in wg-quick, I won't insist.

> The right thing to do for a `wg-quick reload` command
> would be to take into account all of the various other changes, and
> mutate them the minimal distance to reflect the updated config file.
> But this sounds pretty hard to do in bash. And that makes me worry
> about overall mission creep in wg-quick(8). syncconf in wg(8) is
> fairly simple, though still a bit verbose, but that's in C:
> https://git.zx2c4.com/wireguard-tools/tree/src/setconf.c#n30 . And
> there's a very clear way of doing this, whereas there are lots of
> weird edge cases when handling routing.

Agreed, this sounds very complex and not worth the trouble.

That said, I do believe that most admins would not be bothered by the
fact that some changes would require a restart (i.e., an wg-quick
up/down cycle). This limitation is common in other pieces of software
too, e.g., one can normally not use 'apachectl graceful' to make Apache
listen on a new port below 1024. However, in spite of it not being
perfect, 'apachectl graceful' remains extremely useful.

> Plus, how hard is it to add `wg syncconf wgnet0 <(wg-quick strip
> wgnet0)` to scripts?

Not hard - it is precisely what my patch did, after all.

Tore


  reply	other threads:[~2020-07-28  9:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VI1PR02MB52169D6F055314DCD03746EDE6760@VI1PR02MB5216.eurprd02.prod.outlook.com>
2020-07-23 14:10 ` Tomcsanyi, Domonkos
2020-07-24  9:14   ` Jason A. Donenfeld
2020-07-24  9:25     ` Garrit Franke
2020-07-24  9:27       ` Garrit Franke
2020-07-24  9:29       ` Jason A. Donenfeld
2020-07-24 13:09         ` Tomcsányi, Domonkos
2020-07-24 14:26           ` Jason A. Donenfeld
2020-07-24 14:46             ` Dominique Martinet
2020-07-24 14:49               ` Jason A. Donenfeld
2020-07-24  9:54       ` Matthias Urlichs
2020-07-24 10:52         ` Stefan Tatschner
2020-07-24 11:00           ` Matthias Urlichs
2020-07-25 12:16     ` Tore Anderson
2020-07-27 15:51       ` Jason A. Donenfeld
2020-07-27 20:04         ` Tore Anderson
2020-07-28  9:03           ` Jason A. Donenfeld
2020-07-28  9:54             ` Tore Anderson [this message]
2020-07-28 11:55               ` Jason A. Donenfeld
2020-07-28 12:17                 ` Tore Anderson
2020-07-28 12:17                   ` Jason A. Donenfeld

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=48a85c212bffaf7004c4934b1da5c4b02674a54c.camel@fud.no \
    --to=tore@fud.no \
    --cc=Jason@zx2c4.com \
    --cc=domi@tomcsanyi.net \
    --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).