最近使用了NodeBB开源站点搭建了一套内部论坛系统。
nodebb相关资料 :https://docs.nodebb.org/en/latest/installing/os/ubuntu.html
https://docs.nodebb.org/en/latest/configuring/databases/mongo.html
nodebb 源码:https://github.com/NodeBB/NodeBB
一、修改主配置文件为自己
vim config.json
{
"url": "http://host:port",
"secret": "XXX",
"database": "mongo",
"port": port,
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"username": "username",
"password": "password",
"database": "nodebb"
}
}
二、Logo、上传、语言等修改都在对应的admin后台中
http://XXXX/admin/general/languages 论坛语言修改
http://XXXX/admin/manage/categories 论坛导航修改
http://XXXX/admin/settings/general 论坛LOGO以及Title修改
http:/XXXX/admin/settings/uploads 论坛上传附件大小修改
http://XXXX/admin/extend/widgets 论坛Header与Footer修改
三、论坛免登陆附件修改
src/middleware/middleware.js 将403注释直接NEXT即可
middleware.privateUploads = function(req, res, next) {
if (req.user || parseInt(meta.config.privateUploads, 10) !== 1) {
return next();
}
if (req.path.startsWith('/uploads/files')) {
return next();
//return res.status(403).json('未登录不允许下载');
}
next();
};
四、论坛绑定域名后登录仍然使用IP地址的修改
public/src/client/login.js:32:window.location.href = 'http://XXXXcom/?loggedin';
五、本次修改查找某些关键词的shell命令
grep -rn "loggedin" *
在当前目录下遍历所有文件找到携带loggedin的文件名