Documentation ¶
Index ¶
- Constants
- Variables
- func MonitorTtySize(ctx context.Context, out *streams.Out, cli *client.Client, id string, ...) error
- func Run(params RunParams) error
- type BasicAuthCredentials
- type CertificateAuthority
- type Config
- type FileFetcherJobFile
- type Networks
- type Proxy
- type RunParams
- type Updater
- func (u *Updater) Close() error
- func (u *Updater) InstallCertificates(ctx context.Context) error
- func (u *Updater) RunShell(ctx context.Context, proxyURL string, apiPort int) error
- func (u *Updater) RunUpdate(ctx context.Context, proxyURL string, apiPort int) error
- func (u *Updater) Wait(ctx context.Context, condition container.WaitCondition) error
Constants ¶
const ConfigFilePath = "/config.json"
ConfigFilePath is the path to proxy config file.
Variables ¶
var CertSubject = pkix.Name{ CommonName: "Dependabot Internal CA", OrganizationalUnit: []string{"Dependabot"}, Organization: []string{"GitHub Inc."}, Locality: []string{"San Francisco"}, Province: []string{"California"}, Country: []string{"US"}, }
var ErrInvalidVolume = fmt.Errorf("invalid volume syntax")
var ProxyImageName = "ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy:latest"
ProxyImageName is the docker image used by the proxy
var UpdaterImageName = "ghcr.io/dependabot/dependabot-updater:latest"
UpdaterImageName is the docker image used by the updater
Functions ¶
Types ¶
type BasicAuthCredentials ¶
type BasicAuthCredentials struct { Username string `json:"username"` Password string `json:"password"` }
BasicAuthCredentials represents credentials required for HTTP basic auth
type CertificateAuthority ¶
CertificateAuthority includes the MITM CA certificate and private key
func GenerateCertificateAuthority ¶
func GenerateCertificateAuthority() (CertificateAuthority, error)
GenerateCertificateAuthority generates a new proxy keypair CA
type Config ¶
type Config struct { Credentials []model.Credential `json:"all_credentials"` CA CertificateAuthority `json:"ca"` }
Config is the structure of the proxy's config file
type FileFetcherJobFile ¶
FileFetcherJobFile is the payload passed to file updater containers.
type Networks ¶
type Networks struct { NoInternet types.NetworkCreateResponse Internet types.NetworkCreateResponse // contains filtered or unexported fields }
type RunParams ¶
type RunParams struct { // job definition passed to the updater Job *model.Job // expectations asserted at the end of a test Expected []model.Output // credentials passed to the proxy Creds []model.Credential // local directory used for caching CacheDir string // write output to a file Output string // ProxyCertPath is the path to a cert for the proxy to trust ProxyCertPath string // attempt to pull images if they aren't local? PullImages bool // run an interactive shell? Debug bool // Volumes are used to mount directories in Docker Volumes []string // Timeout specifies an optional maximum duration the CLI will run an update. // If Timeout is <= 0 it will never time out. Timeout time.Duration // ExtraHosts adds /etc/hosts entries to the proxy for testing. ExtraHosts []string }
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
func NewUpdater(ctx context.Context, cli *client.Client, net *Networks, params *RunParams, prox *Proxy) (*Updater, error)
NewUpdater starts the update container interactively running /bin/sh, so it does not stop.
func (*Updater) Close ¶
Close kills and deletes the container and deletes updater mount paths related to the run.
func (*Updater) InstallCertificates ¶
InstallCertificates runs update-ca-certificates as root, blocks until complete.