normalize names and conventions

This commit is contained in:
AJ ONeal 2016-08-09 13:05:36 -04:00
vanhempi 6d1c594e17
commit 7fac8e5de6
2 muutettua tiedostoa jossa 29 lisäystä ja 6 poistoa

Näytä tiedosto

@ -1,3 +1,12 @@
[![Join the chat at https://gitter.im/Daplie/letsencrypt-express](https://badges.gitter.im/Daplie/letsencrypt-express.svg)](https://gitter.im/Daplie/letsencrypt-express?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
| [letsencrypt](https://github.com/Daplie/node-letsencrypt) (library)
| [letsencrypt-cli](https://github.com/Daplie/letsencrypt-cli)
| [letsencrypt-express](https://github.com/Daplie/letsencrypt-express)
| [letsencrypt-koa](https://github.com/Daplie/letsencrypt-koa)
| [letsencrypt-hapi](https://github.com/Daplie/letsencrypt-hapi)
|
# le-challenge-fs
A fs-based strategy for node-letsencrypt for setting, retrieving,
@ -33,14 +42,17 @@ LE.create({
});
```
NOTE: If you request a certificate with 6 domains listed,
it will require 6 individual challenges.
Exposed Methods
---------------
For ACME Challenge:
* `setChallange(opts, domain, key, val, done)`
* `getChallange(opts, domain, key, done)`
* `removeChallange(opts, domain, key, done)`
* `set(opts, domain, key, val, done)`
* `get(defaults, domain, key, done)`
* `remove(defaults, domain, key, done)`
For node-letsencrypt internals:

Näytä tiedosto

@ -32,21 +32,32 @@ Challenge.create = function (options) {
return results;
};
Challenge.set = function (defaults, domain, challengePath, keyAuthorization, done) {
//
// NOTE: the "args" here in `set()` are NOT accessible to `get()` and `remove()`
// They are provided so that you can store them in an implementation-specific way
// if you need access to them.
//
Challenge.set = function (args, domain, challengePath, keyAuthorization, done) {
var mkdirp = require('mkdirp');
mkdirp(defaults.webrootPath, function (err) {
mkdirp(args.webrootPath, function (err) {
if (err) {
done(err);
return;
}
fs.writeFile(path.join(defaults.webrootPath, challengePath), keyAuthorization, 'utf8', function (err) {
fs.writeFile(path.join(args.webrootPath, challengePath), keyAuthorization, 'utf8', function (err) {
done(err);
});
});
};
//
// NOTE: the "defaults" here are still merged and templated, just like "args" would be,
// but if you specifically need "args" you must retrieve them from some storage mechanism
// based on domain and key
//
Challenge.get = function (defaults, domain, key, done) {
fs.readFile(path.join(defaults.webrootPath, key), 'utf8', done);
};