diff --git a/journey/troubleshooting/250820_happybell80_skill-email_DB통합및Actions배포.md b/journey/troubleshooting/250820_happybell80_skill-email_DB통합및Actions배포.md index bd51c36..0d3bca0 100644 --- a/journey/troubleshooting/250820_happybell80_skill-email_DB통합및Actions배포.md +++ b/journey/troubleshooting/250820_happybell80_skill-email_DB통합및Actions배포.md @@ -56,7 +56,7 @@ docker compose down - SSH 포트: 51124 (커스텀 포트) 2. **정확한 경로**: - - 51124 서버: `/home/admin/ivada_project/skill-email` + - 51124 서버: `/home/admin/ivada_project/skill_email` (디렉토리명 확인 필수) - git pull 방식으로 코드 업데이트 #### 수정된 워크플로우 @@ -72,7 +72,7 @@ docker compose down - name: Deploy to 51124 Server run: | ssh -p 51124 -i ~/.ssh/deploy_key admin@${{ secrets.SSH_HOST_51124 }} << 'EOF' - cd /home/admin/ivada_project/skill-email + cd /home/admin/ivada_project/skill_email git pull origin main --rebase docker compose down || echo "Container was not running" docker compose up -d --build @@ -215,4 +215,4 @@ git push → Gitea Actions (51123) → SSH (포트 51124) → 51124 서버 --- -**문서 끝** \ No newline at end of file +**문서 끝** diff --git a/journey/troubleshooting/251014_slack_lists_file_attachment.md b/journey/troubleshooting/251014_slack_lists_file_attachment.md index dc9d32c..125a5e1 100644 --- a/journey/troubleshooting/251014_slack_lists_file_attachment.md +++ b/journey/troubleshooting/251014_slack_lists_file_attachment.md @@ -36,20 +36,22 @@ coldmail_briefing.py:207에서 document_id를 attachment에 전달하지만, Sla - `from app.api import upload, search, download` - `app.include_router(download.router, prefix="/api", tags=["download"])` -### 2단계: skill-slack 파일 업로드 API 추가 -**파일**: skill-slack/app/api/endpoints/files.py (신규) -**import**: lists.py:4-9 참고 (FastAPI, settings, verify_api_key) -- `from slack_sdk import WebClient` (test_lists_with_file.py:4) -**router**: `@router.post("/files/upload", dependencies=[Depends(verify_api_key)])` -**파라미터**: file (UploadFile), title (str), token (Optional[str]) -**업로드**: test_lists_with_file.py:18, 21-24 패턴 -- `client = WebClient(token or settings.SLACK_BOT_TOKEN)` -- 임시 파일 저장 → `client.files_upload_v2(file=temp_path, title=title)` -- 업로드 후 임시 파일 삭제 -**주의**: 임시 파일 저장 시 원본 filename 유지 필요 -**반환**: `{"file_id": result["file"]["id"], "url_private": result["file"]["url_private"]}` -**에러**: HTTPException(400 or 500) -**등록**: skill-slack/app/api/__init__.py:4, 13 수정 +### 2단계: skill-slack 파일 업로드 API 추가 +**파일**: skill-slack/app/api/endpoints/files.py (신규) +**import**: lists.py:4-9 참고 (FastAPI, settings, verify_api_key) +- `from slack_sdk import WebClient` (test_lists_with_file.py:4) +**router**: `@router.post("/files/upload", dependencies=[Depends(verify_api_key)])` +**파라미터**: file (UploadFile), title (str), token (Optional[str]) +**업로드**: test_lists_with_file.py:18, 21-24 패턴 +- `client = WebClient(token or settings.SLACK_BOT_TOKEN)` +- 임시 파일 저장 → `client.files_upload_v2(file=temp_path, title=title)` +- 업로드 후 임시 파일 삭제 +**주의**: +- 임시 파일 경로에 원본 filename을 그대로 쓰면 `Errno 36 (File name too long)`로 실패할 수 있음 → `NamedTemporaryFile(delete=False, suffix=.pdf)` 등으로 안전한 temp 경로 사용 +- 원본 filename은 로그/메타데이터 용도로만 유지 +**반환**: `{"file_id": result["file"]["id"], "url_private": result["file"]["url_private"]}` +**에러**: HTTPException(400 or 500) +**등록**: skill-slack/app/api/__init__.py:4, 13 수정 ### 3단계: coldmail_briefing.py 통합