Skip to content

Commit fcd7dcf

Browse files
authored
Merge pull request #287 from GDGoCINHA/develop
Merge Dev
2 parents c860a6b + 9e52b01 commit fcd7dcf

134 files changed

Lines changed: 3299 additions & 2230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,24 @@ jobs:
2020
build:
2121
runs-on: ubuntu-latest
2222

23+
services:
24+
redis:
25+
image: redis
26+
ports:
27+
- 6379:6379
28+
options: >-
29+
--health-cmd "redis-cli ping"
30+
--health-interval 10s
31+
--health-timeout 5s
32+
--health-retries 5
33+
2334
steps:
2435
- uses: actions/checkout@v4
2536

2637
- uses: actions/setup-java@v4
2738
with:
2839
distribution: temurin
29-
java-version: 17
40+
java-version: 21
3041

3142
- uses: gradle/actions/setup-gradle@v3
3243
if: ${{ !env.ACT }}
@@ -35,7 +46,14 @@ jobs:
3546
gradle-home-cache-cleanup: true
3647

3748
- name: Create dummy .env for CI
38-
run: echo "# ci dummy" > .env
49+
env:
50+
AUDIENCE_SECRET: ${{ secrets.JWT_AUDIENCE }}
51+
run: |
52+
AUDIENCE_VALUE="${AUDIENCE_SECRET:-ci-audience}"
53+
cat > .env <<EOF
54+
# ci dummy
55+
JWT_AUDIENCE=${AUDIENCE_VALUE}
56+
EOF
3957
4058
- name: Gradle build (skip tests)
4159
id: assemble
@@ -57,6 +75,8 @@ jobs:
5775
SPRING_JPA_DATABASE_PLATFORM: org.hibernate.dialect.H2Dialect
5876
SPRING_JPA_HIBERNATE_DDL_AUTO: create-drop
5977
SPRING_FLYWAY_ENABLED: "false"
78+
SPRING_DATA_REDIS_HOST: localhost
79+
SPRING_DATA_REDIS_PORT: 6379
6080
run: ./gradlew test --no-daemon --stacktrace --info --no-watch-fs | tee test.log
6181

6282
- name: Publish unit-test results (check UI)

.github/workflows/deploy-dev.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ jobs:
3636
DB_NAME_DEV=${{ secrets.DB_NAME_DEV }}
3737
DB_USERNAME=${{ secrets.DB_USERNAME }}
3838
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
39+
REDIS_HOST=${{ secrets.REDIS_HOST || 'localhost' }}
40+
REDIS_PORT=${{ secrets.REDIS_PORT || '6379' }}
41+
REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}
3942
GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}
40-
GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}
41-
GOOGLE_REDIRECT_URI=${{ secrets.GOOGLE_REDIRECT_URI }}
4243
GOOGLE_ISSUER=${{ secrets.GOOGLE_ISSUER }}
4344
SELF_ISSUER=${{ secrets.SELF_ISSUER }}
45+
JWT_AUDIENCE=${{ secrets.JWT_AUDIENCE }}
46+
REFRESH_COOKIE_SECURE=${{ secrets.REFRESH_COOKIE_SECURE || 'false' }}
47+
REFRESH_COOKIE_SAME_SITE=${{ secrets.REFRESH_COOKIE_SAME_SITE || 'Lax' }}
48+
REFRESH_COOKIE_DOMAIN=${{ secrets.REFRESH_COOKIE_DOMAIN }}
4449
SECRET_KEY=${{ secrets.SECRET_KEY }}
4550
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
4651
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/deploy-prod.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ jobs:
3939
DB_NAME=${{ secrets.DB_NAME }}
4040
DB_USERNAME=${{ secrets.DB_USERNAME }}
4141
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
42+
REDIS_HOST=${{ secrets.REDIS_HOST }}
43+
REDIS_PORT=${{ secrets.REDIS_PORT }}
44+
REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}
4245
GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}
43-
GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}
44-
GOOGLE_REDIRECT_URI=${{ secrets.GOOGLE_REDIRECT_URI }}
4546
GOOGLE_ISSUER=${{ secrets.GOOGLE_ISSUER }}
4647
SELF_ISSUER=${{ secrets.SELF_ISSUER }}
48+
JWT_AUDIENCE=${{ secrets.JWT_AUDIENCE }}
49+
REFRESH_COOKIE_SECURE=${{ secrets.REFRESH_COOKIE_SECURE || 'false' }}
50+
REFRESH_COOKIE_SAME_SITE=${{ secrets.REFRESH_COOKIE_SAME_SITE || 'Lax' }}
51+
REFRESH_COOKIE_DOMAIN=${{ secrets.REFRESH_COOKIE_DOMAIN }}
4752
SECRET_KEY=${{ secrets.SECRET_KEY }}
4853
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
4954
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
# --- Build stage ---
4-
FROM gradle:8.11.1-jdk17 AS build
4+
FROM eclipse-temurin:21-jdk AS build
55
WORKDIR /app
66

