Commands & Scripts
You will learn: common start, build, test, install, and uninstall commands for the OpenFlare Server, admin frontend, Agent, Relay, OpenFlared, Swagger, and the docs site.
All commands run at the repo root unless noted otherwise.
Server
Source startup:
cp config.example.yaml config.yaml
go run main.go allSplit processes:
go run main.go api # HTTP API only
go run main.go worker # Asynq Worker only
go run main.go scheduler # scheduled tasks onlyBuild the binary:
make build-backend
# output: bin/openflare-serverTests:
GOCACHE=/tmp/openflare-go-cache go test ./...Quality gate:
make code-checkAuto-format backend Go source (organize imports) and frontend source:
make formatThis command uses goimports to organize backend Go imports and the repo-pinned Prettier version to format frontend/ source; build artifacts, dependencies, public static assets, and lock files are ignored.
Frontend
Dev:
cd frontend
pnpm install
pnpm devBuild the embedded artifact (hosted by the Go Server):
cd frontend
pnpm build:embed
# or at repo root: make build-embeddedChecks:
cd frontend
pnpm lint
pnpm tsc --noEmit --jsx preserve
pnpm check:i18nAgent
Source run:
go run ./cmd/agent -config /path/to/agent.jsonBuild:
make build-agent
# or: go build -o bin/openflare-agent ./cmd/agentTests:
GOCACHE=/tmp/openflare-go-cache go test ./internal/apps/agent/...Relay
Source run:
go run ./cmd/relay -config /path/to/relay.jsonBuild:
make build-relay
# or: go build -o bin/openflare-relay ./cmd/relayOpenFlared (Tunnel client)
Source run:
go run ./cmd/flared -config /path/to/flared.jsonBuild:
make build-flared
# or: go build -o bin/flared ./cmd/flaredInstall Agent
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_TOKENUninstall Agent
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/uninstall-agent.sh | bashSwagger
Regenerate the Swagger docs:
make swaggerAccess: http://localhost:3000/api/swagger/index.html (default api_prefix /api; only mounted in non-production)
Docs
Local preview:
cd docs
pnpm devBuild:
cd docs
pnpm build