세팅할 때마다 "이 값이 어디 가는 거지" 를 코드에서 되짚고 있었다. 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 같은 걸 추가하면 조용히 무시된다는 것을 규칙 옆에 적었다.
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
# 복사해서 사용: cp config.test.toml.example config.test.toml
|
|
# 실제 config.test.toml 은 커밋하지 않는다(.gitignore: *.toml).
|
|
#
|
|
# ★ 이 파일이 없으면 `.venv/bin/pytest` 가 conftest import 단계에서 죽는다
|
|
# (server_configs 가 config.<APP_ENV>.toml 을 읽는다). 그래서 템플릿을 둔다.
|
|
# ★ DB 이름을 dev 와 절대 같게 두지 말 것 — 픽스처가 TRUNCATE 를 돌린다.
|
|
# conftest 의 안전가드가 이름을 확인하지만, 여기서부터 갈라 두는 게 먼저다.
|
|
[WebServerConfig]
|
|
server_name = "Web4aiServerTest"
|
|
port = 9800
|
|
process_count = 1
|
|
is_ssl = false
|
|
is_test = true
|
|
client_url = "http://localhost:3000"
|
|
landing_url = ""
|
|
|
|
[LogConfig]
|
|
print_console = false
|
|
log_level = "warning"
|
|
|
|
[MainDBConfig]
|
|
db_type = "postgresql"
|
|
name = "web4ai_test_db" # ★ dev(web4ai_db)와 다른 DB. 픽스처가 매번 지웠다 만든다
|
|
write_host = "127.0.0.1"
|
|
write_port = 5432
|
|
write_id = "postgres"
|
|
write_pw = "password"
|
|
read_host = "127.0.0.1"
|
|
read_port = 5432
|
|
read_id = "postgres"
|
|
read_pw = "password"
|
|
show_log = false
|
|
pool_size = 5
|
|
max_overflow = 10
|
|
sslmode = ""
|
|
|
|
[JwtToken]
|
|
access_key = "test-access-key-not-a-secret"
|
|
refresh_key = "test-refresh-key-not-a-secret"
|
|
access_expire_min = 30
|
|
refresh_expire_day = 7
|
|
|
|
# ★ 전부 빈값으로 둔다. APP_ENV=test 는 .env 를 읽지 않는데(실키가 테스트로 새는 경로 차단),
|
|
# 여기에 실키를 적으면 그 차단을 우회해 외부 API 요금이 나간다.
|
|
[ExternalApiConfig]
|
|
perplexity_api_key = ""
|
|
kakao_rest_api_key = ""
|
|
naver_client_id = ""
|
|
naver_client_secret = ""
|
|
gemini_api_key = ""
|
|
tour_api_key = ""
|