Fix FastAPI deprecation warnings and lengthen demo SECRET_KEY
Browse files- Dockerfile +1 -1
- README.md +2 -2
- qa_annotate/api/annotation.py +1 -1
- qa_annotate/api/project.py +1 -1
- qa_annotate/config.py +1 -1
Dockerfile
CHANGED
|
@@ -12,7 +12,7 @@ RUN pip install --no-cache-dir .
|
|
| 12 |
|
| 13 |
ENV DB_DIR=/data
|
| 14 |
ENV ENVIRONMENT=production
|
| 15 |
-
ENV SECRET_KEY=qaloop-demo-secret-key
|
| 16 |
ENV PYTHONUNBUFFERED=1
|
| 17 |
|
| 18 |
RUN chmod +x scripts/space_entrypoint.sh
|
|
|
|
| 12 |
|
| 13 |
ENV DB_DIR=/data
|
| 14 |
ENV ENVIRONMENT=production
|
| 15 |
+
ENV SECRET_KEY=qaloop-demo-jwt-secret-key-32bytes
|
| 16 |
ENV PYTHONUNBUFFERED=1
|
| 17 |
|
| 18 |
RUN chmod +x scripts/space_entrypoint.sh
|
README.md
CHANGED
|
@@ -40,7 +40,7 @@ pinned: false
|
|
| 40 |
|
| 41 |
| 配置项 | 默认值 | 说明 |
|
| 42 |
|--------|--------|------|
|
| 43 |
-
| `SECRET_KEY` | `qaloop-demo-secret-key` | JWT 签名密钥(Demo 用,勿用于正式部署) |
|
| 44 |
| `ADMIN_USERNAME` | `admin` | 首次启动自动创建的管理员 |
|
| 45 |
| `ADMIN_PASSWORD` | `123456` | 管理员密码 |
|
| 46 |
| `DB_DIR` | `/data` | 数据库存储目录 |
|
|
@@ -57,7 +57,7 @@ pinned: false
|
|
| 57 |
|
| 58 |
| Secret | Demo 默认 | 说明 |
|
| 59 |
|--------|-----------|------|
|
| 60 |
-
| `SECRET_KEY` | `qaloop-demo-secret-key` | JWT 密钥,正式环境请改为随机字符串 |
|
| 61 |
| `ADMIN_USERNAME` | `admin` | 首次启动自动创建的管理员用户名 |
|
| 62 |
| `ADMIN_PASSWORD` | `123456` | 管理员密码(至少 6 位) |
|
| 63 |
|
|
|
|
| 40 |
|
| 41 |
| 配置项 | 默认值 | 说明 |
|
| 42 |
|--------|--------|------|
|
| 43 |
+
| `SECRET_KEY` | `qaloop-demo-jwt-secret-key-32bytes` | JWT 签名密钥(Demo 用,勿用于正式部署) |
|
| 44 |
| `ADMIN_USERNAME` | `admin` | 首次启动自动创建的管理员 |
|
| 45 |
| `ADMIN_PASSWORD` | `123456` | 管理员密码 |
|
| 46 |
| `DB_DIR` | `/data` | 数据库存储目录 |
|
|
|
|
| 57 |
|
| 58 |
| Secret | Demo 默认 | 说明 |
|
| 59 |
|--------|-----------|------|
|
| 60 |
+
| `SECRET_KEY` | `qaloop-demo-jwt-secret-key-32bytes` | JWT 密钥,正式环境请改为随机字符串 |
|
| 61 |
| `ADMIN_USERNAME` | `admin` | 首次启动自动创建的管理员用户名 |
|
| 62 |
| `ADMIN_PASSWORD` | `123456` | 管理员密码(至少 6 位) |
|
| 63 |
|
qa_annotate/api/annotation.py
CHANGED
|
@@ -589,7 +589,7 @@ def get_dataset_annotation_results(
|
|
| 589 |
def export_dataset_annotation_results(
|
| 590 |
dataset_id: int,
|
| 591 |
format: str = Query(
|
| 592 |
-
"json",
|
| 593 |
),
|
| 594 |
db: Session = Depends(get_db),
|
| 595 |
current_user: User = Depends(get_current_superuser),
|
|
|
|
| 589 |
def export_dataset_annotation_results(
|
| 590 |
dataset_id: int,
|
| 591 |
format: str = Query(
|
| 592 |
+
"json", pattern="^(json|csv)$", description="导出格式:json 或 csv"
|
| 593 |
),
|
| 594 |
db: Session = Depends(get_db),
|
| 595 |
current_user: User = Depends(get_current_superuser),
|
qa_annotate/api/project.py
CHANGED
|
@@ -1004,7 +1004,7 @@ async def import_project(
|
|
| 1004 |
def export_project_annotations(
|
| 1005 |
project_id: int,
|
| 1006 |
format: str = Query(
|
| 1007 |
-
"json",
|
| 1008 |
),
|
| 1009 |
db: Session = Depends(get_db),
|
| 1010 |
current_user: User = Depends(get_current_superuser),
|
|
|
|
| 1004 |
def export_project_annotations(
|
| 1005 |
project_id: int,
|
| 1006 |
format: str = Query(
|
| 1007 |
+
"json", pattern="^(json|csv)$", description="导出格式:json 或 csv"
|
| 1008 |
),
|
| 1009 |
db: Session = Depends(get_db),
|
| 1010 |
current_user: User = Depends(get_current_superuser),
|
qa_annotate/config.py
CHANGED
|
@@ -32,7 +32,7 @@ class Settings(BaseSettings):
|
|
| 32 |
|
| 33 |
# 认证配置
|
| 34 |
TOKEN_EXPIRE_DAYS: int = 7 # Token过期天数
|
| 35 |
-
SECRET_KEY: str = "qaloop-demo-secret-key" # JWT密钥,Demo 默认值,生产环境务必修改
|
| 36 |
ALGORITHM: str = "HS256" # JWT算法
|
| 37 |
|
| 38 |
# SQLAlchemy配置
|
|
|
|
| 32 |
|
| 33 |
# 认证配置
|
| 34 |
TOKEN_EXPIRE_DAYS: int = 7 # Token过期天数
|
| 35 |
+
SECRET_KEY: str = "qaloop-demo-jwt-secret-key-32bytes" # JWT密钥,Demo 默认值,生产环境务必修改
|
| 36 |
ALGORITHM: str = "HS256" # JWT算法
|
| 37 |
|
| 38 |
# SQLAlchemy配置
|