Files
opsxshell/README.md
T

86 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OpsXShell
原生运维**桌面**终端:SSH、SFTP、端口转发、RDP/VNC、串口、本地终端。短路径好用,不做审计/审批/堡垒机。
开发规范:[AGENTS.md](./AGENTS.md)(短入口 [CLAUDE.md](./CLAUDE.md))。授权走 `opsx-licence`。
产品形态(对齐 opsxdb / opsxapi):
```text
浏览器 → 官网 + 文档(Gin :8789)
操作 → 桌面 Tauri(./run.sh gui)
```
官网与用户文档为独立静态站(`homepage/` 源 → `tools/homepage-build` 生成 dist,可部署自有域名;本地 `:8789` 预览)。Gin **不做**桌面操作后端。
需要 Node.js 22 LTS(建议 22.12+)、npm 9+、Rust 1.89+、Go 1.22+(跑官网时)。macOS 打包还要 Xcode Command Line Tools。
## 本地调试
```bash
./run.sh # = web:官网 + docs → http://127.0.0.1:8789/
./run.sh web # 同上
./run.sh gui # 桌面操作入口(默认顺带起 Gin)
./run.sh stop | status
```
DevTools:`Cmd+Option+I` 或 `F12`。桌面应用日志:
```bash
tail -f "$HOME/Library/Application Support/opsxshell/logs/opsxshell.log"
```
只要前端、不要原生窗:`npm run dev:ui`(默认 `http://127.0.0.1:5175`,**不是**产品入口)。
## 测试
```bash
npm run test:patrol # 改功能后优先跑
npm run acceptance:quick
npm run acceptance:full
```
## 开发机卫生
`./run.sh gui` 启动前会自动做**轻量清**(推出残留 Opsx/OpsX DMG 卷、注销非 `/Applications` 且非本次启动路径的幽灵登记;不删 `target`、不重置 Launchpad)。
若 Launchpad / Spotlight 仍堆出重复图标,手动跑全量:
```bash
~/devops/scripts/clean-opsx-apps.sh
# 或:./run.sh clean-apps
# 可选:--delete-target-apps --reset-launchpad
```
## 打包
必须在目标系统上打:macOS 包在 Mac 打,Windows 包在 Windows 打。
```bash
./scripts/build.sh # 当前平台;产物在 src-tauri/target/<triple>/release/bundle/
./scripts/build.sh mac-arm64 --quick # 本机重复打包
./scripts/macos-notarize.sh # 新 DMG:Apple 公证 + staple
```
Windows:`scripts\build.bat win-x64`
本机有 gitignore 的 `src-tauri/tauri.signing.conf.json` 时,`build.sh` 会签 Developer ID。没这份配置就是 ad-hoc,别人电脑会 Gatekeeper 拦截。新打的 DMG **必须再公证**。签名配置、公证与发版细节见 [发布文档](./docs/release.md#签名公证和自动更新)。
Gitee Release(tag 推上去之后):
```bash
./scripts/release.py v2.1.1 --dry-run
./scripts/release.py v2.1.1
```
发版安装包也可放到 `server/download/` 供本地 Gin `/download/` 挂载(勿把大 DMG 提交进 Git)。
## 文档
- 用户文档站(本地):`./run.sh web` → http://127.0.0.1:8789/docs
- [使用指南](docs/user-guide.md)(开发向)
- [架构](docs/architecture.md) · [验收](docs/testing-acceptance.md) · [发布](docs/release.md)
- [路线图](ROADMAP.md) · [当前任务](TASKS.md)
MIT,见 [LICENSE](./LICENSE)。