환경 설정
본 장에서는 AnyEIMS의 환경 설정 방법을 설명합니다.
application-extensions.yml 파일 설정
application-extensions.yml 파일을 통해 다양한 실행 옵션을 설정할 수 있습니다.
Frontend 정적 파일 서빙
1.1.0 버전부터 Nginx를 별도로 구성하지 않아도 Spring Boot에서 직접 React 빌드 결과물을 서빙합니다.
|
-
설정 예시
eims: frontend: enabled: true static-resources-path: /path/to/frontend/dist다음은 각 속성에 대한 설명입니다.
속성 타입 설명 eims.frontend.enabled
Boolean
정적 파일 서빙 활성화 여부(기본값: true)
eims.frontend.static-resources-path
String
React 빌드 결과물 디렉토리 경로(기본값: frontend)
-
환경 변수
환경 변수 설명 EIMS_FRONTEND_ENABLED
정적 파일 서빙 활성화 여부
EIMS_FRONTEND_PATH
정적 파일 디렉토리 경로
-
동작 방식
구분 동작 /v1/**요청API로 처리(인증 필요)
그 외 GET 요청
정적 파일 서빙
파일 존재
해당 파일 반환(MIME 타입 자동 감지)
파일 없음
index.html 반환(SPA 라우팅 지원)
Redis 설정
1.1.0 버전부터 Redis는 옵션입니다. 별도의 Redis 설정을 하지 않아도 Caffeine 캐시를 통해 JWT(JSON Web Token)를 관리할 수 있습니다.
|
-
설정 방법
spring: data: redis: host: <Redis 호스트> port: <Redis 포트> password: <Redis 비밀번호>1.1.0 버전부터 spring.redis 설정이 spring.data.redis로 변경되었습니다.
-
Redis 프로파일 활성화
Redis 프로파일을 활성화하려면 실행 시 아래와 같이 Java 옵션을 추가해야 합니다.
-Dspring.profiles.active=prod,redis
또는 start.sh 스크립트 내에서 해당 옵션을 추가합니다.
HTTP Access Log
Nginx를 별도로 구성하지 않고 Spring Boot에서 직접 HTTP 요청에 대한 access log를 기록합니다.
-
설정 예시
eims: access-log: enabled: true include-query-string: true include-response-time: true exclude-paths: - /health - /actuator다음은 각 속성에 대한 설명입니다.
속성 타입 설명 eims.access-log.enabled
Boolean
access log 활성화 여부(기본값: true)
eims.access-log.include-query-string
Boolean
Query String 포함 여부(기본값: true)
eims.access-log.include-response-time
Boolean
응답 시간(ms) 포함(기본값: true)
eims.access-log.exclude-paths
list
로깅 제외 경로 목록(기본값: [])
-
환경 변수
환경 변수 설명 EIMS_ACCESS_LOG_ENABLED
access log 활성화 여부
-
로그 형식
[ACCESS] {Client IP} "{Method} {URI} {Protocol}" {Status} {Duration}ms -
로그 출력 예시
INFO [ACCESS] 192.168.1.100 "GET /v1/users?page=1 HTTP/1.1" 200 45ms WARN [ACCESS] 192.168.1.100 "GET /v1/users/999 HTTP/1.1" 404 12ms ERROR [ACCESS] 192.168.1.100 "POST /v1/deployments HTTP/1.1" 500 156ms
-
로그 레벨
상태 코드 로그 레벨 5xx
ERROR
4xx
WARN
그 외
INFO
인터페이스 잠금 기능
인터페이스 잠금 기능을 활성화하려면 application-extensions.yml에 아래 설정을 추가합니다.
-
설정 예시
eims: resource-lock: activate: true다음은 각 속성에 대한 설명입니다.
속성 타입 설명 eims.resource-lock.activate
Boolean
인터페이스 잠금 기능 활성화 여부(기본값: false)
커스텀 액션(Custom Action)
사용자 정의 커스텀 액션을 등록합니다. 자세한 내용은 Custom Action 라이브러리를 참고합니다.
-
설정 방법
eims: custom-action: activate: true actions: - class-name: <구현 클래스 전체 경로> action-name: <액션 표시 이름>
커스텀 인증(Custom Auth)
사용자 정의 인증 로직을 등록합니다. 자세한 내용은 Custom Auth 라이브러리를 참고합니다.
-
설정 방법
eims: custom-auth: activate: true auths: - class-name: <구현 클래스 전체 경로> auth-name: <인증 이름>커스텀 인증 클래스는 하나만 등록할 수 있습니다.
커스텀 알림(Custom Notifications)
인터페이스 잠금, 배포 결재 등 특정 이벤트 발생 시 커스텀 알림을 설정할 수 있습니다. 자세한 내용은 Custom Notifications 라이브러리를 참고합니다.
-
설정 방법
eims: custom-notification: class-names: - <CustomLockNotification 구현 클래스>
암호화(Encrypt) 설정
암호화된 프로퍼티 복호화 및 커스텀 복호화 클래스를 등록합니다. 자세한 내용은 Encrypt 라이브러리를 참고합니다.
-
설정 방법
-
커스텀 복호화 클래스 등록
eims: encryption: class-name: <Decrypt 구현 클래스 전체 경로> -
암호화된 프로퍼티 목록 지정
eims: encryption: encrypted-properties: spring.datasource.password,spring.redis.password
-
스트림 래퍼(Stream Wrapper)
파일 업로드 시 DRM 해제 등 커스텀 스트림 처리를 등록합니다. 자세한 내용은 Stream Wrapper 라이브러리를 참고합니다.
-
설정 방법
eims: stream-wrapper: class-name: <StreamIOWrapper 구현 클래스 전체 경로>