From 275a9ef476a07829e294c80c714dd7821af8f4fb Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 24 Apr 2015 15:11:22 -0400 Subject: [PATCH] Reverted the last update to web installer, and updated it so environment variables always take precedence over form input, and form is hidden if database value is passed in --- install/web.js | 13 ++++--------- src/views/install/index.tpl | 6 ++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/install/web.js b/install/web.js index af56943b52..0587238244 100644 --- a/install/web.js +++ b/install/web.js @@ -65,10 +65,7 @@ function welcome(req, res) { res.render('install/index', { databases: databases, - dbBool: { - redis: nconf.get('database') === 'redis', - mongo: nconf.get('database') === 'mongo' - }, + skipDatabaseSetup: !!nconf.get('database'), error: res.locals.error ? true : false, success: res.locals.success ? true : false, values: req.body @@ -76,16 +73,14 @@ function welcome(req, res) { } function install(req, res) { - var env = {}; - for (var i in req.body) { - if (req.body.hasOwnProperty(i)) { - env[i.replace(':', '__')] = req.body[i]; + if (req.body.hasOwnProperty(i) && !process.env.hasOwnProperty(i)) { + process.env[i.replace(':', '__')] = req.body[i]; } } var child = require('child_process').fork('app', ['--setup'], { - env: env + env: process.env }); child.on('close', function(data) { diff --git a/src/views/install/index.tpl b/src/views/install/index.tpl index d3f6df8b3c..296c1d4d44 100644 --- a/src/views/install/index.tpl +++ b/src/views/install/index.tpl @@ -89,6 +89,7 @@ +

Configure your database

@@ -99,8 +100,8 @@
There was an error connecting to your database. Please try again.
@@ -108,6 +109,7 @@
+