merge: sync upstream wavelet/main (clean contracts DTOs and configs)

This commit is contained in:
ryan
2026-09-03 10:25:52 +08:00
10 changed files with 195 additions and 200 deletions
@@ -1,32 +1,33 @@
# wavelet — Full-Stack Boilerplate Config
# openflare — Platform Config
# Copy this file to config.yaml and fill in your values.
# Fields marked with <...> are required; others have sensible defaults.
# ─── Application ────────────────────────────────────────────────────────────────
app:
app_name: "wavelet"
env: "development" # development | testing | production
addr: ":8000"
app_name: "openflare"
env: "production" # development | testing | production
addr: ":3000"
node_id: 1 # Snowflake node ID (0-1023). Must be unique per instance.
graceful_shutdown_timeout: 30
session_cookie_name: "wavelet_session_id" # Change to something unique before deploy
session_cookie_name: "openflare_session_id" # Change to something unique before deploy
session_secret: "<uniq-random-string>" # Cannot be changed after first start
session_domain: "" # e.g. ".yourdomain.com"
session_age: 86400 # Session lifetime in seconds (default: 24h)
session_secure: false
session_http_only: false
api_prefix: "/api"
redirect_trailing_slash: false
# ─── PostgreSQL ─────────────────────────────────────────────────────────────────
# Supports Standalone and Primary-Replica (read/write split) modes.
database:
enabled: true
sqlite_path: "wavelet.db" # PostgreSQL 禁用时使用此 SQLite 文件路径
sqlite_path: "openflare.db" # PostgreSQL 禁用时使用此 SQLite 文件路径
host: "127.0.0.1"
port: 5432
username: "postgres"
password: "postgres"
database: "wavelet"
username: "openflare"
password: "replace-with-strong-password"
database: "openflare"
max_idle_conn: 16
max_open_conn: 128
conn_max_lifetime: 1800
@@ -34,7 +35,7 @@ database:
log_level: "info" # error | warn | info | debug | silent;SQL 语句仅在 log.level=debug 时输出
ssl_mode: "disable"
time_zone: "UTC"
application_name: "wavelet-server"
application_name: "openflare-server"
prefer_simple_protocol: false
search_path: "public"
statement_cache_capacity: 256
@@ -58,7 +59,7 @@ redis:
db: 0 # Ignored in Cluster mode
cluster_mode: false # Set true to enable Cluster mode
master_name: "" # Set non-empty to enable Sentinel mode
key_prefix: "wavelet:"
key_prefix: "openflare:"
pool_size: 100
min_idle_conn: 10
dial_timeout: 5
@@ -96,19 +97,24 @@ worker:
# ─── OpenTelemetry Tracing ──────────────────────────────────────────────────────
otel:
sampling_rate: 0.0 # Trace sampling rate (0.0 – 1.0)
tracer_name: "github.com/Rain-kl/Wavelet" # Global tracer instrumentation name
tracer_name: "github.com/Rain-kl/OpenFlare" # Global tracer instrumentation name
# ─── ClickHouse (optional) ──────────────────────────────────────────────────────
# ─── ClickHouse (optional) ─────────────────────────────────────────────────────
# Analytics / observability OLAP store. Telemetry writes are best-effort (async batch).
# 默认关闭:缺失本配置块或 enabled: false 时不启用 ClickHouse,日志/指标由主库承担;
# 设置 CLICKHOUSE_HOST 或 CLICKHOUSE_ENABLED=true 可经环境变量启用。
clickhouse:
enabled: false
hosts:
- "127.0.0.1:9000"
- "127.0.0.1:9000" # compose 内应用可用 clickhouse:9000(经 CLICKHOUSE_HOST)
username: "default"
password: ""
database: "wavelet"
max_idle_conn: 10
max_open_conn: 100
password: "replace-with-clickhouse-password" # 与 .env / compose CLICKHOUSE_PASSWORD 一致
database: "openflare"
max_idle_conn: 8 # keep warm sockets low to save client + server RAM
max_open_conn: 16 # cap concurrent native sessions on modest CH boxes
conn_max_lifetime: 3600
dial_timeout: 5
block_buffer_size: 10
block_buffer_size: 32 # rows buffered per block; 32 is enough for our batch sizes
# Runtime client also enables async_insert (wait_for_async_insert=1, busy_timeout≈2s)
# in internal/infra/persistence/clickhouse.go — not configured via YAML.