Files
BackupX/docs-site/i18n/zh-CN/docusaurus-plugin-content-docs/current/features/notifications.md
Wu Qing 66373fa8e4 修复: 中文 i18n 目录名从 zh-Hans 改为 zh-CN,首页 SSR 翻译现已生效 (#42)
Docusaurus 3.10 会把 locale id 'zh-Hans' 规范化为 BCP 47 的 'zh-CN' 来
读取 i18n/ 目录。之前手工创建的 i18n/zh-Hans/ 目录 Docusaurus 识别不到,
导致中文版 SSR 输出仍是英文字符串,只有 URL 路由 /zh-Hans/ 生效。

同时修复 index.tsx 中 <Translate id={labelId}> 动态 id 问题:
write-translations 工具要求静态字符串,已拆分为三个独立的 Translate 元素。
2026-04-17 13:52:16 +08:00

50 lines
1.3 KiB
Markdown
Raw 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.
---
sidebar_position: 5
title: 通知
description: 备份成功或失败时通过邮件、Webhook、Telegram 推送通知。
---
# 通知
BackupX 支持三种通知渠道,可为每个渠道单独配置成功/失败事件是否推送。
## 邮件SMTP
| 字段 | 说明 |
|------|------|
| SMTP 主机 / 端口 | 如 `smtp.gmail.com:587` |
| 用户名 / 密码 | 建议使用专用应用密码 |
| 发件人地址 | 邮件 `From:` 头 |
| 收件人列表 | 英文逗号分隔 |
| 使用 TLS / StartTLS | 按 SMTP 提供方要求选择 |
## Webhook
向任意 URL 发送 JSON POST请求体结构
```json
{
"event": "backup_result",
"task": {"id": 1, "name": "web-files", "type": "file"},
"record": {"id": 42, "status": "success", "fileSize": 1048576, "durationSeconds": 12},
"error": ""
}
```
适合自定义场景Slack incoming webhook、PagerDuty、自建 API 等。
## Telegram
| 字段 | 说明 |
|------|------|
| Bot Token | 在 [@BotFather](https://t.me/BotFather) 创建 |
| Chat ID | 数字型,可通过 `/start` 后调 Bot 的 `getUpdates` 获取 |
## 事件规则
每个通知配置可以指定触发范围:
- **仅成功** — 正常运行时静默
- **仅失败** — 适合高噪敏感通道
- **全部** — 初始化配置时用于验证链路