-
Notifications
You must be signed in to change notification settings - Fork 51
Add support for ACME_CHALLENGE_DIR environment variable #33
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Signed it. |
CLAs look good, thanks! |
Thanks for this. Quite useful. I would make it an additional command line arg first and then add Otherwise, we start mixing env vars and flags, and it'll become harder to use the tool. |
var err error | ||
if os.Getenv("ACME_CHALLENGE_DIR") != "" { | ||
// Create .well-known directory | ||
challengeDir := filepath.Join(os.Getenv("ACME_CHALLENGE_DIR"), ".well-known/acme-challenge") |
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.
what if ACME_CHALLENGE_DIR
(or a cmd line flag) already contains .well-known/
or .well-known/acme-challenge
? I can see it being even more useful if I didn't have to specify .well-known/acme-challenge
every time.
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 thought it was more convenient to automatically append .well-known/challenge
. The protocol requires this exact path and having to specify it manually seems error prone.
Not sure what you mean though: Do you mean it's a good thing to specify the ful path manually, or would you rather keep it automatic?
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 mean to append it automatically unless already present in the path. But what you're saying makes sense, I agree. It's important this is documented, e.g. "challenge dir should point to the root of your website".
Thanks for the feedback! |
Right, there's indeed |
First thought is, that parsing What about renaming/ using the |
Well, yeah. for instance, https://getmdl.io is served from a GCS bucket and that's how I get it working with Let's Encrypt cert - placing a temporary token file into gs://my-bucket/.well-known/..., which is then accessible to the CA as getmdl.io/.well-known/... to verify domain ownership. I can see many other options, e.g. AWS S3 or another kind of storage not accessible directly via file system calls. Agree on mixing Note that Maybe then another flag would work? Say, |
It seems to me that a new (mutually exclusive) flag indeed seems like the most straightforward idea. |
Forgot to add, having
|
5f59e88
to
867852f
Compare
867852f
to
f90df62
Compare
Add support for an
ACME_CHALLENGE_DIR
environment variable. If the variable is set and-manual=true
is given, automatically place the generated challenge file in$ACME_CHALLENGE_DIR/.well-known/acme-challenge
.This is helpful when batch-processing the retrieval of certificates.