From 260f0592bebb6bb5e2b983f1d195792a523b19eb Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 16 Dec 2015 23:06:00 +0000 Subject: [PATCH] docs --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ lib/standalone.js | 4 +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0a4145..efd2fbe 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,41 @@ We're working on it ## In the meantime See [examples/express-minimal.js](https://github.com/Daplie/node-letsencrypt/blob/master/examples/express-minimal.js) + +## Options + +If any of these values are `undefined` or `null` the will assume use reasonable defaults. + +Partially defined values will be merged with the defaults. + +Setting the value to `false` will, in many cases (as documented), disable the defaults. + +``` +webrootPath: string // string a path to a folder where temporary challenge files will be stored and read + // default os.tmpdir() + path.sep + 'acme-challenge' + + +getChallenge: func | false // false do not handle getChallenge + // + // func Example: + // + // default function (defaults, hostname, key, cb) { + // var filename = path.join(defaults.webrootPath.replace(':hostname', hostname), key); + // fs.readFile(filename, 'ascii', function (cb, text) { + // cb(null, text); + // }) + // } + + +httpsOptions: object // object will be merged with internal defaults and passed to https.createServer() + // { pfx, key, cert, passphrase, ca, ciphers, rejectUnauthorized, secureProtocol } + // See https://nodejs.org/api/https.html + // Note: if SNICallback is specified, it will be run *before* + // the internal SNICallback that manages automated certificates + // + // default uses a localhost cert and key to prevent https.createServer() from throwing an error + // and also uses our SNICallback, which manages certificates + + +sniCallback: func // func replace the default sniCallback handler (which manages certificates) with your own +``` diff --git a/lib/standalone.js b/lib/standalone.js index 861a6f2..c05c61b 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -33,7 +33,9 @@ function create(obj) { } if (!obj.getChallenge) { - obj.getChallenge = getChallenge; + if (false !== obj.getChallenge) { + obj.getChallenge = getChallenge; + } if (!obj.webrootPath) { obj.webrootPath = path.join(require('os').tmpdir(), 'acme-challenge'); }