afosto / yaac

Yet another ACME client: a decoupled LetsEncrypt client
Other
219 stars 86 forks source link

Set source IP #16

Closed AlexNodex closed 4 years ago

AlexNodex commented 4 years ago

Would you accept a pull request to set the source IP?

Letsencrypt has limits on the number of requests from a single IP address over a 3 hour period. If you have an infrastructure with a lot of domains and accompanying IP addresses this can become impossible to manage. Guzzle allows setting the source IP via curl options so an IP could be passed to the client constructor to send the request from that IP address?

bakkerpeter commented 4 years ago

Hi Alex, sorry for the delay, could you maybe suggest how you would like to make this work - which methods would change? Thanks

AlexNodex commented 4 years ago

The Client constructor could add an optional IP address then in the getHttpClient method the config could be checked to see if a source ip was set and add it as a key/value option under curl.options using the key CURLOPT_INTERFACE and the value of the IP address.

I can create a PR if you like?

bakkerpeter commented 4 years ago

Yes, I think we could add it as an option in the config array? PR would make it easier to discuss

Cheers

Op ma 29 jun. 2020 10:15 schreef AlexNodex notifications@github.com:

The Client constructor could add an optional IP address then in the getHttpClient method the config could be checked to see if a source ip was set and add it as a key/value option under curl.options using the key CURLOPT_INTERFACE and the value of the IP address.

I can create a PR if you like?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/afosto/yaac/issues/16#issuecomment-651006234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFROB2EYXDITIFJKFK5ELH3RZBERHANCNFSM4NZHDKMA .

bakkerpeter commented 4 years ago

Solved https://github.com/afosto/yaac/pull/18

Manawyrm commented 4 years ago

I'm not sure that 0.0.0.0 is a good default here. It will limit the http call to IPv4 traffic only. "::" might be a better default, but that could also have side-effects we don't know about.

I would prefer to not set CURLOPT_INTERFACE at all by default. This way the user can decide for themselves.

bakkerpeter commented 4 years ago

I'll look into this tomorrow, you could be right. Thanks!

Op do 2 jul. 2020 18:21 schreef Tobias Mädel notifications@github.com:

I'm not sure that 0.0.0.0 is a good default here. It will limit the http call to IPv4 traffic only. "::" might be a better default, but that could also have side-effects we don't know about.

I would prefer to not set CURLOPT_INTERFACE at all by default. This way the user can decide for themselves.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/afosto/yaac/issues/16#issuecomment-653103049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFROB2E6FLKXV6STBSOKQRDRZSXYBANCNFSM4NZHDKMA .

bakkerpeter commented 4 years ago

solved it https://github.com/afosto/yaac/commit/25f6660e18544ed8fe19252736697c5345a780b5#diff-25d902c24283ab8cfbac54dfa101ad31

Manawyrm commented 4 years ago

Great, thanks! :)