Phase 2-1: PostgreSQL DB 생성 - 211.208.115.83:5432에 kcgaidb 데이터베이스 생성 - kcg-app 사용자 + kcg 스키마 생성 Phase 2-2: Spring Boot 3.5.7 + Java 21 프로젝트 - gc.mda.kcg.KcgAiApplication 메인 클래스 - 의존성: web, security, data-jpa, validation, postgresql, flyway, actuator, cache, lombok, caffeine, jjwt(0.12.6) - Maven Wrapper 포함, .sdkmanrc로 Java 21 고정 Phase 2-3: application.yml - DataSource: 211.208.115.83/kcgaidb (kcg-app) - JPA: ddl-auto=validate, default_schema=kcg - Flyway: classpath:db/migration, schema=kcg - Caffeine 캐시 (permissions, users) - prediction/iran-backend/cors/jwt 커스텀 설정 - application-local.yml (로컬 디버깅용) Phase 2-4: Flyway 마이그레이션 V001~V005 - V001 auth_init: auth_org, auth_user, auth_role, auth_user_role, auth_login_hist (pgcrypto 확장 포함) - V002 perm_tree: auth_perm_tree, auth_perm, auth_setting (wing 패턴의 트리 기반 RBAC) - V003 perm_seed: 5개 역할(ADMIN/OPERATOR/ANALYST/VIEWER/FIELD) + 13개 Level 0 탭 + 36개 Level 1 패널 (총 49개 리소스) + 역할별 권한 매트릭스 일괄 INSERT - V004 access_logs: auth_audit_log, auth_access_log - V005 parent_workflow: gear_group_parent_resolution, review_log, candidate_exclusions, label_sessions (iran 012/014의 백엔드 쓰기 부분만 이관) Phase 2-5: 빌드 + 기동 검증 완료 - ./mvnw clean compile 성공 - spring-boot:run으로 기동 → Flyway가 V001~V005 자동 적용 - /actuator/health UP 확인 - 14개 테이블 + flyway_schema_history 생성 확인 - ADMIN 245건, OPERATOR 22건, 다른 역할 13건 권한 시드 확인 Phase 2 임시 SecurityConfig: 모든 요청 permitAll (Phase 3에서 JWT 필터 + 트리 기반 권한 체크로 전환 예정) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
spring:
|
|
application:
|
|
name: kcg-ai-backend
|
|
|
|
datasource:
|
|
url: jdbc:postgresql://211.208.115.83:5432/kcgaidb
|
|
username: kcg-app
|
|
password: Kcg2026ai
|
|
driver-class-name: org.postgresql.Driver
|
|
hikari:
|
|
maximum-pool-size: 10
|
|
minimum-idle: 2
|
|
connection-timeout: 30000
|
|
|
|
jpa:
|
|
hibernate:
|
|
ddl-auto: validate
|
|
properties:
|
|
hibernate:
|
|
default_schema: kcg
|
|
format_sql: true
|
|
jdbc:
|
|
time_zone: Asia/Seoul
|
|
open-in-view: false
|
|
|
|
flyway:
|
|
enabled: true
|
|
schemas: kcg
|
|
default-schema: kcg
|
|
locations: classpath:db/migration
|
|
baseline-on-migrate: true
|
|
|
|
cache:
|
|
type: caffeine
|
|
cache-names: permissions,users
|
|
caffeine:
|
|
spec: maximumSize=1000,expireAfterWrite=10m
|
|
|
|
server:
|
|
port: 8080
|
|
forward-headers-strategy: framework
|
|
|
|
management:
|
|
endpoints:
|
|
web:
|
|
exposure:
|
|
include: health,info,flyway
|
|
endpoint:
|
|
health:
|
|
show-details: when-authorized
|
|
|
|
logging:
|
|
level:
|
|
root: INFO
|
|
gc.mda.kcg: DEBUG
|
|
org.flywaydb: INFO
|
|
|
|
# === 애플리케이션 커스텀 설정 ===
|
|
app:
|
|
prediction:
|
|
base-url: ${PREDICTION_BASE_URL:http://localhost:8001}
|
|
iran-backend:
|
|
base-url: ${IRAN_BACKEND_BASE_URL:http://localhost:18080}
|
|
cors:
|
|
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:5174}
|
|
jwt:
|
|
secret: ${JWT_SECRET:change-me-in-production-this-must-be-at-least-256-bits-long-secret-key}
|
|
expiration-ms: ${JWT_EXPIRATION_MS:86400000}
|