Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
test:
name: Unit and integration tests
runs-on: ubuntu-latest
# application-dev.yml이 요구하는 값. CI에는 .env가 없으므로 더미 값을 주입한다(JWT는 32바이트 이상).
# application.yml이 요구하는 값. CI에는 .env가 없으므로 더미 값을 주입한다(JWT는 32바이트 이상).
env:
GOOGLE_CLIENT_ID: ci-dummy
GOOGLE_CLIENT_SECRET: ci-dummy
Expand Down
46 changes: 1 addition & 45 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,13 @@
# 로컬 개발용. 서버(dev·prod)에서는 application-server.yml과 환경 변수가 이 값을 덮는다.
spring:
sql:
init:
mode: never
datasource:
url: jdbc:postgresql://localhost:5678/database
username: user
password: password
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: validate
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
scope:
- email
- profile
kakao:
client-id: ${KAKAO_CLIENT_ID}
client-secret: ${KAKAO_CLIENT_SECRET}
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
authorization-grant-type: authorization_code
client-authentication-method: client_secret_post
client-name: Kakao
scope:
- profile_nickname
provider:
# 카카오 제공자 서버 정보 추가
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize
token-uri: https://kauth.kakao.com/oauth/token
user-info-uri: https://kapi.kakao.com/v2/user/me
user-name-attribute: id

jwt:
expiration: 600
refresh_expiration: 86400
secret: ${JWT_SECRET}


app:
frontend:
url: "http://localhost:5173"
cookie:
secure: false
same-site: Lax
oauth2:
success-redirect-url: "/"
failure-redirect-url: "/login-error"
11 changes: 11 additions & 0 deletions src/main/resources/application-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 배포 서버 공통(deploy/docker-compose.yml). dev 서버는 dev,server, 운영은 server 로 띄운다.
# DB 접속 정보는 SPRING_DATASOURCE_URL/USERNAME/PASSWORD 환경 변수로 받는다.
server:
forward-headers-strategy: framework # nginx 뒤에서 https 리다이렉트 URL을 만들기 위해

app:
frontend:
url: ${FRONTEND_URL}
cookie:
secure: true
same-site: None
47 changes: 47 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,50 @@ spring:
flyway:
baseline-on-migrate: true
baseline-version: 2
sql:
init:
mode: never
datasource:
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: validate
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
scope:
- email
- profile
kakao:
client-id: ${KAKAO_CLIENT_ID}
client-secret: ${KAKAO_CLIENT_SECRET}
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
authorization-grant-type: authorization_code
client-authentication-method: client_secret_post
client-name: Kakao
scope:
- profile_nickname
provider:
# 카카오 제공자 서버 정보 추가
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize
token-uri: https://kauth.kakao.com/oauth/token
user-info-uri: https://kapi.kakao.com/v2/user/me
user-name-attribute: id

jwt:
expiration: 600
refresh_expiration: 86400
secret: ${JWT_SECRET}

app:
oauth2:
success-redirect-url: "/"
failure-redirect-url: "/login-error"
Loading