diff --git a/lib/commands/config/advanced.js b/lib/commands/config/advanced.js index 1fbae4a20..3fc4d0a8d 100644 --- a/lib/commands/config/advanced.js +++ b/lib/commands/config/advanced.js @@ -84,6 +84,10 @@ module.exports = [{ name: 'dbname', description: 'Database name', configPath: 'database.connection.database' +}, { + name: 'sslemail', + description: 'SSL email address', + configPath: 'ssl.email' }, { name: 'auth', description: 'Type of authentication to use', diff --git a/lib/services/nginx/index.js b/lib/services/nginx/index.js index adeccc8fe..3e2b007f7 100644 --- a/lib/services/nginx/index.js +++ b/lib/services/nginx/index.js @@ -73,10 +73,20 @@ class NginxService extends BaseService { }); } - let answers; let ghostExec = process.argv.slice(0,2).join(' '); + let answerPromise; + let answers; + + if (this.config.get('ssl.email', false)) { + answerPromise = Promise.resolve({ + ssl: true, + email: this.config.get('ssl.email') + }); + } else { + answerPromise = this.ui.prompt(prompts); + } - return this.ui.prompt(prompts).then((_answers) => { + return answerPromise.then((_answers) => { answers = _answers; return this.ui.noSpin(execa.shell(`sudo ${ghostExec} service nginx-conf${!answers.ssl ? ' no-ssl' : ''}`, {stdio: 'inherit'})).catch((error) => {