# rill 服务端配置 version: 3 # 配置版本,用于启动时自动补全缺失项,请勿手动修改 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 trusted_proxies: [] # 可信代理/CDN 回源网段(IP 或 CIDR),仅这些来源的转发头会被采信;留空表示不信任任何代理 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"