GithubHelp home page GithubHelp logo

candy's Introduction

Candy

Candy 是基于多说社交评论的社会化论坛系统,采用 Node.js/Mongodb 构建。营造简洁、实用、具有人情味的下一代论坛系统,是 Candy 的设计目标。

screenshot@0.1.7

安装 Candy

你可以选择两种方式安装 Candy,将 Candy 视为一个 NPM 模块,在外部使用启动脚本启动。或者将整个仓库复制到本地直接运行启动文件。 这两种方式各有各的好处,如果你是个谨慎的使用者,并不希望频繁升级 Candy 核心文件,我推荐你采用第二种方式安装。

在尝试下面两种安装方式前,您首先需要安装Node.js和MongoDB到本地

1.将 Candy 仓库复制到本地并运行启动脚本

$ git clone https://github.com/turingou/candy.git
$ cd candy
$ npm install
$ PORT=3001 node app.js

2.将 Candy 视为 NPM 模块安装,在外部使用启动脚本启动,我已经为你准备了一个现成的启动脚本:

$ mkdir candy && cd candy
$ npm install candy
$ cp node_modules/candy/app.sample.js ./app.js
$ PORT=3001 node app.js

无论你以何种方式启动,你将在默认的端口看到一个全新的 Candy 正在静候你的初次访问。现在,使用浏览器访问 localhost:3000 你将能看到一个全新的 Candy Demo。

升级 Candy

无论你使用何种方式安装 Candy,都可以使用 NPM 或 Git 方便地进行升级。升级操作通常需要在 Candy 的安装目录进行,我们假设你的安装目录是 /www/candy,让我们将 Candy 升级到最新版本吧:

如果你使用 Git clone Candy:

$ cd /www/candy
$ git pull

如果你使用 NPM 安装 Candy,采用这种方法升级可能会导致你在 /www/candy/node_modules/candy/node_modules 文件夹下的自定义主题被覆盖,所以应确保在升级之前,备份你的自定义主题。

$ cd /www/candy
$ npm install candy@latest

配置 Candy

配置 Candy 是一条必经之路,没有一个主题或者配置清单可以适应所有的使用环境。因此,在将你的论坛搭建上生产环境服务器之前,确保通读这份配置指引。

管理员用户

第一个登录的用户会是 Candy 的管理员用户,确保你使用正确的社交网络账户登录 Candy,就可以开始自定义论坛了。 你可以在登录后的右侧菜单找到进入 管理面板 的入口,或者访问 localhost:3000/admin 进入管理面板。

启动脚本 app.js

配置脚本负责启动你的 Candy 论坛。这意味着在变更某些配置之后,你可能需要重新启动配置脚本。这个文件通常是 app.js

注意: 在生产环境启动 candy 时,请配置相应的环境变量以启动服务:

// 在 3001 端口启动服务,配置当前环境为 test:
$ PORT=3001 NODE_ENV='test' node app.js

使用 Docker build 启动镜像

Candy 提供了一份 Dockerfile 以便于使用 Docker 部署服务的使用者可以快速根据 ubuntu:14.04 的原始镜像编译出一份在 3000 端口暴露服务的 Docker Container:

  1. 通过 Candy 提供的 Dockerfile 编译镜像
$ sudo docker build -t <your username>/candy
  1. 启动镜像
// 在宿主机上绑定 8080 端口到此容器的 3000 端口,也就是 Candy 服务的端口
$ sudo docker run -p 8080:3000 -d <your username>/candy
  1. 找到镜像 ID (一串哈希或它的前三位)
$ sudo docker ps -l
  1. 打印镜像活动日志
$ sudo docker logs <container id>

测试 Candy (Debug 模式)

如果你启动的 Candy 实例遇到问题,可以开启 Debug 模式边运行边打印测试结果。你可以通过这样的方式启动 debug 模式:

// 在 3001 端口启动 debug 模式的 candy 实例:
$ DEBUG=candy PORT=3000 node app.js
// 或者直接使用快捷方式
$ cd candy
$ npm test

配置文件 configs.json

配置文件是启动脚本使用的初始配置,Candy 使用一个 json 文件当做配置文件。这个文件里规定了论坛初始化时的名字,简介,永久链接,运行环境,数据库信息等等内容。

如果你采用直接 clone 仓库的方式安装 Candy,配置文件为 ./configs.json,当然,你也可以将 Candy 视为 NPM 模块安装。这样的话,你可以在启动文件中传入配置参数,这里的配置参数与配置文件中的参数名称、规则相同。

这是配置文件 configs.json 的范例:

