Re: [PATCH] wg-quick: add restart command

2020-06-21 Thread Tore Anderson
* Garrit Franke

> Do we have an alternative for non-systemd users?

My patch ought to work just fine for non-systemd users. Example usage:

$ wg-quick reload wg0

Try it out and let me know if it works fine for you?

Tore



Re: [PATCH] wg-quick: add restart command

2020-06-20 Thread Tore Anderson
* Jason A. Donenfeld

> On Wed, Jun 17, 2020 at 2:17 AM Eric Light  wrote:
> > As a purely Debian user, the 'service x restart' pattern is far more 
> > memorable than the syncconf method.  I know personal preference isn't a 
> > great reason to add a knob, but Garrit's method is probably going to be 
> > much more familiar to many users.
> 
> For users who want service management patterns like that, it'd
> certainly be possible to map the wg-quick strip stuff to `systemctl
> reload wg-quick@wg0.service`, for that purpose. Maybe that's something
> we should consider?

For what it is worth, I posted a patch that does exactly this back in
March:

https://lists.zx2c4.com/pipermail/wireguard/2020-March/005222.html

Reviews or user tests would be greatly appreciated.

You can also pull from https://github.com/toreanderson/wireguard-tools
if you prefer. The commit in question is here:

https://github.com/toreanderson/wireguard-tools/commit/8305a267ec4259206c0de7f1d3f9cfb8522a3223

There is one bugfix in GitHub compared to the patch I posted to the
list in March - using $REAL_INTERFACE instead of $INTERFACE in wg-
quick/openbsd.bash. I can post the updated patch to the list as well if
you want, just let me know. 

Tore



Re: [PATCH] wg-quick: add restart command

2020-06-18 Thread Garrit Franke
Thanks for your comments!
I really like the systemctl reload approach. My main intention with
this patchset was to add this feature to wg-quicks arsenal because (at
least for me) it's the most obvious approach. I mainly use `wg-quick
down wg0 && wg0 up wg0`, I think you guys see where I'm coming from.

I haven't dealt with systemd units yet, but I can certainly look into
it and submit a corresponding patch soon.

Am Mi., 17. Juni 2020 um 10:32 Uhr schrieb Eric Light :
>
> Oh hey that sounds like a great way to do it.  Seems like it'd be simpler 
> than this patch set as well, which is always good.
>
> E
>
> 
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
>
> On Wed, 17 Jun 2020, at 20:19, Jason A. Donenfeld wrote:
> > On Wed, Jun 17, 2020 at 2:17 AM Eric Light  wrote:
> > >
> > > As a purely Debian user, the 'service x restart' pattern is far more 
> > > memorable than the syncconf method.  I know personal preference isn't a 
> > > great reason to add a knob, but Garrit's method is probably going to be 
> > > much more familiar to many users.
> >
> > For users who want service management patterns like that, it'd
> > certainly be possible to map the wg-quick strip stuff to `systemctl
> > reload wg-quick@wg0.service`, for that purpose. Maybe that's something
> > we should consider?
> >


Re: [PATCH] wg-quick: add restart command

2020-06-17 Thread Jason A. Donenfeld
On Wed, Jun 17, 2020 at 2:17 AM Eric Light  wrote:
>
> As a purely Debian user, the 'service x restart' pattern is far more 
> memorable than the syncconf method.  I know personal preference isn't a great 
> reason to add a knob, but Garrit's method is probably going to be much more 
> familiar to many users.

For users who want service management patterns like that, it'd
certainly be possible to map the wg-quick strip stuff to `systemctl
reload wg-quick@wg0.service`, for that purpose. Maybe that's something
we should consider?


Re: [PATCH] wg-quick: add restart command

2020-06-17 Thread Eric Light
Sorry, failure to complete my thought before I sent:

"wg-quick wg0 restart" fits much more tightly with the familiar "service x 
restart" pattern.

E


Q: Why is this email five sentences or less?
A: http://five.sentenc.es

On Wed, 17 Jun 2020, at 20:16, Eric Light wrote:
> As a purely Debian user, the 'service x restart' pattern is far more 
> memorable than the syncconf method.  I know personal preference isn't a 
> great reason to add a knob, but Garrit's method is probably going to be 
> much more familiar to many users.
> 
> As to _when_ you'd need this... during a config update as you 
> mentioned, but possibly also to easily generate logs for 
> troubleshooting a config I suppose?
> 
> E
> 
> 
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
> 
> On Wed, 17 Jun 2020, at 19:47, Jason A. Donenfeld wrote:
> > Thanks for the patchset. I'm wondering what the intended use case of
> > this is. When do you need to set the interface down and then
> > immediately up again? Most changes to the config file can be reflected
> > with a more simple:
> > 
> > wg syncconf wg0 <(wg-quick strip wg0)
> >
>


Re: [PATCH] wg-quick: add restart command

2020-06-17 Thread Eric Light
As a purely Debian user, the 'service x restart' pattern is far more memorable 
than the syncconf method.  I know personal preference isn't a great reason to 
add a knob, but Garrit's method is probably going to be much more familiar to 
many users.

As to _when_ you'd need this... during a config update as you mentioned, but 
possibly also to easily generate logs for troubleshooting a config I suppose?

E


Q: Why is this email five sentences or less?
A: http://five.sentenc.es

On Wed, 17 Jun 2020, at 19:47, Jason A. Donenfeld wrote:
> Thanks for the patchset. I'm wondering what the intended use case of
> this is. When do you need to set the interface down and then
> immediately up again? Most changes to the config file can be reflected
> with a more simple:
> 
> wg syncconf wg0 <(wg-quick strip wg0)
>


Re: [PATCH] wg-quick: add restart command

2020-06-17 Thread Jason A. Donenfeld
Thanks for the patchset. I'm wondering what the intended use case of
this is. When do you need to set the interface down and then
immediately up again? Most changes to the config file can be reflected
with a more simple:

wg syncconf wg0 <(wg-quick strip wg0)


[PATCH] wg-quick: add restart command

2020-06-17 Thread Garrit Franke
This feature seems quite trivial, so I was wondering if there is any
reason not to have this command implemented.

I didn’t bother implementing it for android, since there is probably next to 
no chance of anyone using it on that platform.

I’d be happy to take your feedback!

Thanks,
Garrit Franke

Garrit Franke (6):
  wg-quick: linux: add restart command
  wg-quick: add restart man page
  wg-quick: freebsd: add restart command
  wg-quick: linux: add notice to restart command
  wg-quick: openbsd: add restart command
  wg-quick: darwin: add restart command

 src/man/wg-quick.8|  8 +---
 src/wg-quick/darwin.bash  | 14 +-
 src/wg-quick/freebsd.bash | 12 +++-
 src/wg-quick/linux.bash   | 12 +++-
 src/wg-quick/openbsd.bash | 14 +-
 5 files changed, 53 insertions(+), 7 deletions(-)

-- 
2.24.3 (Apple Git-128)