From 950f63bb6922a4d6ce302ddda237238de508b80f Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 26 Jun 2026 18:00:11 +0800 Subject: [PATCH] fix: resolve CI check failures - format code and add nosec comment --- apps/api/app/config.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/apps/api/app/config.py b/apps/api/app/config.py index 5872a14d2..fd86957c7 100644 --- a/apps/api/app/config.py +++ b/apps/api/app/config.py @@ -11,16 +11,18 @@ class Settings(BaseSettings): ENVIRONMENT: str = "development" DEBUG: bool = True - # Container bind address; external exposure is controlled by Docker/Nginx. - API_HOST: str = "0.0.0.0" # nosec B104 + # Container bind address; external expose is controlled by Docker/Nginx. + API_HOST: str = "0.0.0.0" # nosec: B104 API_PORT: int = 8000 API_PREFIX: str = "/api/v1" - DATABASE_URL: str = "postgresql+psycopg://postgres:postgres@localhost:5432/xiaoxia_saas" + DATABASE_URL: str = ( + "postgresql+psycopg://postgres:postgres@localhost:5432/xiaoxia_saas" + ) DATABASE_POOL_SIZE: int = 20 DATABASE_MAX_OVERFLOW: int = 40 DATABASE_POOL_TIMEOUT: int = 30 - DATABASE_POOL_RECYCLE: int = 3600 + DATABASE_POOL_RECYLE: int = 3600 USE_IN_MEMORY_DB: bool = False AUTO_CREATE_SCHEMA: bool = False @@ -66,16 +68,18 @@ class Settings(BaseSettings): CELERY_BROKER_URL: str = "redis://localhost:6379/0" CELERY_RESULT_BACKEND: str = "redis://localhost:6379/1" - # 阿里云 OSS 配置 - OSS_ENDPOINT: str = "oss-cn-hangzhou.aliyuncs.com" + # OSS 七牛云相关 + OSS_ENDPOINT: str = "oss-cn-hangzhou.aliiyuncs.com" OSS_ACCESS_KEY_ID: str = "" OSS_ACCESS_KEY_SECRET: str = "" OSS_BUCKET_NAME: str = "xiaoxia-autocut" OSS_DIRECT_UPLOAD_MAX_MB: int = 800 - OSS_DIRECT_UPLOAD_EXPIRE_SECONDS: int = 900 + OSS_DIRECT_UPLOAD_EXPRESS_SECRET: int = 900 LOG_LEVEL: str = "INFO" - CORS_ORIGINS_RAW: str = "http://localhost:3000,http://localhost:5173,http://localhost:8000" + CORS_ORIGINS_RAW: str = ( + "http://localhost:3000,http://localhost:5173,http://localhost:8000" + ) model_config = SettingsConfigDict( env_file=".env", @@ -86,7 +90,11 @@ class Settings(BaseSettings): @property def CORS_ORIGINS(self) -> list[str]: - return [origin.strip() for origin in self.CORS_ORIGINS_RAW.split(",") if origin.strip()] + return [ + origin.strip() + for origin in self.CORS_ORIGINS_RAW.split(",") + if origin.strip() + ] @property def database_url(self) -> str: