세팅할 때마다 "이 값이 어디 가는 거지" 를 코드에서 되짚고 있었다. AGENTS.md 에 설정 파일 지도를 넣고, 흩어져 있던 cp 명령을 거기 한 곳으로 모았다. 두는 곳 — 템플릿이 전부 짝을 갖는다(7개 확인). 루트 .env ← 백엔드가 읽는 유일한 .env solution/backend/config/ config.local.toml DB·JWT·포트·CORS solution/backend/config/ config.test.toml 없으면 pytest 가 import 단계에서 죽는다 solution/frontend/ .env VITE_* (API :9800) admin/frontend/ .env VITE_* (API :9801) nginx/ site.conf 없으면 Docker 가 디렉토리를 만든다 두지 않는 곳과 그 이유도 같이 적었다 — solution/backend(dotenv 가 루트를 본다), admin/backend(PYTHONPATH 로 solution 것을 쓴다), solution/site, solution/shared. solution/site/.env.example 을 지웠다. "여기엔 아무것도 없다" 는 걸 알리려고 둔 파일인데, .env.example 은 이 레포에서 "복사해서 채워라" 라는 뜻이라 정반대 신호를 준다. 그 설명은 지도의 '두지 않는 곳' 으로 옮겼다. 그 밖에 - config.test.toml.example 의 server_name 이 O2oSiteServerTest 로 남아 있었다. - config.local.toml.example 에 생략 가능한 [ExternalApiConfig] 필드 셋을 주석으로 적었다. - .gitignore 의 *.toml 이 레포 전체를 덮는다는 것과, 그래서 pyproject.toml 같은 걸 추가하면 조용히 무시된다는 것을 규칙 옆에 적었다.
57 lines
2.4 KiB
Plaintext
57 lines
2.4 KiB
Plaintext
# 복사해서 사용: cp config.local.toml.example config.local.toml
|
|
# 실제 config.local.toml 은 시크릿 포함이라 커밋하지 않는다(.gitignore: *.toml).
|
|
# 모든 서버는 APP_ENV=local 로 띄우며 이 파일을 읽는다.
|
|
[WebServerConfig]
|
|
server_name = "Web4aiServer"
|
|
port = 9800
|
|
process_count = 1
|
|
is_ssl = false
|
|
is_test = true
|
|
# 관리자 프론트 오리진 — CORS 허용. 쉼표로 여러 개.
|
|
# vite 는 3000 이 쓰이고 있으면 3001, 3002… 로 옮겨 뜨므로 개발 포트 대역을 함께 적어 둔다.
|
|
# 운영에서는 실제 도메인 하나만 남긴다.
|
|
client_url = "http://localhost:3000,http://localhost:3001,http://localhost:3002,http://localhost:3003,http://localhost:3004,http://localhost:3005"
|
|
landing_url = "" # 랜딩(마케팅 사이트). 없으면 빈값
|
|
|
|
[LogConfig]
|
|
print_console = true
|
|
log_level = "debug"
|
|
|
|
# DB Read/Write 분리. 도커 실행 시 host 는 docker-compose 의 DB_HOST 로 override.
|
|
# 관리형 DB(RDS/Aurora/Azure)는 host 에 엔드포인트, sslmode="require".
|
|
[MainDBConfig]
|
|
db_type = "postgresql"
|
|
name = "web4ai_db"
|
|
write_host = "127.0.0.1"
|
|
write_port = 5432
|
|
write_id = "<DB_USER>"
|
|
write_pw = "<DB_PASSWORD>"
|
|
read_host = "127.0.0.1"
|
|
read_port = 5432
|
|
read_id = "<DB_USER>"
|
|
read_pw = "<DB_PASSWORD>"
|
|
show_log = false
|
|
pool_size = 10
|
|
max_overflow = 20
|
|
sslmode = "" # 로컬: "" / 관리형 DB: "require"|"verify-ca"|"verify-full"
|
|
|
|
[JwtToken]
|
|
access_key = "<JWT_ACCESS_SECRET>"
|
|
refresh_key = "<JWT_REFRESH_SECRET>"
|
|
access_expire_min = 30
|
|
refresh_expire_day = 7
|
|
|
|
# 수집 파이프라인 외부 API 키. 빈값이면 해당 어댑터 비활성(서버는 그대로 뜬다).
|
|
# 배포에서 환경변수로만 주입하려면 여기는 비우고 PERPLEXITY_API_KEY 등을 env 로 넘긴다.
|
|
[ExternalApiConfig]
|
|
perplexity_api_key = "" # 채널 URL 발견
|
|
kakao_rest_api_key = "" # 동일 업소 검증(미발급)
|
|
naver_client_id = "" # 동일 업소 검증 — 네이버 지역검색
|
|
naver_client_secret = ""
|
|
gemini_api_key = "" # 사진 분류 · 카피 작성
|
|
tour_api_key = "" # 공공데이터포털 일반 인증키. fact 의 주력 공급원
|
|
# 아래 셋은 생략하면 코드 기본값을 쓴다(config_models.ExternalApiConfig).
|
|
# gemini_vision_model = "gemini-3.7-flash"
|
|
# gemini_text_model = "gemini-3.7-flash"
|
|
# vision_confidence_threshold = 0.7 # 미만이면 사람 확인 큐에 남긴다
|