go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.44k stars 985 forks source link

ovh: allow to use ovh.conf file #2216

Closed ldez closed 1 week ago

ldez commented 1 week ago

Fixes #2215

rbeuque74 commented 1 week ago

Hello,

Thanks for the patch. I suggested another way around here: https://github.com/ldez/lego/pull/2

What do you think ?

Romain

dmke commented 1 week ago

I'm a little confused: Where does it read the ovh.conf, and why was ovh/go-ovh#84 closed without merging?

ldez commented 1 week ago

The read of the file is inside the constructors of the client.

https://github.com/ovh/go-ovh/blob/9c5297024e0b551f222c66504a3ffdf7b0cd479b/ovh/configuration.go#L77-L91

https://github.com/ovh/go-ovh/blob/9c5297024e0b551f222c66504a3ffdf7b0cd479b/ovh/ovh.go#L103-L159

My PR was to be able to fill all the fields and then call loadConfig but by playing with constructors we can do the same.

It's not my preferred solution but it works as expected.