Files
fanqie-go/.env.example
T
chenxin cf16c37f32 ✨ feat(cache): 新增 Redis 缓存与 PostgreSQL 后端支持
- 新增 cache.redis 配置(独立 host/port/password/db 字段),启用后正文缓存与音频代理缓存走 Redis,键前缀 fq:cache:/fq:audio:,TTL 自动过期
- 新增 cache.backend: sqlite|postgres 切换,PG 连接用 net/url 构造 DSN,密码特殊字符自动转义;SQLite 顺手启用 WAL 与 busy_timeout
- SQL 方言收敛:q() 将 ? 占位符转换为 $n、INSERT OR IGNORE 与查询再插入统一为 ON CONFLICT、LastInsertId 改为 RETURNING id、建表 DDL 双版本分派
- PG 下 VACUUM 走 autovacuum 说明、状态页大小改查 pg_database_size
- 修复 PG 下设备保存失败:is_valid 列为 INTEGER,写入点补 boolToInt 转换
- 新增 .env 支持:敏感配置(密码/主机/访问密钥)由环境变量覆盖 config.yaml,.env 进 gitignore,仓库附 .env.example 模板
- 删除死代码 InitDevicePoolTable;新增 rebind_test.go 单测
- 更新 README 与 config.yaml 配置示例,go.mod 新增 go-redis/v9 与 pgx/v5 依赖
2026-09-29 20:22:52 +08:00

16 lines
474 B
Bash
Raw 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 并填入真实值(.env 已被 gitignore,不会提交)
# 环境变量优先于 config.yaml 中的对应配置
# 服务访问密钥(/status、/self-info 等端点的鉴权)
# FQ_SERVER_ACCESS_KEY=your-access-key
# PostgreSQL 连接(覆盖 cache.postgres.*)
FQ_PG_HOST=127.0.0.1
FQ_PG_USER=postgres
FQ_PG_PASSWORD=
FQ_PG_DATABASE=fanqie
# Redis 连接(覆盖 cache.redis.*)
FQ_REDIS_HOST=127.0.0.1
FQ_REDIS_PASSWORD=