Add safer web update flow, group-monitor AI controls, and monitor observability
This commit is contained in:
@@ -29,6 +29,16 @@ tg-watchbot 是一个轻量级 Python 服务,把 **Telegram 双向客服机器
|
||||
```
|
||||
## 更新日志
|
||||
|
||||
### 2026-05-22 更新
|
||||
|
||||
- TG 群监听功能增强:支持可视化配置监听规则、AI 总结参数与防刷屏策略。
|
||||
- 新增 `/update` 安全更新流程:显示本地/远端 commit、ahead/behind、工作区状态;仅允许 `ff-only` 更新。
|
||||
- 更新前若检测到本地未提交改动,会拒绝更新;避免覆盖本地代码。
|
||||
- 新增“回滚上次更新”按钮:更新前自动记录回滚点,可一键回滚并重启。
|
||||
- TG 群监听 AI 总结新增可视化高级控制:`ai_prompt`、`ai_min_interval_seconds`、`ai_dedupe_window_seconds`。
|
||||
- TG 群监听增加限频和去重窗口,降低重复推送与 AI 调用成本;AI 失败时仍会回退模板摘要。
|
||||
- 监控面板新增可观测状态:最近成功/失败时间、最近错误、耗时、推送数、连续失败次数。
|
||||
|
||||
### 2026-05-21 第二次更新
|
||||
|
||||
- Web 面板新增收件箱直接回复、用户管理、快捷回复、私聊广告拦截、监控推送历史、配置导入/导出。
|
||||
@@ -127,7 +137,6 @@ tg-watchbot 是一个轻量级 Python 服务,把 **Telegram 双向客服机器
|
||||
- 如果要把面板暴露到公网,建议使用 Cloudflare Access / 反代鉴权,并使用强密码。
|
||||
- Bot 只能给“已经主动私聊过 Bot 的用户”发消息,这是 Telegram Bot API 的限制。
|
||||
|
||||
<a id="manual-install"></a>
|
||||
## 快速开始
|
||||
|
||||
<a id="docker-install"></a>
|
||||
@@ -157,6 +166,9 @@ docker compose logs -f
|
||||
docker compose restart
|
||||
```
|
||||
|
||||
<a id="manual-install"></a>
|
||||
## 手动安装(Python)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/GongyiChuren/tg-watchbot.git tg-watchbot
|
||||
cd tg-watchbot
|
||||
@@ -321,11 +333,35 @@ group_monitors:
|
||||
exclude_keywords:
|
||||
- 求带
|
||||
notify_telegram: true
|
||||
summary_mode: template
|
||||
ai_base_url: ""
|
||||
ai_api_key: ""
|
||||
ai_model: gpt-4o-mini
|
||||
ai_interface: responses
|
||||
ai_temperature: 0.2
|
||||
ai_timeout_seconds: 30
|
||||
ai_prompt: ""
|
||||
ai_min_interval_seconds: 30
|
||||
ai_dedupe_window_seconds: 300
|
||||
```
|
||||
|
||||
- 命中 `keywords` 且未命中 `exclude_keywords` 时,会给管理员发送摘要。
|
||||
- `summary_mode` 支持:
|
||||
- `template`:固定模板摘要(默认)
|
||||
- `ai`:调用 AI 生成摘要(在 TG 群监听页面可视化配置)
|
||||
- `ai_prompt` 可填自定义总结提示词;留空使用内置默认提示词。
|
||||
- `ai_interface` 支持:
|
||||
- `responses`:`/v1/responses`
|
||||
- `chat`:`/v1/chat/completions`
|
||||
- `ai_min_interval_seconds`:同一个群监听最小推送间隔(防刷屏)
|
||||
- `ai_dedupe_window_seconds`:相同内容摘要去重窗口(防重复)
|
||||
- 机器人想收到群里普通消息,需要在 `@BotFather` 执行 `/setprivacy` 关闭隐私模式。
|
||||
|
||||
更新代码(`/update`)已支持安全检查:
|
||||
- 显示本地/远端 commit、ahead/behind、工作区是否干净
|
||||
- 只允许 `ff-only` 更新,工作区有未提交改动会拒绝更新
|
||||
- 自动记录上次更新前的回滚点,并支持一键回滚
|
||||
|
||||
监控数据自动清理示例:
|
||||
|
||||
```yaml
|
||||
|
||||
Reference in New Issue
Block a user