Templates openvpn-tunnel-server expansion problem

Hi, as in topic I have problem with custom template I’ve created:
/etc/e-smith/templates-custom/openvpn-tunnel-server/60custom
with
auth SHA-256
but no expansion after issue
signal-event nethserver-openvpn-update
Any help appreciated. Cheers.

That path is not correct as you have to embed the full path of the file you are updating.

For the “nethserver-openvpn-update” event, the path for the supplied templates is:

/etc/e-smith/templates/etc/openvpn/host-to-net.conf

So your updates/overrides would go in:

/etc/e-smith/templates-custom/etc/openvpn/host-to-net.conf

Cheers.

So, how can I change eg.
add
auth SHA-256
to a openvpn-tunnel-server configuration

  1. one for all created servers or
  2. one per server

Maybe I need add templates2expand? Or there is somewhere other event than the mentioned one?
Thanks for Your extremely fast answer. :wink:

I think the event you are looking for is:

signal-event openvpn-tunnel-modify tunnel_name

replacing tunnel_name as appropriate.

1 Like

But where to put the option SHA-256 to have it in all or only few created servers?

Edit:
Ok it works for single tunnel but what if i want add option to all server tunnels?
(I’ve added just a template like for host-to-net and it works)
Thank You for Your help.

It affects all tunnels, but the template (for each tunnel) will be expanded only when you create or modify a server tunnel.

Thanks a lot.
As a summary, create:
/etc/e-smith/templates-custom/openvpn-tunnel-server/70custom
with options inside and run:
signal-event openvpn-tunnel-modify tunnel_name

It’s funny that I tried all this but without the tunnel_name and that was the all problem.
But is it possible to expand this template to all already created tunnels with only one command (not providing tunnel_name)?

Sorry about pointing you at the wrong location earlier. I only use a RoadWarrior VPN and didn’t realise that the tunnel configuration files don’t follow the same convention. :cry:

Looking at the supplied templates, it looks like the tunnel name is passed in when expanding. If that really is the case, then your additional template could use some rudimentary logic to set the option based on the tunnel name.

Cheers.