S R Chaitanya
S R Chaitanya

Reputation: 748

Spring Cloud Config - Git backend

I was going through Spring Cloud Config's documentation and what I learnt is that the Spring prefers using Git as a config repository as it supports labelling/branching etc., and it is also the default option with Spring Cloud Config.
Now I have two questions

  1. I am accustomed to storing all the properties on the server (one of the 12-factor app tenets). So am pretty confused as to why Git repo is suggested for config which can be easily seen by others within the organization especially while storing production config
  2. My second question is about storing {cipher}ed values in the property file. Again, though the value is encrypted, but still keeping the encrypted text in Git seems to be as a not a good approach.

Requesting for anyone to provide insight on these questions.

Upvotes: 0

Views: 704

Answers (2)

Anchal Todariya
Anchal Todariya

Reputation: 93

You can disable Git ssl config - git config --global http.sslVerify false

Create a Git Personal Access Token. Use token to keep in spring.cloud.config.token property. Use config below in application.yml

server:

    git:

      uri: https://github.com/AKS/config/

      OR

      uri: file:///AKS/config/

      skipSslValidation: true

      search-paths:

        - config-map

      try-master-branch: false

      username: user

      password: ******

      default-label: <branch-name-git-branch>

      clone-on-start: true

Upvotes: 1

Frederic
Frederic

Reputation: 19

You can use you config server with a local property files stored on your host. To do so, you just need to use the native profile with the following properties

spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=file:///C:/path/to/your/config/folder

Then the following properties to set up your Git repo are not longer needed:

#spring.cloud.config.server.git.uri=...
#spring.cloud.config.server.git.username=...
#spring.cloud.config.server.git.password=...
#spring.cloud.config.server.git.timeout=10
#spring.cloud.config.server.git.clone-on-start=true

Upvotes: 0

Related Questions