Documentation ¶
Index ¶
- Constants
- Variables
- func MonitorTtySize(ctx context.Context, out *streams.Out, cli *client.Client, id string, ...) error
- func Run(params RunParams) error
- func SetupOutputDir(tempDir string) (string, error)
- func StoreProxyConfig(tmpPath string, config *Config) (string, error)
- func TempDir(tmpPath string) string
- func WriteContainerInput(tempDir string, input interface{}) (string, 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 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 ¶
func MonitorTtySize ¶
func MonitorTtySize(ctx context.Context, out *streams.Out, cli *client.Client, id string, isExec bool) error
MonitorTtySize updates the container tty size when the terminal tty changes size
func SetupOutputDir ¶
func StoreProxyConfig ¶
StoreProxyConfig saves the config to a temporary file, returning the path
func WriteContainerInput ¶
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 []map[string]string `json:"all_credentials"` CA CertificateAuthority `json:"ca"` ProxyAuth BasicAuthCredentials `json:"proxy_auth"` }
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 Proxy ¶
type Proxy struct { CertPath string // 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 []map[string]string // local directory used for caching CacheDir string // write output to a file Output 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 // TempDir is the path to use as the temporary directory. TempDir string }
type Updater ¶
type Updater struct { RepoDir string // 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.