扩展认证逻辑支持 API Token 和动态权限解析,更新配置结构及 Swagger 文档

This commit is contained in:
2026-01-14 16:31:58 +08:00
parent fe656fb298
commit 2ea2c93bb4
13 changed files with 634 additions and 207 deletions

View File

@@ -1,40 +1,35 @@
site:
name: "文件暂存柜"
description: "临时文件中转服务"
name: 文件暂存柜
description: 临时文件中转服务
security:
# 管理员密码的 bcrypt 哈希。如果首次运行且此处为空,系统将自动生成随机密码并打印在控制台
admin_password_hash: "$2a$10$Bm0TEmU4uj.bVHYiIPFBheUkcdg6XHpsanLvmpoAtgU1UnKbo9.vy" # 默认密码: admin
pickup_code_length: 6
pickup_fail_limit: 5
jwt_secret: "file-relay-secret"
admin_password_hash: $2a$10$Bm0TEmU4uj.bVHYiIPFBheUkcdg6XHpsanLvmpoAtgU1UnKbo9.vy
pickup_code_length: 6
pickup_fail_limit: 5
jwt_secret: file-relay-secret
upload:
max_file_size_mb: 500
max_batch_files: 20
max_retention_days: 30
max_file_size_mb: 100
max_batch_files: 20
max_retention_days: 30
require_token: false
storage:
type: "local"
local:
path: "storage_data"
webdav:
url: "https://dav.example.com"
username: "user"
password: "pass"
root: "/file-relay"
s3:
endpoint: "s3.amazonaws.com"
region: "us-east-1"
access_key: "your-access-key"
secret_key: "your-secret-key"
bucket: "file-relay-bucket"
use_ssl: true
type: local
local:
path: storage_data_test
webdav:
url: https://dav.example.com
username: user
password: pass
root: /file-relay
s3:
endpoint: s3.amazonaws.com
region: us-east-1
access_key: your-access-key
secret_key: your-secret-key
bucket: file-relay-bucket
use_ssl: false
api_token:
enabled: true
allow_admin_api: false
max_tokens: 20
enabled: true
allow_admin_api: true
max_tokens: 20
database:
path: "file_relay.db"
path: file_relay.db