当前位置: 首页 > article >正文

开源评论系统 Isso 全攻略

博客评论系统现状:

  • 多说已经倒闭了,将于 2017.6.31 结束服务
  • Disqus 国内非常不稳定,虽然用了一段时间,但是发现最近好像有广告了,有很多乱七八糟的请求。
  • 畅言估计和多说差不了多少,没看到赢利点。
  • 网易云跟帖,不能设置昵称,不能匿名评论,加了官方群,都是提问的,管理员不作为。
  • 然后就找到了这个开源的评论系统:Isso

2017.5.1 update:新增微信审核评论的方法,见:微信审核开源评论系统 Isso 的评论

官网 https://posativ.org/isso/
Github https://github.com/posativ/isso/

安装

节选并翻译自官方文档:https://posativ.org/isso/docs/install/

使用 pip 安装

要求:

  • Python 2.6, 2.7 or 3.3+ (+ devel headers)
  • SQLite 3.3.8 +
  • C 编译器
先安装 python 和依赖

Debian/Ubuntu 系统:

~> sudo apt-get install python-dev sqlite3 build-essential

对于 Fedora/Centos 系统 :

~> sudo yum install python-devel sqlite
~> sudo yum groupinstall "Development Tools"

注:这个 Development Tools 我没有安装成功,但是没影响

安装 Isso
~> pip install isso

or

~> easy_install isso  

注:我是用 Python 2 安装的,在 Python 3 上面报 sqlite3 的错误,没法用。

使用操作系统的包管理器安装

  • Debian: https://packages.crapouillou.... – built from PyPi. Includes startup scripts and vhost configurations for Lighttpd,
    Apache and Nginx [source]. #729218 is an ITP for Debian.
  • Gentoo: http://eroen.eu/cgit/cgit.cgi... – not yet available in Portage, but you can use the ebuild to build Isso.
  • Arch Linux: https://aur.archlinux.org/pac... – install with yaourt isso.
  • Fedora: https://copr.fedoraproject.or... — copr repository. Built from Pypi, includes a systemctl unit script.
  • Docker Image: https://registry.hub.docker.c...

注:上述方法我没有实验

从源码安装

要求:

  • Python 2.6, 2.7 or 3.3+ (+ devel headers)
  • Virtualenv
  • SQLite 3.3.8 or later
  • a working C compiler
  • Node.js, NPM and Bower(安装 nodejs 后 可以使用 npm 安装 Bower)

克隆仓库:

~> git clone https://github.com/posativ/isso.git
~> cd isso/

注:截止2017.3.30,最新版为 0.10.7-dev ,经测试没法用,各种404。后来从 github Release 下载的 0.10.5 和 0.10.6 均正常。

创建一个虚拟环境(推荐,我没用,我用的 pyenv):

~> virtualenv .
~> source ./bin/activate

安装 Isso 及其依赖:

~> python setup.py develop  # or `install`
~> isso run

安装 JavaScript 模块:

~> make init

优化前的 js:

<script src="/js/config.js"></script>
<script data-main="/js/embed" src="/js/components/requirejs/require.js"></script>

压缩 js:

~> npm install -g requirejs uglify-js jade
~> make js

配置

服务端配置

详情见文档 https://posativ.org/isso/docs/configuration/server/

自己编写一个配置文件 : isso.conf

[general]
; 数据库位置,注意检查权限,如果没有会自动创建。
dbpath = /var/lib/isso/comments.db
; 博客的地址,可以添加多个,比如 http 和 https
host =http://localhost:4000/http://zhangnew.com/https://zhangnew.com/
; 评论通知,使用 smtp
notify = smtp[server]
; 监听的地址和端口 : 0.0.0.0 代表任何人可以访问
listen = http://0.0.0.0:8001/[smtp]
username = 
password = 
host = smtp.mxhichina.com
port = 25
security = none
to =
from = 
timeout = [guard]
enabled = true
ratelimit = 2
; 评论数量限制
direct-reply = 30
; 是否允许回复自己
reply-to-self = true
; 是否必须填写作者
require-author = false
; 是否必须填写邮箱
require-email = false

客户端配置

