docs
This commit is contained in:
parent
ef84fc2504
commit
260f0592be
38
README.md
38
README.md
|
@ -8,3 +8,41 @@ We're working on it
|
||||||
## In the meantime
|
## In the meantime
|
||||||
|
|
||||||
See [examples/express-minimal.js](https://github.com/Daplie/node-letsencrypt/blob/master/examples/express-minimal.js)
|
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
|
||||||
|
```
|
||||||
|
|
|
@ -33,7 +33,9 @@ function create(obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj.getChallenge) {
|
if (!obj.getChallenge) {
|
||||||
obj.getChallenge = getChallenge;
|
if (false !== obj.getChallenge) {
|
||||||
|
obj.getChallenge = getChallenge;
|
||||||
|
}
|
||||||
if (!obj.webrootPath) {
|
if (!obj.webrootPath) {
|
||||||
obj.webrootPath = path.join(require('os').tmpdir(), 'acme-challenge');
|
obj.webrootPath = path.join(require('os').tmpdir(), 'acme-challenge');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue