Fix: Move project files to root directory
This commit is contained in:
45
config.py
Normal file
45
config.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import os
|
||||
from typing import Optional
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""应用配置类"""
|
||||
|
||||
# API密钥配置
|
||||
api_key: str = "123tangledup-ai"
|
||||
|
||||
# SMS配置
|
||||
sms_template_code: str = "SMS_465420786"
|
||||
sms_sign_name: str = "叠加态科技"
|
||||
|
||||
# 数据库配置
|
||||
db_host: str = "121.43.104.161"
|
||||
db_port: str = "6432"
|
||||
db_name: str = "call_data"
|
||||
db_user: str = "tangledup-ai"
|
||||
db_password: str = "123tangledup-ai"
|
||||
db_sslmode: str = "disable"
|
||||
|
||||
# 阿里云OSS配置
|
||||
oss_access_key_id: str = "LTAI5tE62GW8MKyoEaotzxXk"
|
||||
oss_access_key_secret: str = "Zdzqo1fgj57DxxioXOotNKhJdSfVQW"
|
||||
oss_endpoint: str = "https://oss-cn-shanghai.aliyuncs.com"
|
||||
oss_bucket_name: str = "tangledup-ai-staging"
|
||||
oss_internal_endpoint: str = "https://oss-cn-shanghai-internal.aliyuncs.com"
|
||||
|
||||
# FastAPI配置
|
||||
app_host: str = os.getenv("APP_HOST", "0.0.0.0")
|
||||
app_port: int = int(os.getenv("APP_PORT", "8000"))
|
||||
debug: bool = os.getenv("DEBUG", "True").lower() == "true"
|
||||
|
||||
# 文件上传配置
|
||||
max_file_size: int = 1024 * 1024 * 1024 # 1GB
|
||||
allowed_extensions: list = ['.jpg', '.jpeg', '.png', '.gif', '.pdf', '.txt', '.doc', '.docx', '.mp3', '.mp4', '.wav', '.webm']
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
|
||||
# 全局设置实例
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user