如何使用私有 Github 存储库引导 Spring Cloud 配置服务器?

ant*_*y44 6 cloud git ssh spring config

我需要将 Spring Cloud 服务器连接到我的私有 github 存储库。我收到错误“原因:属性‘spring.cloud.config.server.git.privateKey’不是有效的私钥”

脚步:

  • 首先,我通过 git bash 创建公钥和私钥。
  • 然后我将公钥部署在 github 配置存储库下(我放置配置文件== config-repo)
  • 最后这是我的 application.yml
spring:
   cloud:
    config:
      server:
        git:
          uri: git@github.com:[repository]/config-repo.git
          searchPaths: '{application}'
          hostKey: someHostKey
          hostKeyAlgorithm: ssh-rsa
          ignoreLocalSshSettings: true
          privateKey: |
                      -----BEGIN RSA PRIVATE KEY-----
                      [...]
                      -----END RSA PRIVATE KEY-----
Run Code Online (Sandbox Code Playgroud)

你能帮我启动我的服务器吗?多谢

Jua*_*o G 1

我面临着同样的问题...我正在使用 Linux ssh-keygen 生成密钥

我生成了密钥,但没有生成更多 原因:属性“spring.cloud.config.server.git.privateKey”不是有效的私钥 错误