Skip to main content

ChatComment

Python 服务、SQLite 数据和一个无依赖的 JavaScript 留言组件。支持多站点、逐页隔离、匿名开关、昵称/邮箱/网址必填设置、审核与软删除。邮箱只在管理界面出现。默认私有站点由可信网关保护;可显式注册公开站点。

python -m pip install .
chatcomment --version
chatcomment --tree
chatcomment site register personal-blog --origin https://blog.example.com --page /post/one --public
chatcomment serve --token-file ~/.chatarch/chatcomment/admin-token

--token-file 必须指向仅部署者可读的现有文件(建议随机 32 字节以上);命令不生成或打印密钥。默认数据库 ~/.chatarch/chatcomment/comments.sqlite3,监听 127.0.0.1:10196。公网接入必须使用 HTTPS 反向代理;私有站点的 API 要由网关验证登录后附加 Bearer token,不能把该 token 交给浏览器。管理入口也必须经这种登录网关,或使用支持 Bearer token 的管理客户端。

<div id="comments"></div>
<script src="https://comments.example.com/widget.js" defer
  data-chatcomment data-target="#comments"
  data-api="https://comments.example.com" data-site="personal-blog"
  data-page="/post/one"></script>

组件自动读取设置并只显示允许的字段;必填校验由服务器执行。默认不记住访客信息、不加载第三方头像、不渲染留言 HTML。公开模式的匿名留言不代表拥有可信实名;关闭匿名时要求可信网关提供已验证的作者身份。

API、网关接入、备份与恢复见 docs/api.md、docs/deployment.md。本包不自动开放防火墙或注册 DNS,也不包含云服务凭据。

多用户平台接入使用 平台服务协议:--gateway-key-env 启用按主体/session/站点校验的签名上下文,所有非 health 路由均拒绝未签名访问,兼容独立 Coolify 资源。AccessContext.from_chatlogin() 复用已验证的 ChatLogin Session;项目 ACL 与密码二次验证由平台拥有,账户全局 admin 不能自动获得站点权限。旧 --token-file 模式仅保留给已有单网关部署迁移使用。

独立留言板为 /board?site=personal-blog&page=%2Fpost%2Fone,与嵌入表单读写同一留言流。组件只提供一个齿轮入口:已登录 owner 在邮箱栏填写匹配邮箱后,服务器返回显示提示;昵称不参与判断,邮箱不下发到 JS 配置。齿轮指向邮箱/密码验证页;网关须实现 /api/admin/reauth 并在校验现有账号后授予短时管理权限。公开站点没有该提示。

网关为普通成员设置 X-ChatComment-Role: reader,仅经服务端验证的 owner 使用 admin;管理接口另行验证权限。公开浏览器不能靠昵称、邮箱或伪造角色 header 获得权限,因为缺少服务器 Bearer token。服务器可为受信 owner 请求附加 X-ChatComment-Admin-Email,只用于入口提示。完整验证合约见部署文档。

Metadata

Release files for ChatComment 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ChatComment 0.2.1
File Size Uploaded Provenance
chatcomment-0.2.1.tar.gz 39.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ChatComment 0.2.1
File Interpreter ABI Platform
chatcomment-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.3 kB

Release files / chatcomment-0.2.1.tar.gz

Download URL chatcomment-0.2.1.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8598839e4ffe78e9a9f066b08cbefe9d9cbe49901b77a280e4ee8990a59dc8a4
BLAKE2b-256 checksum
How to use checksums
ea5074d93928da26c958cf14ae54ad31c4e7168011b4fe3de99437e249538e6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / chatcomment-0.2.1-py3-none-any.whl

Download URL chatcomment-0.2.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96d68ba33a59949376845e6dfb4363b70199c16f5b3e79442fd53f6fe3fd047c
BLAKE2b-256 checksum
How to use checksums
7369e7b74c62a2f31a041c097d81e26e3c857b7bc6f7a47c4040238d7a0dbd7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for ChatComment 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chatcomment-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page