Files
Telegram-Panel/docker-compose.yml
T
meoacgxandClaude 7203c9091c feat(bot): 添加 Webhook 模式支持
- 新增 Webhook 端点 /api/bot/webhook/{token} 接收 Telegram 推送
- 新增 WebhookRegistrationService 启动时自动注册 Webhook
- 新增 TelegramBotApiClient.SetWebhookAsync/DeleteWebhookAsync/GetWebhookInfoAsync
- 新增 BotUpdateHub.InjectWebhookUpdateAsync/SubscribeWebhookAsync
- 新增 IBotRepository.GetByTokenAsync 用于 Webhook 验证
- 修复 Webhook 模式下仍启动轮询导致 409 冲突的问题
- 更新 docker-compose.yml 添加 Webhook 配置选项
- 更新 README.md 添加 Webhook 模式说明(生产环境推荐)

配置项:
- Telegram__WebhookEnabled: 启用 Webhook 模式
- Telegram__WebhookBaseUrl: Webhook 公网 HTTPS 地址
- Telegram__WebhookSecretToken: 验证密钥

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-02 16:15:11 +08:00

38 lines
1.4 KiB
YAML
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.
services:
telegram-panel:
build:
context: .
dockerfile: ${TP_DOCKERFILE:-Dockerfile}
container_name: telegram-panel
restart: unless-stopped
ports:
- "5000:5000"
volumes:
- ./docker-data:/data
environment:
ASPNETCORE_URLS: "http://+:5000"
DOTNET_ENVIRONMENT: "Production"
# SQLite 数据库(持久化到 ./docker-data)
ConnectionStrings__DefaultConnection: "Data Source=/data/telegram-panel.db"
# Sessions(持久化到 ./docker-data/sessions)
Telegram__SessionsPath: "/data/sessions"
# 后台登录凭据文件(持久化到 ./docker-data/admin_auth.json)
AdminAuth__CredentialsPath: "/data/admin_auth.json"
# 默认关闭,避免频繁调用 Telegram API;可在系统设置里开启并保存到 /data/appsettings.local.json
Sync__AutoSyncEnabled: "false"
# 默认关闭 bot 轮询自动同步(需要时可手动同步),使用Webhook建议开启
Telegram__BotAutoSyncEnabled: "true"
# ========== Webhook 模式配置 ==========
# 启用 Webhook 模式(启用后将使用 Webhook 替代轮询接收更新)
Telegram__WebhookEnabled: "false"
# Webhook 公网基础 URL(必须是 HTTPS,例如: https://your-domain.com)
Telegram__WebhookBaseUrl: ""
# Webhook 验证密钥(用于验证 Telegram 请求,建议使用随机字符串)
Telegram__WebhookSecretToken: ""