diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8843735..d12ff1e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -4,7 +4,7 @@ on: branches: - "develop" - "main" - - "hotfix/cd-script" + - "infra/**" pull_request: branches: - "develop" @@ -35,14 +35,25 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- -# - name: Make 'application.yml' -# if: contains(github.ref, 'develop') -# run: | -# cd ./src/main/resources -# touch ./application.yml -# echo "${{ secrets.APPLICATION_YML_DEV }}" > ./application.yml -# cat ./application.yml -# shell: bash + - name: Inject Resource Files + run: | + mkdir ./src/main/resources + shell: bash + + - name: Make 'application.yml' +# if: contains(github.ref, 'main') + run: | + cd ./src/main/resources + touch ./application.yml + echo "${{ secrets.APPLICATION_YML_DEV }}" | base64 --decode > ./application.yml + shell: bash + + - name: Make 'keystore.p12' + run: | + cd ./src/main/resources + touch ./keystore.p12 + echo "${{ secrets.KEYSTORE }}" | base64 --decode > ./keystore.p12 + shell: bash - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/.gitignore b/.gitignore index 4ccc24f..258a768 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ build/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ +application.yml +**/keystore.p12 +**/keystore.p12.base64 + ### IntelliJ IDEA ### .idea diff --git a/src/main/kotlin/retepmil/personal/dailysteady/common/security/config/WebConfig.kt b/src/main/kotlin/retepmil/personal/dailysteady/common/security/config/WebConfig.kt index 6ad99a7..0d0b5c8 100644 --- a/src/main/kotlin/retepmil/personal/dailysteady/common/security/config/WebConfig.kt +++ b/src/main/kotlin/retepmil/personal/dailysteady/common/security/config/WebConfig.kt @@ -12,7 +12,7 @@ class WebConfig : WebMvcConfigurer { // CORS 설정 override fun addCorsMappings(registry: CorsRegistry) { registry.addMapping("/**") - .allowedOrigins("http://localhost:5173", "http://dailysteady.site/") + .allowedOrigins("http://localhost:5173", "https://dailysteady.site/") .allowedMethods("*") .allowCredentials(true) .exposedHeaders("*") diff --git a/src/main/kotlin/retepmil/personal/dailysteady/common/security/jwt/JwtTokenProvider.kt b/src/main/kotlin/retepmil/personal/dailysteady/common/security/jwt/JwtTokenProvider.kt index f4f9673..312f683 100644 --- a/src/main/kotlin/retepmil/personal/dailysteady/common/security/jwt/JwtTokenProvider.kt +++ b/src/main/kotlin/retepmil/personal/dailysteady/common/security/jwt/JwtTokenProvider.kt @@ -125,7 +125,7 @@ class JwtTokenProvider( .value(refreshTokenValue) .path("/") .maxAge(maxAgeSeconds) - .httpOnly(false) // 배포 환경에서는 true로 설정 필요 + .httpOnly(true) .secure(true) .sameSite("None") .build() @@ -133,7 +133,7 @@ class JwtTokenProvider( fun generateAccessTokenCookie(accessTokenValue: String): ResponseCookie = ResponseCookie.from("x-access-token") .value(accessTokenValue) .maxAge(expirationMiliseconds) - .httpOnly(false) + .httpOnly(true) .secure(true) .sameSite("None") .build() diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index 39cdb2b..0000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,43 +0,0 @@ -spring: - jpa: - hibernate: - ddl-auto: create - properties: - hibernate: - format_sql: true - highlight_sql: true - database: postgresql - open-in-view: true - datasource: - hikari: - maximum-pool-size: 4 - url: jdbc:postgresql://daily-steady-db.clgq6c3hfkhr.ap-southeast-2.rds.amazonaws.com:5432/dev - username: postgres - password: 12345678 - driver-class-name: org.postgresql.Driver - sql: - init: - mode: always - -server: - port: 9000 - servlet: - encoding: - charset: UTF-8 - enabled: true - force: true - error: - include-message: always - -logging: - pattern: - console: "[%d{HH:mm:ss.SSS}][%-5level][%logger.%method:line%line] - %msg%n" - level: - org: - hibernate: - SQL: debug - type.descriptor.sql: trace - retepmil.personal.dailysteady: debug - -jwt: - secret: d8e3b829ff785f3465143d93993a36790d569231e969b0aa70a01b437fb7c844 \ No newline at end of file