2026-02-02 23:11:27 +09:00
|
|
|
"""
|
|
|
|
|
Application configuration using Pydantic Settings.
|
|
|
|
|
"""
|
2026-03-20 12:27:05 +09:00
|
|
|
|
2026-02-02 23:11:27 +09:00
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
from functools import lru_cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
|
# Application
|
2026-02-05 23:24:53 +09:00
|
|
|
app_name: str = "Galaxis-Po"
|
2026-02-02 23:11:27 +09:00
|
|
|
debug: bool = False
|
|
|
|
|
|
|
|
|
|
# Database
|
2026-03-20 12:27:05 +09:00
|
|
|
database_url: str
|
2026-02-02 23:11:27 +09:00
|
|
|
|
|
|
|
|
# JWT
|
2026-03-20 12:27:05 +09:00
|
|
|
jwt_secret: str
|
2026-02-02 23:11:27 +09:00
|
|
|
jwt_algorithm: str = "HS256"
|
|
|
|
|
access_token_expire_minutes: int = 60 * 24 # 24 hours
|
|
|
|
|
|
2026-02-07 23:09:22 +09:00
|
|
|
# CORS
|
|
|
|
|
cors_origins: str = "http://localhost:3000"
|
|
|
|
|
|
2026-02-08 22:21:36 +09:00
|
|
|
# Admin user (auto-created on startup if not exists)
|
|
|
|
|
admin_username: str = ""
|
|
|
|
|
admin_email: str = ""
|
|
|
|
|
admin_password: str = ""
|
|
|
|
|
|
2026-02-02 23:11:27 +09:00
|
|
|
# External APIs
|
|
|
|
|
kis_app_key: str = ""
|
|
|
|
|
kis_app_secret: str = ""
|
|
|
|
|
kis_account_no: str = ""
|
2026-05-05 23:03:53 +09:00
|
|
|
kis_paper_trade: bool = True
|
2026-02-02 23:11:27 +09:00
|
|
|
dart_api_key: str = ""
|
2026-04-17 23:07:09 +09:00
|
|
|
krx_openapi_key: str = ""
|
2026-02-02 23:11:27 +09:00
|
|
|
|
2026-05-05 23:03:53 +09:00
|
|
|
# LLM Provider (optional)
|
|
|
|
|
anthropic_api_key: str = ""
|
|
|
|
|
openai_api_key: str = ""
|
|
|
|
|
llm_fast_model: str = ""
|
|
|
|
|
llm_strong_model: str = ""
|
|
|
|
|
|
2026-03-29 10:03:08 +09:00
|
|
|
# Notifications (optional)
|
|
|
|
|
discord_webhook_url: str = ""
|
|
|
|
|
telegram_bot_token: str = ""
|
|
|
|
|
telegram_chat_id: str = ""
|
|
|
|
|
|
2026-02-02 23:11:27 +09:00
|
|
|
class Config:
|
|
|
|
|
env_file = ".env"
|
|
|
|
|
case_sensitive = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@lru_cache
|
|
|
|
|
def get_settings() -> Settings:
|
|
|
|
|
return Settings()
|