feat: add debug log stream support

This commit is contained in:
2026-04-02 23:27:46 +08:00
parent f1c16e89f0
commit 9ec25b94f1
15 changed files with 624 additions and 15 deletions

View File

@@ -12,16 +12,49 @@
### 拉取代码
```shell
git clone --recurse-submodules https://gitea.kmux.cn/zhilv/wk-backend
git clone --recurse-submodules https://gitea.kmux.cn/cqcst/wk-backend
```
更新已有仓库时,建议带上 submodule 一起同步:
```shell
git pull --recurse-submodules
task fe:sync
```
如果前端仓库 `wk-frontend` 有新提交,需要把主仓库里的 submodule 指针更新到最新:
```shell
task fe:update
git status
```
### 代码构建
**推荐使用 [Taskfile](https://taskfile.dev/) 进行项目构建**
调试模式下可通过环境变量开启本地代理/跳过 SSL 校验:
```shell
CKWK_DEBUG_PROXY=http://127.0.0.1:9000
CKWK_DEBUG_SKIP_SSL_VERIFY=true
```
`release` 模式下会自动忽略这两个调试开关。
调试日志 WS 仅在 `debug` 模式开启,连接地址:
```shell
ws://127.0.0.1:8080/api/debug/ws/logs
```
服务端会保留最近 1000 条内存日志,并持续推送新的入站 HTTP、出站请求和应用日志。
- 支持命令
```
* fe:sync: 同步前端 submodule 🔁
* fe:update: 拉取前端 submodule 最新提交 ⬆️
* build: 构建前端 + 后端 📦
* dev: 同时启动前后端(开发模式)🔥
* rebuild: 清理并重建 🔁
@@ -39,7 +72,7 @@ git clone --recurse-submodules https://gitea.kmux.cn/zhilv/wk-backend
### 项目结构
- 目录
**前端项目地址: [wk-frontend](https://gitea.kmux.cn/zhilv/wk-frontend)**
**前端项目地址: [wk-frontend](https://gitea.kmux.cn/cqcst/wk-frontend)**
```
.
├── Taskfile.yml # taskfile 命令定义