优化文档

This commit is contained in:
ryan
2026-05-09 18:07:35 +08:00
parent 797a15ae70
commit 2d6cc908f5
17 changed files with 763 additions and 1078 deletions
+1
View File
@@ -40,6 +40,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
items: [
{ text: 'Overview', link: '' },
{ text: 'Quick Start', link: 'quick-start' },
{ text: 'Deployment', link: 'deployment' },
{ text: 'Run Server', link: 'server' },
{ text: 'Connect Agent', link: 'agent' },
{ text: 'Publish First Site', link: 'first-site' },
+102
View File
@@ -0,0 +1,102 @@
# Deployment
This page summarizes the OpenFlare deployment baseline, integration flow, upgrade entry points, and Agent install scripts.
## Requirements
Server:
* Go 1.24+
* Node.js 18+
* Writable SQLite directory or reachable PostgreSQL instance
Agent:
* Go 1.24+
* Writable Agent data directory
* Local mode requires `openresty -t` and `openresty -s reload`
* Docker mode requires Docker access
## Docker Compose
PostgreSQL is recommended for production:
```yaml
services:
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: openflare
POSTGRES_USER: openflare
POSTGRES_PASSWORD: replace-with-strong-password
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U openflare -d openflare"]
interval: 10s
timeout: 5s
retries: 5
openflare:
image: ghcr.io/rain-kl/openflare:latest
container_name: openflare
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "3000:3000"
environment:
SESSION_SECRET: replace-with-random-string
SQLITE_PATH: /data/openflare.db
DSN: postgres://openflare:replace-with-strong-password@postgres:5432/openflare?sslmode=disable
GIN_MODE: release
LOG_LEVEL: info
volumes:
- openflare-data:/data
volumes:
postgres-data:
openflare-data:
```
```bash
docker compose up -d
```
Open `http://localhost:3000`. The default account is `root` / `123456`; change the password immediately.
## Agent Install
Using `discovery_token`:
```bash
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/install-agent.sh | bash -s -- \
--server-url http://your-server:3000 \
--discovery-token YOUR_DISCOVERY_TOKEN
```
Using node-specific `agent_token`:
```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
```
Supported options include `--server-url`, `--discovery-token`, `--agent-token`, `--install-dir`, `--repo`, and `--no-service`.
## Validation
1. Prepare `agent_token` or `discovery_token` in the console.
2. Start Agent and confirm the node is online.
3. Add an enabled reverse proxy site.
4. Publish and activate a new version.
5. Confirm Agent pulls, validates, reloads, and reports the result.
## Uninstall Agent
```bash
curl -fsSL https://raw.githubusercontent.com/Rain-kl/OpenFlare/main/scripts/uninstall-agent.sh | bash
```
+5 -4
View File
@@ -5,7 +5,8 @@ This section helps operators take OpenFlare from first boot to the first working
Suggested order:
1. [Quick Start](./quick-start.md): run Server with Docker Compose and complete the first login.
2. [Run Server](./server.md): learn source startup, frontend build, and Swagger access.
3. [Connect Agent](./agent.md): use `agent_token` or `discovery_token` to bring a node online.
4. [Publish First Site](./first-site.md): create a site configuration, publish it, and verify node application.
5. [Upgrade and Maintenance](./upgrade.md): understand upgrade, uninstall, validation, and maintenance entry points.
2. [Deployment](./deployment.md): review production deployment, Agent install, validation, and upgrade.
3. [Run Server](./server.md): learn source startup, frontend build, and Swagger access.
4. [Connect Agent](./agent.md): use `agent_token` or `discovery_token` to bring a node online.
5. [Publish First Site](./first-site.md): create a site configuration, publish it, and verify node application.
6. [Upgrade and Maintenance](./upgrade.md): understand upgrade, uninstall, validation, and maintenance entry points.