admin , front 수정 및 vm 수정

This commit is contained in:
주수현
2025-07-10 14:16:48 +09:00
parent e553a99591
commit 61562c01ca
12 changed files with 312 additions and 26 deletions

View File

@@ -0,0 +1,34 @@
package app.module.front.config.application.bean;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JasyptConfig {
@Value("${jasypt.encryptor.password}")
private String jasyptPassword;
@Value("${jasypt.encryptor.algorithm}")
private String jasyptAlgorithm;
@Bean("jasyptStringEncryptor")
public StringEncryptor stringEncryptor() {
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword(jasyptPassword); // 암호화할 때 사용하는 키
config.setPoolSize("1"); // 인스턴스 pool
config.setAlgorithm(jasyptAlgorithm); // 암호화 알고리즘
config.setStringOutputType("base64"); // 인코딩 방식
config.setKeyObtentionIterations("1000"); // 반복할 해싱 회수
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); // salt 생성 클래스
config.setIvGeneratorClassName("org.jasypt.iv.RandomIvGenerator");
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
encryptor.setConfig(config);
return encryptor;
}
}

View File

@@ -0,0 +1,66 @@
package app.module.front.config.application.bean;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.boot.autoconfigure.SpringBootVFS;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
import java.io.IOException;
@Slf4j
@Configuration
@MapperScan(
basePackages = { "app.module.front", "app.module.core" },
annotationClass = org.apache.ibatis.annotations.Mapper.class,
sqlSessionFactoryRef = "kriSqlSessionFactory")
@EnableTransactionManagement
public class KRIConfig {
@Value("${mybatis.mapper-locations.kri}")
private String mybatisMapper;
@Primary
@Bean(name = "kriDataSource")
@ConfigurationProperties(prefix = "spring.datasource.kri")
public DataSource kriDataSource() {
return DataSourceBuilder.create().build();
}
@Primary
@Bean(name = "kriSqlSessionFactory")
public SqlSessionFactory kriSqlSessionFactory(@Qualifier("kriDataSource") DataSource dataSource) throws Exception {
SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
sessionFactoryBean.setVfs(SpringBootVFS.class);
configureSqlSessionFactory(sessionFactoryBean, dataSource);
return sessionFactoryBean.getObject();
}
protected void configureSqlSessionFactory(SqlSessionFactoryBean sessionFactoryBean, DataSource dataSource) throws IOException {
sessionFactoryBean.setDataSource(dataSource);
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
sessionFactoryBean.setMapperLocations(resolver.getResources(mybatisMapper));
org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
configuration.setMapUnderscoreToCamelCase(true);
sessionFactoryBean.setConfiguration(configuration);
}
@Primary
@Bean(name = "kriSqlSessionTemplate")
public SqlSessionTemplate kriSqlSessionTemplate(@Qualifier("kriSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
SqlSessionTemplate sqlSessionTemplate = new SqlSessionTemplate(sqlSessionFactory);
return sqlSessionTemplate;
}
}

View File

@@ -6,4 +6,34 @@ logging:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
messages:
# 메시지 소스 캐시 지속 시간(초)
# 4초마다 메시지 파일을 다시 읽어옵니다
# 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적
cache-duration: 10s
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 데이터베이스 설정
# ==============================================
datasource:
kri:
driver-class-name: org.postgresql.Driver
jdbc-url: ENC(SH5G+4mdOrW3PpVEmVyNXIFyV7eFC6uLTa0e18qa+7ueQeWrduIeGVJLrQP3mUw86dzqLK7AUHjTRuex4ud+rTt026L7csDLFYzLWGkGCTEqfFBOwHng3uQ7n+qmkKiW)
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
# ==============================================
# 암호화 설정
# ==============================================
jasypt:
encryptor:
password: etribe
algorithm: PBEWITHHMACSHA512ANDAES_256

View File

@@ -6,4 +6,21 @@ logging:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
spring:
datasource:
kri:
driver-class-name: org.postgresql.Driver
jdbc-url: ENC(SH5G+4mdOrW3PpVEmVyNXIFyV7eFC6uLTa0e18qa+7ueQeWrduIeGVJLrQP3mUw86dzqLK7AUHjTRuex4ud+rTt026L7csDLFYzLWGkGCTEqfFBOwHng3uQ7n+qmkKiW)
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
# ==============================================
# 암호화 설정
# ==============================================
jasypt:
encryptor:
password: etribe
algorithm: PBEWITHHMACSHA512ANDAES_256

View File

@@ -8,7 +8,26 @@ logging:
app:
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
messages:
# 메시지 소스 캐시 지속 시간 (단위: 초)
# 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장
cache-duration: 5m
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 데이터베이스 설정
# ==============================================
datasource:
kri:
driver-class-name: org.postgresql.Driver
jdbc-url: ENC(mF3Z0fgCagFruOk/F2Z2PYzXhwGedE1secfYDgci+ke9z8xFEZ/GWbgXA4XeSq5D+k9/oRLOxzwx/D24tswdoHdQugHmGb0UqrW4vGBa7YFJvcnWylOpd5ppUeEIUJGv)
username: ENC(cNXntROGOeM115QfLlVhhBz8+qY70eTWwmwLM+7AMslWmfWTq9ZPl4pVnDopJauM)
password: ENC(kUIzqWTu0+bqjYH4Jq9TFOOh3UwY+XVvA2OlT4VXJvxWCas66UNdGRmWDQKri5fI)
# ==============================================
# 서버 압축 설정

View File

@@ -10,6 +10,17 @@ spring:
enabled: true
mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript
min-response-size: 2048
# ==============================================
# 데이터베이스 설정
# ==============================================
datasource:
hikari:
maximum-pool-size: 10
minimum-idle: 5
idle-timeout: 120000
max-lifetime: 900000
connection-timeout: 5000
leak-detection-threshold: 30000
# 정적 자원 캐싱 설정
web:
@@ -92,6 +103,14 @@ logging:
jdbc:
bind: trace # Hibernate SQL 파라미터 바인딩 로깅
# ==============================================
# MyBatis 설정
# ==============================================
mybatis:
mapper-locations:
kri: classpath*:mappers/**/*Mapper.xml # 매퍼 파일 위치
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체
# ==============================================
# 서버 압축 설정
# ==============================================
server: