Quickstart

Quickstart

Assuming you have successfully installed Isso, here’s a quickstart guide that covers the most common setup. Sections covered:

Configuration

您必须提供一个自定义配置来设置 dbpath (数据库位置)和 hostCORS 的网站列表)。所有其他选项均具有默认值。

[general]
; database location, check permissions, automatically created if it
does not exist
dbpath = /var/lib/isso/comments.db
; your website or blog (not the location of Isso!)
host = http://example.tld/
; you can add multiple hosts for local development
; or SSL connections. There is no wildcard to allow
; any domain.
host =
    http://localhost:1234/
    http://example.tld/
    https://example.tld/

请注意,单个配置 支持多个 不同 的网站。要为不同的网站提供评论,请参考 Multiple Sites

审核是通过发送邮件或标准输出上的签名URL进行完成的。默认情况下,评论立即有效并显示给其他用户。要启用审核队列,请添加:

[moderation]
enabled = true

要审核评论,要么使用日志中activation、deletion URL,要么 使用SMTP 来获取新评论的通知,包括用于激活和删除的URL(activation、deletion URL):

[general]
notify = smtp
[smtp]
; SMTP settings

有关更多选项,请参阅 服务端客户端 配置。

Migration

Isso provides a tool for importing comments from Disqus or WordPress. You can also import comments from any other comment system, but this topic is more complex and is covered in advanced migration.

要从Disqus导出评论,请登录Disqus,转到您的网站,单击 Discussions ,然后选择 Export 选项卡。您会收到一封包含评论的电子邮件。不幸的是,Disqus不会导出投票。

要从以前的WordPress安装中导出评论,请转到 Tools ,然后导出数据。据说,WordPress可能会生成损坏的XML。在继续导入之前,尝试使用 xmllint 修复文件。

现在导入XML转储:

~> isso -c /path/to/isso.cfg import -t [disqus|wordpress] disqus-or-wordpress.xml
[100%]  53 threads, 192 comments

Running Isso

要运行Isso,只需执行以下命令:

$ isso -c /path/to/isso.cfg run
2013-11-25 15:31:34,773 INFO: connected to HTTP server

接下来,我们配置 Nginx 来代理Isso服务。不要在公共界面运行Isso!托管Isso的一种流行但经常容易出错(因为CORS )的设置是使用了专用域,例如 comment.example.tld

假设您的网站和Isso都在同一台服务器上,则nginx配置如下所示:

server {
    listen [::]:80 default ipv6only=off;
    server_name example.tld;
    root ...;
}

server {
    listen [::]:80;
    server_name comments.example.tld;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Integration

现在,将Isso嵌入到您的网站中:

<script data-isso="//comments.example.tld/"
        src="//comments.example.tld/js/embed.min.js"></script>

<section id="isso-thread"></section>

请注意, data-isso 是可选的,但是当网站使用 异步 引用脚本时,将无法再确定脚本的外部URL。

是的。当您打开网站时,您应该看到一个评论表单。发表评论以查看设置是否可行。如果不是,请参阅故障排除(Troubleshooting)。

进阶

There are several server and client configuration options not covered in this quickstart, check out Server Configuration and Client Configuration for more information. For further website integration, see Advanced integration.

要自动启动Isso,请检查安装指南中的 Init scripts 部分。此处编写了另一种部署Web应用程序的方法: Deployment of Isso