Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Robin Schneider <ypid@riseup.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] wg-quick linux: Add strip-and-eval cmd to extract keys from PostUp
Date: Sat, 10 Oct 2020 17:57:48 +0200	[thread overview]
Message-ID: <b1955eb8-bc38-770c-848d-540c6c13bfbc@riseup.net> (raw)
In-Reply-To: <CAHmME9oe5e84gpsGjGYkWHZoOLYKX1xUZBNzM7g0R6cEHg5JUg@mail.gmail.com>

Hi Jason,

On 2020-10-09 14:20, Jason A. Donenfeld wrote:
> This seems like a weird inconsistent hack. Strip should return
> something that is acted on by something else, and not also do things.

I know. Thats why I made this clear by making it a separate subcommand so that users can choose if they want this hack or not.

> 
> But I have another suggestion on how to achieve what you want:
> 
> wg syncconf wg0 <(printf '[Interface]\nPrivateKey=%s\n' "$(wg show wg0
> private-key)"; wg-quick strip wg0)
> 

At first I considered/implemented such a workaround on the systemd level. It is good to know that I would not have to care about merging two INI files as `wg` can handle two `Interface` sections and merge them together itself as it seems.

The proposed workaround has two issues:

1. It does not allow to replace the PrivateKey or PresharedKey using the `syncconf` now from the config file which is what I want to have.
2. It only outputs the PrivateKey and not the PresharedKey for each peer. Sure, this could be done with a for loop.

-- 
Live long and prosper
Robin `ypid` Schneider -- https://me.ypid.de/

  reply	other threads:[~2020-10-10 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04 21:20 Robin Schneider
2020-10-09 12:20 ` Jason A. Donenfeld
2020-10-10 15:57   ` Robin Schneider [this message]
2020-10-12 15:01     ` Jason A. Donenfeld
2020-10-12 19:54       ` Robin Schneider
2020-10-12 22:31         ` 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=b1955eb8-bc38-770c-848d-540c6c13bfbc@riseup.net \
    --to=ypid@riseup.net \
    --cc=Jason@zx2c4.com \
    --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).