Feature(Go): Web auth, WebSocket signaling and live device list (Phase 3)
This commit is contained in:
@@ -25,9 +25,15 @@ server/go/
|
||||
│ └── pool.go # Goroutine 工作池
|
||||
├── logger/
|
||||
│ └── logger.go # 日志模块 (基于 zerolog)
|
||||
├── hub/
|
||||
│ └── hub.go # 在线设备注册表 + 事件订阅
|
||||
├── wsauth/
|
||||
│ └── wsauth.go # Web 鉴权 (challenge-response + 不透明 token)
|
||||
├── web/
|
||||
│ ├── embed.go # //go:embed 嵌入 HTML/xterm.js 等 web 资源
|
||||
│ ├── server.go # HTTP server (静态页面 + 后续 WS 信令)
|
||||
│ ├── server.go # HTTP server (静态页面 + REST + WS 路由)
|
||||
│ ├── ws.go # WebSocket 连接生命周期
|
||||
│ ├── ws_handlers.go # WS 消息分发与处理
|
||||
│ └── assets/
|
||||
│ ├── index.html # 从 ../../web/index.html sync 而来 (gitignored)
|
||||
│ └── static/ # 第三方 xterm.js 资源 (checked in)
|
||||
@@ -109,9 +115,10 @@ VSCode F5 调试时由 `sync-web-assets` preLaunchTask 自动同步。
|
||||
### 环境变量
|
||||
|
||||
| 变量 | 说明 | 示例 |
|
||||
|------|------|------|
|
||||
| ---- | ---- | ---- |
|
||||
| `YAMA_PWDHASH` | 密码的 SHA256 哈希值 (64位十六进制) | `61f04dd6...` |
|
||||
| `YAMA_PWD` | 超级密码,用于 HMAC 签名验证 | `your_super_password` |
|
||||
| `YAMA_PWD` | 超级密码,用于 HMAC 签名验证;也作为 Web admin 密码的默认来源 | `your_super_password` |
|
||||
| `YAMA_WEB_ADMIN_PASS` | Web UI 的 admin 密码(明文);优先于 `YAMA_PWD`。两者都未设置时 Web 登录禁用 | `your_admin_password` |
|
||||
|
||||
```bash
|
||||
# Linux/macOS
|
||||
|
||||
Reference in New Issue
Block a user