[新增] 同步更新英文版文档

This commit is contained in:
ryan
2026-05-28 23:00:48 +08:00
parent 95d58eb724
commit b0117b7c84
11 changed files with 870 additions and 121 deletions
+53
View File
@@ -1,7 +1,11 @@
# Commands and Scripts
You will learn: Common commands for starting, building, testing, installing, and uninstalling the OpenFlare Server, management console frontend, Agent, Swagger, and documentation site.
## Server
Start from source:
```bash
cd openflare_server
export SESSION_SECRET='replace-with-random-string'
@@ -10,10 +14,14 @@ export LOG_LEVEL='info'
go run .
```
Specify listening port and log directory:
```bash
go run . --port 3000 --log-dir ./logs
```
Test:
```bash
cd openflare_server
GOCACHE=/tmp/openflare-go-cache go test ./...
@@ -21,29 +29,48 @@ GOCACHE=/tmp/openflare-go-cache go test ./...
## Frontend
Development:
```bash
cd openflare_server/web
pnpm install
pnpm dev
```
Build static artifacts:
```bash
cd openflare_server/web
pnpm build
```
Checks:
```bash
cd openflare_server/web
pnpm lint
pnpm typecheck
pnpm test
```
## Agent
Run from source:
```bash
cd openflare_agent
go run ./cmd/agent -config /path/to/agent.json
```
Compile:
```bash
cd openflare_agent
go build -o openflare-agent ./cmd/agent
```
Test:
```bash
cd openflare_agent
GOCACHE=/tmp/openflare-go-cache go test ./...
@@ -62,3 +89,29 @@ curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/inst
```bash
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/uninstall-agent.sh | bash
```
## Swagger
Regenerate Swagger documentation:
```bash
go install github.com/swaggo/swag/cmd/swag@v1.16.4
cd openflare_server
swag init -g main.go -o docs
```
## Docs
Local preview:
```bash
cd docs
pnpm dev
```
Build:
```bash
cd docs
pnpm build
```