d0be2fdcf1
使 deploy-production.sh 可读本机 secrets 并在非 docker 组用户下用 sudo 识别 1Panel 栈;修复 security_probe_external.sh 的 curl shift 误用与 WebSocket 自动 venv。
55 lines
1.9 KiB
Markdown
55 lines
1.9 KiB
Markdown
# Linux 开发路径约定(SSOT)
|
||
|
||
> **生效日期**: 2026-06-04
|
||
> 取代各 handoff 文档中的 `C:\Users\...` / `/mnt/c/...` 示例。
|
||
|
||
## 工作区
|
||
|
||
| 变量 | 示例 |
|
||
|------|------|
|
||
| `NEXUS_ROOT` | `~/Nexus` 或 `/home/you/Nexus` |
|
||
| Git 克隆 | `git clone http://66.154.115.8:3000/admin/Nexus.git "$NEXUS_ROOT"`(匿名,无需令牌) |
|
||
|
||
### Git push
|
||
|
||
- `git clone` / `git pull`:公共仓库可匿名。
|
||
- `git push`:`bash scripts/git-push.sh`(读取 `deploy/nexus-1panel.secrets.sh` 中的 `NEXUS_GITEA_TOKEN`,即 admin 密码;**该文件不入 git**)。
|
||
- 应用密钥仍在 `.env`,与 Gitea 无关。
|
||
|
||
## SSH / 部署
|
||
|
||
| 用途 | Linux |
|
||
|------|--------|
|
||
| SSH 目标 | `azureuser@20.24.218.235`(生产 VPS) |
|
||
| 私钥 | 本机路径写在 `deploy/nexus-1panel.secrets.sh` 的 `NEXUS_SSH_KEY`(**不入 git**) |
|
||
| 一键部署 | `bash deploy/pre_deploy_check.sh && bash deploy/deploy-production.sh`(自动 source secrets) |
|
||
| 生产目录 | `/opt/nexus`(Docker)或 `/www/wwwroot/api.synaglobal.vip/`(Supervisor) |
|
||
|
||
```bash
|
||
# secrets 已配置时无需 export;否则:
|
||
# export NEXUS_SSH=azureuser@20.24.218.235
|
||
# export NEXUS_SSH_KEY='/path/to/nz-admin.pem'
|
||
bash deploy/deploy-production.sh
|
||
```
|
||
|
||
## Cursor MCP
|
||
|
||
- MySQL:`scripts/linux_mcp_mysql.sh`(见 `docs/project/mysql-mcp-setup.md` §4)
|
||
- 本地验证:`bash scripts/local_verify.sh`(见 `docs/project/local-integration-test.md`)
|
||
- **勿**在 `mcp.json` 使用 `wsl` + Windows 路径(已废弃)
|
||
|
||
## 历史文档
|
||
|
||
`docs/handoff-2026-05-31.md`、`AI-HANDOFF-2026-05-23.md` 等保留 Windows 示例作归档;**以本文 + `AI-HANDOFF-2026-06-03.md` 为准**。
|
||
|
||
## 本地验收账号
|
||
|
||
```bash
|
||
# .env(不入 git)
|
||
NEXUS_TEST_ADMIN_USER=admin
|
||
NEXUS_TEST_ADMIN_PASSWORD='你的本地密码'
|
||
|
||
python3 scripts/seed_local_admin.py # 仅空库 + 127.0.0.1
|
||
cd frontend && NEXUS_E2E_BASE=http://127.0.0.1:8600 npm run test:e2e
|
||
```
|