sky/.env.example
root 6ed55254a0 chore: initial import of sky project
Go + PostgreSQL + Valkey backend (cmd/internal/migrations),
uni-app mobile frontend, PC web (web/), admin console (admin/),
Android WebView container (android_project/).
Build artifacts, node_modules, local env and debug screenshots excluded.
2026-11-09 22:22:44 +08:00

48 lines
1.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 复制为 .env 后按需修改。不要提交真实密钥。
# ── 运行环境 ──
APP_ENV=dev
HTTP_ADDR=:8080
# ── PostgreSQL ──
# 生产环境应指向 PgBouncer(transaction pooling),而非 PG 直连
PG_DSN=postgres://app:change-me@127.0.0.1:55432/article_platform?sslmode=disable
# 每副本连接数上限。总连接 = 副本数 × PG_MAX_CONNS,必须小于 PG 的 max_connections
PG_MAX_CONNS=20
# ── Valkey / Redis ──
# 注意:不要用 KeyDB(已停止维护)。Valkey 9 与 redis 协议兼容,客户端无需改动
VALKEY_ADDR=127.0.0.1:56379
VALKEY_PASSWORD=
VALKEY_DB=0
# ── 认证 ──
# 生产环境必须设置,且至少 32 字节。缺失时服务启动直接失败(这是有意设计,
# 随机密钥会导致重启后所有登录态失效)
JWT_SECRET=
JWT_TTL_HOURS=720
SESSION_RENEW_LAST_HOURS=168
# ── 限流 ──
RATE_ANON_PER_MIN=120
RATE_USER_PER_MIN=600
# ── 对象存储(S3 兼容:阿里云 OSS / 腾讯云 COS / MinIO)──
S3_ENDPOINT=
S3_REGION=us-east-1
S3_BUCKET=article-media
S3_ACCESS_KEY=
S3_SECRET_KEY=
# CDN 域名,用于拼接最终访问 URL
S3_PUBLIC_BASE=
# ── 可观测性 ──
# 留空则 span 打到 stdout(本地开发);生产填 otel-collector:4317
OTLP_ENDPOINT=
# 生产高流量建议 0.1
TRACE_SAMPLE_RATIO=1.0
# ── CORS ──
# 逗号分隔的来源白名单。开发模式额外放行本机任意端口
CORS_ORIGINS=http://127.0.0.1:3100,http://localhost:3100