mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-27 14:30:50 +08:00
Merge remote-tracking branch 'upstream/master'
Conflicts: lib/boot.js
This commit is contained in:
10
lib/boot.js
10
lib/boot.js
@@ -11,19 +11,11 @@ var config = require('./config').load()
|
||||
, path
|
||||
;
|
||||
|
||||
// expose current directory to plugins
|
||||
try {
|
||||
require.paths.unshift('.');
|
||||
} catch(e) {
|
||||
// no longer supported
|
||||
console.warn(e.message);
|
||||
}
|
||||
|
||||
// load plugins
|
||||
plugins.forEach(function(fd) {
|
||||
path = __dirname + '/plugins/' + fd;
|
||||
if(fs.statSync(path).isDirectory()) {
|
||||
lib[fd] = require(path);
|
||||
lib[fd] = require(path);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ module.exports = {
|
||||
|
||||
collection(db, model, function(err, collection) {
|
||||
// TODO limit 1 for models, allow all for collections
|
||||
collection.find(query).toArray(function(err, results) {
|
||||
// TODO remove password filter, add to model
|
||||
collection.find(query, {password: 0}).toArray(function(err, results) {
|
||||
if(err) throw err;
|
||||
model.refresh(results);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var Model = require('../../model')
|
||||
, ObjectID = require('mongodb').BSONPure.ObjectID
|
||||
, _ = require('underscore')
|
||||
, crypto = require('crypto')
|
||||
;
|
||||
|
||||
module.exports = Model.spawn({
|
||||
@@ -51,7 +52,11 @@ module.exports = Model.spawn({
|
||||
},
|
||||
|
||||
hash: function(password) {
|
||||
return password + 'hash!';
|
||||
return crypto
|
||||
.createHash('md5')
|
||||
.update(password.toString())
|
||||
.digest('hex')
|
||||
;
|
||||
},
|
||||
|
||||
defineRoutes: function() {
|
||||
|
||||
Reference in New Issue
Block a user