├── src └── main │ ├── resources │ └── application.yml │ └── java │ └── org │ └── openpaas │ └── paasta │ └── configserver │ └── ConfigServerApplication.java ├── .gitignore └── README.md /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: PortalConfigServer 4 | cloud: 5 | config: 6 | server: 7 | git: 8 | uri: YOUR_GIT_URL 9 | username: GIT_ID 10 | password: GIT_PASSWORD 11 | force-pull: true 12 | 13 | server: 14 | port: ${PORT:8004} 15 | 16 | management: 17 | security: 18 | enabled: false 19 | -------------------------------------------------------------------------------- /src/main/java/org/openpaas/paasta/configserver/ConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package org.openpaas.paasta.configserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | 7 | /** 8 | * The type Application. 9 | */ 10 | 11 | @EnableConfigServer 12 | @SpringBootApplication 13 | public class ConfigServerApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(ConfigServerApplication.class, args); 17 | } 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # ignore output and build directories 14 | build/** 15 | bin/** 16 | out/** 17 | .idea/** 18 | 19 | # Package Files # 20 | *.jar 21 | *.war 22 | *.ear 23 | *.zip 24 | *.tar.gz 25 | *.rar 26 | 27 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 28 | hs_err_pid* 29 | 30 | # generated gradle directories and files 31 | .gradle 32 | .settings 33 | 34 | # eclise settings 35 | .classpath 36 | .project 37 | 38 | # remove spring bean configuration 39 | .spring* 40 | 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PAAS-TA-PORTAL-CONFIG-SERVER 2 | 3 | 4 | ## Config Server 5 | config server 를 간단히 설명하면, 다른 서버들의 설정을 제공하는 서비스 6 | 7 | 예를 들어, 어떤 API Server 가 있다면, 설정에 자신의 서비스 이름과 config server 주소만 적어주면 됩니다. 그리고 config server 에 해당 API Server에 사용될 port 정보나 여러가지 설정들이 들어가게 됩니다. 보통 시작 Port는 설정 파일이나, 코드에 입력돼있는 경우도 흔한데, 이럴 경우 쉽게 설정을 변경하기가 어렵습니다. 즉, config server는 설정을 바꿀 때 Git 에서 받아와서 각각의 서비스를 실행하게 하는 것이 핵심. 그래서 Eureka 서버, API Gateway 등 모든 서비스가 config server에 접근하여 해당 설정을 가져가게 됩니다. 8 | 9 | - 환경변수를 제공해주는 REST API 서버(필수)와 환경변수를 받는 클라이언트로 구성(옵션) 10 | - JSON 형식으로 제공(어떤 서버에서도 사용 가능) 11 | - 환경변수 관리(GIT, SVN, 로컬 file 등 이용) 12 | - 환경변수에 대한 암/복호화 기능 내장 13 | - 다양한 Application, Profile, Version 형태를 지원 14 | - 코드와 설정의 분리 15 | 16 | 17 | ## 유의사항 18 | 19 | 개발 정보 20 | - java 1.8 버전 21 | - SpringCloud Edgware.RELEASE 22 | - TomcatEmded 8.5.14 23 | - Gradle 4.4.1 24 | - Spring-boot 1.5.9 25 | - Redis 1.3.1 26 | 27 | 28 | --------------------------------------------------------------------------------