Files
rill/internal/config/config.default.yaml
T
kevin b683fb293e 增加注册登录与鉴权,并按功能拆分 internal 模块
- 新增 /api/auth/register、/api/auth/login,JWT 签发与 Bearer 鉴权中间件
- notes 需登录,users/user-groups 仅管理员;auth 配置项随版本 1→2 自动补全
- internal/api 仅保留路由装配,拆分为 auth/user/usergroup/note/httpx/testutil
- 同步更新 Swagger 文档与前端注册接口路径
2026-09-20 02:03:06 +08:00

50 lines
1.5 KiB
YAML

# rill 服务端配置
version: 2 # 配置版本,用于启动时自动补全缺失项,请勿手动修改
server:
host: "0.0.0.0" # 监听地址,0.0.0.0 表示所有网卡
port: 8080 #web 服务端口,为 0 则不使用 tcp html
sock: "web.sock" # unix socket 文件路径,留空表示不启用
mode: release # gin 运行模式: debug / release / test
log:
level: info # 日志级别: debug / info / warn / error
access_log: true # 是否输出 HTTP 访问日志
static:
dir: "./dist" # 前端构建产物目录
api:
prefix: "/api" # API 路由前缀
cors:
enabled: true
allow_origins:
- "http://localhost:5173" # Vite 开发服务器地址
allow_methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
allow_headers: ["Origin", "Content-Type", "Accept", "Authorization"]
allow_credentials: false
max_age: "12h"
# 认证
auth:
secret: "" # JWT 签名密钥,留空则每次启动生成临时密钥(重启后 token 失效),生产环境请务必配置
token_ttl: "24h" # 登录凭证有效期
# 数据库
database:
driver: sqlite3 # sqlite3 / mysql
connect_timeout: "10s" # 建立连接超时
sqlite:
path: "./data/rill.db"
mysql:
host: "127.0.0.1"
port: 3306
user: "root"
password: "" # 允许留空
database: "rill"
charset: "utf8mb4"
max_open_conns: 10
max_idle_conns: 5
conn_max_lifetime: "1h"