mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
docs(worker): align guides with runtime behavior
Synchronize both language guides, API references and examples with the implemented authorization, storage and delivery behavior. Document migration requirements and accepted operational limits.
This commit is contained in:
1 parent
a62044f359
commit
5fcb129170
47 files changed
+938
-660
No files matched your search
@@ -33,12 +33,12 @@ GITHUB_CLIENT_ID=your-client-id
|
||||
GITHUB_CLIENT_SECRET=your-client-secret
|
||||
DISCORD_TOKEN=your-bot-token
|
||||
DISCORD_PUBLIC_KEY=your-public-key
|
||||
ADMIN_USER_IDS=your-github-id,your-github-login
|
||||
ADMIN_USER_IDS=your-github-id
|
||||
BASE_URL=http://localhost:8787
|
||||
```
|
||||
|
||||
::: tip
|
||||
`GITHUB_APP_ID` / `GITHUB_PRIVATE_KEY` 为可选,仅用于 App 安装流程解析安装所属账号的登录名(OAuth 流程只需要 Client ID/Secret)。目标频道在 Web UI 中按路由设置,因此不需要 `DISCORD_CHANNEL_ID`。若要在本地启用 `/gh` 命令,请在开发者门户复制 **Public Key** 填入 `DISCORD_PUBLIC_KEY`,并把 Interactions Endpoint URL 设为 `http://localhost:8787/discord/interactions`。
|
||||
`GITHUB_APP_ID` / `GITHUB_PRIVATE_KEY` 只在 GitHub App 安装流程与 API 增强中需要:没有它们时,安装流程无法核实登录用户是否管理该安装,只有超级管理员能绑定安装(OAuth 流程本身只需要 Client ID/Secret)。目标频道在 Web UI 中按路由设置,因此不需要 `DISCORD_CHANNEL_ID`。若要在本地启用 `/gh` 命令,请在开发者门户复制 **Public Key** 填入 `DISCORD_PUBLIC_KEY`,并把 Interactions Endpoint URL 设为 `http://localhost:8787/discord/interactions`。
|
||||
:::
|
||||
|
||||
::: warning
|
||||
@@ -48,10 +48,11 @@ BASE_URL=http://localhost:8787
|
||||
### 2. 启动开发服务器
|
||||
|
||||
```bash
|
||||
bun run dev
|
||||
bun run db:migrate # 首次运行:将 D1 迁移应用到本地数据库
|
||||
bun run cf:dev # 先构建,再用 wrangler dev(Miniflare)运行 worker
|
||||
```
|
||||
|
||||
这将在 `http://localhost:8787` 启动本地 Miniflare 环境。
|
||||
这会在 `http://localhost:8787` 运行构建后的 worker。未执行迁移时 worker 会拒绝服务(`D1 migrations are incomplete`)。开发界面时可改用 `bun run dev` 启动带 HMR 的 Nuxt 开发服务器(`http://localhost:3000`;其中队列消息没有消费者)。
|
||||
|
||||
### 3. 验证
|
||||
|
||||
@@ -66,7 +67,7 @@ curl http://localhost:8787/health
|
||||
| ---------------------- | ------------------------------------ |
|
||||
| `bun run dev` | 启动 Nuxt 开发服务器 (HMR) |
|
||||
| `bun run build` | 生产构建(cloudflare_module preset) |
|
||||
| `bun run deploy` | 部署到 Cloudflare |
|
||||
| `bun run deploy` | 应用待执行的 D1 迁移并部署 |
|
||||
| `bun run typecheck` | TypeScript 类型检查 |
|
||||
| `bun run lint` | ESLint |
|
||||
| `bun run lint:md` | Markdownlint |
|
||||
|
||||
Reference in new issue
Block a user