This commit is contained in:
AJ ONeal 2016-08-05 18:21:10 -04:00
parent 63b9cb5ec9
commit a654891cfa
2 changed files with 33 additions and 31 deletions

View File

@ -154,31 +154,30 @@ le.exists({ domain: 'example.com' }).then(function (results) {
return; return;
} }
// Register Certificate manually // Register Certificate manually
le.register( le.register({
{ domains: ['example.com'] // CHANGE TO YOUR DOMAIN (list for SANS) domains: ['example.com'] // CHANGE TO YOUR DOMAIN (list for SANS)
, email: 'user@email.com' // CHANGE TO YOUR EMAIL , email: 'user@email.com' // CHANGE TO YOUR EMAIL
, agreeTos: '' // set to tosUrl string to pre-approve (and skip agreeToTerms) , agreeTos: '' // set to tosUrl string to pre-approve (and skip agreeToTerms)
, rsaKeySize: 2048 // 1024 or 2048 , rsaKeySize: 2048 // 2048 or higher
, challengeType: 'http-01' // http-01, tls-sni-01, or dns-01 , challengeType: 'http-01' // http-01, tls-sni-01, or dns-01
}
, function (err, results) { }).then(function (results) {
if (err) {
// Note: you must either use le.middleware() with express,
// manually use le.getChallenge(domain, key, val, done)
// or have a webserver running and responding
// to /.well-known/acme-challenge at `webrootPath`
console.error('[Error]: node-letsencrypt/examples/standalone');
console.error(err.stack);
return;
}
console.log('success'); console.log('success');
}
); }, function (err) {
// Note: you must either use le.middleware() with express,
// manually use le.getChallenge(domain, key, val, done)
// or have a webserver running and responding
// to /.well-known/acme-challenge at `webrootPath`
console.error('[Error]: node-letsencrypt/examples/standalone');
console.error(err.stack);
});
}); });
``` ```
@ -241,7 +240,7 @@ TODO double check and finish
* accounts.get * accounts.get
* accounts.exists * accounts.exists
* certs * certs
* certs.byDomain * certs.byAccount
* certs.all * certs.all
* certs.get * certs.get
* certs.exists * certs.exists
@ -250,9 +249,9 @@ TODO double check and finish
TODO finish TODO finish
* setChallenge(opts, domain, key, value, done); // opts will be saved with domain/key * `.set(opts, domain, key, value, done);` // opts will be saved with domain/key
* getChallenge(domain, key, done); // opts will be retrieved by domain/key * `.get(opts, domain, key, done);` // opts will be retrieved by domain/key
* removeChallenge(domain, key, done); // opts will be retrieved by domain/key * `.remove(opts, domain, key, done);` // opts will be retrieved by domain/key
Change History Change History
============== ==============

View File

@ -1,20 +1,17 @@
'use strict'; 'use strict';
// TODO handle www and no-www together somehow?
var PromiseA = require('bluebird'); var PromiseA = require('bluebird');
var leCore = require('letiny-core'); var leCore = require('letiny-core');
var LE = module.exports; var LE = module.exports;
LE.defaults = { LE.defaults = {
server: leCore.productionServerUrl productionServerUrl: leCore.productionServerUrl
, stagingServer: leCore.stagingServerUrl
, liveServer: leCore.productionServerUrl
, productionServerUrl: leCore.productionServerUrl
, stagingServerUrl: leCore.stagingServerUrl , stagingServerUrl: leCore.stagingServerUrl
, rsaKeySize: leCore.rsaKeySize || 2048
, challengeType: leCore.challengeType || 'http-01'
, acmeChallengePrefix: leCore.acmeChallengePrefix , acmeChallengePrefix: leCore.acmeChallengePrefix
}; };
@ -23,6 +20,7 @@ Object.keys(LE.defaults).forEach(function (key) {
LE[key] = LE.defaults[key]; LE[key] = LE.defaults[key];
}); });
// show all possible options
var u; // undefined var u; // undefined
LE._undefined = { LE._undefined = {
store: u store: u
@ -32,6 +30,9 @@ LE._undefined = {
, renewWithin: u , renewWithin: u
, memorizeFor: u , memorizeFor: u
, acmeChallengePrefix: u , acmeChallengePrefix: u
, rsaKeySize: u
, challengeType: u
, server: u
}; };
LE._undefine = function (le) { LE._undefine = function (le) {
Object.keys(LE._undefined).forEach(function (key) { Object.keys(LE._undefined).forEach(function (key) {
@ -49,6 +50,8 @@ LE.create = function (le) {
var core = le.core = require('./lib/core'); var core = le.core = require('./lib/core');
le.acmeChallengePrefix = LE.acmeChallengePrefix; le.acmeChallengePrefix = LE.acmeChallengePrefix;
le.rsaKeySize = le.rsaKeySize || LE.rsaKeySize;
le.challengeType = le.challengeType || LE.challengeType;
if (!le.renewWithin) { le.renewWithin = 3 * 24 * 60 * 60 * 1000; } if (!le.renewWithin) { le.renewWithin = 3 * 24 * 60 * 60 * 1000; }
if (!le.memorizeFor) { le.memorizeFor = 1 * 24 * 60 * 60 * 1000; } if (!le.memorizeFor) { le.memorizeFor = 1 * 24 * 60 * 60 * 1000; }