refactor(lps): 환경설정 TOML 단일화 — .env 제거, 시크릿도 config.local.toml 로 통합
설정이 .env(시크릿)+toml(설정)로 갈려 있던 것을 config.local.toml 하나로 통합. DB 비번이 이미 toml 에 있어 분리 기준이 임의적이었고, backend(하우스 패턴)도 toml 단일이라 일관성 확보. 환경별로 바뀌는 값(DB_HOST 등)만 env override 유지. - config_models: NaverConfig(keys 로테이션)·OpenAIConfig·DecodoConfig 추가 - server_configs: 3개 로드, load_dotenv 제거(python-dotenv 의존성도 제거) - proxy/naver/similarity/keyword/worker_main: os.environ → config 객체 참조 - config.local.toml.example: [NaverConfig]/[OpenAIConfig]/[DecodoConfig] 섹션 - .env/.env.example 삭제, README/주석 갱신 (배포는 toml 마운트 or env override) - tests: DecodoConfig 기반으로 갱신 → 전체 44/44 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2481c79e3f
commit
7911ba1745
12 files changed
+103
-86
No files matched your search
@@ -1,3 +1,5 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from config.config_loader import ConfigModel
|
||||
|
||||
|
||||
@@ -36,3 +38,36 @@ class MainDBConfig(ConfigModel):
|
||||
max_overflow: int = 20
|
||||
# SSL/TLS 모드: ""/"disable"=미사용(로컬), "require"/"verify-ca"/"verify-full"=관리형 DB(RDS/Aurora/Azure).
|
||||
sslmode: str = ""
|
||||
|
||||
|
||||
# ── 시크릿(API 키 등)도 TOML 로 통합 관리. config.local.toml 은 미커밋(*.toml). ──
|
||||
# 배포는 이 파일을 마운트하거나(권장), 환경별로 바뀌는 값만 env override 한다(DB_HOST 등).
|
||||
|
||||
|
||||
class NaverKey(BaseModel):
|
||||
id: str = ""
|
||||
secret: str = ""
|
||||
|
||||
|
||||
class NaverConfig(ConfigModel):
|
||||
"""네이버 쇼핑 오픈API 키. 여러 개면 429/403 로테이션에 자동 포함."""
|
||||
|
||||
keys: list[NaverKey] = []
|
||||
|
||||
|
||||
class OpenAIConfig(ConfigModel):
|
||||
"""AI 유사도 판정/검색어 생성용 OpenAI."""
|
||||
|
||||
api_key: str = ""
|
||||
model: str = "gpt-4o-mini"
|
||||
|
||||
|
||||
class DecodoConfig(ConfigModel):
|
||||
"""DECODO residential 프록시(쿠팡 전용, 포트기반 sticky). 값이 다 차야 활성."""
|
||||
|
||||
host: str = ""
|
||||
username: str = ""
|
||||
password: str = ""
|
||||
port_start: int = 0
|
||||
port_end: int = 0
|
||||
session_minutes: int = 10
|
||||
Reference in new issue
Block a user