[Question or feature request] Support multiple peer config file using something like /etc/wireguard/conf.d

2022-08-23 Thread Quentin Vallin
Hi, 

I'm trying to separate my peer configuration and automate it. 

I know that I can use the post hook PostUp = wg addconf /path/to/my/file

It would be easier to have a special path were wireguard can merge the config 
file together, like /etc/wireguard/conf.d//.conf. 

I don't find anything in the doc. Do you have a clue if that feature exists? Or 
if that feature is on the backlog?

Thank you for your amazing tool !

Quentin.

Re: [Question or feature request] Support multiple peer config file using something like /etc/wireguard/conf.d

2022-08-23 Thread Roman Mamedov
Hello,

On Tue, 19 Jul 2022 21:36:57 +
Quentin Vallin  wrote:

> I'm trying to separate my peer configuration and automate it. 
> 
> I know that I can use the post hook PostUp = wg addconf /path/to/my/file
> 
> It would be easier to have a special path were wireguard can merge the config 
> file together, like /etc/wireguard/conf.d//.conf. 

Personally I use my own shell script that concatenates pieces of the config
into a single file and runs wg on that. The same script also then handles
addresses, routes and such.

If you're doing any sort of non-trivial setup, you'd likely have a similar
wrapper on top of WG, and then it is easy to also make your own "conf.d".

-- 
With respect,
Roman