Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/prod-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
-p $NEW_PORT:8080 \
--name $NEW_CONTAINER \
--network common \
-e SPRING_PROFILES_ACTIVE=prod \
-e SPRING_DATASOURCE_URL="${{secrets.PROD_DB_URL}}" \
-e SPRING_DATASOURCE_USERNAME="${{secrets.PROD_DB_USERNAME}}" \
-e SPRING_DATASOURCE_PASSWORD="${{secrets.PROD_DB_PASSWORD}}" \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-server-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
-p $NEW_PORT:8080 \
--name $NEW_CONTAINER \
--network common \
-e SPRING_PROFILES_ACTIVE=server \
-e SPRING_DATASOURCE_URL="${{secrets.TEST_DB_URL}}" \
-e SPRING_DATASOURCE_USERNAME="${{secrets.TEST_DB_USERNAME}}" \
-e SPRING_DATASOURCE_PASSWORD="${{secrets.TEST_DB_PASSWORD}}" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-server-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Generate application-secrets.yml
run: |
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_SECRET_YML }}" > src/main/resources/application-secrets.yml
echo "${{ secrets.APPLICATION_SECRET_YML_V2 }}" > src/main/resources/application-secrets.yml
echo "OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}" >> src/main/resources/application-secrets.yml
echo "spring.cloud.aws.region.static: ${{ secrets.AWS_REGION }}" >> src/main/resources/application-secrets.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public class OAuth2SuccessHandler extends SimpleUrlAuthenticationSuccessHandler
@Value("${front.redirect_domain}")
private String redirect_domain;

@Value("${spring.profiles.active:dev}")
private String activeProfile;
private final String SITE_DOMAIN = "zoopzoop.kro.kr";

@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Expand Down Expand Up @@ -112,7 +111,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
.maxAge(jwtProperties.getAccessTokenValidity() / 1000)
// .domain() // 프론트엔드 & 백엔드 상위 도메인
// .secure(true) // https 필수 설정.
.domain(redirect_domain)
.domain(SITE_DOMAIN)
.secure(true)
.sameSite("None")
.build();
Expand All @@ -121,7 +120,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
.httpOnly(true)
.path("/")
.maxAge(jwtProperties.getRefreshTokenValidity() / 1000) // RefreshToken 유효기간과 동일하게
.domain(redirect_domain)
.domain(SITE_DOMAIN)
.secure(true)
.sameSite("None")
.build();
Expand Down
25 changes: 16 additions & 9 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,27 @@ spring:
host: localhost
port: 6379
timeout: 6000
cache: #Spring Cache를 사용하기 위한 Redis
type: redis
redis:
time-to-live: 300000
cache-null-values: false

security:
oauth2:
client:
registration:
kakao:
redirect-uri: http://localhost:8080/login/oauth2/code/kakao
google:
redirect-uri: http://localhost:8080/login/oauth2/code/google

app:
seed:
enabled: true

front:
redirect_domain: http://localhost:3000

sentry:
dsn: https://60f1acad189d2994353d59b7895076ee@o4510100579155968.ingest.us.sentry.io/4510100584923136
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
send-default-pii: true
environment: local
traces-sample-rate: 0.0
traces-sample-rate: 0.0

liveblocks:
secret-key: test_dummy_liveblocks_secret_key
32 changes: 32 additions & 0 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
spring:
datasource:
url: ${SPRING_DATASOURCE_URL}
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}

data: #RedisTemplate 등을 사용하기 위한 직접 연결용
redis:
host: 10.0.1.153
port: 6379
timeout: 6000
password: ${redis-password-prod}

security:
oauth2:
client:
registration:
kakao:
redirect-uri: https://api.prod.zoopzoop.kro.kr/login/oauth2/code/kakao
google:
redirect-uri: https://api.prod.zoopzoop.kro.kr/login/oauth2/code/google

front:
redirect_domain: https://www.zoopzoop.kro.kr/

sentry:
send-default-pii: true
environment: prod-server
traces-sample-rate: 0.2

liveblocks:
secret-key: ${liveblocks-secret-key}
3 changes: 2 additions & 1 deletion src/main/resources/application-secrets.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ jwt:
OPENAI_API_KEY: {OPENAI_API_KEY}

liveblocks:
secret-key: {LIVEBLOCKS_SECRET_KEY}
secret-key: {LIVEBLOCKS_SECRET_KEY}

40 changes: 18 additions & 22 deletions src/main/resources/application-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,31 @@ spring:
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}

jpa:
hibernate:
ddl-auto: update

