feat: 添加管理员密码保护 bootstrap 接口
This commit is contained in:
13
DESIGN.md
13
DESIGN.md
@@ -12,15 +12,16 @@ npm install
|
||||
npm start # 默认 3000 端口, ./storage 目录
|
||||
PORT=8080 npm start # 指定端口
|
||||
STORAGE_DIR=/data myoss # 指定存储目录
|
||||
PORT=8080 STORAGE_DIR=/data myoss # 同时指定
|
||||
|
||||
# 首次启动需要设置管理员密码
|
||||
ADMIN_PASSWORD=yourpassword npm start
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 1. 创建首个 API Key(bootstrap)
|
||||
### 初始化首个 API Key
|
||||
```bash
|
||||
curl -X POST http://localhost:3000/api/keys/bootstrap -H "Content-Type: application/json" -d '{"name":"root"}'
|
||||
# 返回: {"key":"xxx","name":"root"}
|
||||
curl -X POST http://localhost:3000/api/keys/bootstrap \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"password":"yourpassword","name":"root"}'
|
||||
```
|
||||
|
||||
### 2. 上传文件
|
||||
|
||||
Reference in New Issue
Block a user