Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Support Git over HTTPS with creds from env vars #2470

Merged
merged 5 commits into from
Sep 26, 2019
Merged

Commits on Sep 26, 2019

  1. Support Git over HTTPS with creds from env vars

    This commit makes supplying HTTP(S) basic auth credentials in the
    `--git-url` secure. Places where the full remote origin were logged
    have been modified to only log the `Remote.SafeURL()` so that the
    authentication key is never exposed in the logs.
    
    Securely supplying the credentials without exposing them in the
    Flux workload is possible by adding two environment variables (e.g.
    `GIT_AUTHUSER` and `GIT_AUTHKEY`) to a Kubernetes secret, and using
    Kubernetes mechanics to define them in the Flux pod by using an
    `envFrom`. The variables can then be used in `--git-url` argument as
    documented in the Kubernetes documentation[1]:
    `--git-url=https://$(GIT_AUTHUSER):$(GIT_AUTHKEY)@github.com/an/example.git`
    
    If the `--git-url` uses a HTTP(S) scheme; the generation of an SSH
    private key and the setup of the SSH keyring is now disabled.
    
    Co-Authored-By: Vytautas Maciulskis <vyckou@gmail.com>
    
    [1]: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config
    hiddeco committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    4200850 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    35a9f64 View commit details
    Browse the repository at this point in the history
  3. Support environment vars from a secret in chart

    To make secure HTTPS configurations using Helm possible, by using
    the defined environment variables from the `env.secretName` in the
    `git.url`.
    hiddeco committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    65422f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fd89537 View commit details
    Browse the repository at this point in the history
  5. Improve 'use git over HTTPS' guide

    By adding links to various documentation pages from git vendors about
    creating a personal access token.
    hiddeco committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    e48def6 View commit details
    Browse the repository at this point in the history