Merge pull request #2 from agnat/fix/port_number_arguments

Fix port number command line arguments
This commit is contained in:
AJ ONeal 2015-12-28 12:03:18 -05:00
commit d8ce19a18b
1 changed files with 7 additions and 3 deletions

View File

@ -10,8 +10,8 @@ cli.parse({
, duplicate: [ false, " Allow getting a certificate that duplicates an existing one", 'boolean', false ] , duplicate: [ false, " Allow getting a certificate that duplicates an existing one", 'boolean', false ]
, 'agree-tos': [ false, " Agree to the Let's Encrypt Subscriber Agreement", 'boolean', false ] , 'agree-tos': [ false, " Agree to the Let's Encrypt Subscriber Agreement", 'boolean', false ]
, debug: [ false, " show traces and logs", 'boolean', false ] , debug: [ false, " show traces and logs", 'boolean', false ]
, 'tls-sni-01-port': [ false, " Port number to perform tls-sni-01 challenge. Boulder in testing mode defaults to 5001. (default: 443,5001)" ] , 'tls-sni-01-port': [ false, " Port number to perform tls-sni-01 challenge. Boulder in testing mode defaults to 5001. (default: 443,5001)", 'string' ]
, 'http-01-port': [ false, " Port used in the SimpleHttp challenge. (default: 80)" ] , 'http-01-port': [ false, " Port used in the SimpleHttp challenge. (default: 80)", 'string' ]
, 'rsa-key-size': [ false, " Size (in bits) of the RSA key.", 'int', 2048 ] , 'rsa-key-size': [ false, " Size (in bits) of the RSA key.", 'int', 2048 ]
, 'cert-path': [ false, " Path to where new cert.pem is saved", 'string',':config/live/:hostname/cert.pem' ] , 'cert-path': [ false, " Path to where new cert.pem is saved", 'string',':config/live/:hostname/cert.pem' ]
, 'fullchain-path': [ false, " Path to where new fullchain.pem (cert + chain) is saved", 'string', ':config/live/:hostname/fullchain.pem' ] , 'fullchain-path': [ false, " Path to where new fullchain.pem (cert + chain) is saved", 'string', ':config/live/:hostname/fullchain.pem' ]
@ -66,12 +66,16 @@ cli.main(function(_, options) {
} }
if (args.tlsSni01Port) { if (args.tlsSni01Port) {
// [@agnat]: Coerce to string. cli returns a number although we request a string.
args.tlsSni01Port = "" + args.tlsSni01Port;
args.tlsSni01Port = args.tlsSni01Port.split(',').map(function (port) { args.tlsSni01Port = args.tlsSni01Port.split(',').map(function (port) {
return parseInt(port, 10); return parseInt(port, 10);
}); });
} }
if (args.http01Port) { if (args.http01Port) {
// [@agnat]: Coerce to string. cli returns a number although we request a string.
args.http01Port = "" + args.http01Port;
args.http01Port = args.http01Port.split(',').map(function (port) { args.http01Port = args.http01Port.split(',').map(function (port) {
return parseInt(port, 10); return parseInt(port, 10);
}); });
@ -92,7 +96,7 @@ cli.main(function(_, options) {
} }
else /*if (args.standalone)*/ { 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.http01Port || [80], args.tlsSni01Port || [443, 5001]);
} }
// let LE know that we're handling standalone / webroot here // let LE know that we're handling standalone / webroot here