77
# 루트 프로젝트 전체 복사
@@ -18,7 +18,7 @@ RUN ./gradlew clean bootJar -x test --no-daemon
1818
RUN cp "$(ls build/libs/*.jar | head -n 1)" build/libs/app.jar
1919

2020
# --- Runtime stage ---
21-
FROM eclipse-temurin:17-jre
21+
FROM eclipse-temurin:21-jre
2222
WORKDIR /app
2323

2424
COPY --from=build /app/build/libs/app.jar app.jar

build.gradle

Lines changed: 67 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,52 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '3.3.6'
3+
id 'org.springframework.boot' version '3.5.9'
44
id 'io.spring.dependency-management' version '1.1.7'
5+
id 'com.diffplug.spotless' version '6.25.0'
56
}
67

78
group = 'inha'
89
version = '0.0.1-SNAPSHOT'
910

10-
/* ===== Java Toolchain ===== */
1111
java {
1212
toolchain {
13-
languageVersion = JavaLanguageVersion.of(17)
13+
languageVersion = JavaLanguageVersion.of(21)
1414
}
1515
}
1616

17-
/* ===== Configurations ===== */
1817
configurations {
1918
compileOnly {
2019
extendsFrom annotationProcessor
2120
}
2221
}
2322

24-
/* ===== Repositories ===== */
2523
repositories {
2624
mavenCentral()
2725
}
2826

29-
/* ===== Dependencies ===== */
27+
/* ===== Version Pins (필요한 것만) ===== */
28+
ext {
29+
awspringBomVersion = '3.4.2'
30+
springdocVersion = '2.8.15'
31+
flywayVersion = '11.19.0'
32+
postgresVersion = '42.7.3'
33+
hibernateTypes60 = '2.21.1'
34+
dotenvVersion = '5.2.2'
35+
querydslVersion = '6.10.1'
36+
jjwtVersion = '0.13.0'
37+
googleApiClientVersion = '2.6.0'
38+
}
39+
40+
/* ===== Vulnerability Pins (정확한 CVE 기반 대응) ===== */
41+
configurations.configureEach {
42+
resolutionStrategy {
43+
// CVE-2024-47554 대응 (commons-compress 체인 영향 → commons-lang3 3.18.0 필요)
44+
force 'org.apache.commons:commons-lang3:3.18.0'
45+
// springdoc transitive classgraph 취약점 대응 버전으로 상향
46+
force 'io.github.classgraph:classgraph:4.8.179'
47+
}
48+
}
49+
3050
dependencies {
3151
// --- Spring Boot Starters ---
3252
implementation 'org.springframework.boot:spring-boot-starter-web'
@@ -35,62 +55,77 @@ dependencies {
3555
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
3656
implementation 'org.springframework.boot:spring-boot-starter-mail'
3757

38-
// --- DB & JPA Utils ---
39-
implementation 'com.vladmihalcea:hibernate-types-60:2.21.1'
40-
implementation 'org.postgresql:postgresql:42.7.3'
41-
runtimeOnly 'com.h2database:h2' // 테스트/로컬용 인메모리 DB
58+
// --- Swagger / OpenAPI (springdoc) ---
59+
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdocVersion}") {
60+
exclude group: "org.apache.commons", module: "commons-lang3"
61+
}
62+
implementation "org.apache.commons:commons-lang3:3.18.0"
63+
64+
// --- DB & JPA Utils (Boot 관리 버전과 동기화 필요) ---
65+
implementation "com.vladmihalcea:hibernate-types-60:${hibernateTypes60}"
66+
implementation "org.postgresql:postgresql:${postgresVersion}"
67+
testRuntimeOnly 'com.h2database:h2' // 테스트 환경 전용, 운영 패키지에서는 제외
68+
69+
// --- Cache / Redis ---
70+
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
71+
72+
// --- Querydsl (OpenFeign fork) ---
73+
implementation "io.github.openfeign.querydsl:querydsl-jpa:${querydslVersion}"
74+
annotationProcessor "io.github.openfeign.querydsl:querydsl-apt:${querydslVersion}:jakarta"
75+
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
4276

