网站建设加优化成人用品网店进货渠道
Config Server提供了加密与解密的端点,分别是/encrypt 与 /decrypt。
可使用curl $CONFIG_SERVER_URL/encrypt -d 想要加密的明文来加密明文。
使用curl $CONFIG_SERVER_URL/decrypt -d 想要解密的密文来解密密文。
package com.didispace;import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.config.server.EnableConfigServer;@EnableConfigServer
@SpringBootApplication
public class Application {public static void main(String[] args) {new SpringApplicationBuilder(Application.class).web(true).run(args);}}
spring.application.name=config-server
server.port=7001# git
#spring.cloud.config.server.git.uri=http://git.oschina.net/didispace/SpringCloud-Learning/
#spring.cloud.config.server.git.searchPaths=spring_cloud_in_action/config-repo
#spring.cloud.config.server.git.username=username
#spring.cloud.config.server.git.password=password#
#spring.cloud.config.server.health.repositories.check.name=check-repo
#spring.cloud.config.server.health.repositories.check.label=master
#spring.cloud.config.server.health.repositories.check.profiles=default#
#spring.cloud.config.server.health.enabled=false#
#spring.cloud.config.server.overrides.name=didi
#spring.cloud.config.server.overrides.from=shanghai#
spring.profiles.active=native# spring-boot-starter-security
#security.user.name=user
#security.user.password=37cc5635-559b-4e6f-b633-7e932b813f73encrypt.key=didispace
#encrypt.key-store.location=config-server.keystore
#encrypt.key-store.alias=config-server
#encrypt.key-store.password=111111
#encrypt.key-store.secret=222222
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.didispace</groupId><artifactId>config-server</artifactId><version>1.0.0</version><packaging>jar</packaging><name>config-server</name><description>Spring Cloud project</description><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.3.7.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-config-server</artifactId></dependency><!--<dependency>--><!--<groupId>org.springframework.boot</groupId>--><!--<artifactId>spring-boot-starter-security</artifactId>--><!--</dependency>--></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Brixton.SR5</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>