Files
mce/config.yaml
Victor_Jay e3853071d6 chore: 清理 JWT 向后兼容残留,移除全部死代码
- 删除 5 个空壳占位文件:auth_token.go/auth_parser.go/repository.go(middleware)/token_service.go/provider.go
- 移除 Config.JWT 字段、JWTConfig 结构体、JWT_SECRET 环境变量绑定
- 移除 config.yaml 中的 jwt 配置段
- 移除 model.User.TokenVersion 字段(session DestroyByUID 替代)
- 移除 service/repository.go 中已废弃的 userTokenStore 接口
2026-05-30 23:42:27 +08:00

57 lines
1.8 KiB
YAML
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.

# MetaZone.FAN 默认配置
# 敏感值通过环境变量或 .env 覆盖
server:
port: 8080
mode: debug # debug | release | test
database:
host: 127.0.0.1
port: 5432
user: metazone
password: "" # 敏感值由 .env 注入
dbname: metalab_dev
sslmode: disable
# 会话配置(服务端 Session滑动窗口续期
# 每次请求自动续期,解决"记住我"掉线问题
session:
idle_timeout: 1440 # 不记住我:空闲超时(分钟),默认 1440 = 24 小时
remember_timeout: 43200 # 记住我:空闲超时(分钟),默认 43200 = 30 天
cleanup_interval: 300 # 后台清理过期会话间隔(秒),默认 300
bcrypt:
cost: 12
# 站点设置(运行时通过管理后台 /admin/site-settings 配置DB持久化+内存缓存,无需重启)
# site.framework 页脚附加标识,默认 "Framework: MetaZone",留空则隐藏
# site.copyright_start 版权起始年,默认 "2024"
# registration.enabled 是否允许新用户注册,默认 true
# audit.* 审核系统配置,可运行时覆盖本文件默认值
audit:
enabled: true # 审核总开关
username_audit: true # 用户名修改审核
avatar_audit: true # 头像修改审核
bio_audit: true # 个性签名审核
# 角色配置(可扩展,无需修改源代码)
roles:
# 角色层级(数字越大权限越高)
levels:
user: 0
moderator: 1
admin: 2
owner: 3
# 角色显示名称
names:
user: "普通用户"
moderator: "版主"
admin: "管理员"
owner: "站长"
# 角色权限规则
permissions:
# 可操作的目标角色(未在此列出的角色默认可操作所有角色)
operable_roles:
admin: ["user"]
moderator: ["user"]