diff --git a/app.js b/app.js index 56b95a1cee..4005af1aa1 100644 --- a/app.js +++ b/app.js @@ -18,7 +18,7 @@ global.templates = {}; templates.init([ 'header', 'footer', 'logout', 'admin/header', 'admin/footer', 'admin/index', 'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext', - 'emails/header', 'emails/footer', 'install/header', 'install/footer', 'install/basic' + 'emails/header', 'emails/footer', 'install/header', 'install/footer', 'install/redis' ]); templates.ready(function() { diff --git a/public/templates/config.json b/public/templates/config.json index 04aa514a26..5af89957fb 100644 --- a/public/templates/config.json +++ b/public/templates/config.json @@ -1,25 +1,29 @@ { - "custom_mapping": { - "admin/topics[^]*": "admin/topics", - "admin/categories[^]*": "admin/categories", - "admin/users[^]*": "admin/users", - "admin/redis[^]*": "admin/redis", - "admin/index[^]*": "admin/index", - "admin/themes[^]*": "admin/themes", - "admin/settings[^]*": "admin/settings", - "admin/twitter[^]*": "admin/twitter", - "admin/facebook[^]*": "admin/facebook", - "admin/gplus[^]*": "admin/gplus", - "install/?$": "install/basic", - "install/basic/?$": "install/basic", - "users[^]*edit": "accountedit", - "users[^]*friends": "friends", - "users/[^]*": "account", - "latest": "category", - "popular": "category", - "active": "category" - }, - "force_refresh": { - "logout": true - } + "custom_mapping": { + "admin/topics[^]*": "admin/topics", + "admin/categories[^]*": "admin/categories", + "admin/users[^]*": "admin/users", + "admin/redis[^]*": "admin/redis", + "admin/index[^]*": "admin/index", + "admin/themes[^]*": "admin/themes", + "admin/settings[^]*": "admin/settings", + "admin/twitter[^]*": "admin/twitter", + "admin/facebook[^]*": "admin/facebook", + "admin/gplus[^]*": "admin/gplus", + "install/?$": "install/redis", + "install/basic/?": "install/basic", + "install/redis/?": "install/redis", + "install/mail/?": "install/mail", + "install/social/?": "install/social", + "install/privileges/?": "install/privileges", + "users[^]*edit": "accountedit", + "users[^]*friends": "friends", + "users/[^]*": "account", + "latest": "category", + "popular": "category", + "active": "category" + }, + "force_refresh": { + "logout": true + } } \ No newline at end of file diff --git a/public/templates/install/basic.tpl b/public/templates/install/basic.tpl index 9ab273509e..5a656fc21d 100644 --- a/public/templates/install/basic.tpl +++ b/public/templates/install/basic.tpl @@ -1,28 +1,51 @@ -

Step 1 – Basic Information

- -

- Thanks for choosing to install NodeBB! We'll need some information to set up your installation - configuration... -

- -

Path Information

-

- Please enter the web-accessible url that will be used to point to the NodeBB installation. If you are using a port number in the address, - include it in the field below, not here - -

- -

- -

+

Step 2 – Basic Information

- +

Path Information

+

+ Please enter the web-accessible url that will be used to point to the NodeBB installation. If you are using a port number in the address, + include it in the field below, not here. Do not include a trailing slash.
+ +

+ +

+ +

+

+ +

+ +

+ Path to uploads folder (relative to the root of the NodeBB install)
+ +

NodeBB Secret

This "secret" is used to encode user sessions, so they are not stored in plaintext. Enter a bunch of random characters below:

- \ No newline at end of file + + +
+
+ +
+
+ +
+ + \ No newline at end of file diff --git a/public/templates/install/footer.tpl b/public/templates/install/footer.tpl index 9c25607790..9823d43371 100644 --- a/public/templates/install/footer.tpl +++ b/public/templates/install/footer.tpl @@ -1,3 +1,130 @@ + \ No newline at end of file diff --git a/public/templates/install/header.tpl b/public/templates/install/header.tpl index 535efe3092..d598b0bb06 100644 --- a/public/templates/install/header.tpl +++ b/public/templates/install/header.tpl @@ -25,7 +25,7 @@ +
\ No newline at end of file diff --git a/public/templates/install/mail.tpl b/public/templates/install/mail.tpl new file mode 100644 index 0000000000..42ba612a18 --- /dev/null +++ b/public/templates/install/mail.tpl @@ -0,0 +1,36 @@ + +

Step 3 – Mailer Information

+ +
+

+ The mailer information is used when sending out registration confirmation emails to new users. + It is also used to send password reset emails to users who have forgotten their password. +

+

+ The defaults here correspond to a local sendmail server, although any third-party + mail server can be used. +

+

+ +

+

+ +

+

+ +

+
+ +
+
+ +
+
+ +
+ + \ No newline at end of file diff --git a/public/templates/install/privileges.tpl b/public/templates/install/privileges.tpl new file mode 100644 index 0000000000..466febc9c5 --- /dev/null +++ b/public/templates/install/privileges.tpl @@ -0,0 +1,40 @@ + +

Step 5 – User Privilege Thresholds

+ +
+

+ Privilege thresholds grants a community membership the ability to moderate itself. + These numbers denote the minimum amount of user reputation required before the + corresponding privilege is unlocked. +

+

+ Reputation is gained when other users favourite posts that you have made. +

+ +

+ +

+

+ Users with reach the "Manage Content" threshold are able to edit/delete other users' posts. +

+

+ +

+

+ Users with reach the "Manage Topics" threshold are able to edit, lock, pin, close, and delete topics. +

+
+ +
+
+ Start using NodeBB! +
+
+ +
+ + \ No newline at end of file diff --git a/public/templates/install/redis.tpl b/public/templates/install/redis.tpl new file mode 100644 index 0000000000..e60954ee89 --- /dev/null +++ b/public/templates/install/redis.tpl @@ -0,0 +1,81 @@ + +

Step 1 – Establish Redis Connection

+ +

+ Thanks for choosing to install NodeBB! We'll need some information to set up your installation + configuration... +

+

+ Please enter the details of your Redis server here. If redis is hosted on the same + server as NodeBB, you can leave the default values as-is. +

+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+ + diff --git a/public/templates/install/social.tpl b/public/templates/install/social.tpl new file mode 100644 index 0000000000..046021dbf5 --- /dev/null +++ b/public/templates/install/social.tpl @@ -0,0 +1,47 @@ + +

Step 4 – Social Media Logins (Optional)

+ +
+

+ You may opt to allow users to register and login in via a social media account, if that + social network supports doing so. +

+ +

Facebook

+

+ +

+

+ +

+ +

Twitter

+

+ +

+

+ +

+ +

Google

+

+ +

+

+ +

+
+ +
+
+ +
+
+ +
+ + \ No newline at end of file diff --git a/src/meta.js b/src/meta.js new file mode 100644 index 0000000000..f4fd57edc2 --- /dev/null +++ b/src/meta.js @@ -0,0 +1,59 @@ +var config = require('../config.js'), + utils = require('./../public/src/utils.js'), + RDB = require('./redis.js'), + async = require('async'); + +(function(Meta) { + Meta.testRedis = function(callback) { + RDB.set('nodebb-redis-test', 'foobar', function(err, res) { + if (!err) { + RDB.get('nodebb-redis-test', function(err, res) { + if (!err && res === 'foobar') { + callback(true); + } else { + callback(false); + } + }); + } else { + callback(false); + } + }); + } + + Meta.config = { + get: function(callback) { + var config = {}; + + async.waterfall([ + function(next) { + RDB.hkeys('config', function(err, keys) { + next(err, keys); + }); + }, + function(keys, next) { + async.each(keys, function(key, next) { + RDB.hget('config', key, function(err, value) { + if (!err) { + config[key] = value; + } + + next(err); + }); + }, next); + } + ], function(err) { + if (!err) { + config.status = 'ok'; + callback(config); + } else callback({ + status: 'error' + }); + }); + }, + set: function(field, value, callback) { + RDB.hset('config', field, value, function(err, res) { + callback(err); + }); + } + } +}(exports)); \ No newline at end of file diff --git a/src/routes/install.js b/src/routes/install.js index e882aa954a..5b352fcd71 100644 --- a/src/routes/install.js +++ b/src/routes/install.js @@ -5,7 +5,7 @@ var RDB = require('../redis.js'); Install.create_routes = function(app) { (function() { - var routes = ['basic']; + var routes = ['basic', 'redis', 'mail', 'social', 'privileges']; for (var i=0, ii=routes.length; i