mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
65 lines
1.0 KiB
Markdown
65 lines
1.0 KiB
Markdown
# Commands and Scripts
|
|
|
|
## Server
|
|
|
|
```bash
|
|
cd openflare_server
|
|
export SESSION_SECRET='replace-with-random-string'
|
|
export SQLITE_PATH='./openflare.db'
|
|
export LOG_LEVEL='info'
|
|
go run .
|
|
```
|
|
|
|
```bash
|
|
go run . --port 3000 --log-dir ./logs
|
|
```
|
|
|
|
```bash
|
|
cd openflare_server
|
|
GOCACHE=/tmp/openflare-go-cache go test ./...
|
|
```
|
|
|
|
## Frontend
|
|
|
|
```bash
|
|
cd openflare_server/web
|
|
pnpm install
|
|
pnpm dev
|
|
```
|
|
|
|
```bash
|
|
cd openflare_server/web
|
|
pnpm build
|
|
```
|
|
|
|
## Agent
|
|
|
|
```bash
|
|
cd openflare_agent
|
|
go run ./cmd/agent -config /path/to/agent.json
|
|
```
|
|
|
|
```bash
|
|
cd openflare_agent
|
|
go build -o openflare-agent ./cmd/agent
|
|
```
|
|
|
|
```bash
|
|
cd openflare_agent
|
|
GOCACHE=/tmp/openflare-go-cache go test ./...
|
|
```
|
|
|
|
## Install Agent
|
|
|
|
```bash
|
|
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/install-agent.sh | bash -s -- \
|
|
--server-url http://your-server:3000 \
|
|
--agent-token YOUR_AGENT_TOKEN
|
|
```
|
|
|
|
## Uninstall Agent
|
|
|
|
```bash
|
|
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/uninstall-agent.sh | bash
|
|
```
|