docs: 补齐 common/file/process/shell 四个既有包的 README
- 每包定位/路由表/用法与注意事项(鉴权告诫、录制审计、防误杀语义) - 至此 remote-core 全部包 README 覆盖
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# shell
|
||||
|
||||
被控端 Web 终端(自 remote-backend-server internal/handlers/shell 移植,去 DB
|
||||
依赖):WebSocket 交互式终端(Windows ConPTY / Unix pty)+ asciinema 会话录制。
|
||||
|
||||
## 路由
|
||||
|
||||
```go
|
||||
import "git.zeroonesoft.cn/golib/remote-core/shell"
|
||||
|
||||
shell.RegisterRoutersWebShell(r *gin.RouterGroup, recDir)
|
||||
```
|
||||
|
||||
| 方法 | 路径 | 说明 |
|
||||
|---|---|---|
|
||||
| GET | `/web/shell` | WebSocket 升级,启动终端(Windows 优先 powershell.exe,缺失回退 cmd.exe;Unix 为 bash) |
|
||||
| GET | `/web/shell/record` | 录制文件列表 |
|
||||
|
||||
## 协议
|
||||
|
||||
WebSocket JSON 信封 `OpDataType{op, data}`:输入/输出流与 `resize`(`ResizeDataType`
|
||||
调整行列)走同一连接。
|
||||
|
||||
## 注意
|
||||
|
||||
- 录制为 asciinema 格式,落盘 `recDir`,可用 asciinema 播放器回放审计。
|
||||
- `CheckOrigin` 放开所有来源(跨域),接入公网必须由网关侧补鉴权。
|
||||
Reference in New Issue
Block a user