Files
blog/infra/artalk/README.md
wait4xandGLM-5.3 aea11469e3 feat(artalk): 部署 Artalk 2.10.0 评论服务并入库接入草稿
- 容器 artalk/artalk-go:2.10.0 仅绑 127.0.0.1:13030,sqlite 落实例卷
- 子路径 /artalk 经 proxy_pass 尾斜杠剥前缀(官方无 base path 模式),
  nginx 草稿为 location 片段,合并主域 vhost 后需实测 sidebar 内页跳转
- 凭据不进 git:初始密码移实例目录 INITIAL-CREDENTIALS.txt(0600),
  仓库 README 仅留指引(本仓库将公开)

验证: curl -sf http://127.0.0.1:13030/api/v2/conf 返回 2.10.0 JSON;
      docker inspect artalk = running;管理员 wait4xx 经 sqlite 查证落库

Co-authored-by: GLM-5.3
2026-10-24 22:00:57 +08:00

37 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Artalk 评论系统
部署实例:`~/docker_apps/artalk/`(compose + 数据),本目录为入库交付件(配置模板,`app_key` 以占位符入库,真身在实例目录)。
## 管理入口
- 控制中心(Dashboard):评论框右下角齿轮,或直访 `https://wait4x.online/artalk/sidebar/`(需 nginx 片段合并生效后可用)
- 管理员:`wait4xx` / `admin@wait4x.online`
- **初始密码**:见实例目录 `~/docker_apps/artalk/data/INITIAL-CREDENTIALS.txt`(0600,不入库——本仓库将公开,凭据不进 git 历史);首次登录后立即修改并删除该文件
## 命令速查(在 `~/docker_apps/artalk/` 下执行)
```bash
docker compose up -d # 启动
docker compose logs -f artalk # 跟日志
docker compose pull && docker compose up -d # 升级(改 compose 中 image tag 后)
docker compose exec artalk artalk admin # 创建/修改管理员(非交互:--name --email --password)
curl -sf http://127.0.0.1:13030/api/v2/conf # 健康自查,返回 JSON 即存活
```
## 数据与备份
- sqlite 库:`~/docker_apps/artalk/data/artalk.db`(容器以 root 写入,宿主备份需 sudo 或 `docker cp artalk:/data/artalk.db ./`)
- 日志:`~/docker_apps/artalk/data/artalk.log`(JSON 行格式)
- 备份只需拷贝整个 `data/` 目录,停容器后拷贝保证一致性
## 接入
- nginx 片段:`nginx-artalk.conf`(合并进 wait4x.online vhost,见文件头注释;容器仅绑 127.0.0.1:13030)
- 博客前端:`Artalk.init({ el: '#Comments', server: 'https://wait4x.online/artalk', site: 'wait4x.online', pageKey: <文章相对路径> })`
## 已知事项
- 启动日志有 `Email Sender initialize failed` ERROR:邮件通知未配置(`email` 段默认关闭)所致,不影响评论功能;将来需要邮件通知时补 `email` 配置段即可消除
- 镜像名 `artalk/artalk-go` 带历史后缀 `-go`,是官方现用镜像名(官方文档与 Dockerfile 均为此名),勿"纠正"成 `artalk/artalk`
- 固定 tag `2.10.0`(2026-07-24 构建,当前最新稳定版),升级前先看上游 CHANGELOG 是否有 sqlite schema 迁移,并先备份 `data/`