Skip to content

Commit

Permalink
Infra/https-config (#7)
Browse files Browse the repository at this point in the history
* 🚀 프론트 https 설정

* 🚀 인증서 추가

* 🔧 application.yml 숨김

....

* 🚑 보안 설정 추가
  • Loading branch information
RetepMil authored Oct 13, 2023
1 parent d3db0b7 commit 9ece462
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 55 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- "develop"
- "main"
- "hotfix/cd-script"
- "infra/**"
pull_request:
branches:
- "develop"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ class JwtTokenProvider(
.value(refreshTokenValue)
.path("/")
.maxAge(maxAgeSeconds)
.httpOnly(false) // 배포 환경에서는 true로 설정 필요
.httpOnly(true)
.secure(true)
.sameSite("None")
.build()

fun generateAccessTokenCookie(accessTokenValue: String): ResponseCookie = ResponseCookie.from("x-access-token")
.value(accessTokenValue)
.maxAge(expirationMiliseconds)
.httpOnly(false)
.httpOnly(true)
.secure(true)
.sameSite("None")
.build()
Expand Down
43 changes: 0 additions & 43 deletions src/main/resources/application.yml

This file was deleted.

0 comments on commit 9ece462

Please sign in to comment.