From 29400c8e25a4f19ac8cfe42af63b680cfdca6bcc Mon Sep 17 00:00:00 2001 From: jysperm Date: Thu, 17 Jul 2014 20:37:38 +0800 Subject: [PATCH] fixbugs --- INSTALL.md | 4 ++-- config.coffee | 2 +- core/model/ticket.coffee | 2 +- core/plan.coffee | 8 +++++++- plugin/mysql/INSTALL.md | 6 ++++++ plugin/phpfpm/INSTALL.md | 2 ++ 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 022c82a..4a89b84 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,9 +16,9 @@ mongo use admin - db.addUser({user: 'rpadmin', pwd: '', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']}) + db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']}) use RootPanel - db.addUser({user: 'rpadmin', pwd: '', roles: ['readWrite']}) + db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWrite']}) vi /etc/mongodb.conf diff --git a/config.coffee b/config.coffee index 1c51985..82c9bed 100644 --- a/config.coffee +++ b/config.coffee @@ -42,7 +42,7 @@ module.exports = transfer: 39 memory: 27 - mongodb: 'mongodb://localhost/RootPanel' + mongodb: 'mongodb://rpadmin:password@localhost/RootPanel' bitcoin: forward_to: '1FjhhWrzAvb9YD4tVdbE6wrSoHSwxMJoWe' diff --git a/core/model/ticket.coffee b/core/model/ticket.coffee index ef1045f..1dba6ef 100644 --- a/core/model/ticket.coffee +++ b/core/model/ticket.coffee @@ -51,7 +51,7 @@ exports.createTicket = (account, title, content, type, members, status, attribut exports.createReply = (ticket, account, content, status, callback) -> data = - _id: db.ObjectID() + _id: new ObjectID() account_id: account._id created_at: new Date() content: content diff --git a/core/plan.coffee b/core/plan.coffee index 235660a..7372889 100644 --- a/core/plan.coffee +++ b/core/plan.coffee @@ -15,12 +15,15 @@ exports.joinPlan = (account, plan, callback) -> (plugin.get serviceName).service.enable account, -> callback() + , -> + callback() + exports.leavePlan = (account, plan, callback) -> mAccount.leavePlan account, plan, -> async.each config.plans[plan].services, (serviceName, callback) -> stillInService = do -> for item in _.without(account.attribute.plans, plan) - if serviceName in config.plans[plan].services + if serviceName in config.plans[item].services return true return false @@ -34,3 +37,6 @@ exports.leavePlan = (account, plan, callback) -> , -> (plugin.get serviceName).service.delete account, -> callback() + + , -> + callback() diff --git a/plugin/mysql/INSTALL.md b/plugin/mysql/INSTALL.md index f996b94..1c32830 100644 --- a/plugin/mysql/INSTALL.md +++ b/plugin/mysql/INSTALL.md @@ -1 +1,7 @@ +## MySQL + apt-get install mysql-server mysql-client + + mysql -u root -p + + GRANT ALL ON *.* TO 'rpadmin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; diff --git a/plugin/phpfpm/INSTALL.md b/plugin/phpfpm/INSTALL.md index 594a66e..e2d52e3 100644 --- a/plugin/phpfpm/INSTALL.md +++ b/plugin/phpfpm/INSTALL.md @@ -1 +1,3 @@ +## PHP-FPM + apt-get install php5-cli php5-fpm php-pear php5-mysql php5-curl php5-gd php-pear php5-imap php5-mcrypt php5-memcache php5-tidy php5-xmlrpc php5-sqlite php5-mongo