Files

49 lines
1.7 KiB
Markdown
Raw Permalink 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.
# Bell
Bell 是独立部署的预警管理产品。本目录从冻结的 go-admin/go-admin-ui 完整源码派生;来源与裁剪证据见 `LICENSES/SOURCES.md`。
## 固定工具链
- Go `1.26.5`:`$env:GOTOOLCHAIN='go1.26.5'`
- Node `22.22.1`
- pnpm `9.15.1`:`corepack pnpm@9.15.1`
## 必需环境变量
```text
BELL_DATABASE_URL=<独立 PostgreSQL DSN>
BELL_JWT_SECRET=<至少 32 字符的独立随机值>
BELL_BOOTSTRAP_USERNAME=<仅首次迁移使用>
BELL_BOOTSTRAP_PASSWORD=<仅首次迁移使用,至少 8 字符>
```
可选 `BELL_HOST`、`BELL_PORT` 覆盖默认监听 `127.0.0.1:18090`。不要把这些值写入仓库。
## 迁移与启动
```powershell
Set-Location Bell/server
$env:GOTOOLCHAIN='go1.26.5'
go run . migrate -c config/settings.yml
go run . server -c config/settings.yml
```
前端:
```powershell
Set-Location Bell/ui
corepack pnpm@9.15.1 install --frozen-lockfile
corepack pnpm@9.15.1 dev
```
生产构建使用 `corepack pnpm@9.15.1 build:prod`。生产环境不会生成或接受仓库默认管理员、默认 JWT secret 或默认数据库连接串。
## Windows 交付与独立验收
- Windows 构建:`Bell\scripts\build\build-windows.bat`
- 包审计:`pwsh -NoProfile -File Bell\scripts\build\test-package.ps1 -PackageRoot Bell\dist\bell-windows-amd64`
- 隔离 E2E:`pwsh -NoProfile -File Bell\scripts\test-independent-e2e.ps1 -PreparedPackageRoot Bell\dist\bell-windows-amd64`
- 包内启动、检查和停止:`start-bell.bat`、`check-bell.bat -Running`、`stop-bell.bat`
完整配置、排错和验收标准见 `README-WINDOWS.md` 与 `ACCEPTANCE.md`。隔离 E2E 使用临时 PostgreSQL、随机端口和随机凭据,不启动或调用 Sense、Brain。