Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0930dce62f | |||
| 6a797b3ab9 | |||
| a8a635d549 | |||
| fe119839ae | |||
| d7dbc26bf7 | |||
| 412e0a568e | |||
| 9620845daf | |||
| 03aa7ced90 |
@@ -0,0 +1,129 @@
|
||||
name: eapim-portal CI (from elink-online-core-jpa)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- feats/ci-test
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: [self-hosted, linux, eapim-portal]
|
||||
env:
|
||||
JAVA_HOME: /apps/opts/jdk8
|
||||
JAVA_HOME_TOMCAT: /apps/opts/jdk17
|
||||
CATALINA_BASE: /prod/eapim/devportal
|
||||
CATALINA_HOME: /prod/eapim/apache-tomcat-9.0.116
|
||||
CATALINA_PID: /prod/eapim/devportal/temp/catalina.pid
|
||||
DEPLOY_HTTP_PORT: "39130"
|
||||
defaults:
|
||||
run:
|
||||
working-directory: eapim-portal
|
||||
|
||||
steps:
|
||||
- name: Checkout elink-online-core-jpa (trigger SHA)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: eapim-online/elink-online-core-jpa
|
||||
|
||||
- name: Checkout eapim-portal (master)
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
rm -rf eapim-portal
|
||||
git clone --depth=1 --branch master \
|
||||
http://oauth2:${{ secrets.CI_TOKEN }}@172.30.1.50:3000/djb-eapim/eapim-portal.git \
|
||||
eapim-portal
|
||||
|
||||
- name: Checkout elink-portal-common (master)
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
rm -rf elink-portal-common
|
||||
git clone --depth=1 --branch master \
|
||||
http://oauth2:${{ secrets.CI_TOKEN }}@172.30.1.50:3000/djb-eapim/elink-portal-common.git \
|
||||
elink-portal-common
|
||||
|
||||
- name: Verify toolchain
|
||||
run: |
|
||||
java -version
|
||||
gradle --version
|
||||
|
||||
- name: Gradle build (no tests)
|
||||
run: gradle clean build -x test --no-daemon
|
||||
|
||||
- name: Upload WAR artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: eapim-portal-wars-${{ github.sha }}
|
||||
path: |
|
||||
eapim-portal/build/libs/eapim-portal.war
|
||||
eapim-portal/build/libs/eapim-portal-boot.war
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Stop tomcat (pre-clean)
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
if [ -f "$CATALINA_PID" ] && kill -0 "$(cat $CATALINA_PID)" 2>/dev/null; then
|
||||
JAVA_HOME=$JAVA_HOME_TOMCAT "$CATALINA_HOME/bin/shutdown.sh" 30 -force || true
|
||||
for i in $(seq 1 30); do
|
||||
[ -f "$CATALINA_PID" ] && kill -0 "$(cat $CATALINA_PID)" 2>/dev/null || break
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
rm -f "$CATALINA_PID"
|
||||
|
||||
- name: Deploy war as ROOT
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
DEPLOY_DIR="$CATALINA_BASE/webapps"
|
||||
rm -rf "$DEPLOY_DIR/ROOT" "$DEPLOY_DIR/ROOT.war"
|
||||
cp eapim-portal/build/libs/eapim-portal.war "$DEPLOY_DIR/ROOT.war"
|
||||
ls -la "$DEPLOY_DIR"
|
||||
|
||||
- name: Start tomcat and health check (timeout 90s)
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
LOG="$CATALINA_BASE/logs/catalina.$(date +%Y-%m-%d).log"
|
||||
BEFORE=0
|
||||
[ -f "$LOG" ] && BEFORE=$(stat -c %s "$LOG")
|
||||
|
||||
mkdir -p "$(dirname $CATALINA_PID)"
|
||||
JAVA_HOME=$JAVA_HOME_TOMCAT "$CATALINA_HOME/bin/startup.sh"
|
||||
|
||||
DEADLINE=$(($(date +%s) + 90))
|
||||
STATUS=000
|
||||
while [ $(date +%s) -lt $DEADLINE ]; do
|
||||
STATUS=$(curl -sS -o /dev/null -w '%{http_code}' --max-time 3 http://localhost:$DEPLOY_HTTP_PORT/ 2>/dev/null || echo "000")
|
||||
if [ "$STATUS" = "200" ]; then
|
||||
echo "HTTP 200 received from /"
|
||||
break
|
||||
fi
|
||||
if [ -f "$LOG" ] && tail -c +$((BEFORE+1)) "$LOG" | grep -qE "Application listener .* Exception|SEVERE.*startup.Catalina"; then
|
||||
echo "::error::Startup error detected in log"
|
||||
tail -c +$((BEFORE+1)) "$LOG" | tail -80
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
if [ "$STATUS" != "200" ]; then
|
||||
echo "::error::Health check failed within 90s (last HTTP status: $STATUS)"
|
||||
[ -f "$LOG" ] && tail -c +$((BEFORE+1)) "$LOG" | tail -100
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "--- key boot log lines ---"
|
||||
tail -c +$((BEFORE+1)) "$LOG" | grep -E "Server startup|Deployment of web" | head -10 || true
|
||||
|
||||
- name: Stop tomcat (post-clean)
|
||||
if: always()
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
if [ -f "$CATALINA_PID" ] && kill -0 "$(cat $CATALINA_PID)" 2>/dev/null; then
|
||||
JAVA_HOME=$JAVA_HOME_TOMCAT "$CATALINA_HOME/bin/shutdown.sh" 30 -force || true
|
||||
for i in $(seq 1 30); do
|
||||
[ -f "$CATALINA_PID" ] && kill -0 "$(cat $CATALINA_PID)" 2>/dev/null || break
|
||||
sleep 1
|
||||
done
|
||||
[ -f "$CATALINA_PID" ] && kill -9 "$(cat $CATALINA_PID)" 2>/dev/null || true
|
||||
fi
|
||||
rm -f "$CATALINA_PID"
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.eactive.eai.common.security.loader;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.security.CryptoModuleConfig;
|
||||
import com.eactive.eai.data.jpa.AbstractDataLoader;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class CryptoModuleConfigLoader
|
||||
extends AbstractDataLoader<CryptoModuleConfig, String, CryptoModuleConfigLoaderRepository> {
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.eactive.eai.common.security.loader;
|
||||
|
||||
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
|
||||
|
||||
import com.eactive.eai.data.DataLoaderRepository;
|
||||
import com.eactive.eai.data.entity.onl.security.CryptoModuleConfig;
|
||||
import com.eactive.eai.data.jpa.BaseRepository;
|
||||
|
||||
interface CryptoModuleConfigLoaderRepository
|
||||
extends DataLoaderRepository<CryptoModuleConfig>,
|
||||
BaseRepository<CryptoModuleConfig, String>,
|
||||
QuerydslPredicateExecutor<CryptoModuleConfig> {
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.eactive.eai.data.entity.onl.security;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.eactive.eai.data.entity.AbstractEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
|
||||
|
||||
@Entity
|
||||
@Table(name = "crypto_module_config")
|
||||
@org.hibernate.annotations.Table(appliesTo = "crypto_module_config", comment = "암호화모듈_설정")
|
||||
public class CryptoModuleConfig extends AbstractEntity<String> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "UUID")
|
||||
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
|
||||
@Column(name = "crypto_id", updatable = false, nullable = false, length = 36)
|
||||
@Comment("암호화모듈 ID")
|
||||
private String cryptoId;
|
||||
|
||||
@Column(name = "crypto_name", unique = true, nullable = false, length = 100)
|
||||
@Comment("암호화모듈 이름 (어댑터 참조 키)")
|
||||
private String cryptoName;
|
||||
|
||||
@Column(name = "crypto_desc", nullable = true, length = 500)
|
||||
@Comment("암호화모듈 설명")
|
||||
private String cryptoDesc;
|
||||
|
||||
@Column(name = "alg_type", nullable = false, length = 10)
|
||||
@Comment("알고리즘 유형 (AES, ARIA)")
|
||||
private String algType;
|
||||
|
||||
@Column(name = "cipher_mode", nullable = false, length = 20)
|
||||
@Comment("운영 모드 (CBC, GCM, FF1, FF3-1)")
|
||||
private String cipherMode;
|
||||
|
||||
@Column(name = "padding", nullable = true, length = 30)
|
||||
@Comment("패딩 방식 (PKCS5Padding, NoPadding)")
|
||||
private String padding;
|
||||
|
||||
@Column(name = "iv_hex", nullable = true, length = 200)
|
||||
@Comment("초기화 벡터 Hex (선택)")
|
||||
private String ivHex;
|
||||
|
||||
@Column(name = "key_source_type", nullable = false, length = 20)
|
||||
@Comment("키 소스 유형 (STATIC: DB 직접, DYNAMIC: 전략 기반 동적 생성)")
|
||||
private String keySourceType;
|
||||
|
||||
@Column(name = "enc_key_hex", nullable = true, length = 200)
|
||||
@Comment("암호화 키 Hex (STATIC 전용)")
|
||||
private String encKeyHex;
|
||||
|
||||
@Column(name = "dec_key_hex", nullable = true, length = 200)
|
||||
@Comment("복호화 키 Hex (STATIC 전용, 미입력 시 encKeyHex와 동일)")
|
||||
private String decKeyHex;
|
||||
|
||||
@Column(name = "key_deriv_strategy", nullable = true, length = 200)
|
||||
@Comment("동적 키 도출 전략 코드 또는 FQCN (DYNAMIC 전용)")
|
||||
private String keyDerivStrategy;
|
||||
|
||||
@Column(name = "key_deriv_params", nullable = true, length = 2000)
|
||||
@Comment("동적 키 도출 전략 파라미터 JSON (DYNAMIC 전용)")
|
||||
private String keyDerivParams;
|
||||
|
||||
@Column(name = "cache_yn", nullable = false, length = 1)
|
||||
@Comment("동적 키 캐싱 사용 여부 (Y/N)")
|
||||
private String cacheYn;
|
||||
|
||||
@Column(name = "cache_ttl_sec", nullable = true)
|
||||
@Comment("캐시 TTL 초 (기본 300)")
|
||||
private Integer cacheTtlSec;
|
||||
|
||||
@Column(name = "use_yn", nullable = false, length = 1)
|
||||
@Comment("사용 여부 (Y/N)")
|
||||
private String useYn;
|
||||
|
||||
@Column(name = "modified_by", nullable = true, length = 50)
|
||||
@Comment("수정자")
|
||||
private String modifiedBy;
|
||||
|
||||
@Column(name = "modified_at", nullable = true)
|
||||
@Comment("수정일시")
|
||||
private LocalDateTime modifiedAt;
|
||||
|
||||
@Override
|
||||
public @NonNull String getId() {
|
||||
return this.cryptoId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user