bugfixes for defaults
This commit is contained in:
parent
a5d0cde282
commit
e3153c5c8b
|
@ -4,6 +4,7 @@ var P = require('../plugins.js');
|
|||
var args = process.argv.slice(3);
|
||||
var cli = require('./lib/cli.js');
|
||||
var Init = require('../lib/init.js');
|
||||
var Greenlock = require('../');
|
||||
|
||||
var Flags = require('./lib/flags.js');
|
||||
|
||||
|
@ -44,16 +45,17 @@ cli.main(async function(argList, flags) {
|
|||
}
|
||||
}
|
||||
|
||||
var opts = Init._init({
|
||||
var greenlock = Greenlock.create({
|
||||
packageRoot: pkgRoot,
|
||||
manager: flags.manager,
|
||||
maintainerEmail: flags.maintainerEmail,
|
||||
_mustPackage: true
|
||||
});
|
||||
await greenlock.manager.defaults();
|
||||
|
||||
//writeGreenlockJs(pkgdir, flags);
|
||||
writeServerJs(opts.packageRoot, flags);
|
||||
writeAppJs(opts.packageRoot);
|
||||
writeServerJs(pkgRoot, flags);
|
||||
writeAppJs(pkgRoot);
|
||||
|
||||
/*
|
||||
rc._bin_mode = true;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
var Flags = module.exports;
|
||||
|
||||
var path = require('path');
|
||||
//var path = require('path');
|
||||
var pkgRoot = process.cwd();
|
||||
var Init = require('../../lib/init.js');
|
||||
//var Init = require('../../lib/init.js');
|
||||
|
||||
// These are ALL options
|
||||
// The individual CLI files each select a subset of them
|
||||
|
|
|
@ -5,6 +5,7 @@ var pkg = require('./package.json');
|
|||
var ACME = require('@root/acme');
|
||||
var Greenlock = module.exports;
|
||||
var request = require('@root/request');
|
||||
var process = require('process');
|
||||
|
||||
var G = Greenlock;
|
||||
var U = require('./utils.js');
|
||||
|
@ -566,8 +567,13 @@ function mergeDefaults(MCONF, gconf) {
|
|||
console.info('[default] renewStagger: ' + MCONF.renewStagger);
|
||||
}
|
||||
|
||||
var vers = process.versions.node.split('.');
|
||||
var defaultKeyType = 'EC-P256';
|
||||
if (vers[0] < 10 || (vers[0] === '10' && vers[1] < '12')) {
|
||||
defaultKeyType = 'RSA-2048';
|
||||
}
|
||||
if (!MCONF.accountKeyType) {
|
||||
MCONF.accountKeyType = gconf.accountKeyType || 'EC-P256';
|
||||
MCONF.accountKeyType = gconf.accountKeyType || defaultKeyType;
|
||||
console.info('[default] accountKeyType: ' + MCONF.accountKeyType);
|
||||
}
|
||||
if (!MCONF.serverKeyType) {
|
||||
|
@ -587,6 +593,7 @@ function mergeDefaults(MCONF, gconf) {
|
|||
gconf.agreeToTerms ||
|
||||
'(show notice on use)')
|
||||
);
|
||||
console.info('');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ Init._init = function(opts) {
|
|||
myPkg.author =
|
||||
(realPkg.author && realPkg.author.email) || realPkg.author;
|
||||
}
|
||||
if (opts._init) {
|
||||
if (!opts._init) {
|
||||
opts.maintainerEmail = myPkg.author;
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ Init._init = function(opts) {
|
|||
throw new Error(msgErr);
|
||||
}
|
||||
|
||||
if (opts._init) {
|
||||
if (!opts._init) {
|
||||
opts.maintainerEmail = parseMaintainer(opts.maintainerEmail);
|
||||
if (!opts.maintainerEmail) {
|
||||
msgErr =
|
||||
|
|
|
@ -34,8 +34,9 @@ Rc._initSync = function(dirname, manager, configDir) {
|
|||
if (manager) {
|
||||
if (rc.manager) {
|
||||
if (
|
||||
rc.manager !== manager ||
|
||||
rc.manager.module !== manager.module
|
||||
('string' === typeof rc.manager && rc.manager !== manager) ||
|
||||
('string' !== typeof rc.manager &&
|
||||
rc.manager.module !== manager.module)
|
||||
) {
|
||||
changed = true;
|
||||
console.info(
|
||||
|
|
Loading…
Reference in New Issue