详情见文档 https://posativ.org/isso/docs/configuration/client/

<script data-isso="/prefix/"data-isso-css="true"data-isso-lang="ru"data-isso-reply-to-self="false"data-isso-require-author="false"data-isso-require-email="false"data-isso-max-comments-top="10"data-isso-max-comments-nested="5"data-isso-reveal-on-click="5"data-isso-avatar="true"data-isso-avatar-bg="#f0f0f0"data-isso-avatar-fg="#9abf88 #5698c4 #e279a3 #9163b6 ..."data-isso-vote="true"data-vote-levels=""src="https://zhangnew.com/js/embed.js"></script>

使用

导入 Disqus 或 Wordpress 的评论,这一点很好。可怜了多说用户。

isso -c /path/to/isso.conf import disqus-or-wordpress.xml

运行命令:

isso -c /path/to/isso.conf run

部署

文档: https://posativ.org/isso/docs/extras/deployment/

gevent

pip install gevent
isso -c my.cfg run

uWSGI

安装 :

~> apt-get install build-essential python-dev
~> pip install uwsgi

配置文件:

[uwsgi]
http = :8080
master = true
; set to `nproc`
processes = 4
cache2 = name=hash,items=1024,blocksize=32
; you may change this
spooler = /tmp/isso/mail
module = isso.run
; uncomment if you use a virtual environment
; virtualenv = /path/to/isso
env = ISSO_SETTINGS=/path/to/isso.cfg

运行:

~> mkdir /tmp/isso/mail
~> uwsgi /path/to/uwsgi.ini

注:该方法运行失败,有一个 status code 报错。

gunicorn

我现在用的是这种方式,支持 https

$ pip install gunicorn

运行:

$ export ISSO_SETTINGS="/path/to/isso.cfg"
$ gunicorn -b 0.0.0.0:8001 -w 4 --certfile=certificate.crt --keyfile=private.key --preload isso.run

其他部署方式

见文档:

  • mod_wsgi
  • mod_fastcgi
  • Openshift

优缺点

优点

  • 自己对评论系统有完全的控制权。

缺点

  • 不支持回复评论时通知评论作者, Isso 的作者在考虑要不要 merge 这个 pull request(我根据这个 pr 实现了该功能)。
  • avatar 头像不能关联 gravatar.com 的头像(自己实现了)。
  • 评论不好管理,常规方法可以通过邮件提醒里面的链接来删除评论。非常规方法就要修改数据库了,sqlite 进入命令行:
ATTACH 'comments.db' as isso;
SELECT id,author,text from isso.comments;
DELETE FROM isso.comments WHERE id=87;

转载自我的博客 https://zhangnew.com

http://www.lryc.cn/news/2419616.html

相关文章:

  • (SDL2)SDL在ubuntu下的测试代码(雷霄骅)
  • 负数求补码
  • short 下 32768的二进制
  • winRAR 破解注册码
  • 文件加密系统的设计与实现(源码+开题报告)
  • contest11 CF510E div2 ooxxx oooox oooox
  • Spider爬虫框架之Spiders模块
  • JS-变量提升与暂时性死区概念
  • 什么是WordPress?
  • jq-jquery根据内容设置select和input radio选中
  • 高数 | 工具及必备方法 | 【一元函数积分学】常用积分公式表
  • default-gateway和default-router的区别
  • Apche部署https详解
  • 采样定理的证明与推导
  • XSLT知识总结
  • 传说中的“摸奶节”!随便你怎么摸!
  • 社会网络分析与人脉网络:如何建立有效的人脉资源
  • Toybox、toolbox、busybox 软件协议
  • HTTP代理和SOCKS代理
  • 内存术语详解
  • 探索听诊器效应:了解声音在耳朵中的传播方式
  • StringTokenizer类的详解
  • 超音速启动 2020 年版发布
  • AMR音频格式分析
  • CrashRpt
  • 【音视频知识】MP4文件格式解析-详解
  • 日本的feature phone版twitter的follow链接
  • Android——bindService()方法启动服务
  • 汇编实验1——利用8255实现LED的流水点亮实验
  • td 元素属性 noWrap 防止折行、撑开及文字换行