Mattermost
Mattermost 适配器走 Outgoing Webhook 模式。
前置
- 在 Mattermost System Console → Integrations 启用 Outgoing Webhooks。
- 创建一个 Bot Account,获取 Bot Token。
- 配置 Outgoing Webhook 指向
https://<你的公网>/mattermost,并复制它的 Token。
环境变量
export MATTERMOST_SERVER_URL=https://mattermost.example.comexport MATTERMOST_BOT_TOKEN=...export MATTERMOST_WEBHOOK_TOKEN=...export MATTERMOST_WEBHOOK_HOST=0.0.0.0export MATTERMOST_WEBHOOK_PORT=16671export MATTERMOST_WEBHOOK_PATH=/mattermostThread 语义
Mattermost 的 root_id 作为 thread key(消息所属 thread 的根消息 ID)。
故障排查
- Bot 不能发消息:检查 Bot Account 是否被加入目标 channel。
- 附件上传 413:Mattermost 默认单文件 50MB,在 System Console → File Storage 中调整。