spring-cloud / spring-cloud-config

External configuration (server and client) for Spring Cloud
Apache License 2.0
1.95k stars 1.29k forks source link

Dynamic Repo provisioning #788

Closed remo408 closed 5 years ago

remo408 commented 7 years ago

Team,

I wanted to dynamically provide git url's instead of manually adding them i see a provision something like

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/myorg/{application}

But that doesn't give me provision to change the entire URI. Should we be able to pass on the git uri in rest body would something like that be possible if so how should do that .

ryanjbaxter commented 7 years ago

Can you provide an example of what you are trying to do?

remo408 commented 7 years ago

I was trying to do something like:

spring:
  cloud:
    config:
      server:
        git:
          uri: {git_url}
          username:{git_uname}
          password:{git_pwd}

Where i want to provide these as part of my request url:

http://localhost:8888/configserver/
body:
{
git_url:""
git_uname:""
git_pwd:""
}

This way i can dynamically provide any url and client can have the control on where to store there configurations.

or something similar to :https://github.com/spring-cloud/spring-cloud-config/issues/139 is also fine if the configserver handles it instead of me tweaking the source.

spencergibb commented 7 years ago

I'm not comfortable sending the whole URI to Config server is an abstraction and sending in a git URI is leaky, and potentially dangerous.

remo408 commented 7 years ago

How about the second option where i can point my configserver through bootstrap.yml to a repo with property file that refers to multiple repo's that way i can add repo's dynamically with out restarting the configserver

spencergibb commented 7 years ago

the issue you pointed to was implemented 2 years ago if you read further down.

remo408 commented 7 years ago

so i tried this: my bootstrap.yml:

spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        bootstrap: true
        git:
          uri: file:/C:/Users/dev/local/demo/testrepo

my testrepo has configserver.yml

spring:
  cloud:
    config:
      server:
        git:
          repos:
            configserver: https://<url>/scm/testconfigs.git

when i do

http://localhost:8888/configserver/configserver.properties

its returnign me

spring.cloud.config.server.git.repos.configserver: https://<url>/scm/testconfigs.git

the content from :configserver.yml plz advice, so do i need to follow same process followed in issue #139

remo408 commented 7 years ago

Hi when giving support to multiple repo configuration how can we enable username and password for different repos: spring: cloud: bus: enabled: false config: server: git: uri: ${configserver.git.baseUrl}/{application} searchPaths: '{profile}' username: {username} password : {pwd} force-pull: true

spring-projects-issues commented 5 years ago

Closing due to age of the question. If you would like us to look at this issue, please comment and we will look at re-opening the issue.