32 lines
758 B
Python
32 lines
758 B
Python
|
|
"""
|
||
|
|
Shared configuration for all Weibo-HotSign backend services.
|
||
|
|
Loads settings from environment variables using pydantic-settings.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from pydantic_settings import BaseSettings
|
||
|
|
|
||
|
|
|
||
|
|
class SharedSettings(BaseSettings):
|
||
|
|
"""Shared settings across all backend services."""
|
||
|
|
|
||
|
|
# Database
|
||
|
|
DATABASE_URL: str = "mysql+aiomysql://root:password@localhost/weibo_hotsign"
|
||
|
|
|
||
|
|
# Redis
|
||
|
|
REDIS_URL: str = "redis://localhost:6379/0"
|
||
|
|
|
||
|
|
# JWT
|
||
|
|
JWT_SECRET_KEY: str = "change-me-in-production"
|
||
|
|
JWT_ALGORITHM: str = "HS256"
|
||
|
|
JWT_EXPIRATION_HOURS: int = 24
|
||
|
|
|
||
|
|
# Cookie encryption
|
||
|
|
COOKIE_ENCRYPTION_KEY: str = "change-me-in-production"
|
||
|
|
|
||
|
|
class Config:
|
||
|
|
case_sensitive = True
|
||
|
|
env_file = ".env"
|
||
|
|
|
||
|
|
|
||
|
|
shared_settings = SharedSettings()
|