Update hardcoded URL removal troubleshooting doc

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
happybell80 2025-09-24 21:51:41 +09:00
parent c531ed00a8
commit 587392975e

View File

@ -1,21 +1,22 @@
# 하드코딩 URL 제거 작업
## 작성일: 2025-09-15
## 최초 작성: 2025-09-15
## 최종 수정: 2025-09-23
## 작성자: 51123 서버 관리자
## 정정 사항 (문서 vs 코드 불일치)
- ROBEING_HOST 변수명은 실제 코드에서 사용되지 않음. robeing-gateway는 `DEFAULT_ROBEING_HOST`/`DEFAULT_ROBEING_PORT`/`DEFAULT_ROBEING_ID`를 사용함.
- ROBEING_HOST 변수명은 실제 코드에서 사용되지 않음. robeing-gateway는 `ROBEING_DEFAULT_HOST`/`ROBEING_DEFAULT_PORT`를 사용함 (2025-09-23 기준).
- SLACK_CALLBACK_URL, GMAIL_CALLBACK_URL은 코드에 없음. auth-server는 `SLACK_REDIRECT_URI`, `GOOGLE_REDIRECT_URI`, `GOOGLE_PASSPORT_REDIRECT_URI`를 사용함.
- FRONTEND_URL은 코드에서 직접 사용하지 않음. 프론트는 `VITE_AUTH_SERVER_URL`을 사용하고, CORS 도메인은 코드에 상수로 정의되어 있음.
## 발견된 하드코딩 현황
### auth-server
### auth-server (2025-09-23 현재)
**app/providers/slack.py**
- Line 79, 187, 189: `http://localhost:3000`
- Line 158, 165, 177: `http://localhost:3000/login?error=`
- Line 94: `https://auth.ro-being.com/auth/slack/login/callback`
- Line 203: `https://auth.ro-being.com/auth/slack/login/callback`
- Line 79, 187, 189: `http://localhost:3000` ✅ 여전히 존재
- Line 158, 165, 177: `http://localhost:3000/login?error=` ✅ 여전히 존재
- Line 94: `https://auth.ro-being.com/auth/slack/login/callback` (확인 필요)
- Line 203: `https://auth.ro-being.com/auth/slack/login/callback` (확인 필요)
**app/providers/gmail_passport.py**
- Line 54: `postgresql://robeings:robeings@192.168.219.45:5432/main_db`
@ -27,18 +28,22 @@
**app/main.py**
- Line 28-32: `http://localhost:3000`, `5173`, `5174`, `8000`, `10508`
### frontend-customer
### frontend-customer (2025-09-23 현재)
**src/contexts/auth-context.tsx**
- Line 22: `https://auth.ro-being.com` (기본값)
- Line 79: `https://auth.ro-being.com/auth/verify`
- Line 23: `https://auth.ro-being.com` (기본값) ✅ 여전히 존재
- Line 80: `https://auth.ro-being.com/auth/verify` ✅ 여전히 존재
**src/components/skills-items-panel.tsx**
- Line 361: `https://auth.ro-being.com/auth/gmail/passport`
- Line 432: `https://auth.ro-being.com/auth/slack/passport/install`
### rb8001
### rb8001 (2025-09-23 현재)
**app/core/config.py**
- Line 35-36: `postgresql://postgres:postgres@localhost` ✅ 기본값으로 존재
- Line 15: `LUNCH_WORLDCUP_CHANNEL_ID` ✅ 추가됨 (환경변수 지원)
**app/commands/skill_commands.py**
- 하드코딩: `localhost:8502`, `localhost:8505` URL
- 하드코딩: `localhost:8502`, `localhost:8505` URL (확인 필요)
**app/skills/email_integration.py**
- Line 37: `http://192.168.219.45:9000/api/slack/mapping/{slack_id}`
@ -54,14 +59,13 @@
**app/brain/state_client.py**
- Line 17: `http://localhost:8507` (STATE_SERVICE_URL 기본값)
### robeing-gateway
### robeing-gateway (2025-09-23 현재)
**app/main.py**
- Line 128-129: `http://localhost:5173`, `http://localhost:3000`
- Line 157: `http://192.168.219.52:9024` (MONITOR_URL로 부분 환경변수화됨)
- Line 304: `http://192.168.219.52:9024/api/stats/{robeing_id}` (하드코딩)
- Line 383: `http://192.168.219.52:9024`
- Line 567: `http://192.168.219.52:8001/api/slack/events`
- Line 620: `http://192.168.219.52:8001/api/slack/interactive`
- ❌ root 엔드포인트 제거됨 (보안 개선)
- Line 205: 환경변수 사용 (`robeing_info['host']`, `robeing_info['port']`)
- Line 552: `ROBEING_DEFAULT_HOST`, `ROBEING_DEFAULT_PORT` 환경변수 사용 ✅ 개선됨
- Line 605: `ROBEING_DEFAULT_HOST`, `ROBEING_DEFAULT_PORT` 환경변수 사용 ✅ 개선됨
- 하드코딩된 IP 대부분 제거됨
**app/database.py**
- Line 20: `postgresql+asyncpg://postgres:postgres@localhost:5432/main_db`
@ -123,13 +127,26 @@
**server-nginx-default**
- proxy_pass에 `http://localhost:*`, `http://192.168.219.52:*` 다수 고정
## 실제 사용되는 환경변수
## 실제 사용되는 환경변수 (2025-09-23 업데이트)
- VITE_AUTH_SERVER_URL (frontend-customer)
- DATABASE_URL (여러 서비스 공통)
- DEFAULT_ROBEING_HOST, DEFAULT_ROBEING_PORT, DEFAULT_ROBEING_ID (robeing-gateway)
- ROBEING_DEFAULT_HOST, ROBEING_DEFAULT_PORT (robeing-gateway) ✅ 변수명 변경됨
- MONITOR_URL (robeing-gateway)
- SLACK_REDIRECT_URI, GOOGLE_REDIRECT_URI, GOOGLE_PASSPORT_REDIRECT_URI (auth-server)
- SKILL_EMAIL_URL, SKILL_NEWS_URL, SKILL_SLACK_URL, SKILL_EMBEDDING_URL, STATE_SERVICE_URL (rb8001 및 관련 스킬)
- LUNCH_WORLDCUP_CHANNEL_ID (rb8001) ✅ 신규 추가
## 진행 상황 (2025-09-23)
### 완료된 작업
- ✅ robeing-gateway: Pydantic v2 마이그레이션 완료
- ✅ robeing-gateway: 하드코딩된 IP 대부분 환경변수로 대체
- ✅ robeing-gateway: root 엔드포인트 제거 (보안 개선)
- ✅ rb8001: LUNCH_WORLDCUP_CHANNEL_ID 환경변수 추가
### 미완료 항목
- ⚠️ auth-server: localhost:3000 하드코딩 여전히 존재
- ⚠️ frontend-customer: auth.ro-being.com 하드코딩 존재 (기본값)
- ⚠️ 각 skill 서비스들의 localhost URL 확인 필요
## 교체 가이드 (요약)
- 코드 상수에 직접 박힌 URL/IP/포트를 전부 환경변수로 치환한다. 이미 존재하는 키를 우선 사용하고, 미존재 시 새 키를 정의한다.