{
  "name": 'Candy',
  "desc": 'some description for your very new Candy forum',
  "public": "./public",
  "uploads": "./public/uploads",
  "views": "./node_modules/candy-theme-flat",
  "database": {
    "name": 'candy'
  },
  "session": {
    "store": true
  },
  "duoshuo": {
    "short_name": 'xxx',
    "secret": 'xxx'
  }
});

让我们来看看配置文件 configs.json 中的具体参数

configs#name [String] 站点名称
configs#desc [String] 站点介绍
configs#public [String] 静态资源目录 (默认为 ./public)
configs#uploads [String] 附件上传目录 (默认为 ./public/uploads)
configs#views [String] 默认主题目录 (默认为 ./node_modules/candy-theme-flat)
configs#url [String] 站点永久链接

这是一个以 http 或 https 开头的 URL,这个 URL 只有在你将站点的运行环境设定为 production 时才会变成站点的根。

configs#database [Object] 数据库信息

Candy 采用 Mongodb 构建。这是储存论坛数据库信息的对象。包括

  • database.name [String] 数据库名称(必要)
  • database.host [String] 数据库地址
  • database.port [Number] 数据库运行端口
  • database.options [Object] 数据库配置选项(参见 moogoose 文档
configs#session [Object] session 持久化相关信息
  • session.store [Boolean] 是否使用 Conenct-Mongo 做 session 持久化 (默认为 false)
configs#duoshuo [Object] 多说相关信息

Candy 基于多说社交评论构建,因此,你需要提供一个多说 short_name 和相应的 secret

  • duoshuo.short_name [String] 多说 short_name (必要)
  • duoshuo.secret [String] 多说 secret(必要)

Candy 主题系统

Candy 构建于 Theme 主题系统之上。这意味着你可以编写 NPM 模块,作为 Candy 的主题,并发布到 NPM,使所有使用 Candy 的用户受益。

  • 所有主题遵守一套命名约定,必须采用 candy-theme-xxx 的命名规则进行命名,并发布到 NPM。
  • 所有主题都必须按照一定规范书写 package.json 可以参照 Candy 的默认主题 candy-theme-flat 书写你的主题描述文件。
  • 所有主题的静态资源文件夹都推荐放置于主题文件夹下的 static 目录。
  • 所有主题模块均应位于 './node_modules' 文件夹内,小心升级模块时造成的文件覆盖。

欢迎提交 Pull Request

Candy 仍未达到我们期望的完善程度,欢迎一起来完善这个有趣的社会化论坛实验。

  • Fork Candy
  • 在不破坏基本结构的情况下,添加功能。
  • 确保自己添加的功能经过 人工 或者 单元测试
  • 发起 Pull Request

MIT license

Copyright (c) 2013 turing <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

candy's People

Contributors

alanoy avatar deepure avatar guo-yu avatar lvwzhen avatar shen2 avatar sofish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

candy's Issues

Candy 现在基本瘫痪跑不起来了

从 GitHub 中克隆的代码,运行的时候遇到以下问题。

第一个问题是由 express-scaffold 引起的

express-scaffold 依赖的的 node-sass 没有指定版本号,最新版的 node-sass 已经把 middleware 独立到另外一个模块中,导致启动的时候报错。找到 express-scaffold 目录下面的 libs/server.js,把 95 行注销了,可以启动服务了。

// app.use(sass({ src: dirs.publics }));

多说账号登录问题

接下来使用第三方账号登录,结果又报下面的错……

[Error: code is required]
Error: code is required
    at Duoshuo.auth (/Users/minwe/Downloads/candy/node_modules/duoshuo/libs/duoshuo.js:21:30)
    at Object.handle (/Users/minwe/Downloads/candy/node_modules/duoshuo/libs/duoshuo.js:40:10)
    at next_layer (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/route.js:103:13)
    at Route.dispatch (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/route.js:107:5)
    at /Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:213:24
    at Function.proto.process_params (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:284:12)
    at next (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:207:19)
    at next (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:182:38)
    at Function.proto.handle (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:154:3)
    at Layer.router (/Users/minwe/Downloads/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:24:12)

安装成功,但无法运行

运行 $ PORT=3001 node app.js 后,报错

module.js:340
throw err;
^
Error: Cannot find module 'npm'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/Han/mysite/candy/node_modules/theme/node_modules/pkghub/libs/npm.js:1:73)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Candy 0.2.0 开发计划

在完善后台管理部分未编码完成的API的同时,主要针对以下几个方向进行优化:

