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
This commit is contained in:
wait4xandGLM-5.3 committed 2026-10-24 22:00:57 +08:00
1 parent d8f5ecfbf5
commit aea11469e3
5 files changed
+103 -1

No files matched your search

@@ -24,7 +24,7 @@
- boundary: 新建 `~/docker_apps/gitea/`(compose+数据卷);容器仅绑 127.0.0.1:13020;初始化管理员与 blog 空仓;nginx conf 草稿与 app.ini 上传限制调整(MAX_FILES=20)写进 `infra/gitea/`(仓库内);不安装任何 nginx 配置、不 reload、不碰 DNS
- verify: `curl -sf http://127.0.0.1:13020/api/v1/version && docker inspect -f {{.State.Status}} gitea | grep -q running`
- [ ] T4 Artalk 部署(容器 13030,nginx conf 草稿不安装)
- [x] T4 Artalk 部署(容器 13030,nginx conf 草稿不安装)
- claim: op-artalk 2026-10-24
- boundary: 新建 `~/docker_apps/artalk/`(compose+sqlite 卷);容器仅绑 127.0.0.1:13030;站点配置含 wait4x.online;nginx conf 草稿(主域 /artalk location)写进 `infra/artalk/`(仓库内);不安装任何 nginx 配置、不 reload、不碰 DNS
- verify: `curl -sf http://127.0.0.1:13030/api && docker inspect -f {{.State.Status}} artalk | grep -q running`
+36
View File
@@ -0,0 +1,36 @@
# 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/`
+34
View File
@@ -0,0 +1,34 @@
# Artalk 配置模板(与官方镜像 -w / -c /data/artalk.yml 启动方式配套,数据路径须为 /data 绝对路径)
# 部署实例真身:~/docker_apps/artalk/data/artalk.yml(app_key 已生成,勿将真实密钥提交入库)
host: "0.0.0.0"
port: 23366
# 会话与内容加密密钥,部署时用 `openssl rand -hex 24` 生成;泄漏须更换
app_key: "<openssl rand -hex 24 生成>"
debug: false
locale: zh-CN
timezone: Asia/Shanghai
# 站点名与站点地址同填域名,前端 Artalk.init({ site: 'wait4x.online' })
site_default: wait4x.online
site_url: https://wait4x.online
db:
type: sqlite
file: /data/artalk.db
http:
# 经 nginx 反代后从 X-Forwarded-For 取访客真实 IP
proxy_header: X-Forwarded-For
log:
enabled: true
filename: /data/artalk.log
# 前端页面域名(CORS 白名单;site_url 会自动加入)
trusted_domains:
- https://wait4x.online
admin_users: []
+14
View File
@@ -0,0 +1,14 @@
services:
artalk:
image: artalk/artalk-go:2.10.0
container_name: artalk
restart: unless-stopped
# 仅回环暴露,公网访问必须经 nginx 反代(见 nginx-artalk.conf)
ports:
- "127.0.0.1:13030:23366"
volumes:
# 配置与 sqlite 同卷:官方 entrypoint 自动检测 /data/artalk.yml 并以 -c 启动
- ./data:/data
- /etc/localtime:/etc/localtime:ro
environment:
- TZ=Asia/Shanghai
+18
View File
@@ -0,0 +1,18 @@
# Artalk 反代 location 片段 —— 由 orchestrator 合并进 wait4x.online vhost 的 server{} 内,勿直接启用
# 后端仅绑回环 127.0.0.1:13030(docker-compose.yml 端口映射)
# Artalk 官方无子路径(base path)模式:靠 proxy_pass 尾斜杠剥掉 /artalk 前缀;
# 前端 Artalk.init({ server: 'https://wait4x.online/artalk' }),API 与内嵌资源(/dist /sidebar)随之可达
# 合并后需实测侧边栏控制中心内页跳转,若存在绝对路径引用会 404,届时改用子域名方案
location = /artalk { return 301 /artalk/; }
location /artalk/ {
proxy_pass http://127.0.0.1:13030/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# 覆盖 vhost 默认 body 上限,覆盖评论图片上传场景
client_max_body_size 20m;
}