mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 14:06:36 +08:00
1.2 KiB
1.2 KiB
Run Server
OpenFlare Server is the Gin + GORM control plane. It owns the web console, management API, Agent API, configuration rendering, release publishing, and state storage.
Requirements
| Item | Requirement |
|---|---|
| Go | 1.25+ |
| Node.js | 18+ |
| Database | Writable SQLite path or reachable PostgreSQL instance |
Set SESSION_SECRET explicitly in production and prefer PostgreSQL.
Build Frontend
cd openflare_server/web
corepack enable
pnpm install
pnpm build
Run from Source
cd openflare_server
export SESSION_SECRET='replace-with-random-string'
export SQLITE_PATH='./openflare.db'
export LOG_LEVEL='info'
# Optional PostgreSQL:
# export DSN='postgres://openflare:secret@127.0.0.1:5432/openflare?sslmode=disable'
go run .
The default port is 3000.
Swagger
After logging in, open:
http://localhost:3000/swagger/index.html
Regenerate Swagger files locally:
go install github.com/swaggo/swag/cmd/swag@v1.16.4
cd openflare_server
swag init -g main.go -o docs