seems to all work

This commit is contained in:
AJ ONeal 2015-12-16 12:51:14 +00:00
parent b83b665a1e
commit c12a35124a
3 changed files with 18 additions and 12 deletions

View File

@ -19,7 +19,7 @@ cli.parse({
, 'domain-key-path': [ false, " Path to privkey.pem to use for domain (default: generate new)", 'string' ] , 'domain-key-path': [ false, " Path to privkey.pem to use for domain (default: generate new)", 'string' ]
, 'config-dir': [ false, " Configuration directory.", 'string', '~/letsencrypt/etc/' ] , 'config-dir': [ false, " Configuration directory.", 'string', '~/letsencrypt/etc/' ]
, server: [ false, " ACME Directory Resource URI.", 'string', 'https://acme-v01.api.letsencrypt.org/directory)' ] , server: [ false, " ACME Directory Resource URI.", 'string', 'https://acme-v01.api.letsencrypt.org/directory)' ]
, standalone: [ false, " Obtain certs using a \"standalone\" webserver.", 'boolean', true ] , standalone: [ false, " Obtain certs using a \"standalone\" webserver.", 'boolean', false ]
//, manual: [ false, " Provide laborious manual instructions for obtaining a cert (default: false)", 'boolean', false ] //, manual: [ false, " Provide laborious manual instructions for obtaining a cert (default: false)", 'boolean', false ]
, webroot: [ false, " Obtain certs by placing files in a webroot directory.", 'boolean', false ] , webroot: [ false, " Obtain certs by placing files in a webroot directory.", 'boolean', false ]
, 'webroot-path': [ false, " public_html / webroot path.", 'string' ] , 'webroot-path': [ false, " public_html / webroot path.", 'string' ]
@ -80,17 +80,19 @@ cli.main(function(_, options) {
var LE = require('letsencrypt'); var LE = require('letsencrypt');
var handlers; var handlers;
if (args.standalone) { if (args.webrootPath) {
handlers = require('../lib/webroot').create(args);
}
else /*if (args.standalone)*/ {
handlers = require('../lib/standalone').create(); handlers = require('../lib/standalone').create();
handlers.startServers(args.http01Ports || [80], args.tlsSni01Port || [443, 5001]); handlers.startServers(args.http01Ports || [80], args.tlsSni01Port || [443, 5001]);
} }
else if (args.webrootPath) {
handlers = require('../lib/webroot').create(args);
}
LE.create({}, handlers).register(args, function (err, results) { // let LE know that we're handling standalone / webroot here
LE.create({ manual: true }, handlers).register(args, function (err, results) {
if (err) { if (err) {
console.error(err.stack); console.error('[Error]: letsencrypt');
console.error(err);
return; return;
} }

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var handlers = module.exports.create = function () { module.exports.create = function () {
return { var handlers = {
// //
// set,get,remove challenges // set,get,remove challenges
// //
@ -66,4 +66,6 @@ var handlers = module.exports.create = function () {
handlers._servers = []; handlers._servers = [];
} }
}; };
return handlers;
}; };

View File

@ -1,11 +1,11 @@
'use strict'; 'use strict';
var handlers = module.exports.create = function (defaults) { module.exports.create = function (defaults) {
var fs = require('fs'); var fs = require('fs');
var path = require('path'); var path = require('path');
var mkdirp = require('mkdirp'); var mkdirp = require('mkdirp');
return { var handlers = {
// //
// set,get,remove challenges // set,get,remove challenges
// //
@ -48,4 +48,6 @@ var handlers = module.exports.create = function (defaults) {
}); });
} }
}; };
return handlers;
}; };