sighupio / furyagent

Apache License 2.0
9 stars 2 forks source link

remote <server> line missing in generated OpenVPN configuration #19

Closed ralgozino closed 4 years ago

ralgozino commented 4 years ago

When generating an OpenVPN configuration file using the following command:

furyagent configure openvpn-client --config openvpn-furyagent.yml --client-name myname > myname.ovpn

and if in the openvpn-furyagent.yml the Server section is missing, then furyagent instead of failing, generates an OpenVPN configuration without the remote <server> line, so the openvpn client doesn't know where to connect to.

iknite commented 4 years ago

https://github.com/sighupio/furyagent/blob/master/pkg/component/openvpnclient.go#L54 strangely the template has the required part

lnovara commented 4 years ago

I think that the issue is related to behavior of mapstructure that if it does not find the servers key does not complain and the range in the template stays empty.

Ref: https://github.com/sighupio/furyagent/blob/master/pkg/component/component.go#L90

iknite commented 4 years ago

Can you give us the config you've been using? @ralgozino

ralgozino commented 4 years ago

It has sensitive information. I'll get in touch in private.