Repository navigation
chore(storage): S3 대신 Pi 디스크 파일 저장소 사용 (S3 구현 유지) - #202
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- storage.type=filesystem(기본)이면 /app/storage에 저장하고 아이콘만 /files/category-icon/** 로 공개 - storage.type=s3이면 기존 S3 구현을 그대로 사용 (S3 코드는 유지) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
저장소 설정과 선택 src/main/kotlin/depromeet/hotsix/obrit/global/common/storage/StorageProperties.kt, src/main/resources/application-prod.yml, src/main/kotlin/depromeet/hotsix/obrit/global/common/storage/*, src/main/kotlin/depromeet/hotsix/obrit/global/config/S3Config.kt, src/test/kotlin/depromeet/hotsix/obrit/global/config/StorageTypeSwitchTest.kt |
storage.type 기본값을 filesystem으로 설정하고, 프로덕션에서 파일시스템 또는 S3 구현을 선택하도록 변경했습니다. 저장소 유형별 빈 등록을 테스트합니다. |
파일 저장과 아이콘 제공 src/main/kotlin/depromeet/hotsix/obrit/global/common/storage/FileSystemFileUploader.kt, src/main/kotlin/depromeet/hotsix/obrit/global/common/storage/FileSystemPublicUrlResolver.kt, src/main/kotlin/depromeet/hotsix/obrit/global/config/StorageConfig.kt, src/main/kotlin/depromeet/hotsix/obrit/global/config/AdminSecurityConfig.kt, src/main/kotlin/depromeet/hotsix/obrit/global/config/WebMvcConfig.kt, src/main/kotlin/depromeet/hotsix/obrit/global/exception/GlobalExceptionHandler.kt, src/test/kotlin/depromeet/hotsix/obrit/global/common/storage/FileSystemFileUploaderTest.kt, src/test/kotlin/depromeet/hotsix/obrit/global/config/StorageConfigTest.kt |
파일을 UUID 이름으로 저장하고 공개 URL을 구성합니다. /files/category-icon/** 경로만 정적 리소스로 제공하며, 업로드와 URL 구성, 캐시 헤더, 비공개 경로 및 404 응답을 테스트합니다. |
Pi 영속 저장소와 운영 절차 Dockerfile, docker-compose.pi.yml, infra/pi/env.example, infra/pi/README.md, docs/plans/2026-09-30-raspberry-pi-migration-design.md |
/app/storage를 앱 사용자 소유로 생성하고 orbit-storage-data 볼륨에 연결합니다. 파일시스템 및 S3 설정 예시와 백업 복원·접근 확인 절차를 문서에 추가했습니다. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Admin as 백오피스
participant Uploader as FileSystemFileUploader
participant Storage as 파일시스템
participant Resolver as FileSystemPublicUrlResolver
participant Client as 요청 클라이언트
participant Static as StorageConfig
Admin->>Uploader: prefix와 파일로 업로드 요청
Uploader->>Storage: prefix 아래 파일 저장
Uploader-->>Admin: 파일 키 반환
Resolver->>Resolver: 공개 기본 URL과 files 경로에 키 결합
Client->>Static: /files/category-icon/** 요청
Static->>Storage: 공개 아이콘 경로의 파일 조회
Static-->>Client: 파일 응답과 캐시 헤더 반환
Merge Risk: 
Minimal · up to 0df9f
-
The storage switch is ready for normal deployment checks, including configuring the public base URL and completing the documented file restore.
Pre-merge checks: 
3 · 
2
-
Failed checks: 2 warnings Passed checks: 3 passedFull details: Linked Issues check
-
Explanation
직접 연결된
#196은MySQL·MinIO의 Compose 구성과 데이터 영속화, S3 저장 코드를 MinIO에 맞게 변경하고 이미지 URL을 정리하는 작업을 요구합니다. 이 PR은 파일시스템 저장소와 선택적 기존 S3 저장소를 추가하지만, 변경 요약에 MySQL·MinIO Compose 구성, MinIO 연동 코드, 또는 해당 동작을 검증하는 테스트가 없습니다. CI/CD를 앱만 교체하도록 변경한 근거도 없습니다. 저장소 전환 관련 자체 테스트는 있으나#196의핵심 코딩 요구를 충족하지 않습니다.Resolution
#196의코딩 요구에 맞게 MySQL·MinIO Compose 구성과 영속 볼륨을 추가하고, 저장소 구현을 MinIO에 맞게 변경하며 이미지 URL 처리를 완료해야 합니다. 앱만 교체하는 CI/CD 변경도 구현하고 자동화 테스트로 검증해야 합니다. 파일시스템 저장소를 최종 대안으로 사용할 경우#196의요구사항과 PR 범위를 먼저 갱신해야 합니다.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 14 files. (6 skipped: 6 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 2
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
나는 토끼, 저장 경로를 살펴봐요
파일은 UUID 이름으로 깡총 저장돼요
아이콘 URL은 키를 따라 이어지고
영수증은 공개 경로 밖에 남아요
Pi의 볼륨에 당근처럼 파일이 쌓여요
Comment @coderabbitai help to get the list of available commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #196
Summary
서버를 라즈베리파이로 옮기고 AWS를 정리하기 위해 파일 저장소를 S3에서 Pi 디스크로 바꿉니다. 기존 S3 구현은 지우지 않았고,
storage.type설정으로 둘 중 하나를 고릅니다(기본값filesystem).Changes
storage.type)filesystem(기본):FileSystemFileUploader가/app/storage/{prefix}/{uuid}.{ext}위치에 저장합니다.FileSystemPublicUrlResolver는{STORAGE_PUBLIC_BASE_URL}/files/{key}형태의 URL을 만듭니다.s3: 기존S3Config/S3Uploader/S3PublicUrlResolver를 그대로 씁니다. 각 클래스에는 조건 어노테이션 한 줄만 추가했습니다.@Qualifier("s3PublicUrlResolver")는 바꾸지 않았고, 파일시스템 쪽 resolver도 같은 빈 이름으로 등록됩니다.GET /files/category-icon/**만 정적 리소스로 내려줍니다(30일 캐시). 영수증(receipts/)은 개인정보가 있어 공개하지 않습니다.../같은 경로 조작을 막습니다./app/storage를 만들고 소유자를 지정합니다.orbit-storage-data볼륨을 추가했습니다.env.example에STORAGE_TYPE,STORAGE_PUBLIC_BASE_URL을 추가했습니다. S3 변수는 s3 모드에서만 필요합니다.infra/pi/README.md에 S3 백업을 볼륨으로 복원하는 절차와icons.url갱신 SQL을 정리했습니다.검증
./gradlew harness통과FileSystemFileUploaderTest: 저장, 경로 조작 차단, URL 생성StorageConfigTest: 아이콘 200·Cache-Control, 없는 아이콘·영수증·경로 조작 404StorageTypeSwitchTest: type이 없으면 파일시스템 빈만,s3면 S3 빈만 등록되는지 확인Etc
ENV_FILE에STORAGE_PUBLIC_BASE_URL이 있어야 합니다. 없으면 앱이 뜨지 않습니다.~/s3-backup을 볼륨에 복원하고, DB의icons.url을 갱신합니다(README 참고).FileUploader.download()를 추가하므로, 둘 중 나중에 머지하는 쪽에서FileSystemFileUploader.download()를 구현해야 합니다.GlobalExceptionHandler에서도 충돌이 날 수 있습니다.Summary by CodeRabbit