跳转到内容

Mattermost

Mattermost 适配器走 Outgoing Webhook 模式。

前置

  1. 在 Mattermost System Console → Integrations 启用 Outgoing Webhooks。
  2. 创建一个 Bot Account,获取 Bot Token。
  3. 配置 Outgoing Webhook 指向 https://<你的公网>/mattermost,并复制它的 Token。

环境变量

Terminal window
export MATTERMOST_SERVER_URL=https://mattermost.example.com
export MATTERMOST_BOT_TOKEN=...
export MATTERMOST_WEBHOOK_TOKEN=...
export MATTERMOST_WEBHOOK_HOST=0.0.0.0
export MATTERMOST_WEBHOOK_PORT=16671
export MATTERMOST_WEBHOOK_PATH=/mattermost

Thread 语义

Mattermost 的 root_id 作为 thread key(消息所属 thread 的根消息 ID)。

故障排查

  • Bot 不能发消息:检查 Bot Account 是否被加入目标 channel。
  • 附件上传 413:Mattermost 默认单文件 50MB,在 System Console → File Storage 中调整。