yearning
11 小时以前 3f96c9c6502243b06efd4bb34a189e72e3a5557c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from pathlib import Path
 
from pydantic_settings import BaseSettings
 
ROOT = Path(__file__).resolve().parents[2]
 
 
class Settings(BaseSettings):
    database_url: str = f"sqlite:///{ROOT / 'backend' / 'data' / 'app.db'}"
    jwt_secret: str = "score-query-dev-secret-change-in-prod"
    jwt_algorithm: str = "HS256"
    jwt_expire_hours: int = 24
    login_max_failures: int = 5
    login_lock_minutes: int = 15
    # 逗号分隔;可通过环境变量 CORS_ORIGINS 覆盖
    cors_origins: str = (
        "http://localhost:5174,"
        "http://127.0.0.1:5174,"
        "http://localhost:5175,"
        "http://127.0.0.1:5175,"
        "http://grader.gps120.com,"
        "https://grader.gps120.com"
    )
 
 
settings = Settings()