diff --git a/AGENTS.md b/AGENTS.md index e89dd93..925957c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -114,7 +114,7 @@ npm run lint # ESLint - **KV namespace**: Required binding for token/state/config/session storage - **D1 database**: Binding `DB` (database `webhooker`, id `214a0104-3235-47c0-b7bf-ddda95f3c8ac`) for `send_logs` + `discord_links` + `telegram_links` tables - **Discord**: `DISCORD_PUBLIC_KEY` (Interactions Endpoint signature verification, from Discord Developer Portal) and `DISCORD_APPLICATION_ID` (optional, auto-resolved via `GET /oauth2/applications/@me` when omitted) are required for interactions -- **Telegram**: `TELEGRAM_TOKEN` (Bot API token from BotFather) required for Telegram routes; `TELEGRAM_WEBHOOK_SECRET` (optional secret token for `POST /telegram/webhook` verification) +- **Telegram**: `TELEGRAM_TOKEN` (Bot API token from BotFather) required for Telegram routes; `TELEGRAM_WEBHOOK_SECRET` (optional secret token for `POST /telegram/webhook` verification); avatars are sent as a link-preview card via the built-in `GET /api/richheader` (overridable with `TELEGRAM_RICH_HEADER_HOST`) ## Deployment diff --git a/docs/api/overview.md b/docs/api/overview.md index 789ff09..f4de420 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -16,6 +16,7 @@ https://your-worker.workers.dev | `POST` | `/webhook` | HMAC signature | GitHub webhook ingestion | | `POST` | `/discord/interactions` | Ed25519 signature | Discord interactions (slash commands, buttons, modals) | | `POST` | `/telegram/webhook` | Secret token | Telegram updates (bot `/gh` commands) | +| `GET` | `/api/richheader` | None | Open Graph page for the Telegram avatar link-preview card | | `GET` | `/auth/github` | None | Start GitHub OAuth flow | | `GET` | `/auth/github/callback` | None | OAuth callback | | `DELETE` | `/auth/token/:userId` | None | Revoke user token | diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index ff577c0..536faa4 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -23,6 +23,7 @@ WebHooker requires several secrets to function. For local development, store the | `DISCORD_PUBLIC_KEY` | Discord application public key (Developer Portal) — required for interactions | Unset → interactions return `401` | | `DISCORD_APPLICATION_ID` | Discord application id; auto-resolved when omitted | Auto-resolved | | `TELEGRAM_WEBHOOK_SECRET` | Secret token for `POST /telegram/webhook` verification (X-Telegram-Bot-Api-Secret-Token) | Disabled (no verification) | +| `TELEGRAM_RICH_HEADER_HOST` | Base URL of an external rich-header service; when unset, the built-in `GET /api/richheader` serves the Telegram avatar card | Built-in `/api/richheader` | | `BASE_URL` | Public URL for OAuth callbacks | `http://localhost:8787` | | `ADMIN_USER_IDS` | Comma-separated GitHub user IDs (or logins) allowed to access the Web UI | Disabled | diff --git a/docs/zh/api/overview.md b/docs/zh/api/overview.md index 4d09cc9..8931844 100644 --- a/docs/zh/api/overview.md +++ b/docs/zh/api/overview.md @@ -16,6 +16,7 @@ https://your-worker.workers.dev | `POST` | `/webhook` | HMAC 签名 | GitHub webhook 接入 | | `POST` | `/discord/interactions` | Ed25519 签名 | Discord 交互(斜杠命令、按钮、modal) | | `POST` | `/telegram/webhook` | Secret token | Telegram 更新(bot `/gh` 命令) | +| `GET` | `/api/richheader` | 无 | 用于 Telegram 头像链接预览卡片的 Open Graph 页面 | | `GET` | `/auth/github` | 无 | 启动 GitHub OAuth 流程 | | `GET` | `/auth/github/callback` | 无 | OAuth 回调 | | `DELETE` | `/auth/token/:userId` | 无 | 撤销用户 Token | diff --git a/docs/zh/guide/configuration.md b/docs/zh/guide/configuration.md index f0b5d25..f53f926 100644 --- a/docs/zh/guide/configuration.md +++ b/docs/zh/guide/configuration.md @@ -25,6 +25,7 @@ WebHooker 需要多个密钥才能运行。本地开发时存储在 `.dev.vars` | `DISCORD_PUBLIC_KEY` | Discord 应用的公钥(开发者门户获取),交互功能必需 | 未设置时交互返回 401 | | `DISCORD_APPLICATION_ID` | Discord 应用 ID;省略时自动获取 | 自动获取 | | `TELEGRAM_WEBHOOK_SECRET` | `POST /telegram/webhook` 验签密钥(X-Telegram-Bot-Api-Secret-Token) | 未设置时不校验 | +| `TELEGRAM_RICH_HEADER_HOST` | 外部 rich-header 服务的基础 URL;未设置时使用内置的 `GET /api/richheader` 生成 Telegram 头像卡片 | 内置 `/api/richheader` | ## Web 控制台 diff --git a/src/lib/locales/en.ts b/src/lib/locales/en.ts index 7b56ec2..4c3178f 100644 --- a/src/lib/locales/en.ts +++ b/src/lib/locales/en.ts @@ -48,6 +48,8 @@ export const en = { status: "Status", run: "Run", job: "Job", + workflow: "Workflow", + context: "Context", duration: "Duration", type: "Type", name: "Name",