Skip to content

Commit 0c2ab35

Browse files
[fix] 502 error로 인한 yml gitignore 임시 제외
* fix: secret 수정 * refactor: yml gitignore 제외
1 parent ba26c68 commit 0c2ab35

7 files changed

Lines changed: 274 additions & 2 deletions

File tree

backend/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ db_dev.trace.db
4242
.env.properties
4343

4444
### Application Configuration ###
45-
src/main/resources/application.yml
46-
src/main/resources/application-*.yml
45+
#src/main/resources/application.yml
46+
#src/main/resources/application-*.yml
47+
src/main/resources/application-secret.yml
48+
src/main/resources/application-local.yml
4749
!src/main/resources/application-example.yml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
spring:
2+
datasource:
3+
url: jdbc:postgresql://localhost:5432/waitfair
4+
username: ${DB_USER}
5+
password: ${DB_PASSWORD}
6+
jpa:
7+
database-platform: org.hibernate.dialect.PostgreSQLDialect
8+
hibernate:
9+
ddl-auto: create-drop
10+
11+
security:
12+
password:
13+
bcrypt-strength: 4
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
spring:
2+
config:
3+
activate:
4+
on-profile: perf
5+
6+
datasource:
7+
url: jdbc:postgresql://localhost:5432/waitfair_perf
8+
username: ${DB_USER}
9+
password: ${DB_PASSWORD}
10+
11+
jpa:
12+
hibernate:
13+
ddl-auto: create
14+
show-sql: false
15+
properties:
16+
hibernate:
17+
format_sql: false
18+
use_sql_comments: false
19+
highlight_sql: false
20+
21+
logging:
22+
level:
23+
com.back: INFO
24+
org.hibernate.SQL: WARN
25+
org.hibernate.orm.jdbc.bind: WARN
26+
org.hibernate.orm.jdbc.extract: WARN
27+
28+
management:
29+
endpoints:
30+
web:
31+
exposure:
32+
include: "*"
33+
metrics:
34+
distribution:
35+
percentiles-histogram:
36+
http.server.requests: true
37+
percentiles:
38+
http.server.requests: 0.5,0.95,0.99
39+
40+
security:
41+
password:
42+
bcrypt-strength: 4
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
spring:
2+
config:
3+
activate:
4+
on-profile: prod
5+
import: optional:classpath:application-secret.yml
6+
7+
datasource:
8+
url: ${SUPABASE_URL}
9+
username: ${SUPABASE_USERNAME}
10+
password: ${SUPABASE_PASSWORD}
11+
driver-class-name: org.postgresql.Driver
12+
13+
jpa:
14+
hibernate:
15+
ddl-auto: validate # 운영에서는 validate만 사용
16+
show-sql: false
17+
properties:
18+
hibernate:
19+
format_sql: false
20+
use_sql_comments: false
21+
show-sql: false # 이거 없으면 aws 세션에서 확인할 때 쿼리 로그 뜸
22+
23+
data:
24+
redis:
25+
host: ${REDIS_HOST:localhost}
26+
port: ${REDIS_PORT:6379}
27+
password: ${REDIS_PASSWORD:}
28+
29+
# 운영 환경용 로깅 설정
30+
logging:
31+
level:
32+
root: INFO
33+
com.back: INFO
34+
org.hibernate.SQL: WARN
35+
org.hibernate.orm.jdbc.bind: WARN
36+
org.hibernate.orm.jdbc.extract: WARN
37+
org.springframework.transaction.interceptor: WARN
38+
39+
# custom.site 설정을 prod로 오버라이드
40+
custom:
41+
jwt:
42+
secret: ${JWT_SECRET}
43+
access-token-duration: ${JWT_ACCESS_TOKEN_DURATION}
44+
refresh-token-duration: ${JWT_REFRESH_TOKEN_DURATION}
45+
site:
46+
domain: "${custom.prod.domain}"
47+
back-url: "${custom.prod.back-url}"
48+
front-url: "${custom.prod.front-url}"
49+
50+
cors:
51+
allowed-origins:
52+
- ${FRONTEND_URL} # 예: https://www.example.com
53+
allowed-methods:
54+
- GET
55+
- POST
56+
- PUT
57+
- DELETE
58+
allowed-headers:
59+
- "*"
60+
61+
# Actuator 설정 (최소한의 엔드포인트만 노출)
62+
management:
63+
endpoints:
64+
web:
65+
exposure:
66+
include: health,prometheus
67+
endpoint:
68+
health:
69+
show-details: never
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
spring:
2+
datasource:
3+
username: sa
4+
password:
5+
driver-class-name: org.h2.Driver
6+
url: jdbc:h2:mem:testdb;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1
7+
8+
jpa:
9+
database-platform: org.hibernate.dialect.H2Dialect
10+
hibernate:
11+
ddl-auto: create-drop
12+
properties:
13+
hibernate.id.optimizer.pooled.preferred: false
14+
custom:
15+
jwt:
16+
secret: i14Yy9GnDi28ac/ZtWIjiavJqz8iI0TGwOLzzKPvAq8KdzS2ABNfgv5yBNQYFPDohgxgMR+s/W5aTK7svlfYoQ==
17+
access-token-duration: 3600000
18+
refresh-token-duration: 1209600000
19+
20+
security:
21+
password:
22+
bcrypt-strength: 4
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
spring:
2+
config:
3+
import: optional:file:.env.properties
4+
profiles:
5+
active: dev
6+
include: secret
7+
output:
8+
ansi:
9+
enabled: always
10+
jpa:
11+
database-platform: org.hibernate.dialect.PostgreSQLDialect
12+
properties:
13+
hibernate:
14+
format_sql: true
15+
use_sql_comments: true
16+
default_batch_fetch_size: 100
17+
hibernate:
18+
ddl-auto: update
19+
show-sql: true
20+
mvc:
21+
hiddenmethod:
22+
filter:
23+
enabled: true
24+
data:
25+
redis:
26+
host: localhost
27+
port: 6379
28+
29+
logging:
30+
level:
31+
org.hibernate.orm.jdbc.bind: TRACE
32+
org.hibernate.orm.jdbc.extract: TRACE
33+
org.springframework.transaction.interceptor: TRACE
34+
com.back: DEBUG
35+
36+
springdoc:
37+
swagger-ui:
38+
tags-sorter: alpha
39+
operations-sorter: method
40+
default-produces-media-type: application/json
41+
default-consumes-media-type: application/json
42+
43+
custom:
44+
cors:
45+
allowed-origins:
46+
- http://localhost:3000
47+
- http://localhost:8080
48+
allowed-methods:
49+
- GET
50+
- POST
51+
- PUT
52+
- DELETE
53+
allowed-headers:
54+
- "*"
55+
56+
jwt:
57+
secret: ${JWT_SECRET}
58+
access-token-duration: ${JWT_ACCESS_TOKEN_DURATION:3600}
59+
refresh-token-duration: ${JWT_REFRESH_TOKEN_DURATION:1209600}
60+
61+
dev:
62+
domain: localhost
63+
back-url: "http://${custom.dev.domain}:${server.port}"
64+
front-url: "http://${custom.dev.domain}:3000"
65+
prod:
66+
domain: ${API_BASE_URL}
67+
back-url: "https://api.${custom.prod.domain}"
68+
front-url: "https://www.${custom.prod.domain}"
69+
site:
70+
domain: "${custom.dev.domain}"
71+
back-url: "${custom.dev.back-url}"
72+
front-url: "${custom.dev.front-url}"
73+
74+
queue:
75+
scheduler:
76+
#입장 처리 스케줄러
77+
entry:
78+
cron: "*/10 * * * * *" # 10초마다 실행
79+
batch-size: 100 # 한 번에 입장시킬 인원
80+
max-entered-limit: 100 # 최대 수용 인원
81+
82+
#셔플 처리 스케줄러
83+
shuffle:
84+
cron: "*/30 * * * * *" # 테스트를 위해 30초마다 실행
85+
#cron: "0 */10 * * * *" # 10분마다 실행
86+
time-range-minutes: 1 # 시간 범위
87+
88+
expire:
89+
cron: "0 * * * * *"
90+
91+
event:
92+
scheduler:
93+
open:
94+
cron: "0 * * * * *"
95+
96+
# Actuator/micrometer/prometheus 설정
97+
management:
98+
endpoints:
99+
web:
100+
exposure:
101+
include: health,info,metrics,prometheus
102+
endpoint:
103+
health:
104+
show-details: always
105+
metrics:
106+
tags:
107+
application: waitfair-backend
108+
distribution:
109+
percentiles-histogram:
110+
http.server.requests: true
111+
percentiles:
112+
http.server.requests: 0.5,0.95,0.99
113+
security:
114+
password:
115+
bcrypt-strength: 8 # prod 8 이상, perf/test/dev 4

terraform.tfstate

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 4,
3+
"terraform_version": "1.14.0",
4+
"serial": 1,
5+
"lineage": "5c9d7900-f20d-0cb2-3e8d-23ecdb34dacc",
6+
"outputs": {},
7+
"resources": [],
8+
"check_results": null
9+
}

0 commit comments

Comments
 (0)