From 97cb11628df67fe5c1999340be301a7870cadf70 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sat, 1 Mar 2014 15:37:02 -0500 Subject: [PATCH 1/5] Installation instructions CentOS 6.5 ReadME.MD Adding installation instructions for CentOS 6.5, also adding npm strict-ssl to false to allow some npm packages that have self signed certs. --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab02209c57..cc34935b7f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ NodeBB requires the following software to be installed: * Redis, version 2.6 or greater **or** MongoDB, version 2.4 or greater * nginx, version 1.3.13 or greater (**only if** intending to use nginx to proxy requests to a NodeBB) -## Installation +## Installation Ubuntu First, we install our base software stack: @@ -57,7 +57,42 @@ Next, clone this repository: Obtain all of the dependencies required by NodeBB: $ cd nodebb + $ npm config set strict-ssl false $ npm install + $ npm config set strict-ssl true + +Initiate the setup script by running the app with the `--setup` flag: + + $ ./nodebb setup + +The default settings are for a local server running on the default port, with a redis store on the same machine/port. + +Lastly, we run the forum. + + $ ./nodebb start + +NodeBB can also be started with helper programs, such as `supervisor` and `forever`. [Take a look at the options here](https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB). + + +## Installation CentOS 6.5 + +First, we install our base software stack: + + # yum update + # yum groupinstall "Development Tools" -y + # yum install nodejs git redis ImageMagick + +Next, clone this repository: + + $ cd /path/to/nodebb/install/location + $ git clone git://github.com/designcreateplay/NodeBB.git nodebb + +Obtain all of the dependencies required by NodeBB: + + $ cd nodebb + $ npm config set strict-ssl false + $ npm install + $ npm config set strict-ssl true Initiate the setup script by running the app with the `--setup` flag: From e9e53ad95ea0f5c757fda3669337daf8afc2ae8d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 6 Mar 2014 15:32:06 -0500 Subject: [PATCH 2/5] added a new property to userData "hasPassword", disabling "current password" field in user editing if no password is set (for SSO logins, for example) --- public/src/forum/accountedit.js | 3 +-- public/templates/accountedit.tpl | 2 +- src/user.js | 24 +++++++++++++++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js index 13bab6cf9d..207785e846 100644 --- a/public/src/forum/accountedit.js +++ b/public/src/forum/accountedit.js @@ -189,8 +189,7 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) { password_confirm.on('blur', onPasswordConfirmChanged); $('#changePasswordBtn').on('click', function() { - - if (passwordvalid && passwordsmatch && (currentPassword.val() || app.isAdmin)) { + if ((passwordvalid && passwordsmatch) || app.isAdmin) { socket.emit('user.changePassword', { 'currentPassword': currentPassword.val(), 'newPassword': password.val(), diff --git a/public/templates/accountedit.tpl b/public/templates/accountedit.tpl index acfe85af56..536943b7b5 100644 --- a/public/templates/accountedit.tpl +++ b/public/templates/accountedit.tpl @@ -115,7 +115,7 @@
- + disabled>
diff --git a/src/user.js b/src/user.js index 4674e1d17b..9d81f2ea71 100644 --- a/src/user.js +++ b/src/user.js @@ -185,8 +185,13 @@ var bcrypt = require('bcryptjs'), return callback(err); } - if (data && data.password) { - delete data.password; + if (data) { + if (data.password) { + delete data.password; + data.hasPassword = true; + } else { + data.hasPassword = false; + } } callback(err, data); }); @@ -467,13 +472,18 @@ var bcrypt = require('bcryptjs'), return callback(err); } - bcrypt.compare(data.currentPassword, currentPassword, function(err, res) { - if (err || !res) { - return callback(err || new Error('Your current password is not correct!')); - } + if (currentPassword !== null) { + bcrypt.compare(data.currentPassword, currentPassword, function(err, res) { + if (err || !res) { + return callback(err || new Error('Your current password is not correct!')); + } + hashAndSetPassword(callback); + }); + } else { + // No password in account (probably SSO login) hashAndSetPassword(callback); - }); + } }); } }; From b2bc1d4555d3282fbfb7ae33e292349fad5a98b6 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 6 Mar 2014 15:37:13 -0500 Subject: [PATCH 3/5] setting password to null in getUserData, because Object.delete is bad? :P (thanks @barisusakli) --- src/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user.js b/src/user.js index 9d81f2ea71..6b425fd401 100644 --- a/src/user.js +++ b/src/user.js @@ -187,7 +187,7 @@ var bcrypt = require('bcryptjs'), if (data) { if (data.password) { - delete data.password; + data.password = null; data.hasPassword = true; } else { data.hasPassword = false; From 958e85a31fcfb291e8861426c9da2b2077c3acef Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 6 Mar 2014 15:56:14 -0500 Subject: [PATCH 4/5] updated readme to point to wiki for platform specific install docs --- README.md | 70 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index cc34935b7f..b45429cdf8 100644 --- a/README.md +++ b/README.md @@ -36,75 +36,9 @@ NodeBB requires the following software to be installed: * Redis, version 2.6 or greater **or** MongoDB, version 2.4 or greater * nginx, version 1.3.13 or greater (**only if** intending to use nginx to proxy requests to a NodeBB) -## Installation Ubuntu +## Installation -First, we install our base software stack: - - # apt-get install git nodejs redis-server build-essential imagemagick - -If you want to use MongoDB instead of Redis install it from http://www.mongodb.org/downloads and remove 'redis-server' from the above command. [MongoDB-Setup](https://github.com/designcreateplay/NodeBB/wiki/Installing-NodeBB-With-MongoDB) - -**If your package manager only installed a version of Node.js that is less than 0.8 (e.g. Ubuntu 12.10, 13.04):** - - # add-apt-repository ppa:chris-lea/node.js - # apt-get update && apt-get dist-upgrade - -Next, clone this repository: - - $ cd /path/to/nodebb/install/location - $ git clone git://github.com/designcreateplay/NodeBB.git nodebb - -Obtain all of the dependencies required by NodeBB: - - $ cd nodebb - $ npm config set strict-ssl false - $ npm install - $ npm config set strict-ssl true - -Initiate the setup script by running the app with the `--setup` flag: - - $ ./nodebb setup - -The default settings are for a local server running on the default port, with a redis store on the same machine/port. - -Lastly, we run the forum. - - $ ./nodebb start - -NodeBB can also be started with helper programs, such as `supervisor` and `forever`. [Take a look at the options here](https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB). - - -## Installation CentOS 6.5 - -First, we install our base software stack: - - # yum update - # yum groupinstall "Development Tools" -y - # yum install nodejs git redis ImageMagick - -Next, clone this repository: - - $ cd /path/to/nodebb/install/location - $ git clone git://github.com/designcreateplay/NodeBB.git nodebb - -Obtain all of the dependencies required by NodeBB: - - $ cd nodebb - $ npm config set strict-ssl false - $ npm install - $ npm config set strict-ssl true - -Initiate the setup script by running the app with the `--setup` flag: - - $ ./nodebb setup - -The default settings are for a local server running on the default port, with a redis store on the same machine/port. - -Lastly, we run the forum. - - $ ./nodebb start - -NodeBB can also be started with helper programs, such as `supervisor` and `forever`. [Take a look at the options here](https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB). +[Please refer to platform-specific installation documentation](https://github.com/designcreateplay/NodeBB/wiki#wiki-installing-nodebb) ## Securing NodeBB From 588059042525f1996767c2755c569c76c2c3943c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 6 Mar 2014 17:50:15 -0500 Subject: [PATCH 5/5] removing "pluginCSS", "css" in plugins is now included directly into stylesheet.css. This is a breaking change. fixes #1168 --- public/templates/header.tpl | 3 --- src/plugins.js | 21 +++++++-------------- src/routes/meta.js | 5 +++++ src/webserver.js | 1 - 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 9682271b8a..a391d9fd04 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -11,9 +11,6 @@ link="{linkTags.link}" rel="{linkTags.rel}" type="{linkTags.type}" href="{linkTags.href}" /> - - - diff --git a/src/plugins.js b/src/plugins.js index 40aa6b996e..32d902b03b 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -62,6 +62,8 @@ var fs = require('fs'), Plugins.loadedHooks = {}; Plugins.staticDirs = {}; Plugins.cssFiles.length = 0; + Plugins.lessFiles.length = 0; + Plugins.clientScripts.length = 0; // Read the list of activated plugins and require their libraries async.waterfall([ @@ -195,21 +197,12 @@ var fs = require('fs'), winston.info('[plugins] Found ' + pluginData.css.length + ' CSS file(s) for plugin ' + pluginData.id); } - if (!pluginData.staticDir) { - Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) { - return path.join('/plugins', file); - })); - } else { - winston.warn('[plugins/' + pluginData.id + '] staticDir is deprecated, define CSS files with new staticDirs instead.'); - Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) { - return path.join('/plugins', pluginData.id, file); - })); - } - - next(); - } else { - next(); + Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) { + return path.join(pluginData.id, file); + })); } + + next(); }, function(next) { // LESS files for plugins diff --git a/src/routes/meta.js b/src/routes/meta.js index cc5683b924..3b5fbed3f7 100644 --- a/src/routes/meta.js +++ b/src/routes/meta.js @@ -26,6 +26,11 @@ var path = require('path'), source += '\n@import "./' + plugins.lessFiles[x] + '";'; } + // ... and for each CSS file + for(x=0,numCSS=plugins.cssFiles.length;x