refactor: restructure passkey with dedicated package
- Create internal/passkey/ package with challenge session management - Add HTTP handler layer in internal/api/passkey.go - Simplify Passkey model to use blob credential storage - Register passkey routes in router - Update frontend to match new API endpoints - Add .env.example template
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# ===========================================
|
||||
# OpenCatd-Open 配置文件
|
||||
# 复制此文件为 .env 并修改相应配置
|
||||
# ===========================================
|
||||
|
||||
# --- 服务器配置 ---
|
||||
PORT=80
|
||||
READ_TIMEOUT=10
|
||||
WRITE_TIMEOUT=10
|
||||
|
||||
# --- Passkey (WebAuthn) 配置 ---
|
||||
# 应用名称(显示给用户)
|
||||
APP_NAME=OpenTeam
|
||||
# 依赖方 ID(通常为域名,生产环境需改为实际域名)
|
||||
RPID=localhost
|
||||
# 依赖方来源(前端 URL,逗号分隔)
|
||||
RPORIGINS=http://localhost:5173,http://localhost:3000
|
||||
|
||||
# --- 数据库配置 ---
|
||||
# 支持: sqlite, mysql, postgres
|
||||
DB_TYPE=sqlite
|
||||
# DSN 连接字符串(SQLite 可留空)
|
||||
DB_DSN=
|
||||
DB_MAX_OPEN_CONNS=10
|
||||
DB_MAX_IDLE_CONNS=5
|
||||
|
||||
# --- Redis 配置(可选)---
|
||||
# REDIS_HOST=localhost
|
||||
# REDIS_PORT=6379
|
||||
# REDIS_PASSWORD=
|
||||
# REDIS_DB=0
|
||||
|
||||
# --- 日志配置 ---
|
||||
LOG_LEVEL=info
|
||||
LOG_PATH=./logs/
|
||||
|
||||
# --- 功能开关 ---
|
||||
# 允许注册(false=关闭注册)
|
||||
ALLOW_REGISTER=false
|
||||
# 无限制配额(true=不限制)
|
||||
UNLIMITED_QUOTA=true
|
||||
# 新用户默认激活
|
||||
DEFAULT_ACTIVE=true
|
||||
|
||||
# --- 用量统计 ---
|
||||
USAGE_WORKER=1
|
||||
USAGE_CHAN_SIZE=1000
|
||||
TASK_TIME_INTERVAL=60
|
||||
Reference in New Issue
Block a user