Warm tip: This article is reproduced from serverfault.com, please click

Spring Cloud Config Server

发布于 2018-09-17 18:11:01

I looked at the code for a number of spring cloud config servers in github repo and below are the 2 values that are provided as part of property file. I believe in order to connect to https end point of github , user id and password are also necessary. Could these perhaps be part of environment variables?

server.port=7070
spring.cloud.config.server.git.uri=https://

EDIT:

Below is the example that I saw in spring website. However in all the github repos within my enterprise I don't see userid and password being set as they are sensitive info. How could it be set or config server access github url , if uid / pwd is not provided in the property file?

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/spring-cloud-samples/config-repo
          username: trolley
          password: strongpassword
Questioner
Punter Vicky
Viewed
0
Se ven 2018-09-18 14:27:49
  1. for public repository there is no need to use username and password or other authorizations to get config properties, for private repository auth are required.
  2. it is possible to set variable from enviroment which from os or java-system-property and command line. for precedence: command-line-param > java-system-property > os-env > application.properties.

So, for example what if i set property use command-line directly (which has highest precedence.) like:

java -jar config-server.jar --spring.cloud.config.server.git.username=xxx --spring.cloud.config.server.git.password=xxx

which contain all param in CI tools or whatever then managed by someone, you wouldn't see that in source code.