From 92480b6e73186e8da4de73a0ffb7b70a6dab2013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=80=EC=9C=A4?= Date: Wed, 26 Aug 2026 13:55:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore(infra):=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EB=B0=8F=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EA=B5=AC=EC=84=B1=20=EC=A0=95=EB=A6=AC=20#76?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 13 ++++ Dockerfile | 20 ++++- .../src/main/resources/application.yaml | 2 - systems/application/.env.example | 19 +++++ .../src/main/resources/application-dev.yaml | 18 +++-- .../src/main/resources/application-prod.yaml | 24 ------ .../src/main/resources/application.yaml | 25 ++++++- .../adapterout/config/S3Config.kt | 2 +- .../hs/kr/entrydsm/DocumentBeanConfig.kt | 2 +- .../src/main/resources/application-dev.yaml | 17 +++++ .../src/main/resources/application.yaml | 20 ++--- .../src/main/resources/application-dev.yaml | 37 +++++++++ .../src/main/resources/application.yaml | 50 ++++++------- .../src/main/resources/application-dev.yaml | 55 +++++++++----- .../src/main/resources/application-prod.yaml | 41 ---------- .../src/main/resources/application.yaml | 75 +++++++++++-------- systems/notification/.env.example | 10 +++ .../src/main/resources/application-dev.yaml | 9 ++- .../src/main/resources/application-prod.yaml | 17 ----- .../src/main/resources/application.yaml | 19 +++-- .../src/main/resources/application.yaml | 2 - 21 files changed, 281 insertions(+), 196 deletions(-) create mode 100644 .dockerignore create mode 100644 systems/application/.env.example delete mode 100644 systems/application/application-bootstrap/src/main/resources/application-prod.yaml create mode 100644 systems/configuration/configuration-bootstrap/src/main/resources/application-dev.yaml create mode 100644 systems/gateway/gateway-bootstrap/src/main/resources/application-dev.yaml delete mode 100644 systems/identity/identity-bootstrap/src/main/resources/application-prod.yaml create mode 100644 systems/notification/.env.example delete mode 100644 systems/notification/notification-bootstrap/src/main/resources/application-prod.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..83a9716e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +.git +.idea +.vscode +.gradle +bazel-* +bazel-bin +bazel-out +bazel-testlogs +tmp +temp +logs +*.log +*.iml diff --git a/Dockerfile b/Dockerfile index b1c7fa89..ce9903b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,21 @@ -# syntax=docker/dockerfile:experimental FROM gcr.io/bazel-public/bazel:8.5.1 AS builder + +ARG SERVICE WORKDIR /workspace -COPY . . \ No newline at end of file +COPY . . +RUN bazel build //:${SERVICE} + +FROM eclipse-temurin:17-jre + +ARG SERVICE +WORKDIR /app + +COPY --from=builder /workspace/bazel-bin/systems/${SERVICE}/${SERVICE}-bootstrap/main /app/main +COPY --from=builder /workspace/bazel-bin/systems/${SERVICE}/${SERVICE}-bootstrap/main.runfiles /app/main.runfiles +COPY --from=builder /workspace/bazel-bin/systems/${SERVICE}/${SERVICE}-bootstrap/main.runfiles_manifest /app/main.runfiles_manifest + +RUN chmod +x /app/main + +EXPOSE 8080 +ENTRYPOINT ["/app/main"] diff --git a/systems/admin/admin-bootstrap/src/main/resources/application.yaml b/systems/admin/admin-bootstrap/src/main/resources/application.yaml index 939589b9..d261fd50 100644 --- a/systems/admin/admin-bootstrap/src/main/resources/application.yaml +++ b/systems/admin/admin-bootstrap/src/main/resources/application.yaml @@ -1,8 +1,6 @@ spring: application: name: admin - profiles: - default: local main: lazy-initialization: true server: diff --git a/systems/application/.env.example b/systems/application/.env.example new file mode 100644 index 00000000..082375a0 --- /dev/null +++ b/systems/application/.env.example @@ -0,0 +1,19 @@ +# Spring profile: dev or prod +SPRING_PROFILES_ACTIVE=dev + +# Server +SERVER_PORT=8080 + +# Database +DB_USERNAME=root +DB_PASSWORD=change-me +DB_URL=jdbc:mysql://localhost:3306/application_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true + +# Application schedule +# Format: yyyy-MM-ddTHH:mm:ss +APPLICATION_START_AT=2026-09-01T00:00:00 +APPLICATION_END_AT=2026-10-01T00:00:00 +RESULT_ANNOUNCED_AT=2026-11-01T00:00:00 + +# gRPC +GRPC_PORT=9090 diff --git a/systems/application/application-bootstrap/src/main/resources/application-dev.yaml b/systems/application/application-bootstrap/src/main/resources/application-dev.yaml index f6212f58..d62412fe 100644 --- a/systems/application/application-bootstrap/src/main/resources/application-dev.yaml +++ b/systems/application/application-bootstrap/src/main/resources/application-dev.yaml @@ -3,9 +3,9 @@ spring: activate: on-profile: dev datasource: - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} + url: ${DB_URL:jdbc:mysql://localhost:3306/application_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true} + username: ${DB_USERNAME:root} + password: ${DB_PASSWORD:password} driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: @@ -19,6 +19,12 @@ spring: entrydsm: application: schedule: - application-start-at: ${APPLICATION_START_AT} - application-end-at: ${APPLICATION_END_AT} - result-announced-at: ${RESULT_ANNOUNCED_AT} + application-start-at: ${APPLICATION_START_AT:2026-09-01T00:00:00} + application-end-at: ${APPLICATION_END_AT:2026-10-01T00:00:00} + result-announced-at: ${RESULT_ANNOUNCED_AT:2026-11-01T00:00:00} + +server: + port: ${SERVER_PORT:8080} + +grpc: + port: ${GRPC_PORT:9090} diff --git a/systems/application/application-bootstrap/src/main/resources/application-prod.yaml b/systems/application/application-bootstrap/src/main/resources/application-prod.yaml deleted file mode 100644 index 8dcb612b..00000000 --- a/systems/application/application-bootstrap/src/main/resources/application-prod.yaml +++ /dev/null @@ -1,24 +0,0 @@ -spring: - config: - activate: - on-profile: prod - datasource: - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - driver-class-name: com.mysql.cj.jdbc.Driver - jpa: - hibernate: - ddl-auto: validate - open-in-view: false - show-sql: false - properties: - hibernate: - dialect: org.hibernate.dialect.MySQLDialect - -entrydsm: - application: - schedule: - application-start-at: ${APPLICATION_START_AT} - application-end-at: ${APPLICATION_END_AT} - result-announced-at: ${RESULT_ANNOUNCED_AT} diff --git a/systems/application/application-bootstrap/src/main/resources/application.yaml b/systems/application/application-bootstrap/src/main/resources/application.yaml index 3d701e28..4c12f779 100644 --- a/systems/application/application-bootstrap/src/main/resources/application.yaml +++ b/systems/application/application-bootstrap/src/main/resources/application.yaml @@ -1,16 +1,35 @@ spring: application: name: application - profiles: - default: dev main: lazy-initialization: true + datasource: + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver + jpa: + hibernate: + ddl-auto: validate + open-in-view: false + show-sql: false + properties: + hibernate: + dialect: org.hibernate.dialect.MySQLDialect + +entrydsm: + application: + schedule: + application-start-at: ${APPLICATION_START_AT} + application-end-at: ${APPLICATION_END_AT} + result-announced-at: ${RESULT_ANNOUNCED_AT} server: + port: ${SERVER_PORT} shutdown: graceful grpc: - port: ${GRPC_PORT:9090} + port: ${GRPC_PORT} management: endpoints: diff --git a/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/configuration/adapterout/config/S3Config.kt b/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/configuration/adapterout/config/S3Config.kt index 89155ffe..45bd6acf 100644 --- a/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/configuration/adapterout/config/S3Config.kt +++ b/systems/configuration/configuration-adapter-out/src/main/kotlin/hs/kr/entrydsm/configuration/adapterout/config/S3Config.kt @@ -9,7 +9,7 @@ import software.amazon.awssdk.services.s3.presigner.S3Presigner @Configuration class S3Config( - @Value("\${aws.s3.region:ap-northeast-2}") private val region: String, + @Value("\${aws.s3.region}") private val region: String, ) { @Bean diff --git a/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/DocumentBeanConfig.kt b/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/DocumentBeanConfig.kt index 7cfff32c..b99335f0 100644 --- a/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/DocumentBeanConfig.kt +++ b/systems/configuration/configuration-bootstrap/src/main/kotlin/hs/kr/entrydsm/DocumentBeanConfig.kt @@ -14,6 +14,6 @@ class DocumentBeanConfig { fun fileDocumentService( storagePort: StoragePort, fileDocumentRepository: FileDocumentRepository, - @Value("\${aws.s3.presign-expiry-seconds:600}") presignExpirySeconds: Long, + @Value("\${aws.s3.presign-expiry-seconds}") presignExpirySeconds: Long, ) = FileDocumentService(storagePort, fileDocumentRepository, presignExpirySeconds) } diff --git a/systems/configuration/configuration-bootstrap/src/main/resources/application-dev.yaml b/systems/configuration/configuration-bootstrap/src/main/resources/application-dev.yaml new file mode 100644 index 00000000..727ed4c6 --- /dev/null +++ b/systems/configuration/configuration-bootstrap/src/main/resources/application-dev.yaml @@ -0,0 +1,17 @@ +spring: + config: + activate: + on-profile: dev + datasource: + url: ${DB_URL:jdbc:mysql://localhost:3306/configuration_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true} + username: ${DB_USERNAME:root} + password: ${DB_PASSWORD:password} + +aws: + s3: + bucket: ${AWS_S3_BUCKET:entrydsm-document-local} + region: ${AWS_S3_REGION:ap-northeast-2} + presign-expiry-seconds: ${AWS_S3_PRESIGN_EXPIRY_SECONDS:600} + +grpc: + port: ${GRPC_PORT:9090} diff --git a/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml b/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml index b1e14063..04418ae3 100644 --- a/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml +++ b/systems/configuration/configuration-bootstrap/src/main/resources/application.yaml @@ -1,14 +1,12 @@ spring: application: name: configuration - profiles: - default: local main: lazy-initialization: true datasource: - url: jdbc:mysql://localhost:3306/configuration_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true - username: ${DB_USERNAME:root} - password: ${DB_PASSWORD:password} + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: @@ -25,20 +23,14 @@ spring: aws: s3: bucket: ${AWS_S3_BUCKET} - region: ${AWS_S3_REGION:ap-northeast-2} - presign-expiry-seconds: ${AWS_S3_PRESIGN_EXPIRY_SECONDS:600} + region: ${AWS_S3_REGION} + presign-expiry-seconds: ${AWS_S3_PRESIGN_EXPIRY_SECONDS} server: shutdown: graceful grpc: - port: ${GRPC_PORT:9090} - -aws: - s3: - bucket: ${S3_BUCKET:entrydsm-document-local} - region: ${AWS_REGION:ap-northeast-2} - presign-expiry-seconds: ${S3_PRESIGN_EXPIRY_SECONDS:600} + port: ${GRPC_PORT} management: endpoints: diff --git a/systems/gateway/gateway-bootstrap/src/main/resources/application-dev.yaml b/systems/gateway/gateway-bootstrap/src/main/resources/application-dev.yaml new file mode 100644 index 00000000..522558c6 --- /dev/null +++ b/systems/gateway/gateway-bootstrap/src/main/resources/application-dev.yaml @@ -0,0 +1,37 @@ +spring: + config: + activate: + on-profile: dev + data: + redis: + url: ${GATEWAY_RESILIENCE_REDIS_URI:redis://localhost:6379} +server: + port: ${SERVER_PORT:8080} +gateway: + downstream: + connect-timeout-millis: ${GATEWAY_DOWNSTREAM_CONNECT_TIMEOUT_MILLIS:2000} + response-timeout-millis: ${GATEWAY_DOWNSTREAM_RESPONSE_TIMEOUT_MILLIS:5000} + retries: ${GATEWAY_DOWNSTREAM_RETRIES:2} + retry-first-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_FIRST_BACKOFF_MILLIS:50} + retry-max-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_MAX_BACKOFF_MILLIS:1000} + retry-backoff-factor: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_FACTOR:2} + retry-backoff-based-on-previous-value: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_BASED_ON_PREVIOUS_VALUE:false} + retry-jitter-random-factor: ${GATEWAY_DOWNSTREAM_RETRY_JITTER_RANDOM_FACTOR:0.5} + services: + identity: ${GATEWAY_SERVICES_IDENTITY:http://localhost:8081} + application: ${GATEWAY_SERVICES_APPLICATION:http://localhost:8082} + admin: ${GATEWAY_SERVICES_ADMIN:http://localhost:8083} + notification: ${GATEWAY_SERVICES_NOTIFICATION:http://localhost:8084} + observability: ${GATEWAY_SERVICES_OBSERVABILITY:http://localhost:8085} + configuration: ${GATEWAY_SERVICES_CONFIGURATION:http://localhost:8086} + cors: + allowed-origins: ${GATEWAY_CORS_ALLOWED_ORIGINS:http://localhost:3000} + request: + max-body-bytes: ${GATEWAY_REQUEST_MAX_BODY_BYTES:10485760} + resilience: + failure-rate-threshold: ${GATEWAY_RESILIENCE_FAILURE_RATE_THRESHOLD:50} + sliding-window-size: ${GATEWAY_RESILIENCE_SLIDING_WINDOW_SIZE:10} + minimum-number-of-calls: ${GATEWAY_RESILIENCE_MINIMUM_NUMBER_OF_CALLS:5} + wait-duration-seconds: ${GATEWAY_RESILIENCE_WAIT_DURATION_SECONDS:30} + permitted-number-of-calls-in-half-open-state: ${GATEWAY_RESILIENCE_PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE:1} + state-store: ${GATEWAY_RESILIENCE_STATE_STORE:redis} diff --git a/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml b/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml index a6f6a0e0..dfd1ae91 100644 --- a/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml +++ b/systems/gateway/gateway-bootstrap/src/main/resources/application.yaml @@ -4,11 +4,9 @@ spring: main: web-application-type: reactive lazy-initialization: false - profiles: - default: local data: redis: - url: ${GATEWAY_RESILIENCE_REDIS_URI:redis://localhost:6379} + url: ${GATEWAY_RESILIENCE_REDIS_URI} cloud: gateway: server: @@ -32,40 +30,40 @@ spring: jitter: randomFactor: ${gateway.downstream.retry-jitter-random-factor} server: - port: 8080 + port: ${SERVER_PORT} shutdown: graceful gateway: downstream: - connect-timeout-millis: ${GATEWAY_DOWNSTREAM_CONNECT_TIMEOUT_MILLIS:2000} - response-timeout-millis: ${GATEWAY_DOWNSTREAM_RESPONSE_TIMEOUT_MILLIS:5000} - retries: ${GATEWAY_DOWNSTREAM_RETRIES:2} + connect-timeout-millis: ${GATEWAY_DOWNSTREAM_CONNECT_TIMEOUT_MILLIS} + response-timeout-millis: ${GATEWAY_DOWNSTREAM_RESPONSE_TIMEOUT_MILLIS} + retries: ${GATEWAY_DOWNSTREAM_RETRIES} retry-methods: GET,HEAD,OPTIONS - retry-first-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_FIRST_BACKOFF_MILLIS:50} - retry-max-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_MAX_BACKOFF_MILLIS:1000} - retry-backoff-factor: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_FACTOR:2} - retry-backoff-based-on-previous-value: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_BASED_ON_PREVIOUS_VALUE:false} - retry-jitter-random-factor: ${GATEWAY_DOWNSTREAM_RETRY_JITTER_RANDOM_FACTOR:0.5} + retry-first-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_FIRST_BACKOFF_MILLIS} + retry-max-backoff-millis: ${GATEWAY_DOWNSTREAM_RETRY_MAX_BACKOFF_MILLIS} + retry-backoff-factor: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_FACTOR} + retry-backoff-based-on-previous-value: ${GATEWAY_DOWNSTREAM_RETRY_BACKOFF_BASED_ON_PREVIOUS_VALUE} + retry-jitter-random-factor: ${GATEWAY_DOWNSTREAM_RETRY_JITTER_RANDOM_FACTOR} services: - identity: ${GATEWAY_SERVICES_IDENTITY:http://localhost:8081} - application: ${GATEWAY_SERVICES_APPLICATION:http://localhost:8082} - admin: ${GATEWAY_SERVICES_ADMIN:http://localhost:8083} - notification: ${GATEWAY_SERVICES_NOTIFICATION:http://localhost:8084} - observability: ${GATEWAY_SERVICES_OBSERVABILITY:http://localhost:8085} - configuration: ${GATEWAY_SERVICES_CONFIGURATION:http://localhost:8086} + identity: ${GATEWAY_SERVICES_IDENTITY} + application: ${GATEWAY_SERVICES_APPLICATION} + admin: ${GATEWAY_SERVICES_ADMIN} + notification: ${GATEWAY_SERVICES_NOTIFICATION} + observability: ${GATEWAY_SERVICES_OBSERVABILITY} + configuration: ${GATEWAY_SERVICES_CONFIGURATION} cors: - allowed-origins: ${GATEWAY_CORS_ALLOWED_ORIGINS:http://localhost:3000} + allowed-origins: ${GATEWAY_CORS_ALLOWED_ORIGINS} allowed-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS allowed-headers: Authorization,Content-Type,X-Trace-Id max-age-seconds: 3600 request: - max-body-bytes: ${GATEWAY_REQUEST_MAX_BODY_BYTES:10485760} + max-body-bytes: ${GATEWAY_REQUEST_MAX_BODY_BYTES} resilience: - failure-rate-threshold: ${GATEWAY_RESILIENCE_FAILURE_RATE_THRESHOLD:50} - sliding-window-size: ${GATEWAY_RESILIENCE_SLIDING_WINDOW_SIZE:10} - minimum-number-of-calls: ${GATEWAY_RESILIENCE_MINIMUM_NUMBER_OF_CALLS:5} - wait-duration-seconds: ${GATEWAY_RESILIENCE_WAIT_DURATION_SECONDS:30} - permitted-number-of-calls-in-half-open-state: ${GATEWAY_RESILIENCE_PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE:1} - state-store: ${GATEWAY_RESILIENCE_STATE_STORE:redis} + failure-rate-threshold: ${GATEWAY_RESILIENCE_FAILURE_RATE_THRESHOLD} + sliding-window-size: ${GATEWAY_RESILIENCE_SLIDING_WINDOW_SIZE} + minimum-number-of-calls: ${GATEWAY_RESILIENCE_MINIMUM_NUMBER_OF_CALLS} + wait-duration-seconds: ${GATEWAY_RESILIENCE_WAIT_DURATION_SECONDS} + permitted-number-of-calls-in-half-open-state: ${GATEWAY_RESILIENCE_PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE} + state-store: ${GATEWAY_RESILIENCE_STATE_STORE} management: endpoints: web: diff --git a/systems/identity/identity-bootstrap/src/main/resources/application-dev.yaml b/systems/identity/identity-bootstrap/src/main/resources/application-dev.yaml index abb279d9..b602f714 100644 --- a/systems/identity/identity-bootstrap/src/main/resources/application-dev.yaml +++ b/systems/identity/identity-bootstrap/src/main/resources/application-dev.yaml @@ -6,27 +6,48 @@ spring: url: ${DB_URL:jdbc:mysql://localhost:3306/identity_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true} username: ${DB_USERNAME:root} password: ${DB_PASSWORD:password} - driver-class-name: com.mysql.cj.jdbc.Driver - jpa: - hibernate: - ddl-auto: validate - open-in-view: false - show-sql: false - properties: - hibernate: - dialect: org.hibernate.dialect.MySQLDialect + data: + redis: + url: ${REDIS_URL:redis://localhost:6379} + connect-timeout: ${REDIS_CONNECT_TIMEOUT:2s} + timeout: ${REDIS_COMMAND_TIMEOUT:2s} + client-name: ${REDIS_CLIENT_NAME:identity} +identity: + redis: + namespace: ${REDIS_KEY_NAMESPACE:identity} + durability-check-enabled: ${REDIS_DURABILITY_CHECK_ENABLED:false} +security: + cookies: + secure: ${COOKIE_SECURE:false} + cors: + allowed-origins: ${IDENTITY_CORS_ALLOWED_ORIGINS:http://localhost:3000} + pii: + login-id-hash-key: ${IDENTITY_LOGIN_ID_HASH_KEY:dev-login-id-hash-key} + encryption-key-base64: ${IDENTITY_PII_ENCRYPTION_KEY_BASE64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=} auth: + password: + bcrypt-strength: ${BCRYPT_STRENGTH:12} + password-reset: + enabled: ${AUTH_PASSWORD_RESET_ENABLED:false} + max-attempts: ${AUTH_PASSWORD_RESET_MAX_ATTEMPTS:5} + window-seconds: ${AUTH_PASSWORD_RESET_WINDOW_SECONDS:900} + max-tracked-login-ids: ${AUTH_PASSWORD_RESET_MAX_TRACKED_LOGIN_IDS:10000} jwt: secret: ${JWT_SECRET:dev-development-jwt-secret-change-me-32} - + issuer: ${JWT_ISSUER:entrydsm-identity} pass: target: ${PASS_TARGET:TEST} - popup-url: ${PASS_POPUP_URL:http://localhost:3000/mock/pass} + cp-code: ${PASS_CP_CODE:} + license: ${PASS_LICENSE:} + license-file-url: ${PASS_LICENSE_FILE_URL:} + license-file-path: ${PASS_LICENSE_FILE_PATH:/tmp/V61290000000_IDS_01_PROD_AES_license.dat} base-url: ${BASE_URL:http://localhost:3000} + site-name: ${SITE_NAME:EntryDSM} + site-url: ${SITE_URL:http://localhost:3000} + popup-url: ${PASS_POPUP_URL:http://localhost:3000/mock/pass} + proof-ttl-seconds: ${PASS_PROOF_TTL_SECONDS:300} + connect-timeout-ms: ${PASS_CONNECT_TIMEOUT_MS:5000} + read-timeout-ms: ${PASS_READ_TIMEOUT_MS:10000} allowed-redirect-origins: ${PASS_ALLOWED_REDIRECT_ORIGINS:http://localhost:3000} - -security: - cookies: - secure: ${COOKIE_SECURE:false} - cors: - allowed-origins: ${IDENTITY_CORS_ALLOWED_ORIGINS:http://localhost:3000} + proof-key-current: ${PASS_PROOF_KEY_CURRENT:dev-proof-key} + proof-key-previous: ${PASS_PROOF_KEY_PREVIOUS:} diff --git a/systems/identity/identity-bootstrap/src/main/resources/application-prod.yaml b/systems/identity/identity-bootstrap/src/main/resources/application-prod.yaml deleted file mode 100644 index 32dfd21c..00000000 --- a/systems/identity/identity-bootstrap/src/main/resources/application-prod.yaml +++ /dev/null @@ -1,41 +0,0 @@ -spring: - config: - activate: - on-profile: prod - datasource: - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - driver-class-name: com.mysql.cj.jdbc.Driver - jpa: - hibernate: - ddl-auto: validate - open-in-view: false - show-sql: false - properties: - hibernate: - dialect: org.hibernate.dialect.MySQLDialect - data: - redis: - url: ${REDIS_URL} - -auth: - jwt: - secret: ${JWT_SECRET} - -security: - cookies: - secure: ${COOKIE_SECURE} - cors: - allowed-origins: ${IDENTITY_CORS_ALLOWED_ORIGINS} - pii: - login-id-hash-key: ${IDENTITY_LOGIN_ID_HASH_KEY} - encryption-key-base64: ${IDENTITY_PII_ENCRYPTION_KEY_BASE64} - -identity: - redis: - durability-check-enabled: ${REDIS_DURABILITY_CHECK_ENABLED:true} - -pass: - target: ${PASS_TARGET:PROD} - popup-url: ${PASS_POPUP_URL:https://safe.ok-name.co.kr/CommonSvl} diff --git a/systems/identity/identity-bootstrap/src/main/resources/application.yaml b/systems/identity/identity-bootstrap/src/main/resources/application.yaml index 62f8c8b9..6d64729d 100644 --- a/systems/identity/identity-bootstrap/src/main/resources/application.yaml +++ b/systems/identity/identity-bootstrap/src/main/resources/application.yaml @@ -1,55 +1,66 @@ spring: application: name: identity - data: - redis: - url: ${REDIS_URL:redis://localhost:6379} - connect-timeout: ${REDIS_CONNECT_TIMEOUT:2s} - timeout: ${REDIS_COMMAND_TIMEOUT:2s} - client-name: ${REDIS_CLIENT_NAME:identity} - profiles: - default: dev main: lazy-initialization: true + datasource: + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver + jpa: + hibernate: + ddl-auto: validate + open-in-view: false + show-sql: false + properties: + hibernate: + dialect: org.hibernate.dialect.MySQLDialect + data: + redis: + url: ${REDIS_URL} + connect-timeout: ${REDIS_CONNECT_TIMEOUT} + timeout: ${REDIS_COMMAND_TIMEOUT} + client-name: ${REDIS_CLIENT_NAME} identity: redis: - namespace: ${REDIS_KEY_NAMESPACE:identity} - durability-check-enabled: ${REDIS_DURABILITY_CHECK_ENABLED:false} + namespace: ${REDIS_KEY_NAMESPACE} + durability-check-enabled: ${REDIS_DURABILITY_CHECK_ENABLED} security: cookies: - secure: ${COOKIE_SECURE:true} + secure: ${COOKIE_SECURE} cors: - allowed-origins: ${IDENTITY_CORS_ALLOWED_ORIGINS:} + allowed-origins: ${IDENTITY_CORS_ALLOWED_ORIGINS} pii: login-id-hash-key: ${IDENTITY_LOGIN_ID_HASH_KEY} encryption-key-base64: ${IDENTITY_PII_ENCRYPTION_KEY_BASE64} auth: password: - bcrypt-strength: ${BCRYPT_STRENGTH:12} + bcrypt-strength: ${BCRYPT_STRENGTH} password-reset: - enabled: ${AUTH_PASSWORD_RESET_ENABLED:true} - max-attempts: ${AUTH_PASSWORD_RESET_MAX_ATTEMPTS:5} - window-seconds: ${AUTH_PASSWORD_RESET_WINDOW_SECONDS:900} - max-tracked-login-ids: ${AUTH_PASSWORD_RESET_MAX_TRACKED_LOGIN_IDS:10000} + enabled: ${AUTH_PASSWORD_RESET_ENABLED} + max-attempts: ${AUTH_PASSWORD_RESET_MAX_ATTEMPTS} + window-seconds: ${AUTH_PASSWORD_RESET_WINDOW_SECONDS} + max-tracked-login-ids: ${AUTH_PASSWORD_RESET_MAX_TRACKED_LOGIN_IDS} jwt: secret: ${JWT_SECRET} - issuer: ${JWT_ISSUER:entrydsm-identity} + issuer: ${JWT_ISSUER} pass: - target: ${PASS_TARGET:} - cp-code: ${CP_CD:${PASS_CP_CODE:}} - license: ${PASS_LICENSE:${PASS_LICENSE_FILE_PATH:/tmp/V61290000000_IDS_01_PROD_AES_license.dat}} - license-file-url: ${PASS_LICENSE_FILE_URL:} - license-file-path: ${PASS_LICENSE_FILE_PATH:/tmp/V61290000000_IDS_01_PROD_AES_license.dat} - base-url: ${BASE_URL:} - site-name: ${SITE_NAME:${PASS_SITE_NAME:EntryDSM}} - site-url: ${SITE_URL:${PASS_SITE_URL:https://entrydsm.kr}} - popup-url: ${PASS_POPUP_URL:} - proof-ttl-seconds: ${PASS_PROOF_TTL_SECONDS:300} - connect-timeout-ms: ${PASS_CONNECT_TIMEOUT_MS:5000} - read-timeout-ms: ${PASS_READ_TIMEOUT_MS:10000} - allowed-redirect-origins: ${PASS_ALLOWED_REDIRECT_ORIGINS:${BASE_URL:}} + target: ${PASS_TARGET} + cp-code: ${PASS_CP_CODE} + license: ${PASS_LICENSE} + license-file-url: ${PASS_LICENSE_FILE_URL} + license-file-path: ${PASS_LICENSE_FILE_PATH} + base-url: ${BASE_URL} + site-name: ${SITE_NAME} + site-url: ${SITE_URL} + popup-url: ${PASS_POPUP_URL} + proof-ttl-seconds: ${PASS_PROOF_TTL_SECONDS} + connect-timeout-ms: ${PASS_CONNECT_TIMEOUT_MS} + read-timeout-ms: ${PASS_READ_TIMEOUT_MS} + allowed-redirect-origins: ${PASS_ALLOWED_REDIRECT_ORIGINS} proof-key-current: ${PASS_PROOF_KEY_CURRENT} - proof-key-previous: ${PASS_PROOF_KEY_PREVIOUS:} + proof-key-previous: ${PASS_PROOF_KEY_PREVIOUS} server: shutdown: graceful management: diff --git a/systems/notification/.env.example b/systems/notification/.env.example new file mode 100644 index 00000000..2d0c9305 --- /dev/null +++ b/systems/notification/.env.example @@ -0,0 +1,10 @@ +# Spring profile: dev or prod +SPRING_PROFILES_ACTIVE=dev + +# Server +SERVER_PORT=8080 + +# Database +DB_USERNAME=root +DB_PASSWORD=change-me +DB_URL=jdbc:mysql://localhost:3306/notification_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true diff --git a/systems/notification/notification-bootstrap/src/main/resources/application-dev.yaml b/systems/notification/notification-bootstrap/src/main/resources/application-dev.yaml index e33c703a..1deaa3d6 100644 --- a/systems/notification/notification-bootstrap/src/main/resources/application-dev.yaml +++ b/systems/notification/notification-bootstrap/src/main/resources/application-dev.yaml @@ -3,9 +3,9 @@ spring: activate: on-profile: dev datasource: - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} + url: ${DB_URL:jdbc:mysql://localhost:3306/notification_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true} + username: ${DB_USERNAME:root} + password: ${DB_PASSWORD:password} driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: @@ -15,3 +15,6 @@ spring: properties: hibernate: dialect: org.hibernate.dialect.MySQLDialect + +server: + port: ${SERVER_PORT:8080} diff --git a/systems/notification/notification-bootstrap/src/main/resources/application-prod.yaml b/systems/notification/notification-bootstrap/src/main/resources/application-prod.yaml deleted file mode 100644 index f75439f9..00000000 --- a/systems/notification/notification-bootstrap/src/main/resources/application-prod.yaml +++ /dev/null @@ -1,17 +0,0 @@ -spring: - config: - activate: - on-profile: prod - datasource: - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - driver-class-name: com.mysql.cj.jdbc.Driver - jpa: - hibernate: - ddl-auto: validate - open-in-view: false - show-sql: false - properties: - hibernate: - dialect: org.hibernate.dialect.MySQLDialect diff --git a/systems/notification/notification-bootstrap/src/main/resources/application.yaml b/systems/notification/notification-bootstrap/src/main/resources/application.yaml index 1989c59c..731c1773 100644 --- a/systems/notification/notification-bootstrap/src/main/resources/application.yaml +++ b/systems/notification/notification-bootstrap/src/main/resources/application.yaml @@ -1,17 +1,26 @@ spring: application: name: notification - profiles: - default: local main: lazy-initialization: true + datasource: + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver + jpa: + hibernate: + ddl-auto: validate + open-in-view: false + show-sql: false + properties: + hibernate: + dialect: org.hibernate.dialect.MySQLDialect server: + port: ${SERVER_PORT} shutdown: graceful -grpc: - port: ${GRPC_PORT} - management: endpoints: web: diff --git a/systems/observability/observability-bootstrap/src/main/resources/application.yaml b/systems/observability/observability-bootstrap/src/main/resources/application.yaml index 956a544d..61fda00a 100644 --- a/systems/observability/observability-bootstrap/src/main/resources/application.yaml +++ b/systems/observability/observability-bootstrap/src/main/resources/application.yaml @@ -1,8 +1,6 @@ spring: application: name: observability - profiles: - default: local main: lazy-initialization: true server: From 81bf2c02006ad9fe24bd1dea548a7904bbc70ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=80=EC=9C=A4?= Date: Thu, 27 Aug 2026 19:40:54 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore(infra):=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EB=B0=8F=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EA=B5=AC=EC=84=B1=20=EC=A0=95=EB=A6=AC=20#76?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yaml | 2 +- .../entrydsm/IdentityBootstrapConfigurationTest.kt | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/systems/identity/identity-bootstrap/src/main/resources/application.yaml b/systems/identity/identity-bootstrap/src/main/resources/application.yaml index 6d64729d..1ff32167 100644 --- a/systems/identity/identity-bootstrap/src/main/resources/application.yaml +++ b/systems/identity/identity-bootstrap/src/main/resources/application.yaml @@ -60,7 +60,7 @@ pass: read-timeout-ms: ${PASS_READ_TIMEOUT_MS} allowed-redirect-origins: ${PASS_ALLOWED_REDIRECT_ORIGINS} proof-key-current: ${PASS_PROOF_KEY_CURRENT} - proof-key-previous: ${PASS_PROOF_KEY_PREVIOUS} + proof-key-previous: ${PASS_PROOF_KEY_PREVIOUS:} server: shutdown: graceful management: diff --git a/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/IdentityBootstrapConfigurationTest.kt b/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/IdentityBootstrapConfigurationTest.kt index 12a63893..07a6f5f8 100644 --- a/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/IdentityBootstrapConfigurationTest.kt +++ b/systems/identity/identity-bootstrap/src/test/kotlin/hs/kr/entrydsm/IdentityBootstrapConfigurationTest.kt @@ -9,21 +9,17 @@ import org.junit.Test class IdentityBootstrapConfigurationTest { @Test - fun exposesProductionConfigurationWithValidatedSchema() { + fun exposesDeploymentConfigurationWithValidatedSchema() { val configuration = requireNotNull( - javaClass.classLoader.getResourceAsStream("application-prod.yaml"), + javaClass.classLoader.getResourceAsStream("application.yaml"), ).use { it.readBytes().toString(StandardCharsets.UTF_8) } - assertTrue(configuration.contains("on-profile: prod")) assertTrue(configuration.contains("ddl-auto: validate")) assertTrue(configuration.contains("open-in-view: false")) assertTrue(configuration.contains("\${DB_URL}")) - - val productionConfiguration = requireNotNull( - javaClass.classLoader.getResourceAsStream("application-prod.yaml"), - ).use { it.readBytes().toString(StandardCharsets.UTF_8) } - assertTrue(productionConfiguration.contains("secure: \${COOKIE_SECURE}")) - assertTrue(productionConfiguration.contains("allowed-origins: \${IDENTITY_CORS_ALLOWED_ORIGINS}")) + assertTrue(configuration.contains("secure: \${COOKIE_SECURE}")) + assertTrue(configuration.contains("allowed-origins: \${IDENTITY_CORS_ALLOWED_ORIGINS}")) + assertTrue(configuration.contains("proof-key-previous: \${PASS_PROOF_KEY_PREVIOUS:}")) } @Test From 50c214f0003cef179e434ebfe9de42a4b8ff426b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=80=EC=9C=A4?= Date: Thu, 27 Aug 2026 23:32:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore(infra):=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20=EC=98=88=EC=8B=9C=20?= =?UTF-8?q?=EB=B3=B4=EA=B0=95=20#76?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- systems/configuration/.env.example | 15 +++++++++++++++ systems/gateway/.env.example | 6 ++++++ systems/identity/.env.example | 25 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 systems/configuration/.env.example diff --git a/systems/configuration/.env.example b/systems/configuration/.env.example new file mode 100644 index 00000000..74dee4f3 --- /dev/null +++ b/systems/configuration/.env.example @@ -0,0 +1,15 @@ +# Spring profile: dev or prod +SPRING_PROFILES_ACTIVE=dev + +# Database +DB_USERNAME=root +DB_PASSWORD=change-me +DB_URL=jdbc:mysql://localhost:3306/configuration_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true + +# S3 +AWS_S3_BUCKET=entrydsm-document-local +AWS_S3_REGION=ap-northeast-2 +AWS_S3_PRESIGN_EXPIRY_SECONDS=600 + +# gRPC +GRPC_PORT=9090 diff --git a/systems/gateway/.env.example b/systems/gateway/.env.example index e5734535..79a455c8 100644 --- a/systems/gateway/.env.example +++ b/systems/gateway/.env.example @@ -1,3 +1,9 @@ +# Spring profile: dev or prod +SPRING_PROFILES_ACTIVE=dev + +# Server +SERVER_PORT=8080 + # Gateway downstream service endpoints GATEWAY_SERVICES_IDENTITY=http://localhost:8081 GATEWAY_SERVICES_APPLICATION=http://localhost:8082 diff --git a/systems/identity/.env.example b/systems/identity/.env.example index fc8ca33e..bc22bab9 100644 --- a/systems/identity/.env.example +++ b/systems/identity/.env.example @@ -27,3 +27,28 @@ BCRYPT_STRENGTH=12 COOKIE_SECURE=false # PASS/OTP verification port 연결 전에는 password reset endpoint를 노출하지 않습니다. AUTH_PASSWORD_RESET_ENABLED=false +AUTH_PASSWORD_RESET_MAX_ATTEMPTS=5 +AUTH_PASSWORD_RESET_WINDOW_SECONDS=900 +AUTH_PASSWORD_RESET_MAX_TRACKED_LOGIN_IDS=10000 + +# Identity security +IDENTITY_CORS_ALLOWED_ORIGINS=http://localhost:3000 +IDENTITY_LOGIN_ID_HASH_KEY=dev-login-id-hash-key +IDENTITY_PII_ENCRYPTION_KEY_BASE64=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + +# PASS verification +PASS_TARGET=TEST +PASS_CP_CODE= +PASS_LICENSE= +PASS_LICENSE_FILE_URL= +PASS_LICENSE_FILE_PATH=/tmp/V61290000000_IDS_01_PROD_AES_license.dat +BASE_URL=http://localhost:3000 +SITE_NAME=EntryDSM +SITE_URL=http://localhost:3000 +PASS_POPUP_URL=http://localhost:3000/mock/pass +PASS_PROOF_TTL_SECONDS=300 +PASS_CONNECT_TIMEOUT_MS=5000 +PASS_READ_TIMEOUT_MS=10000 +PASS_ALLOWED_REDIRECT_ORIGINS=http://localhost:3000 +PASS_PROOF_KEY_CURRENT=dev-proof-key +PASS_PROOF_KEY_PREVIOUS=