-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: timezone 설정 kst로 설정 #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughDocker 및 Spring 설정과 DB 연결 설정에서 타임존을 Asia/Seoul로 통일. Dockerfile 및 Dockerfile-dev에 TZ 환경변수와 JVM 옵션(-Duser.timezone=Asia/Seoul)을 추가하고, 각 모듈의 application.yml에 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
Dockerfile-dev (1)
25-31: 비루트 사용자로 실행 전환 권장보안 강화를 위해 전용 사용자로 실행하세요. (추가 라인 — 파일 상단 Run stage 근처에 배치)
# 앱 사용자 생성 및 권한 설정 RUN addgroup --system app && adduser --system --ingroup app app \ && chown -R app:app /app USER appDockerfile (1)
25-31: 비루트 사용자 실행 전환 권장(CKV_DOCKER_3 대응)보안 모범사례에 따라 전용 사용자로 실행하세요. (Run stage에 추가)
RUN addgroup --system app && adduser --system --ingroup app app \ && chown -R app:app /app USER app
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
Dockerfile(1 hunks)Dockerfile-dev(1 hunks)admin/src/main/resources/application.yml(1 hunks)apis/src/main/resources/application.yml(1 hunks)batch/src/main/resources/application.yml(1 hunks)
🧰 Additional context used
🪛 Checkov (3.2.334)
Dockerfile
[LOW] 1-42: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
[LOW] 1-42: Ensure that a user for the container has been created
(CKV_DOCKER_3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-validation
🔇 Additional comments (5)
batch/src/main/resources/application.yml (1)
6-7: Jackson 직렬화/역직렬화 타임존(KST) 통일 — LGTM
spring.jackson.time-zone: Asia/Seoul추가로 JSON 직렬화/역직렬화 기준이 KST로 명확해졌습니다. 변경 의도와 일치합니다.Dockerfile-dev (1)
42-42: 헬스체크 엔드포인트 확인 및 Docker HEALTHCHECK 추가 권장검증 결과, 코드베이스에서 Spring Boot Actuator 의존성과
/actuator/health경로 노출 설정을 찾지 못했습니다. 아래 사항을 확인해주세요:
build.gradle/build.gradle.kts또는pom.xml에
spring-boot-starter-actuator의존성이 추가되었는지 검토application.properties또는application.yml에서
management.endpoints.web.exposure.include에health(또는 전체*)가 포함되었는지 확인- Actuator를 사용하지 않을 경우, 커스텀 헬스·핑 엔드포인트(
/ping,/health등)를 구현·노출했는지 검토의존성이나 엔드포인트가 확인되면,
Dockerfile-dev에 아래와 같이 HEALTHCHECK를 추가하는 것을 권장드립니다:ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-Duser.timezone=Asia/Seoul", "-jar", "app.jar"] +HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ + CMD curl -fsS http://localhost:8080/actuator/health | grep -q '"status":"UP"' || exit 1만약 다른 경로를 사용 중이거나 Actuator 의존성이 없다면, 해당 엔드포인트로 수정하거나 의존성을 추가해주세요.
apis/src/main/resources/application.yml (1)
6-7: Jackson 타임존 KST 적용 — LGTMAPI 모듈에서도 JSON 기준 타임존을 일관되게 KST로 맞춘 점 적절합니다.
admin/src/main/resources/application.yml (1)
6-7: Admin 모듈 Jackson 타임존 설정 — LGTM세 모듈 간 타임존 표현 기준이 통일되었습니다.
Dockerfile (1)
33-35: 이미지에 비밀 내장 위험 — secret 복사 제거 권장
- Dockerfile 34행:
COPY --from=build /app/secret ./secret/으로 인해 빌드 컨텍스트의secret/폴더가 최종 이미지에 포함됩니다.- 저장소에
.dockerignore파일이 없어, Docker 빌드 시secret/디렉터리가 제외되지 않습니다..gitignore에만secret/이 등록되어 있지만, 이는 Git 추적에서만 무시할 뿐 Docker 빌드 컨텍스트에는 영향을 주지 않습니다.- 외부 레지스트리로 이미지가 푸시되는 CI/CD 설정 여부를 확인해 주세요.
런타임에 볼륨 마운트(
-v /path/to/secret:/app/secret) 또는 Kubernetes Secret/오케스트레이터의 Secret 기능을 활용해 민감 정보를 관리하도록 전환을 권장합니다.- # 런타임에 필요한 secret 폴더 복사 - COPY --from=build /app/secret ./secret/ + # (권장) 런타임에 비밀 볼륨 마운트 + # VOLUME /app/secret– secret 디렉터리에 실제 민감정보가 포함되어 있는지
– 빌드된 이미지가 외부 레지스트리에 업로드되는지위 두 가지를 추가로 검증해 주세요.
| spring: | ||
| jackson: | ||
| time-zone: Asia/Seoul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
스케줄링/배치/감사로그 등 시스템 타임존 의존 영역 재점검 권장
@Scheduled등 zone 미명시 사용부가 있다면 JVM 시스템 타임존(KST)로 동작합니다. 의도와 일치하는지 확인하세요.- 관리자 화면의 날짜/시간 필터와 서버 직렬화 기준이 일치하는지(특히 로컬타임 vs. 오프셋타임)도 확인을 권장합니다.
🤖 Prompt for AI Agents
In admin/src/main/resources/application.yml around lines 5 to 7 the app-wide
Jackson time-zone is set to Asia/Seoul but there is a risk other parts (e.g.
@Scheduled tasks, batch jobs, audit logging, or JVM default time zone) may still
rely on the JVM system timezone; inspect all scheduling and time-handling code
and enforce a consistent zone: (1) search for @Scheduled usages and any
date/time serialization code and add explicit ZoneId/zone attributes or convert
to ZonedDateTime/OffsetDateTime as appropriate; (2) decide a canonical zone
strategy (e.g. UTC or Asia/Seoul) and either set the JVM property
-Duser.timezone=Asia/Seoul (or UTC) for runtime consistency and/or set
spring.jackson.time-zone accordingly; (3) update server-side serialization types
and API DTOs so they produce a consistent offset-aware format and verify admin
UI date/time filters expect the same representation; (4) add tests or logging to
confirm scheduled tasks and audit entries use the chosen zone.
| spring: | ||
| jackson: | ||
| time-zone: Asia/Seoul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
DB I/O 타임존과의 불일치 가능성 점검
- Jackson(KST) ↔ JPA/Hibernate(DB) 간 시간대 처리 기준이 다르면 “한 시간 밀림/당김”과 같은 문제가 발생할 수 있습니다.
- batch 코멘트의 제안대로
hibernate.jdbc.time_zone명시(UTC 또는 Asia/Seoul) 여부 검토를 부탁드립니다.
🤖 Prompt for AI Agents
In apis/src/main/resources/application.yml around lines 5-7, Jackson is set to
Asia/Seoul but there is no explicit Hibernate JDBC time_zone configured which
can cause one-hour offsets between JSON serialization and DB timestamp handling;
add the property spring.jpa.properties.hibernate.jdbc.time_zone and set it to a
consistent zone (either UTC or Asia/Seoul) to match Jackson, update
application.yml accordingly, and verify DB server/connection timezone
configuration to ensure end-to-end consistency.
| spring: | ||
| jackson: | ||
| time-zone: Asia/Seoul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
애플리케이션/DB 간 타임존 경계 명확화(JPA/Hibernate 설정 검토 권장)
- Jackson 설정은 API 입출력(JSON)에만 영향이 있습니다. DB I/O는 Hibernate/JDBC가 처리하므로, DB 변환 타임존을 명시해 의도를 고정하는 것을 권장합니다.
- 의도적으로 KST 저장/조회라면 아래와 같이 명시 가능하고, 일반적으로는 DB 저장은 UTC, 표현만 KST가 권장됩니다.
선호안 A: DB도 KST로 명시
spring:
jpa:
properties:
hibernate.jdbc.time_zone: Asia/Seoul
선호안 B(권장): DB는 UTC, API 표현만 KST
spring:
jpa:
properties:
hibernate.jdbc.time_zone: UTC
아래 스크립트로 타임존을 덮어쓰는 커스텀 ObjectMapper/글로벌 TimeZone 설정/스케줄링(zone 미명시)을 점검해 주세요.
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) ObjectMapper/Jackson Builder가 timeZone을 재설정하는지
rg -n -C3 -g '!**/build/**' --type-add 'kt:*.kt' --type-add 'java:*.java' \
-e 'ObjectMapper|Jackson2ObjectMapperBuilder|JavaTimeModule|setTimeZone'
# 2) 애플리케이션 어딘가에서 TimeZone.setDefault 등을 호출하는지
rg -n -C2 --type=kt --type=java 'TimeZone\.setDefault|ZoneId\.systemDefault\(\)|ZoneOffset'
# 3) @Scheduled에서 zone 속성 없이 시스템 타임존에 의존하는 스케줄이 있는지
rg -n -C2 --type=kt --type=java '@Scheduled\('Length of output: 4683
아래처럼 rg에 .kt/.java 타입을 추가하여 2) TimeZone 관련 호출, 3) @Scheduled 의존 여부를 재확인해주세요.
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 2) 애플리케이션 어딘가에서 TimeZone.setDefault, ZoneId.systemDefault(), ZoneOffset 호출 여부
rg -n -C3 -g '!**/build/**' \
--type-add 'kt:*.kt' --type-add 'java:*.java' \
-e 'TimeZone\.setDefault|ZoneId\.systemDefault\(\)|ZoneOffset'
# 3) @Scheduled 사용 시 zone 속성 없이 시스템 타임존에 의존하는 스케줄 확인
rg -n -C3 -g '!**/build/**' \
--type-add 'kt:*.kt' --type-add 'java:*.java' \
-e '@Scheduled\('Length of output: 158
애플리케이션/DB 타임존 경계 명확화 및 JPA 설정 추가 권장
확인 결과:
- spring.jackson.time-zone(Asia/Seoul)만 정의되어 있어 JSON 입출력에만 적용
- 커스텀
ObjectMapper/Jackson2ObjectMapperBuilder에서setTimeZone호출 없음 TimeZone.setDefault,ZoneId.systemDefault(),ZoneOffset호출 없음@Scheduled에서 zone 속성 없이 시스템 타임존에 의존하는 스케줄 없음
→ DB I/O는 Hibernate/JDBC가 처리하므로, DB 변환 타임존을 명시해 의도를 고정하는 것을 권장합니다.
선호안 A (KST 저장/조회):
spring:
jpa:
properties:
hibernate.jdbc.time_zone: Asia/Seoul선호안 B (권장: UTC 저장, API 표현만 KST):
spring:
jpa:
properties:
hibernate.jdbc.time_zone: UTC🤖 Prompt for AI Agents
In batch/src/main/resources/application.yml around lines 5 to 7, only
spring.jackson.time-zone is set (affecting JSON serialization) but the DB / JPA
time zone is not configured; add a
spring.jpa.properties.hibernate.jdbc.time_zone entry to explicitly fix DB I/O
timezone. Decide which policy you want: set hibernate.jdbc.time_zone to
"Asia/Seoul" if you want KST persisted and returned, or set it to "UTC"
(recommended) to store UTC and keep spring.jackson.time-zone for API
representation; update the YAML accordingly and ensure any custom
ObjectMapper/Jackson2ObjectMapperBuilder and scheduled tasks are reviewed to
respect the chosen zone.
| # TimeZone KST 설정 | ||
| ENV TZ=Asia/Seoul | ||
|
|
||
| # JVM 실행 설정 | ||
| # - Xms512m: 초기 힙 메모리 512MB | ||
| # - Xmx1g: 최대 힙 메모리 1GB | ||
| ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-jar", "app.jar"] | ||
| ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-Duser.timezone=Asia/Seoul", "-jar", "app.jar"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
tzdata 미설치로 OS 타임존 미적용 가능성 — 설치 또는 ENV TZ 제거 중 택1
ENV TZ=Asia/Seoul은 tzdata 부재 시 의미가 없을 수 있습니다. OS/네이티브 종속성 고려 시 tzdata 설치를 권장합니다. 전적으로 JVM만 사용한다면 ENV TZ 제거도 선택지입니다.
옵션 A(권장: tzdata 설치):
RUN apt-get update && apt-get install -y --no-install-recommends tzdata curl \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*옵션 B(JVM만): ENV TZ 제거
-ENV TZ=Asia/Seoul🏁 Script executed:
#!/bin/bash
set -e
# Locate Dockerfile(s)
DOCKERFILES=$(fd -t f -p 'Dockerfile$')
echo "Found Dockerfile(s):"
echo "$DOCKERFILES"
# Search for tzdata references
echo -e "\nSearching for 'tzdata' in Dockerfile(s):"
rg -n 'tzdata' $DOCKERFILES || echo "[No tzdata references found]"
# Search for apt-get install commands to see if tzdata is installed
echo -e "\nSearching for 'apt-get install' in Dockerfile(s):"
rg -n 'apt-get.*install' $DOCKERFILES || echo "[No apt-get install commands found]"Length of output: 577
tzdata 미설치 시 OS 타임존 적용 불가 — 설치 또는 ENV TZ 제거 중 선택 필요
현재 Dockerfile에는 ENV TZ=Asia/Seoul만 설정되어 있어 tzdata가 없으면 OS 레벨의 시간대 변경이 적용되지 않습니다. JVM에서만 시간대를 사용한다면 ENV TZ를 제거할 수 있지만, OS/네이티브 종속성을 고려한다면 tzdata 설치를 권장합니다.
옵션 A (권장: tzdata 설치)
# tzdata 설치 및 로컬타임 설정
RUN apt-get update \
&& apt-get install -y --no-install-recommends tzdata curl \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
ENV TZ=Asia/Seoul옵션 B (JVM만 사용 시): ENV TZ 제거
- ENV TZ=Asia/Seoul🧰 Tools
🪛 Checkov (3.2.334)
[LOW] 1-42: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
[LOW] 1-42: Ensure that a user for the container has been created
(CKV_DOCKER_3)
🤖 Prompt for AI Agents
In Dockerfile around lines 36 to 42, the Docker image sets ENV TZ=Asia/Seoul but
does not install tzdata so OS timezone won't change; either install tzdata and
configure /etc/localtime and /etc/timezone (apt-get update, apt-get install -y
--no-install-recommends tzdata, symlink /usr/share/zoneinfo/$TZ to
/etc/localtime, write $TZ to /etc/timezone, and clean apt lists) and keep ENV
TZ, or if you only need JVM timezone remove the ENV TZ line; choose the tzdata
install option for OS-level correctness and add it before the ENTRYPOINT.
| # - Xms512m: 초기 힙 메모리 512MB | ||
| # - Xmx1g: 최대 힙 메모리 1GB | ||
| ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-jar", "app.jar"] | ||
| ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-Duser.timezone=Asia/Seoul", "-jar", "app.jar"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
HEALTHCHECK 추가 권장(정적 분석 권고 사항 대응, CKV_DOCKER_2)
컨테이너 상태 모니터링을 위해 헬스체크를 추가하세요. (curl 필요)
ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-Duser.timezone=Asia/Seoul", "-jar", "app.jar"]
+HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
+ CMD curl -fsS http://localhost:8080/actuator/health | grep -q '"status":"UP"' || exit 1Actuator 포함 여부를 확인하세요. 미포함 시 다른 엔드포인트/방법으로 대체해야 합니다.
🧰 Tools
🪛 Checkov (3.2.334)
[LOW] 1-42: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
[LOW] 1-42: Ensure that a user for the container has been created
(CKV_DOCKER_3)
| # 런타임에 필요한 secret 폴더 복사 | ||
| COPY --from=build /app/secret ./secret/ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
이미지에 비밀을 내장(COPY secret)하면 레지스트리 유출 리스크가 큽니다
빌드 산출물 이미지에 secret/를 포함시키면 이미지가 유출되거나 권한 범위를 벗어난 사용 시 비밀이 노출됩니다. 런타임 볼륨 마운트/오케스트레이터 Secret(예: K8s Secrets) 사용을 권장합니다.
-# 런타임에 필요한 secret 폴더 복사
-COPY --from=build /app/secret ./secret/
+# (권장) 런타임에 -v /path/to/secret:/app/secret 형태로 마운트
+# 또는 K8s Secret/ConfigMap 사용
+# VOLUME /app/secret # 필요 시🤖 Prompt for AI Agents
In Dockerfile-dev around lines 33-35, remove the COPY --from=build /app/secret
./secret/ step because embedding secrets into the image is a leakage risk;
instead modify the Dockerfile to not copy secrets, update deployment/run
instructions to mount the secret at runtime (bind mount or use the
orchestrator's secret mechanism such as Kubernetes Secrets or Docker secrets),
add guidance in README for how to provide the secret at runtime, and ensure
secret/ is listed in .dockerignore and not present in the build context or
intermediate images so no secret is baked into any image layers.
| # TimeZone KST 설정 | ||
| ENV TZ=Asia/Seoul | ||
|
|
||
| # JVM 실행 설정 | ||
| # - Xms512m: 초기 힙 메모리 512MB | ||
| # - Xmx1g: 최대 힙 메모리 1GB | ||
| ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-jar", "app.jar"] | ||
| ENTRYPOINT ["java", "-Xms512m", "-Xmx1g", "-Duser.timezone=Asia/Seoul", "-jar", "app.jar"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
ENV TZ만으로는 불충분할 수 있음(tzdata 미포함 이미지) — 설치 또는 OS TZ 제거 중 택1
- openjdk:21-slim에는 tzdata가 기본 포함되지 않을 수 있어 ENV TZ만 설정하면 OS 레벨 타임존이 실제로 적용되지 않을 가능성이 큽니다.
- 선택지:
- 옵션 A: tzdata 설치로 OS 타임존을 확정(권장: OS/Native 라이브러리 일관성)
- 옵션 B: OS TZ 제거하고 JVM
-Duser.timezone만 유지(순수 자바만 사용한다면 간단)
옵션 A 적용 예(파일 상단 Run stage에 추가 필요):
# tzdata + curl 설치 (HEALTHCHECK에 사용)
RUN apt-get update && apt-get install -y --no-install-recommends tzdata curl \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*옵션 B 적용 예(현재 라인에서 ENV TZ 제거):
-ENV TZ=Asia/Seoul- 컨테이너 내
/usr/share/zoneinfo/Asia/Seoul존재 여부,date출력 결과로 OS TZ 반영 여부를 점검해 주세요.
아래 스크립트로 베이스 이미지와 tzdata 설치 여부를 검증해 주세요:
🏁 Script executed:
#!/bin/bash
set -eux
# Dockerfile-dev에서 베이스 이미지 확인
grep -nE '^FROM' Dockerfile-dev
# 전체 리포지토리에서 tzdata 설치 또는 참조 여부 검색
grep -R "tzdata" -n .Length of output: 123
Dockerfile-dev: openjdk:21-slim에 tzdata 미포함 — ENV TZ만으로 OS 타임존 적용 불가
openjdk:21-slim 이미지를 확인한 결과 리포지터리 어디에도 tzdata 설치나 참조가 없으므로, ENV TZ 설정만으로는 컨테이너 OS 레벨 타임존이 변경되지 않습니다. 아래 두 가지 중 하나를 적용하세요:
- 옵션 A (권장): tzdata 설치 후 OS 타임존을 고정
# Dockerfile-dev 상단 RUN 단계에 추가 RUN apt-get update \ && apt-get install -y --no-install-recommends tzdata curl \ && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone \ && rm -rf /var/lib/apt/lists/*
- 옵션 B: ENV TZ 제거하고 JVM
-Duser.timezone만 사용- ENV TZ=Asia/Seoul
🤖 Prompt for AI Agents
In Dockerfile-dev around lines 36 to 42: ENV TZ only sets an env var but
openjdk:21-slim lacks tzdata so the OS timezone won’t change; either (A) install
tzdata during build and set /etc/localtime and /etc/timezone in a RUN step (add
apt-get update, install tzdata, link zoneinfo and write timezone, then cleanup
apt lists) so the container OS timezone matches TZ, or (B) remove the ENV TZ
line and keep only the JVM flag -Duser.timezone=Asia/Seoul if you only need the
JVM timezone; implement one of these two options consistently and ensure apt
cleanup to keep the image small.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
infra/src/main/resources/application-persistence.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-validation
🔇 Additional comments (1)
infra/src/main/resources/application-persistence.yml (1)
3-3: 서버 타임존 설정 일관성 검증 및 전략 선택infra/src/main/resources/application-persistence.yml 3행의 JDBC URL에
serverTimezone=Asia/Seoul이 하드코딩되어 있습니다.
DB 서버 실제 타임존과 불일치할 경우 TIMESTAMP 변환 시 ±9h 오프셋 오류가 발생할 수 있으니, 아래 전략 중 하나를 명확히 선택·적용하고 각 환경의 DB 서버 타임존(@@global.time_zone, @@session.time_zone)을 확인해 일관성을 보증해주세요.
코드 위치
- infra/src/main/resources/application-persistence.yml (3행):
url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useSSL=false&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true적용할 전략 (택1)
- JDBC 계층 UTC 고정
•hibernate.jdbc.time_zone=UTC또는 JDBC URL 파라미터connectionTimeZone=UTC설정
• 표현/직렬화 레이어(Jackson, JVM)는 KST 유지- DB 서버를 KST로 운영
• 운영·스테이징·테스트컨테이너 환경 모두 MySQL 서버 타임존을 KST로 설정
• URL 파라미터는serverTimezone=Asia/Seoul유지추가 검토
- Spring 설정:
spring.jackson.time-zone,hibernate.jdbc.time_zone적용 여부
| spring: | ||
| datasource: | ||
| url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true | ||
| url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useSSL=false&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
보안: useSSL=false + allowPublicKeyRetrieval=true는 운영 환경에 부적절
현재 URL은 평문 연결(useSSL=false)이며 서버 공개키 자동 조회(allowPublicKeyRetrieval=true)를 허용합니다. 운영/인터넷 구간에서 크리덴셜 탈취 위험이 큽니다. 운영 기본값은 TLS 강제 및 서버 인증서 검증으로 전환하고, dev/test 프로파일에서만 예외를 허용하세요.
운영 기본 설정 예(라인 3 대체안):
- url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useSSL=false&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true
+ url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useSSL=true&requireSSL=true&verifyServerCertificate=true&serverTimezone=Asia/Seoul주의: 위 설정은 신뢰할 수 있는 CA로 서명된 서버 인증서(또는 적절한 truststore) 구성이 전제됩니다. dev/test는 별도 프로파일에서만 useSSL=false를 허용하세요.
🤖 Prompt for AI Agents
infra/src/main/resources/application-persistence.yml around line 3: the JDBC URL
currently disables TLS (useSSL=false) and enables allowPublicKeyRetrieval=true
which is insecure for production; update the production/default URL to enforce
TLS (useSSL=true and requireSSL=true) and enable server certificate verification
(verifyServerCertificate=true) while removing allowPublicKeyRetrieval=true, and
ensure the application is configured with a proper truststore/CA-signed server
cert; move the insecure settings (useSSL=false and allowPublicKeyRetrieval=true)
into a dev/test-specific profile only.
💡 Verification agent
❓ Verification inconclusive
dev/test 프로파일과 타임존 일관성 정렬 필요
test 프로파일(JDBC Testcontainers URL: Line 58)은 현재 타임존 파라미터가 없습니다. 이 상태에서 prod/dev은 KST로, test는 기본(대개 UTC)로 동작해 날짜·시간 관련 테스트가 환경에 따라 다르게 나올 수 있습니다.
대안:
- JDBC를 UTC로 표준화하고(JDBC 레이어: hibernate.jdbc.time_zone=UTC 또는 connectionTimeZone=UTC), JVM/Jackson만 KST로 유지
- 또는 test URL에도 동일한 타임존 정책을 명시(단, Testcontainers의 MySQL 서버 실제 타임존과 일치시켜야 함)
예시(참고용, 코드 외부 제안):
# (전략 A - JDBC UTC 권장)
spring:
jpa:
properties:
hibernate:
jdbc:
time_zone: UTC
# (전략 B - URL 명시 시)
spring:
datasource:
url: jdbc:tc:mysql:8.0.39:///testdb?serverTimezone=UTC # 컨테이너 MySQL이 기본 UTC일 때
둘 중 어떤 전략을 선택하든, 운영/스테이징/CI의 동작 타임존이 동일하게 정렬되도록 확인해 주세요.
dev/test 프로파일 타임존 일관성 확보 필요
prod/dev 프로파일의 JDBC URL에는 serverTimezone=Asia/Seoul이 설정되어 있지만, test 프로파일(라인 58)의 JDBC URL에는 타임존 파라미터가 없어 기본(대개 UTC)으로 동작합니다. 이로 인해 날짜·시간 관련 테스트가 환경마다 다르게 나올 수 있습니다.
아래 두 가지 전략 중 하나를 선택해 prod, staging, CI, test 등 모든 실행 환경의 JDBC 타임존 동작을 일관성 있게 맞춰주세요:
-
전략 A: JDBC 레이어를 UTC로 표준화
spring: jpa: properties: hibernate: jdbc: time_zone: UTC
– 애플리케이션 로직(JVM/Jackson)에서는 KST를 유지
-
전략 B: test 프로파일 URL에도 타임존 명시
spring: datasource: url: jdbc:tc:mysql:8.0.39:///testdb?serverTimezone=Asia/Seoul
– Testcontainers MySQL 인스턴스의 실제 타임존과 일치시킬 것
※ 선택한 방안이 모든 환경에서 동일하게 적용되는지 최종 확인 부탁드립니다.
🤖 Prompt for AI Agents
In infra/src/main/resources/application-persistence.yml around lines 3 to 3, the
test profile omits a JDBC time zone while prod/dev specify
serverTimezone=Asia/Seoul, causing inconsistent datetime behavior across
environments; pick one strategy and apply it consistently: either set Hibernate
JDBC time_zone to UTC under spring.jpa.properties.hibernate.jdbc.time_zone for
all profiles (Strategy A), or add the serverTimezone=Asia/Seoul parameter to the
test profile datasource URL (Strategy B) and ensure any Testcontainers MySQL
instance uses the same timezone, then verify the chosen change is present in
prod/dev/staging/CI/test profiles.
move-hoon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!



🔧 PR 제목
chore: KST TimeZone 설정 추가 및 Dockerfile 개선
🔗 관련 이슈
📘 작업 유형
📙 작업 내역
Dockerfile-dev
-Duser.timezone=Asia/Seoul추가ENV TZ=Asia/Seoul환경 변수 설정application.yml (admin, apis, batch)
spring.jackson.time-zone: Asia/Seoul설정 추가🧪 테스트 내역
🎨 스크린샷 또는 시연 영상 (선택)
✅ PR 체크리스트
💬 추가 설명 or 리뷰 포인트
Summary by CodeRabbit