From 3c21a5c28ef2eafa799d68605a82f5dc0b4af778 Mon Sep 17 00:00:00 2001 From: Tom Taylor Date: Wed, 10 Oct 2018 10:57:53 +0100 Subject: [PATCH] Fix merge issue --- install.js | 317 +++++++++++++++++++---------------------------------- 1 file changed, 114 insertions(+), 203 deletions(-) diff --git a/install.js b/install.js index 66f5e1fab3..3ef98cfef9 100644 --- a/install.js +++ b/install.js @@ -78,8 +78,8 @@ installHelpers.checkPrimaryDependencies(function(error) { { name: 'frameworkRepository', type: 'string', - before: installHelpers.inputHelpers.toBoolean, - default: 'N' + description: "Git repository URL to be used for the framework source code", + default: 'https://github.com/adaptlearning/adapt_framework.git' }, { name: 'frameworkRevision', @@ -154,222 +154,133 @@ installHelpers.checkPrimaryDependencies(function(error) { ffmpeg: { name: 'useffmpeg', type: 'string', + description: "Are you using ffmpeg? y/N", before: installHelpers.inputHelpers.toBoolean, - default: 'Y' + default: 'N' }, - server: [ - { - name: 'serverPort', - type: 'number', - description: 'Server port', - pattern: installHelpers.inputHelpers.numberValidator, - default: 5000 - }, - { - name: 'serverName', - type: 'string', - description: 'Server name', - default: 'localhost' - }, - { - name: 'dbHost', - type: 'string', - description: 'Database host', - default: 'localhost' - }, - { - name: 'dbName', - type: 'string', - description: 'Master database name', - pattern: installHelpers.inputHelpers.alphanumValidator, - default: 'adapt-tenant-master' - }, - { - name: 'dbPort', - type: 'number', - description: 'Database server port', - pattern: installHelpers.inputHelpers.numberValidator, - default: 27017 - }, - { - name: 'dbUser', + smtp: { + confirm: { + name: 'useSmtp', type: 'string', - description: 'Database server user', - pattern: installHelpers.inputHelpers.alphanumValidator, - default: '' - }, - { - name: 'dbPass', - type: 'string', - description: 'Database server password', - pattern: installHelpers.inputHelpers.alphanumValidator, - default: '' - }, - { - name: 'dbAuthSource', - type: 'string', - description: 'Database server authentication database', - pattern: installHelpers.inputHelpers.alphanumValidator, - default: 'admin' - }, - { - name: 'dataRoot', - type: 'string', - description: 'Data directory path', - pattern: installHelpers.inputHelpers.alphanumValidator, - default: 'data' - }, - { - name: 'authoringToolRepository', - type: 'string', - description: "Git repository URL to be used for the authoring tool source code", - default: 'https://github.com/adaptlearning/adapt_authoring.git' - }, - { - name: 'frameworkRepository', - type: 'string', - description: "Git repository URL to be used for the framework source code", - default: 'https://github.com/adaptlearning/adapt_framework.git' + description: "Will you be using an SMTP server? (used for sending emails) y/N", + before: installHelpers.inputHelpers.toBoolean, + default: 'N' }, - { - name: 'frameworkRevision', - type: 'string', - description: 'Specific git revision to be used for the framework. Accepts any valid revision type (e.g. branch/tag/commit)', - default: 'tags/' + latestFrameworkTag - } - ], - features: { - ffmpeg: { - name: 'useffmpeg', + confirmConnectionUrl: { + name: 'useSmtpConnectionUrl', type: 'string', - description: "Are you using ffmpeg? y/N", + description: "Will you use a URL to connect to your smtp Server y/N", before: installHelpers.inputHelpers.toBoolean, default: 'N' }, - smtp: { - confirm: { - name: 'useSmtp', + configure: [ + { + name: 'fromAddress', type: 'string', - description: "Will you be using an SMTP server? (used for sending emails) y/N", - before: installHelpers.inputHelpers.toBoolean, - default: 'N' + description: "Sender email address", + default: '', }, - confirmConnectionUrl: { - name: 'useSmtpConnectionUrl', + { + name: 'rootUrl', + type: 'string', + description: "The url this install will be accessible from", + default: '' // set using default server options + } + ], + configureService: [ + { + name: 'smtpService', type: 'string', - description: "Will you use a URL to connect to your smtp Server y/N", - before: installHelpers.inputHelpers.toBoolean, - default: 'N' + description: "Which SMTP service (if any) will be used? (see https://github.com/andris9/nodemailer-wellknown#supported-services for a list of supported services.)", + default: 'none', }, - configure: [ - { - name: 'fromAddress', - type: 'string', - description: "Sender email address", - default: '', - }, - { - name: 'rootUrl', - type: 'string', - description: "The url this install will be accessible from", - default: '' // set using default server options - } - ], - configureService: [ - { - name: 'smtpService', - type: 'string', - description: "Which SMTP service (if any) will be used? (see https://github.com/andris9/nodemailer-wellknown#supported-services for a list of supported services.)", - default: 'none', - }, - { - name: 'smtpUsername', - type: 'string', - description: "SMTP username", - default: '', - }, - { - name: 'smtpPassword', - type: 'string', - description: "SMTP password", - hidden: true, - replace: installHelpers.inputHelpers.passwordReplace, - default: '', - before: installHelpers.inputHelpers.passwordBefore - } - ], - configureConnectionUrl: [ - { - name: 'smtpConnectionUrl', - type: 'string', - description: "Custom connection URL: smtps://user%40gmail.com:pass@smtp.gmail.com/?pool=true", - default: 'none', - } - ] - } + { + name: 'smtpUsername', + type: 'string', + description: "SMTP username", + default: '', + }, + { + name: 'smtpPassword', + type: 'string', + description: "SMTP password", + hidden: true, + replace: installHelpers.inputHelpers.passwordReplace, + default: '', + before: installHelpers.inputHelpers.passwordBefore + } + ], + configureConnectionUrl: [ + { + name: 'smtpConnectionUrl', + type: 'string', + description: "Custom connection URL: smtps://user%40gmail.com:pass@smtp.gmail.com/?pool=true", + default: 'none', + } + ] + } + }, + tenant: [ + { + name: 'masterTenantName', + type: 'string', + description: "Set a unique name for your tenant", + pattern: installHelpers.inputHelpers.alphanumValidator, + default: 'master' }, - tenant: [ - { - name: 'masterTenantName', - type: 'string', - description: "Set a unique name for your tenant", - pattern: installHelpers.inputHelpers.alphanumValidator, - default: 'master' - }, - { - name: 'masterTenantDisplayName', - type: 'string', - description: 'Set the display name for your tenant', - default: 'Master' - } - ], - tenantDelete: { - name: "confirm", - description: "Continue? (Y/n)", - before: installHelpers.inputHelpers.toBoolean, - default: "Y" + { + name: 'masterTenantDisplayName', + type: 'string', + description: 'Set the display name for your tenant', + default: 'Master' + } + ], + tenantDelete: { + name: "confirm", + description: "Continue? (Y/n)", + before: installHelpers.inputHelpers.toBoolean, + default: "Y" + }, + superUser: [ + { + name: 'suEmail', + type: 'string', + description: "Email address", + required: true }, - superUser: [ - { - name: 'suEmail', - type: 'string', - description: "Email address", - required: true - }, - { - name: 'suPassword', - type: 'string', - description: "Password", - hidden: true, - replace: installHelpers.inputHelpers.passwordReplace, - required: true, - before: installHelpers.inputHelpers.passwordBefore - }, - { - name: 'suRetypePassword', - type: 'string', - description: "Confirm Password", - hidden: true, - replace: installHelpers.inputHelpers.passwordReplace, - required: true, - before: installHelpers.inputHelpers.passwordBefore - } - ] - }; - if(!IS_INTERACTIVE) { - return start(); - } + { + name: 'suPassword', + type: 'string', + description: "Password", + hidden: true, + replace: installHelpers.inputHelpers.passwordReplace, + required: true, + before: installHelpers.inputHelpers.passwordBefore + }, + { + name: 'suRetypePassword', + type: 'string', + description: "Confirm Password", + hidden: true, + replace: installHelpers.inputHelpers.passwordReplace, + required: true, + before: installHelpers.inputHelpers.passwordBefore + } + ] + }; + if(!IS_INTERACTIVE) { + return start(); + } + console.log(''); + if(!fs.existsSync('conf/config.json')) { + fs.ensureDirSync('conf'); + return start(); + } + console.log('Found an existing config.json file. Do you want to use the values in this file during install?'); + installHelpers.getInput(inputData.useConfigJSON, function(result) { console.log(''); - if(!fs.existsSync('conf/config.json')) { - fs.ensureDirSync('conf'); - return start(); - } - console.log('Found an existing config.json file. Do you want to use the values in this file during install?'); - installHelpers.getInput(inputData.useConfigJSON, function(result) { - console.log(''); - USE_CONFIG = result.useJSON; - start(); - }); + USE_CONFIG = result.useJSON; + start(); }); }); });