mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-28 05:46:36 +08:00
refactor(repo): consolidate openflare-server to root and move subprojects to internal/apps
- Merge all files inside openflare-server to the repository root directory. - Relocate agent, relay, and flared subprojects from internal/ to internal/apps/. - Combine docker-compose files and update build context paths to root. - Update GitHub workflows and Dockerfiles to refer to new directories and package names. - Rewrite Go package imports across all files. - Resolve database renew test race condition and clean up docs.
This commit is contained in:
+100
@@ -0,0 +1,100 @@
|
||||
# ──────────────────────────────────────────────────────────────────────────────
|
||||
# openflare — 环境变量配置模板
|
||||
# 复制此文件为 .env 并填入实际值: cp .env.example .env
|
||||
# 环境变量优先级高于 config.yaml / config.docker.yaml
|
||||
# ──────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
# ─── Docker Compose 服务端口映射 ───────────────────────────────────────────────
|
||||
APP_PORT=3000
|
||||
POSTGRES_PORT=5432
|
||||
REDIS_PORT=6379
|
||||
JAEGER_UI_PORT=16686
|
||||
JAEGER_OTLP_GRPC_PORT=4317
|
||||
JAEGER_OTLP_HTTP_PORT=4318
|
||||
|
||||
# ─── PostgreSQL 容器配置(仅 docker-compose 使用)────────────────────────────
|
||||
POSTGRES_DB=openflare
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=postgres
|
||||
|
||||
# ─── 时区 ─────────────────────────────────────────────────────────────────────
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
# ─── 应用配置 ──────────────────────────────────────────────────────────────────
|
||||
APP_NAME=openflare
|
||||
APP_ENV=production
|
||||
APP_ADDR=:3000
|
||||
APP_NODE_ID=1
|
||||
APP_API_PREFIX=/api
|
||||
# APP_GRACEFUL_SHUTDOWN_TIMEOUT=30
|
||||
APP_SESSION_COOKIE_NAME=openflare_session_id
|
||||
APP_SESSION_SECRET=change-me-to-a-random-string-in-production
|
||||
# APP_SESSION_DOMAIN=
|
||||
APP_SESSION_AGE=86400
|
||||
APP_SESSION_HTTP_ONLY=true
|
||||
# HTTPS 部署时设为 true,HTTP 环境必须为 false
|
||||
APP_SESSION_SECURE=true
|
||||
|
||||
# ─── 数据库 ────────────────────────────────────────────────────────────────────
|
||||
# 设置 DB_HOST 后自动启用 PostgreSQL,也可通过 DB_ENABLED 显式控制
|
||||
# DB_ENABLED=false 时使用 SQLite 作为后备数据库
|
||||
DB_ENABLED=true
|
||||
# SQLITE_PATH=./data/openflare.db
|
||||
DB_HOST=postgres
|
||||
DB_PORT=5432
|
||||
DB_USERNAME=postgres
|
||||
DB_PASSWORD=postgres
|
||||
DB_NAME=openflare
|
||||
DB_SSL_MODE=disable
|
||||
DB_TIMEZONE=Asia/Shanghai
|
||||
# DB_LOG_LEVEL=info
|
||||
# DB_MAX_IDLE_CONN=16
|
||||
# DB_MAX_OPEN_CONN=128
|
||||
|
||||
# ─── Redis ─────────────────────────────────────────────────────────────────────
|
||||
# 设置 REDIS_ADDR 后自动启用,也可通过 REDIS_ENABLED 显式控制
|
||||
REDIS_ENABLED=true
|
||||
REDIS_ADDR=redis:6379
|
||||
# REDIS_USERNAME=
|
||||
# REDIS_PASSWORD=
|
||||
# REDIS_DB=0
|
||||
REDIS_KEY_PREFIX=openflare:
|
||||
# REDIS_POOL_SIZE=100
|
||||
|
||||
# ─── ClickHouse(必需)────────────────────────────────────────────────────
|
||||
CLICKHOUSE_HOST=clickhouse:9000
|
||||
CLICKHOUSE_USERNAME=default
|
||||
CLICKHOUSE_PASSWORD=
|
||||
CLICKHOUSE_NAME=openflare
|
||||
|
||||
# ─── 日志 ──────────────────────────────────────────────────────────────────────
|
||||
LOG_LEVEL=info
|
||||
LOG_FORMAT=console
|
||||
LOG_OUTPUT=stdout
|
||||
|
||||
# ─── OpenTelemetry ─────────────────────────────────────────────────────────────
|
||||
# docker-compose 默认将 Trace 发往 Jaeger All-in-One: http://jaeger:4317
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
|
||||
OTEL_EXPORTER_OTLP_INSECURE=true
|
||||
# 设为 0 关闭 tracing;本地 Jaeger 调试建议设为 1.0
|
||||
OTEL_SAMPLING_RATE=1.0
|
||||
# 全局 Tracer 命名空间,默认为 github.com/Rain-kl/OpenFlare
|
||||
# OTEL_TRACER_NAME=github.com/Rain-kl/OpenFlare
|
||||
|
||||
# ─── S3 兼容存储(可选,默认关闭)──────────────────────────────────────────
|
||||
# S3_ENABLED=false
|
||||
# S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
|
||||
# S3_REGION=auto
|
||||
# S3_BUCKET=<bucket-name>
|
||||
# S3_ACCESS_KEY_ID=<access-key>
|
||||
# S3_SECRET_ACCESS_KEY=<secret-key>
|
||||
# S3_PATH_STYLE=false
|
||||
# S3_CDN_URL=
|
||||
|
||||
# ─── Worker ────────────────────────────────────────────────────────────────────
|
||||
# WORKER_CONCURRENCY=20
|
||||
# WORKER_STRICT_PRIORITY=false
|
||||
|
||||
# ─── Scheduler ─────────────────────────────────────────────────────────────────
|
||||
# 未设置时默认为 @daily
|
||||
# SCHEDULER_CLEANUP_CRON=0 */2 * * *
|
||||
Reference in New Issue
Block a user