data: #RedisTemplate 등을 사용하기 위한 직접 연결용
redis:
host: 10.0.1.246
port: 6379
timeout: 6000
password: zoopzoopRedisTest!
cache: #Spring Cache를 사용하기 위한 Redis
type: redis
redis:
time-to-live: 300000
cache-null-values: false
password: ${redis-password-test}

security:
oauth2:
client:
registration:
kakao:
redirect-uri: https://api.test.zoopzoop.kro.kr/login/oauth2/code/kakao
google:
redirect-uri: https://api.test.zoopzoop.kro.kr/login/oauth2/code/google

management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always
front:
redirect_domain: http://localhost:3000

sentry:
dsn: https://60f1acad189d2994353d59b7895076ee@o4510100579155968.ingest.us.sentry.io/4510100584923136
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
send-default-pii: true
environment: prod
environment: prod-server
traces-sample-rate: 0.2

liveblocks:
secret-key: ${liveblocks-secret-key}


25 changes: 24 additions & 1 deletion src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,32 @@ spring:
init:
mode: never

data: #RedisTemplate 등을 사용하기 위한 직접 연결용
redis:
host: localhost
port: 6379
timeout: 6000

security:
oauth2:
client:
registration:
kakao:
redirect-uri: http://localhost:8080/login/oauth2/code/kakao
google:
redirect-uri: http://localhost:8080/login/oauth2/code/google

front:
redirect_domain: http://localhost:3000

app:
seed:
enabled: false

sentry:
send-default-pii: true
environment: local
traces-sample-rate: 0.0

liveblocks:
secret-key: test_dummy_liveblocks_secret_key
secret-key: test_dummy_liveblocks_secret_key
89 changes: 71 additions & 18 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
spring:
application:
name: back

profiles:
active: dev

output:
ansi:
enabled: always

datasource:
hikari:
auto-commit: false
jackson:

jackson: #Jackson 설정
serialization:
fail-on-empty-beans: false
jpa:

jpa: #Hibernate JPA 설정.
show-sql: true
hibernate:
ddl-auto: create-drop
ddl-auto: update
properties:
hibernate:
format_sql: true
highlight_sql: true
use_sql_comments: true
config:

config: #application-secrets의 값을 바로 받아올 수 있게.
import: optional:classpath:application-secrets.yml
servlet:

servlet: #
multipart:
max-file-size: 10MB
max-request-size: 10MB
ai:

ai: #Spring AI 설정
openai:
base-url: https://api.groq.com/openai # 내부 서버를 groq으로
api-key: ${OPENAI_API_KEY}
chat:
options:
model: meta-llama/llama-4-scout-17b-16e-instruct
temperature: 0
rabbitmq:

rabbitmq: #RabbitMQ 설정
host: ${SPRING_RABBITMQ_HOST:localhost}
port: 5672
username: ${SPRING_RABBITMQ_USERNAME:guest}
Expand All @@ -46,19 +55,54 @@ spring:
enabled: true
initial-interval: 2000
max-attempts: 3
data: #RedisTemplate 등을 사용하기 위한 직접 연결용
redis:
host: localhost
port: 6379
timeout: 6000

cache: #Spring Cache를 사용하기 위한 Redis
type: redis
redis:
time-to-live: 300000
cache-null-values: false
key-prefix:

springdoc:
security: #OAuth2 범용 설정
oauth2:
client:
registration:
kakao:
client-id: ${kakao.client-id}
scope:
- profile_nickname
- profile_image
authorization-grant-type: authorization_code
google:
client-id: ${google.client-id}
client-secret: ${google.client-secret}
scope:
- profile
authorization-grant-type: authorization_code
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
google:
authorization-uri: https://accounts.google.com/o/oauth2/v2/auth
token-uri: https://oauth2.googleapis.com/token
user-info-uri: https://www.googleapis.com/oauth2/v3/userinfo
user-name-attribute: sub

cloud: #S3 설정
aws:
credentials:
access-key: ${aws.access-key}
secret-key: ${aws.secret-key}
region:
static: ap-northeast-2
s3:
bucket: ${aws.bucket}
stack:
auto: false

springdoc: #Spring doc 설정.
default-produces-media-type: application/json;charset=UTF-8
logging:
level:
Expand All @@ -68,9 +112,18 @@ logging:
com.back: DEBUG
org.springframework.retry: DEBUG

server:
port: 8080

app:
seed:
enabled: true
enabled: true

management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always

sentry: #Sentry 모니터렁 기본 설정.
dsn: ${sentry-dsn}