43-
// --- QueryDSL ---
44-
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
45-
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
46-
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
47-
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
77+
// Querydsl APT helper APIs (컴파일 타임만)
78+
compileOnly 'jakarta.annotation:jakarta.annotation-api'
79+
compileOnly 'jakarta.persistence:jakarta.persistence-api'
4880

49-
// --- JWT (JJWT 0.9.x, 레거시 패키지) ---
50-
implementation 'io.jsonwebtoken:jjwt:0.9.1'
81+
// --- JWT ---
82+
implementation "io.jsonwebtoken:jjwt-api:${jjwtVersion}"
83+
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jjwtVersion}"
84+
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jjwtVersion}"
5185

5286
// --- AWS (S3) ---
5387
implementation 'io.awspring.cloud:spring-cloud-aws-starter-s3'
5488

55-
// --- Flyway (DB Migration) ---
56-
implementation "org.flywaydb:flyway-core:10.21.0"
57-
implementation "org.flywaydb:flyway-database-postgresql:10.21.0"
89+
// --- Flyway ---
90+
implementation "org.flywaydb:flyway-core:${flywayVersion}"
91+
implementation "org.flywaydb:flyway-database-postgresql:${flywayVersion}"
5892

5993
// --- 환경변수(.env) ---
60-
implementation 'io.github.cdimascio:java-dotenv:5.2.2'
94+
implementation "io.github.cdimascio:java-dotenv:${dotenvVersion}"
6195

6296
// --- Lombok ---
63-
compileOnly 'org.projectlombok:lombok'
97+
compileOnly 'org.projectlombok:lombok'
6498
annotationProcessor 'org.projectlombok:lombok'
6599

66100
// --- Test ---
67101
testImplementation 'org.springframework.boot:spring-boot-starter-test'
68102
testImplementation 'org.mockito:mockito-core:5.6.0'
69103
testImplementation 'org.mockito:mockito-junit-jupiter:5.6.0'
70104
testImplementation 'org.assertj:assertj-core:3.24.2'
71-
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
105+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
72106

73-
// swagger
74-
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
107+
//Google API Client
108+
implementation "com.google.api-client:google-api-client:${googleApiClientVersion}"
75109
}
76110

77111
dependencyManagement {
78112
imports {
79-
mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:3.1.1"
80-
// ↑ 3.x 대 사용 (프로젝트에 맞는 최신 3.x 가능)
113+
mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:${awspringBomVersion}"
81114
}
82115
}
83116

84-
/* ===== Tasks ===== */
117+
spotless {
118+
java {
119+
googleJavaFormat('1.22.0')
120+
target 'src/**/*.java'
121+
}
122+
}
85123

86-
// 테스트: 프로필과 JUnit 플랫폼 한 곳에서 설정
87124
tasks.test {
88125
useJUnitPlatform()
89126
systemProperty "spring.profiles.active", "test"
90127
}
91128

92-
// QueryDSL 생성물 경로 고정
93129
tasks.withType(JavaCompile).configureEach {
94-
options.annotationProcessorGeneratedSourcesDirectory = file("build/generated/sources/annotationProcessor/java/main")
130+
options.generatedSourceOutputDirectory.set(file("build/generated/sources/annotationProcessor/java/main"))
95131
}
96-

0 commit comments

Comments
 (0)