-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement libcloud-based dns-01 challenge responder. #63
Conversation
Current coverage is 99.94% (diff: 100%)@@ master #63 diff @@
==========================================
Files 22 25 +3
Lines 1606 1808 +202
Methods 0 0
Messages 0 0
Branches 145 163 +18
==========================================
+ Hits 1605 1807 +202
Misses 1 1
Partials 0 0
|
@glyph I guess this is relevant to your interests ;) I'd appreciate if you could cast your reviewer's gaze over at least the libcloud/threading junk (either on Reviewable or here, although Reviewable would be preferred). |
Thanks for doing this. I'll try to look at this when I can :) |
@@ -0,0 +1 @@ | |||
txacme.challenges.LibcloudDNSResponder implements a dns-01 challenge responder using libcloud. Installing txacme[libcloud] is necessary to pull in the dependencies for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
txacme[dns] maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to have other backends in future (that are not libcloud), and I think having a single extra that pulls in everything needed for all of the backends wouldn't be great?
the challenge with. | ||
""" | ||
HOST = _getenv(u'ACME_HOST') | ||
PROVIDER = _getenv(u'LIBCLOUD_PROVIDER') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential namespacing issue here. In my opinion, all variables that influence the operation of txacme should be prefixed TXACME_
. This sort of cross-library bleed-over is how we got httpoxy, after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait a second. I misunderstood. This is just the tests confirming that the library will be configured, but these values are in fact read by libcloud; carry on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, these only influence the operation of the txacme
integration tests.
@mithrandi - since you asked specifically about the threadpool… the Twisted side of it looks right, but I have no idea if the driver objects in libcloud are threadsafe. you might want to do an initial release with a threadpool max of 1, just to be on the safe side initially, and then come up with some way to load-test it for a follow-up change. Unless of course you happen to know that it is totally thread-safe, in which case 👍 . |
In fact, the |
Review status: 0 of 8 files reviewed at latest revision, 6 unresolved discussions. src/integration/test_client.py, line 37 [r2] (raw file):
|
|
Since ACME_HOST is shared between this and the libcloud tests, this makes it easier to run only the one.
Reviewed 4 of 7 files at r1, 1 of 3 files at r2, 1 of 2 files at r3, 2 of 2 files at r4. Comments from Reviewable |
OK so, I tried to provision a bunch of certs with the code in this branch, and my main feedback so far: dang this needs to log a lot more stuff. I just get:
and it's not clear to me if the provisioning is just taking a really long time, or of it's hung, or if something is going wrong. Given that |
Okay! A little bit later:
which I think means... I passed the wrong type to a constructor somewhere? |
Aah. Looks like there is an undocumented requirement to call |
Wow this really takes a minute doesn't it. |
WOOOOOOOOOOOOOOO |
OK. I just provisioned some real live certs from real live LE for a couple of internal on-my-LAN machines. This is pretty dang amazing. Feel free to pester me to share the script I used, I do need to clean it up and open source it. Perhaps I should just contribute it here. |
There is a literal |
@mithrandi - what do you think about inferring "zone" from the domain name passed in, rather than asking the user to name it? |
@glyph: Do you mean as a default? In the general case, I think this is impossible (eg. when I was testing this, I used the hostname You could enumerate the available zones based on the credentials provided, but you might be using a set of credentials that doesn't allow this, or a set of credentials that doesn't have access to every zone in the account. The zone is what your credentials are tied to; handling multiple responders for different zones isn't solved yet, but #64 covers this case; so that's also something to keep in mind. |
Hrm. I didn't realize "enumerating zones" was a thing that could be restricted. In any case, you could still make a pretty clear "best effort", and just give up if the necessary things aren't available to perform the heuristic. |
As it turns out, the API of |
👏 👏 👏 (I can't add emoji reactions to individual commits, apparently?) |
Reviewed 2 of 4 files at r5, 2 of 2 files at r6, 5 of 5 files at r7. Comments from Reviewable |
Fixes #59.
Putting this up for review so people can take a look, but the following things still need to happen before this is merged:
acme
release, and remove the git stuff from tox.ini etc.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)