支持媒体文件的上传
支持主流云储存的媒体文件自动同步
支持截屏自动插入
针对移动版本的界面进行优化
这个版本的目的是让 candy 社区的用户可以更好的进行文件分享。

考虑到这对于国内社区用户来说是普遍需求,将会在0.2.0版本发布时完成以上四点功能。

这个 bug 比较严重,编辑就挂

TypeError: Object function model(doc, fields, skipId) {
    if (!(this instanceof model))
      return new model(doc, fields, skipId);
    Model.call(this, doc, fields, skipId);
  } has no method 'checkAdmin'

theme 的一个 bug

[Error: template not found]
Error: template not found
    at /candy/node_modules/theme/node_modules/pkghub-render/libs/render.js:33:29
    at Hub.find (/candy/node_modules/theme/node_modules/pkghub/libs/pkghub.js:70:16)
    at Hub.load (/candy/node_modules/theme/node_modules/pkghub/libs/pkghub.js:96:44)
    at module.exports (/candy/node_modules/theme/node_modules/pkghub-render/libs/render.js:16:16)
    at Theme.render (/candy/node_modules/theme/libs/theme.js:90:12)
    at /candy/routes/home.js:8:19
    at Promise.<anonymous> (/candy/ctrlers/thread.js:56:13)
    at Promise.<anonymous> (/candy/node_modules/express-scaffold/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
    at Promise.EventEmitter.emit (events.js:95:17)
    at Promise.emit (/candy/node_modules/express-scaffold/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)

登录时出错.

提示说code是必选参数?

同时首页获取文章列表也都报错了.

npm install不通过

npm install后安装依赖包到kerberos时候

(node-gyp rebuild 2> builderror.log) || (exit 0)

在MAC环境下卡住了。而kerberos文档为零,请教原因。

无法启动出错

(最新master分支)
系统: CentOs
node -v v0.10.26

/home/candy/candy/node_modules/express-scaffold/middlewares/auth.js:10
  return this.basic('admin', '123');
              ^
TypeError: Object #<Object> has no method 'basic'
    at /home/candy/candy/node_modules/express-scaffold/middlewares/auth.js:10:15
    at Object.<anonymous> (/home/candy/candy/node_modules/express-scaffold/middlewares/auth.js:11:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/candy/candy/node_modules/express-scaffold/routes/index.js:2:12)
    at Module._compile (module.js:456:26)

上传附件出错

events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/var/www/candy/public/uploads/d3f8c14abf0a12bfe49525999617e92b.jpg'

无法进入admin面板

/Users/candy/node_modules/mongoose/lib/utils.js:419
throw err;
^
TypeError: Object # has no method 'query'
at /Users/candy/routes/sign.js:100:22
at /Users/candy/routes/sign.js:17:13
at /Users/candy/ctrlers/user.js:20:4
at /Users/candy/node_modules/mongoose/lib/utils.js:414:16
at /Users/candy/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection.js:594:7
at /Users/candy/node_modules/mongoose/node_modules/mongodb/lib/mongodb/utils.js:153:27
at /Users/candy/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1658:9
at Server.Base._callHandler (/Users/candy/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:378:41)
at /Users/candy/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:468:18
at MongoReply.parseBody (/Users/candy/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)

首页显示“500 啊哦”错误

首页的 header 和 footer 都显示了,但是中间部分显示了如下两行:

500 啊哦,服务器或者数据库出问题了,麻烦联络管理员解决。
Error: theme not found

数据库连接出错

candy 版本:

mmm@Apollo[master]:~/git/candy
⌘ git log |head
commit f6803c45c424943a80b044b9c31dc65965a83004
Merge: 7872051 2be77f3
Author: Guo Yu <[email protected]>
Date:   Wed Mar 12 12:00:01 2014 +0800

    Merge pull request #30 from rippling/master

    Update README.md

commit 2be77f3eddb6250b2ca53ac88bfd2425624f518b

是直接在 candy clone 下来的仓库里 npm install 后 node app.js 跑起来的,运行了 node app.js 后没有任何输出信息,浏览器访问 http://localhost:3000 后产生如下出错信息:

/Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/lib/connect-mongo.js:176
          throw new Error('Error connecting to database');
                ^
Error: Error connecting to database
    at /Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/lib/connect-mongo.js:176:17
    at /Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:273:18
    at /Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:351:18
    at Server.close (/Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:210:38)
    at Db.close (/Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:347:21)
    at /Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:271:21
    at null.<anonymous> (/Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:563:7)
    at EventEmitter.emit (events.js:106:17)
    at null.<anonymous> (/Users/mmm/git/candy/node_modules/express-scaffold/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
    at EventEmitter.emit (events.js:98:17)

但是在 mongodb 里面,candy 数据库是确实创建成功了的:

vagrant@precise64:~$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> show databases
admin   (empty)
candy   0.203125GB
local   0.078125GB
> use candy
switched to db candy
> show collections
boards
configs
system.indexes
users

是不是更新后哪里有点问题?
我的 nodejs 和 npm 安装的模块的版本信息:

node --version
v0.10.26

[email protected] /Users/mmm/git/candy
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├─┬ [email protected]
│     │ └─┬ [email protected]
│     │   └── [email protected]
│     ├─┬ [email protected]
│     │ ├── [email protected]
│     │ ├── [email protected]
│     │ ├── [email protected]
│     │ └── [email protected]
│     ├─┬ [email protected]
│     │ ├── [email protected]
│     │ ├── [email protected]
│     │ └── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     ├─┬ [email protected]
│     │ └── [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └─┬ [email protected]
│ │ │     ├── [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]
│ │     ├─┬ [email protected]
│ │     │ └── [email protected]
│ │     ├─┬ [email protected]
│ │     │ └── [email protected]
│ │     └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   └── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └─┬ [email protected]
│ │     ├── [email protected]
│ │     └── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └─┬ [email protected]
│   │ │   ├─┬ [email protected]
│   │ │   │ └── [email protected]
│   │ │   ├─┬ [email protected]
│   │ │   │ └── [email protected]
│   │ │   └── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └─┬ [email protected]
│   │ │   └─┬ [email protected]
│   │ │     ├── [email protected]
│   │ │     └── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ ├── [email protected]
│   │ │ │ └── [email protected]
│   │ │ ├─┬ [email protected]
│   │ │ │ └── [email protected]
│   │ │ └─┬ [email protected]
│   │ │   ├─┬ [email protected]
│   │ │   │ └── [email protected]
│   │ │   └─┬ [email protected]
│   │ │     └── [email protected]
│   │ └─┬ [email protected]
│   │   └─┬ [email protected]
│   │     ├─┬ [email protected]
│   │     │ └── [email protected]
│   │     ├─┬ [email protected]
│   │     │ └── [email protected]
│   │     └── [email protected]
│   └─┬ [email protected]
│     ├─┬ [email protected]
│     │ ├── [email protected]
│     │ └── [email protected]
│     └─┬ [email protected]
│       ├─┬ [email protected]
│       │ └── [email protected]
│       ├─┬ [email protected]
│       │ └── [email protected]
│       └── [email protected]
└── [email protected]

启动应用时报错

使用 PORT=3001 node app.js启动时报错
···
/opt/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:367
throw new Error(msg);
^
Error: Router.use() requires callback functions but got a [object Error]
at Function.proto.use (/opt/candy/node_modules/express-scaffold/node_modules/express/lib/router/index.js:367:11)
at Function.app.use (/opt/candy/node_modules/express-scaffold/node_modules/express/lib/application.js:199:16)
at new Server (/opt/candy/node_modules/express-scaffold/libs/server.js:95:7)
at Object. (/opt/candy/app.js:18:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
···

上传文件挂掉

 events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/candy/public/uploads/f70b05c2a4db16f1e5f25c1a02924d37.jpg'

database.json的权限问题

这个文件的读写权限有问题,要设置777或者用root执行才可以,否则报错
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES, permission denied '/var/www/site/database.json'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.writeFileSync (fs.js:966:15)
at Object.exports.set (/var/www/site/pkg.js:9:12)
at new Server (/var/www/site/app.js:22:9)
at Object. (/var/www/site/server.js:3:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10

mongodb 开启强制验证会无法连接

今天配置的时候发现的
首页 500 ,提示:
MongoError: not authorized for query on moeclub.configs
对 mongoose 的文档进行查阅之后,发现没有对 auth 的参数进行更多的描述。
看了下 express-scaffold 的数据库连接部分,发现返回的是:
mongoose.createConnection(host, dbname, port, options);
因为不了解 options 里的 auth 的填写方式,目前只能暂时关闭强制验证。
官方基本上使用 URI 进行连接,可以完好的支持强制验证。
我以前的处理方式是通过检测配置文件的参数,使用不同的链接格式进行连接
可能不算是 bug ,但是觉得挺麻烦的,希望能改进

按照readme安装没成功

你好,

今天看到你的项目,感觉好新奇,尝试安装了一下,但是遇到点小问题...

这里 提到了 app.sample.js ,但我在那个位置没找到那个文件,翻了下 app.js 似乎跟 下面 的代码不一样。

而下面的代码,我直接复制下来,填好信息,执行之后,报一个错误:
new Candy({ ^ TypeError: object is not a function

对 nodejs 我还是个新手,可能上面的问题比较弱弱,还望指教哈哈~~

登陆出错

刚更新了代码测试一下,结果无法登陆,页面报500,数据库为全新。

{"error":{"remind_in":7776000,"access_token":"6cb499299c6457562da83fc9a8c72e07","expires_in":7776000,"user_id":"1360545","code":0},"level":"error","message":"[object Object]","timestamp":"2013-09-02T14:30:54.313Z"}

如何让参与者能更低成本的加入讨论?

这个是我做candy的本质问题,一年多前,写handybbs的时候,也是抱着这个目的去做,对于论坛管理者来说,能够低成本的搭建论坛。对于参与者来说,能够省却不停的重复注册(很多账户都是临时性的,为了获得某些资源),快速通过社交网络的授权来参与讨论。

这个是sn上一个同学的评论,可以看看:

3 points by LTaoist 2 days ago | link

挺好看的……v2ex向……
可惜,博客跟论坛真的是不同的……博客量少而精,重点在第一贴,评论是可有可无的,而且如果有评论,评论一般是对博主……论坛在于参与者活跃,广发有用帖,除了分享型主题,回复帖是很重要而且值得挖掘的……
1. 用第三方的评论系统日后很容易成为技术瓶颈,因为 论坛的核心就是回复 .
2. 改变了外观,但核质没变,论坛现在的瓶颈问题还没解决:信息噪音、通知机制、模型底层。v2ex将传统forum的看版变为节点尚可以说是一个大创新(解决信息噪音问题),但是这个其实没有多少改变。
。。。其实,用phpbb做个深度定制估计是可以做出这种样子的,但估计没有人在意吧。论坛的生产者很多其实是不那么在意界面的,反而是很多围观者一直希望界面好看点。但如果没有真正提供机制让围观者参与转换为生产者,界面怎么改都是一回事而已。
这几年风风火火很多对论坛的改进尝试:
  * http://v2ex.com/
  * http://moot.it/
  * http://try.discourse.org/
算上这个也算一个吧。但其实很少让人满意的……

安装错误

262 silly lockFile ae1bacfa-candy-theme-flat-0-1-0 [email protected]
263 error Error: version not found: [email protected]
263 error at /usr/lib/node_modules/npm/lib/cache/add-named.js:123:12
263 error at saved (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:141:7)
263 error at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
263 error at Object.oncomplete (fs.js:107:15)
264 error If you need help, you may report this entire log,

安装错误,无法连接localhost:27017

安装提示无法连接localhost:27017,mongod已经安装并运行,需要做哪些配置呢?谢谢

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: failed to connect to [localhost:27017]
    at null.<anonymous> (/Users/lv/Documents/code/github/gitstar/node_modules/express-scaffold/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:546:74)
    at EventEmitter.emit (events.js:106:17)
    at null.<anonymous> (/Users/lv/Documents/code/github/gitstar/node_modules/express-scaffold/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
    at EventEmitter.emit (events.js:98:17)
    at Socket.<anonymous> (/Users/lv/Documents/code/github/gitstar/node_modules/express-scaffold/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:833:16
    at process._tickCallback (node.js:415:13)

同500问题,theme not found

[Error: theme not found]
Error: theme not found
at /home/atbbs/node_modules/theme/node_modules/pkghub-render/libs/render.js:22:37
at [object Object].Hub.find (/home/atbbs/node_modules/theme/node_modules/pkghub/libs/pkghub.js:69:39)
at /home/atbbs/node_modules/theme/node_modules/pkghub/libs/pkghub.js:101:21
at /home/atbbs/node_modules/theme/node_modules/pkghub/libs/pkghub.js:38:16
at /home/atbbs/node_modules/npm/lib/ls.js:44:30
at /home/atbbs/node_modules/npm/node_modules/read-installed/read-installed.js:130:5
at /home/atbbs/node_modules/npm/node_modules/read-installed/read-installed.js:258:14
at asyncMap (/home/atbbs/node_modules/npm/node_modules/slide/lib/async-map.js:27:18)
at next (/home/atbbs/node_modules/npm/node_modules/read-installed/read-installed.js:215:5)
at /home/atbbs/node_modules/npm/node_modules/read-installed/read-installed.js:167:7
at LOOP (fs.js:1358:14)
at process._tickCallback (node.js:415:13)

我在折腾Nginx,似乎没有动过它。然后重启了nginx,就500了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.