Isso

来自wrc's Wiki
Weirane讨论 | 贡献2021年4月20日 (二) 04:32的版本 →‎参考链接
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

Isso 可以用于博客的评论服务。Github主页

Nginx 配置

server {
    server_name isso.example.com;

    location / {
        proxy_pass http://unix:/srv/isso/gunicorn.sock;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Isso 配置

将 isso 安装在一个 virtualenv 中。requirements.txt:

isso
gunicorn

注意 isso 0.12.3 和更早的版本和 werkzeug 1.0 不兼容,可在 requirements.txt 中加入 werkzeug==0.16.1 解决。

运行

python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt

写一个脚本用于启动

#!/bin/sh
set -e
cd "$(dirname "$(realpath "$0")")"
. ./venv/bin/activate
export ISSO_SETTINGS=isso.ini
exec gunicorn -b unix:gunicorn.sock isso.run

写配置文件 isso.ini。不需要邮件提醒可将 notify = smtp 和下面的 [smtp] 一节都去掉。

[general]
dbpath = /srv/isso/db.sqlite3
host = https://blog.example.com
notify = smtp

[smtp]
username = blog@example.com
password = p@ssw0rd
host = smtp.example.com
port = 465
security = ssl
to = blog@example.com
from = "Blog Notification" <blog@example.com>
timeout = 10

Systemd 配置

再写一个 systemd unit [1]

# ~/.config/systemd/user/isso.service
[Unit]
Description=Isso Comment Server
After=network.target network-online.target nss-lookup.target

[Service]
WorkingDirectory=/srv/isso
ExecStart=/srv/isso/start.sh

[Install]
WantedBy=default.target

启动

systemctl --user enable --now isso.service

参考资料