* wg-quick@.service argument prevents configs in non-standard locations
@ 2022-08-30 12:07 Nils Werner
0 siblings, 0 replies; only message in thread
From: Nils Werner @ 2022-08-30 12:07 UTC (permalink / raw)
To: wireguard
Hi,
right now `wg-quick@.service` uses the lines
ExecStart=/usr/bin/wg-quick up %i
ExecStop=/usr/bin/wg-quick down %i
ExecReload=/bin/bash -c 'exec /usr/bin/wg syncconf %i <(exec
/usr/bin/wg-quick strip %i)'
to interact with `wq-quick`.
The use of `%i` only allows the use of INTERFACE names, e.g.
systemctl up wg-quick@wg0
but prevents users of passing CONFIG_FILE paths, e.g.
systemctl up wg-quick@-home-me-configs-wg0.conf
because `-home-me-configs-wg0.conf` does not get unescaped to
`/home/me/configs/wg0.conf`.
By replacing the first two lines with
ExecStart=/usr/bin/wg-quick up %I
ExecStop=/usr/bin/wg-quick down %I
would allow such usage.
The third line however is a bit tricky, as the argument to `wg syncconf`
is expected to be an INTERFACE name, and the argument to `wg-quick
strip` can also be a CONFIG_FILE path.
I am not sure how to solve the `ExecReload` argument issue, but I think
having the option to also pass in CONFIG_FILE paths to the unit would be
quite helpful.
Best
--
Nils Werner
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-04 16:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 12:07 wg-quick@.service argument prevents configs in non-standard locations Nils Werner
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).