Conversation
개요배포 서버 주소 변경에 따라 Eureka 서비스 URL을 고정 IP로 업데이트하고, CORS 허용 출처를 추가하며, CI 워크플로우 Docker 빌드 대상 플랫폼을 ARM64로 변경했습니다. 변경사항
코드 리뷰 예상 난이도🎯 2 (단순) | ⏱️ ~10분
관련된 가능성 있는 PR
제안 레이블
제안 검토자
🐰 시 (축하 메시지)
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/com/unionmate/gateway_service/global/SecurityConfig.java (1)
17-18: 하드코딩된 IP 주소를 설정으로 외부화하는 것을 권장합니다CORS 허용 출처에 프로덕션 서버 IP 주소를 직접 하드코딩하면 IP 변경 시 코드 재배포가 필요합니다. 환경 변수나 application.yml을 통해 외부 설정으로 관리하는 것이 더 유연합니다.
다음과 같이 리팩토링을 고려해보세요:
application-prod.yml에 설정 추가:
cors: allowed-origins: - http://localhost:3000 - http://localhost:5173 - https://129.154.54.225.nip.ioSecurityConfig.java 수정:
+import org.springframework.beans.factory.annotation.Value; + @Configuration public class SecurityConfig { + @Value("${cors.allowed-origins}") + private List<String> allowedOrigins; + @Bean public CorsWebFilter corsWebFilter() { CorsConfiguration config = new CorsConfiguration(); - config.setAllowedOrigins( - List.of("http://localhost:3000", "http://localhost:5173", "https://129.154.54.225.nip.io")); + config.setAllowedOrigins(allowedOrigins);src/main/resources/application-prod.yml (1)
15-15: Eureka 서버 URL에 하드코딩된 IP 대신 환경 변수 사용을 권장합니다Eureka defaultZone에 IP 주소를 직접 작성하면 서버 IP 변경 시 설정 파일 수정이 필요합니다. 환경 변수를 활용하면 더 유연하게 관리할 수 있습니다.
다음과 같이 수정하는 것을 고려해보세요:
eureka: client: fetch-registry: true register-with-eureka: true service-url: - defaultZone: http://129.154.54.225:8761/eureka + defaultZone: ${EUREKA_SERVER_URL:http://129.154.54.225:8761/eureka}이렇게 하면 환경 변수
EUREKA_SERVER_URL로 서버 주소를 오버라이드할 수 있으며, 설정되지 않은 경우 기본값이 사용됩니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/ci.yaml(1 hunks)src/main/java/com/unionmate/gateway_service/global/SecurityConfig.java(1 hunks)src/main/resources/application-prod.yml(2 hunks)
🔇 Additional comments (2)
src/main/resources/application-prod.yml (1)
24-24: 변경 사항이 정상적으로 적용되었습니다Swagger UI의 백엔드 서비스 API 문서 URL 설정이 올바르게 유지되고 있습니다.
.github/workflows/ci.yaml (1)
45-45: ARM64 전용 빌드 변경으로 인한 배포 환경 호환성 검증 필수
platforms: linux/amd64에서linux/arm64로 변경되었습니다. 모든 배포 환경(프로덕션, 스테이징, 개발)이 ARM64 기반임을 확인하고 진행하세요. 혼합된 아키텍처 환경(AMD64 서버 포함)이 있다면 다음 설정으로 다중 플랫폼 지원을 권장합니다:platforms: linux/amd64,linux/arm64
Related issue 🛠
작업 내용 💻
스크린샷 📷
같이 얘기해보고 싶은 내용이 있다면 작성 📢
Summary by CodeRabbit
릴리스 노트